/* Site frame: header and footer of the reader, the library shelf (/) and the error page. */
@layer layout {
  .edition-picker { display: inline-flex; flex: none; align-items: center; }
  .edition-picker select { max-width: 200px; color: var(--ink); border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); font: 650 12px var(--body); padding: 8px 26px 8px 9px; }
  @media (max-width: 759.98px) { .edition-picker select { max-width: 155px; font-size: 11px; padding-block: 6px; } }
  .latest-issue { display: grid; grid-template-columns: minmax(220px, 37%) minmax(0, 1fr); gap: clamp(24px, 4vw, 58px); align-items: center; padding: 24px 0 34px; margin-bottom: 26px; border-bottom: 1px solid var(--rule); }
  .latest-cover { width: 100%; max-width: 360px; justify-self: center; border: 0; padding: 0; }
  .latest-cover img { border-radius: 5px; box-shadow: 0 15px 32px var(--shade); }
  .latest-copy h3 { font: 800 clamp(30px, 3.8vw, 52px)/1.08 var(--display); letter-spacing: -1.1px; margin: 16px 0; }
  .latest-copy > p { font-size: 17px; line-height: 1.6; margin: 12px 0 20px; }
  .latest-features { padding: 0; margin: 26px 0; list-style: none; display: grid; gap: 11px; }
  .latest-features a { display: flex; justify-content: space-between; gap: 15px; text-decoration: none; padding-bottom: 9px; border-bottom: 1px solid var(--rule); font-size: 15px; }
  .latest-features a:hover { text-decoration: underline; }
  .latest-features span { white-space: nowrap; color: var(--muted); font-size: 12px; }
  .magazine-section .issue-archive-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  @media (max-width: 540px) { .latest-issue { grid-template-columns: 1fr; gap: 26px; } .latest-cover { max-width: 260px; } .latest-copy h3 { font-size: 34px; } .latest-copy > .button { width: 100%; } .magazine-section .issue-archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .issue-archive { margin-top: 60px; }
  .issue-archive h2 { font: 800 clamp(26px, 3vw, 36px)/1.15 var(--display); margin: 12px 0 24px; }
  .issue-archive-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
  .archive-issue { display: flex; flex-direction: column; gap: 9px; text-decoration: none; color: var(--ink); }
  .archive-issue { min-width: 0; padding-bottom: 12px; border-bottom: 2px solid var(--rule); }
  .archive-issue img { width: 100%; height: auto; aspect-ratio: 210/297; object-fit: cover; border-radius: 4px; box-shadow: 0 6px 18px #182f2a20; }
  .archive-issue strong { font: 800 19px/1.2 var(--display); }
  .archive-issue .eyebrow { font-size: 10px; }
  .archive-focus { font-size: 13px; line-height: 1.4; }
  .archive-issue:hover img { box-shadow: 0 8px 24px #182f2a40; }
  .archive-cover { position: relative; }
  .archive-cover:has(.archive-cover-copy) { aspect-ratio: 210 / 297; overflow: hidden; }
  .archive-issue .archive-cover:has(.archive-cover-copy) > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .archive-cover-copy { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 7%; color: white; background: linear-gradient(180deg, rgba(0,0,0,.72), transparent 40%, rgba(0,0,0,.88)); }
  .archive-cover-masthead { font-family: var(--display); font-size: clamp(22px,3vw,42px); font-weight: 900; letter-spacing: -.04em; }
  .archive-cover-number { margin-top: 3px; font-size: 9px; letter-spacing: .08em; }
  .archive-cover-copy > strong { margin-top: auto; font-size: clamp(18px,2vw,28px); line-height: 1.1; color: white; }
  .archive-cover-teaser { margin-top: 8px; font-size: 11px; line-height: 1.2; }
  .archive-edition-meta { display: flex; flex-direction: column; align-items: start; justify-content: start; gap: 5px; min-height: 42px; }
  .archive-badge { display: inline-block; width: fit-content; max-width: 100%; padding: 3px 7px; border-radius: 4px; background: var(--tint); color: var(--green); font-size: 11px; line-height: 1.3; font-weight: 800; }
  .archive-issue[aria-current='page'] { border-color: var(--green); }
  .archive-issue[aria-current='page'] img { outline: 3px solid var(--green); outline-offset: -3px; }
  .archive-date { font-size: 12px; color: var(--muted); }
  .archive-open { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; font-size: 13px; font-weight: 750; color: var(--green); }
  .archive-issue:hover .archive-open { text-decoration: underline; text-underline-offset: 3px; }
  .magazine-collection { display: grid; gap: 46px; }
  .magazine-section { --muted: color-mix(in srgb, var(--ink) 80%, var(--paper)); --rule: color-mix(in srgb, var(--ink) 16%, var(--paper)); --line: var(--rule); --shade: color-mix(in srgb, var(--ink) 22%, transparent); padding: 28px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-top: 5px solid var(--green); border-radius: 9px; scroll-margin-top: 24px; }
  .magazine-section-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
  .magazine-section-header > .button { flex: none; }
  .magazine-section-intro { min-width: 0; max-width: 720px; }
  .magazine-section-intro h1, .magazine-section-intro h2 { margin: 7px 0 12px; font: 800 clamp(30px, 4vw, 46px)/1.1 var(--display); letter-spacing: -1.4px; }
  .magazine-section-intro h1 { font-size: clamp(38px, 5vw, 60px); }
  .magazine-section-intro h2 a { text-decoration: none; }
  .magazine-section-intro h2 a:hover { text-decoration: underline; text-underline-offset: 5px; }
  .magazine-mark { margin-left: 8px; color: var(--green); }
  .magazine-section-intro p { margin: 0 0 15px; font-size: 15px; line-height: 1.65; }
  .magazine-section-intro .shelf-topics { margin-bottom: 0; }
  .archive-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
  .archive-heading h2, .archive-heading h3 { margin: 0; font: 800 21px/1.2 var(--display); }
  .archive-heading > span { font-size: 13px; color: var(--muted); }
  .archive-empty { padding: 22px 0; }
  .library-jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
  .library-jump a { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; font-size: 13px; font-weight: 800; text-decoration: none; }
  .library-jump a span { font-size: 12px; font-weight: 500; color: var(--muted); }
  .library-jump a:hover { border-color: var(--green); }
  .library-header .library-back { font: 600 13px var(--body); letter-spacing: 0; }
  .edition-focus { padding: 20px; margin-bottom: 22px; background: var(--soft); border-radius: 12px; }
  .edition-focus h3 { margin: 7px 0; font: 800 24px/1.15 var(--display); }
  .edition-focus p { line-height: 1.5; margin: 8px 0 14px; }
  .focus-topics { display: flex; flex-wrap: wrap; gap: 7px; }
  .focus-topics span { padding: 5px 9px; background: var(--paper); border: 1px solid var(--rule); border-radius: 20px; font-size: 12px; }
  @media (max-width: 899px) { .issue-archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
  @media (max-width: 759.98px) { .magazine-section { padding: 20px; } .magazine-section-header { flex-direction: column; align-items: flex-start; gap: 18px; } }
  @media (max-width: 540px) { .issue-archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .archive-issue strong { font-size: 17px; } .magazine-section { padding: 16px; } .archive-badge { left: 6px; right: 6px; bottom: 6px; padding: 4px 6px; max-width: calc(100% - 12px); font-size: 10px; } .archive-issue .eyebrow { font-size: 9px; letter-spacing: 0.06em; } }
}
@layer layout {
  /* --- Reader header: one row (two on phones) with a fixed height, see --header-h in reader.css --- */
  .site-header {
    display: flex;
    align-items: center;
    gap: 22px;
    height: var(--header-h);
    padding: 0 max(var(--edge), env(safe-area-inset-left), calc((100vw - 1600px) / 2));
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .brand {
    display: flex;
    align-items: center;
    flex: none;
    font: 800 32px/1 var(--display);
    letter-spacing: -1.5px;
    text-decoration: none;
    white-space: nowrap;
  }
  .brand-star {
    margin-left: 5px;
    font-size: 30px;
    letter-spacing: 0;
    color: color-mix(in srgb, var(--green) 62%, var(--lime));
  }
  .edition-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding-left: 18px;
    border-left: 1px solid var(--rule);
  }
  .edition-title {
    margin: 0;
    font: 750 15px/1.25 var(--display);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .edition-issue {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--muted);
  }
  .site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-link {
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
  }
  .nav-library {
    flex: none;
    padding-left: 20px;
    border-left: 1px solid var(--rule);
  }

  .workspace {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 max(var(--edge), env(safe-area-inset-left));
  }

  /* The footer follows <main> (contentinfo landmark), aligned with the workspace edges. */
  .site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    align-items: center;
    width: min(1100px, calc(100% - 2 * max(var(--edge, 24px), env(safe-area-inset-left))));
    margin: 32px auto 0;
    padding: 28px 0 20px;
    border-top: 1px solid var(--rule);
  }
  .footer-brand {
    font: 800 24px var(--display);
    letter-spacing: -1px;
  }
  .footer-brand .masthead-mark--text {
    font-size: 25px;
  }
  .site-footer p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
  }
  .site-footer button {
    background: none;
    padding: 8px 0;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .site-footer button:first-of-type {
    margin-left: auto;
  }

  @media (max-width: 999.98px) {
    /* Visually hidden, not display:none: it holds the page's only h1. */
    .edition-meta {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
      white-space: nowrap;
    }
  }
  @media (max-width: 759.98px) {
    .site-header {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      /* Two rows that add up to --header-h (reader.css) with the 1 px bottom border. */
      grid-template-rows: 46px calc(var(--header-h) - 47px);
      grid-template-areas:
        'brand library'
        'nav nav';
      column-gap: 12px;
      row-gap: 0;
    }
    .brand {
      grid-area: brand;
      font-size: 27px;
    }
    .brand-star {
      font-size: 25px;
    }
    .nav-library {
      grid-area: library;
      justify-self: end;
      padding-left: 0;
      border: 0;
      font-size: 13px;
    }
    .nav-library::after {
      content: ' →' / '';
    }
    .site-nav {
      grid-area: nav;
      gap: 16px;
      margin: 0 calc(-1 * var(--edge));
      padding: 0 var(--edge);
      align-self: stretch;
      border-top: 1px solid var(--rule);
    }
    .nav-link {
      font-size: 13px;
      padding: 6px 0;
    }
    .site-nav .nav-link {
      align-self: stretch;
    }
    .site-nav [aria-hidden='true'] {
      display: none;
    }
    .site-footer {
      display: grid;
      grid-template-columns: 1fr 1fr;
      padding: 22px 2px;
    }
    .site-footer p {
      grid-column: 1 / -1;
    }
    .site-footer button,
    .site-footer button:first-of-type {
      margin: 0;
      text-align: left;
    }
  }
  @media (max-height: 500px) {
    .site-header {
      display: flex;
      gap: 16px;
    }
    .brand {
      font-size: 22px;
    }
    .brand-star {
      font-size: 20px;
    }
    /* The page's h1 stays for screen readers (visually hidden, as below 1000 px). */
    .edition-meta {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
      white-space: nowrap;
      padding: 0;
      border: 0;
    }
    .site-nav {
      margin: 0 0 0 auto;
      padding: 0;
      border: 0;
      gap: 14px;
    }
    .nav-link {
      font-size: 12px;
    }
    .nav-library {
      padding-left: 14px;
      border-left: 1px solid var(--rule);
    }
    .nav-library::after {
      content: none;
    }
  }

  /* --- Library shelf (Pages/Root.cshtml) ------------------------------------------------------------ */
  .magazine-library {
    background: color-mix(in srgb, var(--bg) 70%, var(--paper));
  }
  .library-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
  }
  .library-header a {
    text-decoration: none;
    font: 800 23px var(--display);
    letter-spacing: -0.7px;
  }
  .library-header span {
    font-size: 12px;
    color: var(--muted);
  }
  .library-main {
    max-width: 1280px;
    margin: auto;
    padding: 58px 34px 45px;
  }
  .library-intro {
    max-width: 740px;
    margin-bottom: 42px;
  }
  .library-intro h1 {
    font: 800 clamp(40px, 5vw, 68px) / 1.04 var(--display);
    letter-spacing: -2.8px;
    margin: 13px 0 22px;
  }
  .library-intro p {
    font-size: 18px;
    max-width: 620px;
    color: var(--muted);
    line-height: 1.7;
  }
  .magazine-shelf {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .shelf-card {
    display: grid;
    grid-template-columns: 44% 1fr;
    overflow: hidden;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    text-decoration: none;
    min-height: 420px;
    box-shadow: 0 8px 22px var(--shade);
  }
  .shelf-cover {
    position: relative;
    background: var(--green);
    overflow: hidden;
    color: white;
  }
  .shelf-cover img {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }
  .shelf-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      color-mix(in srgb, var(--ink) 25%, transparent),
      transparent 30%,
      color-mix(in srgb, var(--ink) 80%, transparent)
    );
  }
  .shelf-cover b {
    position: absolute;
    top: 18px;
    left: 14px;
    right: 14px;
    font: 850 clamp(28px, 3.2vw, 43px) / 1 var(--display);
    letter-spacing: -2px;
    z-index: 1;
  }
  .shelf-cover span {
    position: absolute;
    bottom: 23px;
    left: 20px;
    right: 20px;
    font: 750 24px/1.12 var(--display);
    z-index: 1;
  }
  .shelf-info {
    padding: 29px 26px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .shelf-info h2 {
    font: 800 32px/1.1 var(--display);
    letter-spacing: -1px;
    margin: 14px 0;
  }
  .shelf-info p {
    font-size: 15px;
    line-height: 1.65;
    margin: 0 0 20px;
  }
  .shelf-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 22px;
  }
  .shelf-topics span {
    font-size: 11px;
    padding: 4px 8px;
    background: var(--bg);
    border: 1px solid var(--line);
  }
  .shelf-link {
    display: flex;
    gap: 18px;
    background: var(--green);
    color: white;
    padding: 11px 14px;
    margin-top: auto;
    font-size: 13px;
    font-weight: 700;
  }
  .shelf-link b {
    color: var(--lime);
  }
  .shelf-card:hover .shelf-link {
    text-decoration: underline;
  }
  .library-note {
    font-size: 13px;
    color: var(--muted);
    margin-top: 30px;
  }
  @media (max-width: 999.98px) {
    .magazine-shelf {
      grid-template-columns: 1fr;
    }
    .shelf-card {
      min-height: 360px;
    }
    .shelf-cover b {
      font-size: 48px;
    }
    .library-intro h1 {
      font-size: 54px;
    }
  }
  @media (max-width: 759.98px) {
    .library-main {
      padding: 38px 20px;
    }
    .library-header {
      padding: 22px 20px;
    }
    .library-header span {
      max-width: 95px;
      text-align: right;
    }
    .library-intro h1 {
      font-size: 43px;
      letter-spacing: -1.8px;
    }
    .library-intro p {
      font-size: 16px;
    }
    .shelf-card {
      grid-template-columns: 40% 1fr;
      min-height: 410px;
    }
    .shelf-info {
      padding: 24px 20px;
    }
    .shelf-info h2 {
      font-size: 29px;
    }
    .shelf-info p {
      font-size: 14px;
    }
    .shelf-cover b {
      font-size: 33px;
      letter-spacing: -1.5px;
    }
    .shelf-cover span {
      font-size: 21px;
    }
    .shelf-topics span {
      font-size: 10px;
    }
  }
  @media (max-width: 540px) {
    .shelf-card {
      grid-template-columns: 1fr;
    }
    .shelf-cover {
      height: 270px;
    }
    .shelf-cover img {
      object-position: center 43%;
    }
    .shelf-cover b {
      font-size: 55px;
      left: 22px;
      top: 22px;
    }
    .shelf-cover span {
      max-width: 260px;
      font-size: 26px;
    }
    .shelf-info {
      padding: 25px;
    }
    .shelf-info p {
      font-size: 16px;
    }
    .library-header a {
      font-size: 21px;
    }
  }

  /* --- Error page ------------------------------------------------------------------------------------ */
  .error-page {
    max-width: 600px;
    margin: 12vh auto;
    padding: 35px;
  }
  .error-page h1 {
    font: 800 44px/1.1 var(--display);
    letter-spacing: -1px;
  }
  .error-page p {
    font-size: 18px;
    margin: 25px 0;
  }
}
/*
 * Masthead lockup (Pages/Shared/_Masthead.cshtml) on the reader header, footer, shelf and archive: the masthead
 * face of the magazine (--font-masthead from its typography roles), the dark masthead tone and the brand mark of
 * coverDefaults.masthead; VONK's letters carry their own colour, tilt, shift and yellow offset shadow.
 * Cover cards (_ArchiveCoverImage): painted in the cover's dominant colour while the image loads (never a white box).
 */
