/* ====== BASE ====== */
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
  background: white;
  color: #111;
}

/* ====== HEADER & NAV ====== */
.site-header {
  background: white;
  padding: 1rem 2rem;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.mal-logo {
  text-decoration: none;
  color: #111;
  font-size: 1rem;
  letter-spacing: 0.12em;   /* Wider spacing */
  text-transform: uppercase;
  font-weight: 400;
  display: inline-block;
  white-space: nowrap;
}

.mal-logo .dot {
  font-size: 1.2rem;
  letter-spacing: 0;
  margin: 0 0.4em;
  color: black;
  vertical-align: middle;
  position: relative;
  top: -0.1em;
}

.nav-links a {
  color: #444;
  margin-left: 1.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-links a:first-child {
  margin-left: 0;
}

.nav-links a:hover {
  color: black;
}

/* ====== NOTEBOOK NAV BREADCRUMBS ====== */
.breadcrumb {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: #666;
  text-decoration: underline;
}

.breadcrumb span {
  color: #999;
}

/* ====== HERO IMAGE ====== */
.hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* ====== INTRO TEXT BLOCK ====== */
.intro {
  /* max-width: 800px; */
  margin: 2rem auto;
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* ===== Notebook Styles ===== */

.notebook {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

.notebook-intro {
  margin-bottom: 2rem;
  color: #333;
}

.notebook-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notebook-list li {
  margin-bottom: 1rem;
}

.notebook-list a {
  color: #000;
  text-decoration: none;
  font-weight: 500;
}

.notebook-list a:hover {
  text-decoration: underline;
}

.glyph {
  margin-right: 0.5rem; /* instead of margin-left */
  font-size: 1.1rem;
  color: #888;
}

.notebook-list .notebook-blurb {
  font-style: italic;
  color: #666;
  font-size: 0.95rem;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  padding-left: 0; /* aligns with notebook title if title has no padding */
}

/* ===== Softnote Styles ===== */

.softnote {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1.7;
}

.note-glyph {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #666;
}

.block-image {
  margin: 2rem 0;
}

.block-image img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 4px; /* optional aesthetic touch */
}

.block-image figcaption {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  line-height: 1.4;
  margin-top: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ====== MOBILE ====== */
@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    margin-top: 1rem;
  }

  .nav-links a {
    margin-left: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }

  .mal-logo {
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
  }

  .mal-logo .dot {
    font-size: 1.1rem;
    top: -0.1em;
  }
}

/* ====== notebook header icon ====== */

.notebook-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.notebook-header-icon img {
  display: block;
  object-fit: cover; /* extra safety */
}

.notebook-header h2 {
  margin: 0;
}

/* ====== GALLERY ====== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.gallery-thumb {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-thumb img {
  width: 100%;
  height: 140px;
  display: block;
  object-fit: cover;
}

.gallery-modal[hidden] { display: none; }

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.95);
}

.gallery-modal-dialog {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 18px;
}

.gallery-modal-figure {
  margin: 0;
  text-align: center;
}

.gallery-modal-img {
  max-width: min(92vw, 1200px);
  max-height: 82vh;
  width: auto;
  height: auto;
  display: inline-block;
}

.gallery-modal-caption {
  margin-top: 10px;
  color:  #111;
  font-size: 0.95rem;
}

.gallery-modal-prev,
.gallery-modal-next,
.gallery-modal-close {
  border: 0;
  background: rgba(0, 0, 0, 0.06);
  color: black;
  cursor: pointer;
  border-radius: 10px;
}

.gallery-modal-prev,
.gallery-modal-next {
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 44px;
}

.gallery-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 44px;
}

body.gallery-modal-open {
  overflow: hidden;
}

.gallery-modal-close:focus {
  outline: 2px solid rgba(0,0,0,0.2);
  outline-offset: 2px;
}

/* reset default figure indentation */
.block-image {
  margin: 1em 0;
}

/* base image behaviour */
.block-image img {
  display: block;
  height: auto;
  max-width: 100%;
}

/* size */
.block-image.is-small  img { width: 320px; }
.block-image.is-medium img { width: 640px; }
.block-image.is-large  img { width: 960px; }
.block-image.is-full   img { width: 100%; max-width: none; }

/* alignment */
.block-image.is-align-left   img { margin-left: 0; margin-right: auto; }
.block-image.is-align-center img { margin-left: auto; margin-right: auto; }
.block-image.is-align-right  img { margin-left: auto; margin-right: 0; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}