/* ───────────── every form factor: phones from 320 px, foldables (cover, open, book posture), tablets, desktops ─────────────
   rules_design_review, 28-Oct-2026. The viewport meta carries viewport-fit=cover; see directory-blueprint/design/FOLD-LAYER.md. */

/* nothing wider than the screen: the "checked" stamp stays inside between 921 and 1279 px (it widened the home 10 px on a Fold main
   screen and an iPad held sideways, and on 932–1180 px laptops); a long name breaks inside its heading */
@media (max-width: 1279px) { .st-stamp { right: -6px; } }
.hx { overflow-x: clip; }
h1, h2, h3 { overflow-wrap: anywhere; }

/* the masthead never sticks (the owner's standing rule: no sticky header on any site); the filter bar gives way on short screens */
.mast { position: relative; }
@media (max-height: 520px) { .sift { position: static; } }

/* safe areas: notches, rounded corners and the home bar */
.page { width: min(var(--max), 100% - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right))); }
.foot { padding-bottom: max(42px, env(safe-area-inset-bottom)); }

/* touch: every target at least 44 px (links inside sentences excepted) */
@media (pointer: coarse) {
  .lookup input, .lookup button { height: 44px; }
  .shade { width: 44px; height: 44px; }
  .name { min-height: 44px; }
  .links a, .list-yours { display: inline-flex; align-items: center; min-height: 44px; }
  .act, .btn-ink, .btn-line, .sift button { min-height: 44px; }
  .foot ul { gap: 0; }
  .foot ul a, .foot .legal a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .foot .legal { gap: 0 18px; }
  .sec-h > a, .st-foot a { display: inline-block; padding-block: 13px; margin-block: -13px; }
  a.fig { padding: 9px; margin: -9px; }
}

/* book posture (a foldable half-open like a book): nothing across the fold */
@media (horizontal-viewport-segments: 2) {
  :root { --seg0: env(viewport-segment-width 0 0, 50vw); --fold-gap: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px) + 32px); --fold-page: calc(var(--seg0) - 32px); }
  .page { width: calc(100% - 32px); }
  .hx .page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--fold-gap); }
  .foot .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--fold-gap); }
}

/* ── v2 (28-Oct-2026 evening; helper 34 for lead 68): what the full 45-viewport run left — small touch targets, and text across the
   fold in book posture (bin/hinge.mjs --leaf at 954×859 and 626×890). Ad slots, the sidebar column and the sponsor box (.tl-sponsor)
   are left exactly as they are; so are the estate's search (.ymhs*) and newsletter (.ymel*). ── */
@media (pointer: coarse) {
  .top-card header a { display: inline-block; min-width: 44px; padding-block: 13px; margin-block: -13px; }
  .st-foot a { padding-block: 14px; margin-block: -14px; }        /* v1's 13 px left 43 px */
  a.tl-skip, .tl-menu li > a, .comment-form .form-submit .submit { min-height: 44px; }
  .tl-menu li > a { display: inline-flex; align-items: center; }
  .tl-pages .page-numbers { min-width: 44px; }
  .tl-path a, .footer-link-wrapper a, .footer-text a, main > .page > p.path > a { display: inline-block; min-width: 44px; padding-block: 13px; margin-block: -13px; }
  .wp-block-categories-list li > a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .ym-policy-links a { display: inline-block; min-width: 44px; padding-block: 14px; margin-block: -14px; }
}
@media (horizontal-viewport-segments: 2) {
  /* grids and lists: one column on each page */
  .page > section.sec > ul.accounts, main > .page > ul.accounts, .page > section.part > ul.cards, .tl-column > ul.tl-grid, main > .page > ol.ledger
    { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--fold-gap); }
  /* two-part blocks: the words on the left page, the list / summary on the right */
  .page > section.sec > .rates, main > section.lx > .page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--fold-gap); }
  /* single text blocks, forms and openings: the left page */
  .page > section.sec > .sec-h, main > .page > section.opening, main > .page > p.path, main > .page > section.part > :is(p, h2), main > .page > nav.pager,
    .tl-main .page > header.tl-head, .tl-body > .tl-column, .tl-rail :is(.ym-latest-posts-widget, .widget_block), .foot .page > p.small-print
    { max-width: var(--fold-page); margin-left: 0; margin-right: auto; }
  footer.foot > p.ym-policy-links { max-width: var(--fold-page); margin-left: max(16px, env(safe-area-inset-left)); margin-right: auto; }
  /* the masthead: its search takes a row of its own on the RIGHT page (its outer box = the full row, so it always wraps; a capped
     flex-basis alone did not), and "List yours" goes to the right end of the first row */
  .mast > .page { flex-wrap: wrap; }
  .mast > .page > form.lookup { order: 9; flex: 0 0 calc(var(--fold-page) - 20px); max-width: none; margin-left: calc(100% - var(--fold-page) + 20px); }   /* 20 px: the WordPress mast pulls its input 16 px left */
  /* a list's filter bar wraps on the left page */
  main > .page > #tfb-sift { max-width: var(--fold-page); margin-left: 0; margin-right: auto; flex-wrap: wrap; }
  .mast > .page > a.list-yours { margin-left: auto; }
  /* the home's and a topic's top cards: one card on each page */
  .page .tops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--fold-gap); }
  /* a list's reading section, the plans page's fine print, the footer's legal links: the left page */
  main > .page > section.part.read, main > .page > p, .foot .page > nav.legal { max-width: var(--fold-page); margin-left: 0; margin-right: auto; }
  /* the estate's network box carries its size and centring in a style attribute */
  aside.ym-net { max-width: var(--fold-page) !important; margin-left: max(16px, env(safe-area-inset-left)) !important; margin-right: auto !important; }
}

/* ── v3 (28-Oct-2026 night; helper 34 for lead 68): the finer book-posture check found an author page's crumb trail across the fold
   (192→332 at 626); it keeps to the left half now. ── */
@media (horizontal-viewport-segments: 2) {
  main#main nav.tl-path { max-width: var(--fold-page); }
}