@layer layout {
  .masthead {
    display: inline-flex;
    align-items: center;
    gap: 0.14em;
    font-family: var(--font-masthead, var(--display));
    font-weight: var(--font-masthead-weight, 800);
    font-stretch: var(--font-masthead-stretch, 100%);
    color: var(--masthead-ink, currentColor);
    line-height: 1;
    white-space: nowrap;
  }
  .masthead-mark {
    flex: none;
    width: 0.58em;
    height: 0.58em;
    color: var(--mark-ink, currentColor);
  }
  .masthead-mark.decor-svg--plus {
    width: 0.46em;
    height: 0.46em;
    margin-top: -0.32em;
  }
  .masthead-mark.decor-svg--asterisk {
    margin-top: -0.36em;
  }
  .masthead-mark--text {
    width: auto;
    height: auto;
    font-size: 0.9em;
    letter-spacing: 0;
  }
  .masthead-mark--star {
    width: 0.72em;
    height: 0.72em;
    margin: -0.5em 0 0 -0.05em;
  }
  .masthead-mark--star .decor-svg {
    display: block;
    width: 100%;
    height: 100%;
  }
  .masthead--letters .masthead-name {
    display: inline-flex;
    letter-spacing: 0.03em;
  }
  .masthead-letter {
    display: inline-block;
    color: var(--letter-color);
    rotate: var(--letter-rotate, 0deg);
    translate: 0 var(--letter-shift, 0);
    text-shadow: var(--letter-shadow-x, 0) var(--letter-shadow-y, 0) 0 var(--letter-shadow, transparent);
  }
  .brand .masthead,
  .footer-brand .masthead,
  .magazine-section-intro .masthead {
    letter-spacing: -0.03em;
  }
  .brand .masthead--letters .masthead-name,
  .footer-brand .masthead--letters .masthead-name,
  .magazine-section-intro .masthead--letters .masthead-name {
    letter-spacing: 0.03em;
  }

  /* Each magazine's own title face on its shelf (the section carries its typography variables). */
  .magazine-section .latest-copy h3,
  .magazine-section .archive-issue strong {
    font-family: var(--font-title, var(--display));
    font-weight: var(--font-title-weight, 800);
    font-stretch: var(--font-title-stretch, 100%);
    font-style: var(--font-title-style, normal);
  }
  .archive-cover {
    position: relative;
    aspect-ratio: 210 / 297;
    background: var(--cover-dominant, var(--green));
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 10%, transparent), 0 10px 24px -14px color-mix(in srgb, var(--ink) 55%, transparent);
    transition: translate 0.2s ease, box-shadow 0.2s ease;
  }
  .archive-issue .archive-cover > img {
    width: 100%;
    height: 100%;
    aspect-ratio: 210 / 297;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
  }
  .latest-cover .archive-cover {
    border-radius: 4px;
    box-shadow: 0 2px 4px color-mix(in srgb, var(--ink) 10%, transparent), 0 18px 34px -16px color-mix(in srgb, var(--ink) 60%, transparent);
  }
  .latest-cover .archive-cover > img {
    border-radius: 0;
    box-shadow: none;
  }
  @media (hover: hover) {
    .archive-issue:hover .archive-cover {
      translate: 0 -2px;
      box-shadow: 0 2px 4px color-mix(in srgb, var(--ink) 12%, transparent), 0 16px 30px -14px color-mix(in srgb, var(--ink) 65%, transparent);
    }
    .archive-issue:hover img {
      box-shadow: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .archive-issue:hover .archive-cover {
      translate: none;
    }
  }
  .archive-issue[aria-current='page'] .archive-cover {
    outline: 3px solid var(--green);
    outline-offset: 3px;
  }
  .archive-issue[aria-current='page'] img {
    outline: 0;
  }
}
