/* ============================================================
   hormusjicama.com — responsive.css
   Recomposition (not shrinking) for tablet and handset widths.
   Breakpoints: 1180 · 1024 · 900 · 720 · 560 · 400
   ============================================================ */

/* ---------- ≤ 1180px : ease the widest columns -------------- */
@media (max-width: 1180px) {
  :root { --measure: 62ch; }
  .opening__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); }
  .opening__plate { max-width: 400px; }
  .profile__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .essay__grid { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
}

/* ---------- ≤ 1024px : tablet landscape --------------------- */
@media (max-width: 1024px) {
  .nav__list { gap: .85rem; }
  .nav__link { font-size: .8rem; }
  .footer__top { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
  .footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4-8, .grid--5-7, .grid--7-5 { grid-template-columns: minmax(0, 1fr); }
  .sticky-aside, .essay__index { position: static; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .chapter__split, .chapter__split--rev { grid-template-columns: minmax(0, 1fr); }
  .chapter__split--rev .chapter__figure { order: 0; }
  .statement__grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .closing__inner { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .contact__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- ≤ 900px : stack the primary compositions -------- */
@media (max-width: 900px) {
  /* A backdrop-filter makes .masthead a containing block for its
     own fixed-position children, which would trap the navigation
     panel inside the header bar. Handsets get a solid bar. */
  .masthead {
    background: var(--mineral);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* Mobile navigation panel.
     The closed panel stays inside the viewport and hides by
     opacity + visibility: a fixed element translated off-screen
     still widens the document in Blink, which produced a
     horizontal scrollbar on handsets. */
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(360px, 88vw);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5.5rem var(--sp-4) var(--sp-4);
    background: var(--forest-deep);
    border-left: 1px solid rgba(250, 250, 248, .12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--t-mid), visibility var(--t-mid);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  .nav.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
  .nav__list { transform: translateX(16px); transition: transform var(--t-mid); }
  .nav.is-open .nav__list { transform: none; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list li { border-bottom: 1px solid rgba(250, 250, 248, .12); }
  .nav__list li:first-child { border-top: 1px solid rgba(250, 250, 248, .12); }
  .nav__link {
    padding: 1.05rem .25rem;
    font-family: var(--font-display);
    font-size: 1.32rem;
    font-weight: 400;
    color: var(--sage);
  }
  .nav__link:hover { color: var(--paper); }
  .nav__link::after { bottom: .65rem; background: var(--gold-soft); }
  .nav__link[aria-current="page"] { color: var(--gold-soft); font-weight: 400; }
  .nav__link[aria-current="page"]::after { transform: scaleX(0); }
  .nav__link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 5px; height: 5px;
    margin-left: -.85rem;
    border-radius: 50%;
    background: var(--gold-soft);
    transform: translateY(-50%);
  }
  .nav__foot {
    display: block;
    margin-top: var(--sp-4);
    padding-top: var(--sp-3);
    border-top: 1px solid rgba(250, 250, 248, .12);
    font-size: var(--fs-meta);
    font-weight: 600;
    letter-spacing: .17em;
    text-transform: uppercase;
    color: rgba(220, 227, 216, .6);
  }
  .nav-scrim {
    position: fixed;
    inset: 0;
    background: rgba(18, 36, 30, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-mid), visibility var(--t-mid);
    z-index: 110;
  }
  .nav-scrim.is-open { opacity: 1; visibility: visible; }
  body.nav-open { overflow: hidden; }

  /* Layout recomposition */
  .page-head__grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .opening__grid { grid-template-columns: minmax(0, 1fr); }
  .opening__plate { justify-self: start; max-width: 460px; margin-top: var(--sp-2); }
  .opening::before { height: 100%; }
  .profile__grid { grid-template-columns: minmax(0, 1fr); }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .highlights { grid-template-columns: minmax(0, 1fr); }
  .highlights__item { border-right: 0; }
  .dossier { grid-template-columns: minmax(0, 1fr); }
  .chapter__head, .chapter--offset .chapter__head { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .chapter--offset .chapter__year { grid-column: 1; grid-row: 1; text-align: left; }
  .chapter--offset .chapter__title { grid-column: 1; grid-row: 2; }
  .strands__item { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .strands__item::before { grid-row: 1 / span 2; }
  .strands__title { grid-column: 2; }
  .strands__text { grid-column: 2; margin-top: .7rem; }
  .essay__grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .essay__index { display: flex; align-items: baseline; gap: .9rem; }
  .essay__no { font-size: 1.7rem; }
  .essay__cat { margin-top: 0; }
  .journal__lead { grid-template-columns: minmax(0, 1fr); }
  .values { grid-template-columns: minmax(0, 1fr); }
  .values__item, .values__item:nth-child(odd), .values__item:nth-child(even) {
    border-right: 0; padding-left: 0; padding-right: 0;
  }
  .ledger__row { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .spanner { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* ---------- ≤ 720px : tablet portrait / large handset ------- */
@media (max-width: 720px) {
  :root { --measure: 100%; --fs-meta: .7rem; }
  .masthead__inner { min-height: 66px; }
  .footer__cols { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .opening__strap { grid-template-columns: minmax(0, 1fr); }
  .opening__strap > div { padding-bottom: var(--sp-2); border-bottom: 1px solid var(--rule); }
  .opening__strap > div:last-child { border-bottom: 0; padding-bottom: 0; }
  .register__item { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .register__num { padding-top: 0; }
  .spanner { grid-template-columns: minmax(0, 1fr); }
  .spanner__cell { border-right: 0; border-bottom: 1px solid var(--rule); padding-right: 0; }
  .spanner__cell:last-child { border-bottom: 0; }
  .contact-lines__row { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .prose p, .lead, .essay__body p, .chapter__body p { max-width: none; }
  .statement__text { max-width: none; }
  .pull { max-width: none; }
  .essay__body .pull { max-width: none; }
}

/* ---------- ≤ 560px : handset ------------------------------- */
@media (max-width: 560px) {
  :root {
    --fs-display: clamp(2.3rem, 1.5rem + 5.2vw, 3rem);
    --section-y: 3.25rem;
  }
  .btn { width: 100%; padding-inline: 1.25rem; }
  .opening__actions, .closing__actions { flex-direction: column; align-items: stretch; }
  .opening__actions .btn, .closing__actions .btn { width: 100%; }
  /* Plate caps are deliberately kept on handsets: these source
     photographs are small, and letting a plate fill the screen
     would scale them past what their resolution can carry. */
  .plate__cap { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .strands__item { grid-template-columns: minmax(0, 1fr); }
  .strands__item::before { grid-row: auto; grid-column: 1; padding-top: 0; margin-bottom: .3rem; }
  .strands__title, .strands__text { grid-column: 1; }
  .social__link { width: 46px; height: 46px; }
  .dropcap::first-letter { font-size: 3em; }
  .card-contact { padding: 1.4rem 1.25rem; }
  .note { padding: 1.15rem 1.25rem; }
}

/* ---------- ≤ 400px : compact handset ----------------------- */
@media (max-width: 400px) {
  :root { --gutter: 1.1rem; }
  .wordmark__name { font-size: 1.02rem; }
  .wordmark__sub { font-size: .56rem; letter-spacing: .22em; }
  .nav-toggle { padding: .5rem .6rem .5rem .7rem; font-size: .64rem; letter-spacing: .12em; }
  .contact-lines__val a { font-size: 1rem; }
}

/* ---------- Landscape handsets ------------------------------ */
@media (max-height: 460px) and (max-width: 900px) {
  .nav { justify-content: flex-start; padding-top: 4.75rem; }
  .nav__link { padding-block: .7rem; font-size: 1.08rem; }
}

/* ---------- Fine pointer only: hover polish ------------------ */
@media (hover: none) {
  .link:hover::after { transform: none; }
  a.register__item:hover { background: transparent; }
}

/* ---------- Print -------------------------------------------- */
@media print {
  .masthead, .nav-scrim, .skip-link, .closing__actions, .social { display: none !important; }
  body { background: #fff; color: #000; }
  .section--forest, .closing, .site-footer { background: #fff !important; color: #000 !important; }
  .plate__mount { box-shadow: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
