@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

/* ═══════════════════════════════════════════════════════════════
       COLOR THEME — swap the :root block to switch between A and B
       ═══════════════════════════════════════════════════════════════

       VARIATION A — warm newsprint / aged paper
       Deep brown-blacks, brick red, warm cream, muted tones
    */
    :root {
      --red:         #b5121b;   /* brick red — slightly darker, less neon */
      --yellow:      #e8b84b;   /* warm amber rather than bright yellow */
      --cream:       #f5edd6;   /* deeper aged newsprint cream */
      --canvas-bg:   rgba(245,237,214,0.97);
      --ink:         #1c0f07;   /* very dark warm brown, not pure black */
      --muted:       #7a6248;   /* warm brown-gray */
      --blue:        #2b4d8c;
      --teal:        #196b6a;
      --border-col:  #1c0f07;
      --nav-bg:      #1c0f07;
      --nav-text:    #e8b84b;
      --nav-hover:   rgba(232,184,75,0.15);
      --header-bg:   #2e1a0c;   /* dark warm brown */
      --header-text: #e8b84b;
      --strip-bg:    #e8b84b;
    }

    /*
       VARIATION B — high contrast / graphic / bold
       True black, pure MAD red, bright white canvas — like the covers themselves

    :root {
      --red:         #cc0000;
      --yellow:      #ffcc00;
      --cream:       #ffffff;
      --canvas-bg:   rgba(255,255,255,0.98);
      --ink:         #0a0a0a;
      --muted:       #555555;
      --blue:        #1a3d8f;
      --teal:        #006b6a;
      --border-col:  #0a0a0a;
      --nav-bg:      #cc0000;
      --nav-text:    #ffcc00;
      --nav-hover:   rgba(0,0,0,0.2);
      --header-bg:   #0a0a0a;
      --header-text: #ffcc00;
      --strip-bg:    #ffcc00;
    }
    */

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    /* ── Page background: MAD cover collage ── */
    body {
      color: var(--ink);
      font-family: 'Libre Baskerville', Georgia, serif;
      font-size: 16px;
      line-height: 1.6;
      background-color: #1a0808;
      background-image: url('mad-bg.jpg');
      background-size: cover;
      background-position: center;
      background-attachment: fixed;
      min-height: 100vh;
    }

    /* Cream canvas — no side borders */
    .page-canvas {
      background: var(--canvas-bg);
      max-width: 1160px;
      margin: 0 auto;
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.5),
        0 0 80px rgba(0,0,0,0.7),
        -12px 0 50px rgba(0,0,0,0.35),
          12px 0 50px rgba(0,0,0,0.35);
    }

    /* ════════════════════════════════════
       NAV BAR — logo+face | links
       ════════════════════════════════════ */
    .site-nav {
      background: var(--nav-bg);
      border-bottom: 3px solid var(--red);
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .nav-inner {
      display: grid;
      grid-template-columns: auto 1fr;
      align-items: stretch;
      min-height: 48px;
    }

    /* Left: site ID + face */
    .nav-brand {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.35rem 0.75rem;
      border-right: 2px solid rgba(255,255,255,0.1);
      text-decoration: none;
      flex-shrink: 0;
    }
    .nav-brand-text {
      font-family: 'Oswald', sans-serif;
      font-size: 0.72rem;
      line-height: 1.25;
      color: var(--nav-text);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .nav-brand-text strong {
      display: block;
      font-size: 0.95rem;
      letter-spacing: 0.06em;
    }
    .nav-face {
      height: 38px;
      width: auto;
      display: block;
    }

    /* Center: two rows of links */
    .nav-links {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    .nav-row {
      display: flex;
      flex-wrap: wrap;
      list-style: none;
      border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .nav-row:last-child { border-bottom: none; }
    .nav-row a {
      display: block;
      padding: 0.28rem 0.65rem;
      color: var(--nav-text);
      text-decoration: none;
      font-family: 'Oswald', sans-serif;
      font-size: 0.82rem;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      white-space: nowrap;
      transition: background 0.12s;
    }
    .nav-row a:hover { background: var(--nav-hover); }


    /* Mobile nav — hide desktop nav, show simple scroll bar */
    @media (max-width: 767px) {
      .nav-inner { display: none; }
      .mobile-brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--nav-bg);
        padding: 0.4rem 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        text-decoration: none;
        position: sticky;
        top: 0;
        z-index: 101;
      }
      .mobile-brand-text {
        font-family: 'Oswald', sans-serif;
        font-size: 0.65rem;
        line-height: 1.25;
        color: var(--nav-text);
        text-transform: uppercase;
        letter-spacing: 0.04em;
      }
      .mobile-brand-text strong {
        display: block;
        font-size: 0.85rem;
        letter-spacing: 0.06em;
      }
      .mobile-brand img {
        height: 32px;
        width: auto;
        display: block;
      }
      .mobile-nav {
        display: flex;
        overflow-x: scroll;
        background: var(--nav-bg);
        border-bottom: 3px solid var(--red);
        position: sticky;
        top: 49px;
        z-index: 100;
      }
      .mobile-nav a {
        display: block;
        flex-shrink: 0;
        padding: 0.5rem 0.65rem;
        color: var(--nav-text);
        text-decoration: none;
        font-family: 'Oswald', sans-serif;
        font-size: 0.8rem;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        border-right: 1px solid rgba(255,255,255,0.1);
        white-space: nowrap;
      }
      .mobile-nav a:last-child { border-right: none; }
      .mobile-nav a:hover { background: var(--nav-hover); }
    }
    @media (min-width: 768px) {
      .mobile-nav   { display: none; }
      .mobile-brand { display: none; }
    }

    /* ── Issue strip ── */
    .issue-strip {
      background: var(--strip-bg);
      border-bottom: 3px solid var(--border-col);
      padding: 0.6rem 1rem;
      overflow-x: auto;
      white-space: nowrap;
    }
    .issue-strip ul { display: inline-flex; gap: 0.5rem; list-style: none; align-items: center; }
    .issue-strip a {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      text-decoration: none;
      font-family: 'Oswald', sans-serif;
      font-size: 0.72rem;
      color: var(--ink);
      padding: 3px;
      border: 2px solid transparent;
      border-radius: 2px;
      transition: border-color 0.12s;
    }
    .issue-strip a:hover,
    .issue-strip a[aria-current] { border-color: var(--red); }
    .issue-strip img { display: block; height: 52px; width: auto; border: 1px solid var(--ink); }

    /* ── Main two-column layout ── */
    .main-wrapper {
      max-width: 1100px;
      margin: 0 auto;
      padding: 2rem 1.5rem;
      display: grid;
      grid-template-columns: 1fr 300px;
      gap: 3rem;
      align-items: start;
    }

    /* Hide mini thumb on desktop */
    .cover-mini { display: none; }

    /* Landscape tablet: tighten columns */
    @media (min-width: 768px) and (max-width: 860px) {
      .main-wrapper { grid-template-columns: 1fr 220px; gap: 1.5rem; padding: 1.5rem 1rem; }
    }

    /* Portrait mobile: single column, covers move below contents */
    @media (max-width: 767px) {
      .main-wrapper { display: flex; flex-direction: column; padding: 1rem 0.85rem; }
      .main-wrapper > main { order: 1; }
      .cover-col {
        order: 2;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        padding-top: 1.5rem;
        border-top: 2px solid rgba(0,0,0,0.1);
        margin-top: 1.5rem;
      }
      .cover-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 120px;
      }
      .cover-item .cover-frame { width: 100%; box-shadow: 3px 3px 0 var(--ink); }
      .cover-item .cover-caption { text-align: left; margin-top: 0.3rem; }
      .cover-item .section-label,
      .cover-item .cover-label { text-align: left; margin-bottom: 0.3rem; margin-top: 0; }
      .cover-item .section-label { text-align: left; margin-bottom: 0.3rem; margin-top: 0; }
      .cover-mini {
        display: block;
        float: right;
        width: 80px;
        margin: 0.2rem 0 0.6rem 0.8rem;
        border: 3px solid var(--ink);
        box-shadow: 3px 3px 0 var(--ink);
        cursor: zoom-in;
      }
    }

    /* ── Issue heading ── */
    .issue-heading {
      font-family: 'Oswald', sans-serif;
      font-size: clamp(1.5rem, 5vw, 2.4rem);
      font-weight: 700;
      line-height: 1.1;
      border-bottom: 4px solid var(--red);
      padding-bottom: 0.5rem;
      margin-bottom: 1.1rem;
    }
    .issue-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem 1.5rem;
      font-size: 0.84rem;
      color: var(--muted);
      margin-bottom: 1.5rem;
    }
    .issue-meta a { color: var(--blue); text-decoration: none; }
    .issue-meta a:hover { text-decoration: underline; }
    .sample-link, .reprint-list a.sample-link {
      color: var(--teal);
      font-style: italic;
      text-decoration: none;
      font-size: 0.83rem;
      margin-left: 0.2rem;
    }
    .sample-link:hover, .reprint-list a.sample-link:hover { color: var(--blue); text-decoration: underline; }

    /* ── AEN Quote ── */
    .aen-quote {
      border-left: 5px solid var(--red);
      padding: 0.55rem 1rem;
      margin: 0.75rem 0 1.5rem;
      background: rgba(181,18,27,0.05);
      font-style: italic;
      font-size: 0.88rem;
      color: var(--red);
    }
    .aen-quote cite {
      display: block;
      margin-top: 0.25rem;
      font-style: normal;
      font-weight: 700;
      font-size: 0.78rem;
      letter-spacing: 0.04em;
    }

    /* ── Contents list ── */
    .section-label {
      font-family: 'Oswald', sans-serif;
      font-size: 0.63rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 0.35rem;
    }
    .contents-list {
      list-style: none;
      border-top: 3px solid var(--border-col);
    }
    .contents-list li {
      border-bottom: 1px solid rgba(0,0,0,0.1);
      padding: 0.55rem 0;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 0.5rem;
      align-items: baseline;
    }
    .contents-list li:hover { background: rgba(232,184,75,0.1); }

    .item-title { font-weight: 700; font-size: 0.95rem; }
    .item-dept  { font-size: 0.8rem; color: var(--muted); font-style: italic; }
    .item-creators { font-size: 0.85rem; color: var(--blue); margin-top: 0.1rem; }
    .item-creators a { color: inherit; text-decoration: none; }
    .item-creators a:hover { text-decoration: underline; }
    .item-page {
      font-family: 'Oswald', sans-serif;
      font-size: 0.84rem;
      color: var(--muted);
      white-space: nowrap;
      align-self: start;
      padding-top: 0.15rem;
    }

    .item-links { font-size: 0.73rem; margin-top: 0.2rem; }
    .item-links a {
      color: var(--muted);
      text-decoration: none;
      border: 1px solid var(--muted);
      border-radius: 2px;
      padding: 1px 5px;
      margin-right: 4px;
      font-family: 'Oswald', sans-serif;
      font-size: 0.63rem;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      transition: background 0.12s, color 0.12s;
    }
    .item-links a:hover { background: var(--ink); color: var(--yellow); border-color: var(--ink); }

    /* ── Reprint details ── */
    .reprints { grid-column: 1 / -1; margin-top: 0.25rem; }
    .reprints summary {
      font-size: 0.74rem;
      color: var(--muted);
      cursor: pointer;
      user-select: none;
      list-style: none;
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }
    .reprints summary::before { content: '▶'; font-size: 0.52rem; transition: transform 0.15s; }
    .reprints[open] summary::before { transform: rotate(90deg); }
    .reprints summary::-webkit-details-marker { display: none; }
    .reprints summary:hover { color: var(--blue); }
    .reprint-list {
      list-style: none;
      margin-top: 0.35rem;
      padding: 0.45rem 0.75rem;
      background: rgba(0,0,0,0.04);
      border-left: 3px solid var(--yellow);
      font-size: 0.83rem;
    }
    .reprint-list li {
      display: block;
      margin-bottom: 0.22rem;
    }
    .reprint-list li:last-child { margin-bottom: 0; }
    .reprint-list a { color: var(--blue); text-decoration: none; }
    .reprint-list a:hover { text-decoration: underline; }

    /* ── Cover column ── */
    /* Desktop only: sticky cover column */
    @media (min-width: 768px) {
      .cover-col { position: sticky; top: 60px; }
    }
    .cover-frame {
      border: 4px solid var(--ink);
      display: block;
      width: 100%;
      height: auto;
      box-shadow: 6px 6px 0 var(--ink);
      cursor: zoom-in;
      transition: box-shadow 0.12s, transform 0.12s;
      position: relative;
      z-index: 1;
    }
    .cover-frame:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--ink); }
    .cover-label, .section-label {
      font-family: 'Oswald', sans-serif;
      font-size: 0.63rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--muted);
      text-align: left;
      margin: 1.25rem 0 0.35rem;
    }

    /* ── Pop overlay ── */
    #pop-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.65);
      z-index: 499;
      cursor: zoom-out;
    }
    #pop-overlay.active { display: block; }
    #pop-clone {
      display: none;
      position: fixed;
      z-index: 500;
      border: 4px solid var(--ink);
      box-shadow: 0 8px 60px rgba(0,0,0,0.85);
      cursor: zoom-out;
    }
    #pop-clone.active { display: block; }

    /* ── Footer ── */
    .site-footer {
      background: var(--nav-bg);
      color: var(--cream);
      border-top: 3px solid var(--red);
      padding: 0;
    }
    /* Footer repeats the full nav */
    .site-footer .site-nav {
      position: static;
      border-bottom: none;
      border-top: none;
    }
    .footer-credit {
      text-align: center;
      padding: 0.75rem 1rem;
      font-size: 0.75rem;
      color: rgba(245,237,214,0.5);
      font-family: 'Oswald', sans-serif;
      letter-spacing: 0.05em;
    }
    .footer-credit a { color: var(--yellow); text-decoration: none; }
    .footer-credit a:hover { text-decoration: underline; }