/* ==========================================================================
   tuckory-responsive.css  v1  2026-11-27
   Resolution-independent layout for tuckory.com.
   Full standard: ../RESPONSIVE-STANDARD.md

   HOW THE RE-AUDIT LANE APPLIES THIS FILE, PAGE BY PAGE
   1. Delete the page's old first-screen sizing rules (the removal list is
      in RESPONSIVE-STANDARD.md, section 4). This file replaces them; it
      does not layer on top of them.
   2. Link this file LAST among the page's stylesheets, after
      studio-edition.css and after any page inline <style> that sets hero
      sizing. Load order is what makes these rules win at equal
      specificity; the few !important flags below exist only to beat the
      old !important full-screen holds until those rules are deleted.
   3. Give the hero section the class "tk-hero-fluid" in addition to its
      existing classes, and wrap the hero picture in an element with the
      class "tk-hero-media" if it is not already inside a figure.
   4. Run both fold gates: gates.py fold, then gates.py fold-sweep.
      Both must PASS before the page counts as fixed.

   THE ONE IDEA IN THIS FILE
   A first screen must fit at EVERY height, not at a list of heights.
   So the hero never gets a fixed height and never gets sized from a
   height band. The hero is a flex column whose minimum size is the
   small viewport (100svh, the screen with the phone's browser bars
   showing, so it can never overflow on load). The copy blocks take
   their natural size. The picture block is the only flexible member:
   it grows on tall phones and shrinks on short ones, down to a floor,
   and the picture fills it with object-fit. Dead space cannot appear,
   because the flexible member absorbs it. A sliced hero cannot
   appear, because nothing in the stack has a fixed size to slice.
   ========================================================================== */

/* ---- 1. Tokens: one definition of "the screen", used everywhere ---- */
:root{
  /* svh = small viewport height: the visible screen with mobile
     browser chrome shown. vh is declared first as the fallback for
     browsers older than 2022; every current browser uses svh. */
  --tk-screen:100vh;
  --tk-screen:100svh;
  /* dvh tracks the chrome as it slides; for overlays only (rule 6),
     never for page heroes, where resizing on scroll causes jumping. */
  --tk-screen-live:100vh;
  --tk-screen-live:100dvh;
  --tk-header:62px;              /* measured site chrome above the hero */
  --tk-gap:clamp(10px, 2.2svh, 22px);
  --tk-pad-block:clamp(12px, 3svh, 34px);
  --tk-pad-inline:max(16px, env(safe-area-inset-left));
}

/* ---- 2. The fluid hero (replaces every calc(100vh - Npx) hold) ---- */
.tk-hero-fluid,
.studio-edition .tk-hero-fluid[data-studio-opening]{
  display:flex;
  flex-direction:column;
  gap:var(--tk-gap);
  /* Content-sized, with a full-screen MINIMUM in svh. The old rules
     used 100vh, which on a phone means the large viewport (bars
     hidden) and overflows the visible screen on load. */
  min-block-size:calc(var(--tk-screen) - var(--tk-header)) !important;
  padding-block:var(--tk-pad-block);
  padding-inline:var(--tk-pad-inline);
}
/* The flexible member: hero picture absorbs all leftover height. */
.tk-hero-fluid .tk-hero-media{
  flex:1 1 auto;
  min-block-size:clamp(118px, 26svh, 460px);
  display:flex;
}
.tk-hero-fluid .tk-hero-media img,
.tk-hero-fluid figure img{
  width:100%;
  height:100%;
  max-height:none !important;   /* old per-band max-height caps deleted */
  object-fit:cover;             /* pages whose art must show whole use
                                   object-fit:contain on the same rule */
  display:block;
}
/* Copy blocks never flex and never carry fixed heights. */
.tk-hero-fluid > *:not(.tk-hero-media){ flex:0 0 auto; }
/* Short screens: below the media floor the hero simply grows taller
   than the screen and the page scrolls. That is the graceful state;
   nothing is sliced and nothing is hidden. No height bands anywhere. */

/* Pickles and other non-studio heroes: same construction. */
.hero.tk-hero-fluid{ min-block-size:calc(var(--tk-screen) - var(--tk-header)) !important; }
.hero.tk-hero-fluid .hero-art{ flex:1 1 auto; min-block-size:clamp(118px, 26svh, 460px); display:flex; }
.hero.tk-hero-fluid .hero-art img{ height:100% !important; width:100%; object-fit:cover; }

/* ---- 3. Fluid type and spacing (continuous, no breakpoint jumps) -- */
.studio-edition .co-hero h1,
.tk-hero-fluid h1{ font-size:clamp(2rem, 1.15rem + 4.6vw, 4.75rem); line-height:1.02; }
.tk-hero-fluid .co-lead,
.tk-hero-fluid .lede{ font-size:clamp(.95rem, .88rem + .5vw, 1.25rem); line-height:1.5; max-width:55ch; }

/* ---- 4. Proof strips, stats, chips: wrap, never squeeze or slice - */
.co-proof-strip,
.tk-hero-fluid .co-proof-strip{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr));
  gap:8px 14px;
}
.shop-chips, .chips, .tk-filters{
  display:flex; flex-wrap:wrap; gap:8px; max-width:100%;
}
.shop-chips > *, .chips > *, .tk-filters > *{ flex:0 1 auto; min-width:0; }

/* ---- 5. Card sections: intrinsic grid plus container queries ----- */
/* min(...) guard: a track can never be wider than its container, so
   the grid cannot overflow on a narrow phone the way a bare
   minmax(210px, 1fr) can on a sub-210px slot. */
.tk-grid, .card-grid, .rank-grid, .poster-row{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(min(210px, 100%), 1fr));
  gap:clamp(12px, 2.5vw, 20px);
}
/* Cards respond to the space they are IN, not to the viewport.
   A card in a narrow rail stacks; the same card in a wide grid does
   not. This is what container queries are for. */
.tk-card, .card{ container-type:inline-size; }
@container (max-width: 17rem){
  .tk-card-body, .card .body{ padding:10px; }
  .tk-card h3, .card h3{ font-size:1rem; }
}
/* Card pictures: the box owns the shape, the picture fills the box,
   at every width. No natural-height rendering inside a card, ever. */
.tk-card figure, .gallery figure{ aspect-ratio:3 / 4; overflow:hidden; }
.tk-card figure img, .gallery figure img{
  width:100%; height:100%; object-fit:cover; display:block;
}
/* Card bodies pin their actions to the bottom, so a row of cards has
   no dead space under the shortest card's content. */
.tk-card{ display:flex; flex-direction:column; }
.tk-card .dl, .tk-card .actions{ margin-top:auto; }

/* ---- 6. Overlays and viewers: dynamic units, because they must
          track the visible screen while the chrome moves --------- */
.co-lightbox-figure{ max-height:92dvh; }
#viewerImg{ max-height:70dvh; }

/* ---- 7. Media: flexible by default -------------------------------- */
img, video{ max-width:100%; }
img[width][height]{ height:auto; }  /* keep aspect from attributes */

/* ---- 8. Horizontal overflow: structurally impossible ------------- */
html, body{ overflow-x:clip; }
.co-wrap, .shell, .inner{ max-width:min(76rem, 100%); margin-inline:auto; }

/* ---- 9. Studio co-hero adaptation (re-audit lane addendum, 2026-11-27)
   Studio heroes nest the picture two levels down:
   section.co-hero > .co-hero-inner > .tuck-page-hero > figure.
   The flex chain is extended through the wrappers so the picture
   block still absorbs the leftover height. Studio hero art shows
   whole (object-fit:contain): these are paintings and room scenes
   that are never cropped. Everything above this section is the
   research lane's file verbatim.
   Two measured corrections to the file's tokens: the studio header
   (topline plus brand bar) measures 114px tall on desktop widths and
   91px at phone widths, not 62px; and the hero takes a definite
   block-size, because a minimum alone never compresses the picture
   on short screens (the section just grows and the proof strip
   slides under the fold). At phone widths, non-opening studio
   sections size to their content: a phone screen is not a panel
   canvas, and holding content sections to a full screen strands
   dead space inside them. ---- */
.studio-edition .tk-hero-fluid[data-studio-opening]{
  --tk-header:114px;
  block-size:calc(var(--tk-screen) - var(--tk-header));
}
@media(max-width:900px){
  .studio-edition .tk-hero-fluid[data-studio-opening]{ --tk-header:91px; }
}
@media(max-width:740px){
  .studio-edition [data-studio-screen]:not([data-studio-opening]){ min-block-size:0; }
}
.studio-edition .tk-hero-fluid .co-hero-inner{
  flex:1 1 auto; display:flex; flex-direction:column; width:100%; min-height:0;
}
.studio-edition .tk-hero-fluid .tuck-page-hero{ flex:1 1 auto; align-items:stretch; min-height:0; }
@media(min-width:741px){
  .studio-edition .tk-hero-fluid .tuck-page-hero{ grid-template-rows:minmax(0,1fr); }
  .studio-edition .tk-hero-fluid .tuck-page-copy{ align-self:center; }
}
@media(max-width:740px){
  .studio-edition .tk-hero-fluid .tuck-page-hero{ grid-template-rows:auto minmax(0,1fr); }
}
.studio-edition .tk-hero-fluid figure.pp-hero-side,
.studio-edition .tk-hero-fluid figure.tuck-page-figure{
  display:flex; flex-direction:column; min-block-size:0;
}
.studio-edition .tk-hero-fluid figure.pp-hero-side picture,
.studio-edition .tk-hero-fluid figure.tuck-page-figure picture{
  flex:1 1 auto; display:flex; min-block-size:0;
}
.studio-edition .tk-hero-fluid figure > img{ flex:1 1 auto; min-height:0; }
.studio-edition .tk-hero-fluid figure picture{ position:relative; }
.studio-edition .tk-hero-fluid figure picture > img{
  position:absolute; inset:0; width:100%; height:100%; min-height:0;
}
.studio-edition .tk-hero-fluid figure img{ object-fit:contain; }
