/* ===========================================================================
   portfolio.css — Robert Roberts, LLC · /portfolio/
   Option B (one URL + popup) with the P2 "immersive" popup. Both approved by the
   operator 2026-08-26; see 05-review/operator-feedback-log.md rows 7 and 8.

   SOURCE OF TRUTH: 00-admin/portfolio/portfolio.css → copied to
   04-site/src/css/portfolio.css by build-portfolio.py. Edit here, not there.

   ⚠ EVERY class is namespaced `ymp-`. This file ships on a page that also loads
   the captured Elementor stylesheets, where bare `.grid` / `.card` / `.stage` /
   `.bar` are all live selectors. The review harness could use short names because
   it was a standalone page; this cannot.

   Colours are the extracted plan-of-record (01-input/audit/tokens.extracted.md),
   written literally rather than via `--e-global-color-*` so the block renders
   correctly even if it is ever lifted onto a page without the Elementor kit.
   =========================================================================== */

.ymp{
  --ymp-brand:#6DC3E1;
  --ymp-deep:#15789B;   /* AA: #1684AA was 4.27:1 as text on white; this is 5.01:1, same hue */
  --ymp-slate:#4A5866;
  --ymp-wash:#E8EFF2;
  --ymp-line:#DCE5EA;
  --ymp-ink:#000;
  --ymp-body:#434343;
  --ymp-font:"Raleway",system-ui,-apple-system,"Segoe UI",sans-serif;
  /* the popup's top bar height, measured at runtime by portfolio.js */
  --ymp-barh:64px;
}

/* ---------- production page shell ---------------------------------------
   This site has NO boxed sections — every section is full_width with fluid
   percentage gutters. The dominant content band (and the original portfolio
   sections themselves) is 2% section padding + 2% column padding: 3.92% of
   the viewport per side at desktop, 5%+2%-of-column ≈ 6.8% at ≤1024, ~5%
   at mobile (measured 2026-09-16, probes/rr-gutter-pad.mjs). The shell
   mirrors that so the block sits on the same gutter as every other section.
   The cards are ANCHORS (href="#slug" — the hash IS the
   open-project state), so neutralize the captured theme's link styling. */
.ymp-shell{margin:0 auto;padding:44px 3.92% 70px}
@media (max-width:1024px){.ymp-shell{padding-left:6.8%;padding-right:6.8%}}
@media (max-width:767px){.ymp-shell{padding-left:5%;padding-right:5%}}
.ymp-shell>h2{font-family:var(--ymp-font);font-size:36px;line-height:1.2;margin:0 0 6px;
  color:var(--ymp-ink);font-weight:700}
.ymp-lede{font-family:var(--ymp-font);font-size:17px;color:var(--ymp-body);
  margin:0 0 26px;max-width:70ch}
a.ymp-card,a.ymp-card:hover,a.ymp-card:focus{text-decoration:none;color:var(--ymp-body)}

/* ---------- filters ------------------------------------------------------ */
.ymp-filters{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin:0 0 18px}
.ymp .ymp-chip{font:inherit;font-family:var(--ymp-font);font-size:14px;font-weight:700;
  cursor:pointer;padding:9px 16px;border-radius:999px;border:1px solid var(--ymp-line);
  background:#fff;color:var(--ymp-body);display:inline-flex;align-items:center;gap:7px}
.ymp-chip .ymp-n{font-size:12px;color:var(--ymp-slate);font-weight:700}
.ymp-chip[aria-pressed="true"]{background:var(--ymp-brand);border-color:var(--ymp-brand);
  color:#000}
/* black on #6DC3E1 = 10.54:1. White would be 1.99:1 — the failure fixed fleet-wide
   in build-styleguide.py on 2026-08-26. Do not "brighten" this to white. */
.ymp-chip[aria-pressed="true"] .ymp-n{color:#000}
.ymp-chip:focus-visible,.ymp-search input:focus-visible{outline:3px solid var(--ymp-deep);
  outline-offset:2px}
.ymp-search{margin-left:auto}
.ymp .ymp-search input{font:inherit;font-family:var(--ymp-font);font-size:15px;padding:9px 14px;
  border:1px solid var(--ymp-line);border-radius:999px;min-width:230px;color:var(--ymp-body)}
.ymp-count{font-size:14px;color:var(--ymp-slate);margin:0 0 18px;font-family:var(--ymp-font)}
.ymp-empty{padding:34px 0;color:var(--ymp-slate);font-family:var(--ymp-font)}

/* ---------- grid --------------------------------------------------------- */
/* Capped at FOUR columns (operator, 2026-09-16 — five-up made every title
   wrap): each track's minimum is a quarter row (25% minus its share of the
   3 gaps), so auto-fill can never seat a fifth; below ~1180px of container
   the 280px floor takes over and the 3/2/1-column behaviour is unchanged. */
.ymp-grid{display:grid;gap:20px;
  grid-template-columns:repeat(auto-fill,minmax(max(280px,calc(25% - 15px)),1fr));
  margin:0;padding:0;list-style:none}
.ymp-item{scroll-margin-top:120px} /* cards carry id="<slug>" (anchor targets); clear the fixed header */
.ymp-item[hidden]{display:none}
.ymp-card{width:100%;border:1px solid var(--ymp-line);background:#fff;text-align:left;
  padding:0;font:inherit;font-family:var(--ymp-font);color:var(--ymp-body);cursor:pointer;
  display:flex;flex-direction:column;transition:box-shadow .18s ease,border-color .18s ease}
.ymp-card:hover,.ymp-card:focus-visible{border-color:var(--ymp-brand);
  box-shadow:0 8px 24px rgba(0,0,0,.10)}
.ymp-card:focus-visible{outline:3px solid var(--ymp-deep);outline-offset:2px}
/* aspect-ratio reserves the box before the image decodes, so 49 lazy photos
   arriving cannot shift the grid (CLS). */
.ymp-shot{position:relative;aspect-ratio:4/3;overflow:hidden;background:var(--ymp-wash);
  display:block}
.ymp-shot img{width:100%;height:100%;object-fit:cover;display:block}
/* K2 "fact tags" card (operator pick 2026-09-16, /_card-options/): the badges
   left the photo — category, photo count and extracted facts live in the box. */
/* Uniform boxes (operator, Gate #2 2026-09-16): the photo is a fixed 4/3 and
   every text zone below it is a fixed-height box — a 1-line title and a short
   write-up get the same card as a 2-line title and a long one, so every card
   in the grid is the same size. flex:1 + margin-top:auto pin the link to the
   bottom edge regardless of content. */
.ymp-cb{padding:15px 17px 18px;display:flex;flex-direction:column;gap:7px;flex:1}
.ymp-cb h3{font-family:var(--ymp-font);font-size:19px;line-height:1.25;margin:0;
  color:var(--ymp-ink);font-weight:700;display:-webkit-box;-webkit-line-clamp:2;
  -webkit-box-orient:vertical;overflow:hidden;min-height:2.5em}
/* Uniform boxes: the tag zone is sized for TWO rows at every breakpoint (the
   worst real card is category + count + sq ft + value); the probe asserts all
   49 cards measure identical, so if a future tag combination ever needs a
   third row it will FAIL the uniformity check loudly, not squeeze silently. */
/* TWO-row reserve: the fact-heavy cards (count + sq ft + value) wrap at some
   column widths (measured wrapping at 1440 and 768), and uniformity must hold
   for every card at every width — so all cards reserve the worst case. The
   probe asserts all 49 identical; a third row would fail loudly. */
.ymp-tags{display:flex;gap:7px;flex-wrap:wrap;align-content:flex-start;min-height:53px}
/* line-height is PINNED: the captured kit's inherited line-height renders a
   chip 34px tall, which broke the two-row math (1-row zones vs 2-row zones
   measured 20px apart). 12.5px x 1.2 + 8px padding = 23px; 2 rows + 7 gap = 53. */
.ymp .ymp-t{font-size:12.5px;line-height:1.2;font-weight:700;padding:4px 10px;
  border-radius:3px;background:var(--ymp-wash);color:var(--ymp-slate)}
/* Category chips are color-coded so the two kinds read at a glance (operator,
   2026-09-16): New Construction = brand teal under BLACK (10.54:1 — never
   white, see the chip note above), Commercial Renovations = slate under white
   (7.3:1). A future third category falls back to the wash chip until it gets
   a color here. */
.ymp .ymp-t-new-construction{background:var(--ymp-brand);color:#000}
.ymp .ymp-t-commercial-renovations{background:var(--ymp-slate);color:#fff}
/* The write-up stays in the markup (the page's indexable content — Option B
   gives projects no URL of their own); K2 just doesn't SHOW it on the card.
   Belt-and-braces display:none: a styled `.ymp-cb p` rule once out-specified
   the [hidden] attribute here. */
.ymp-cb p.ymp-desc[hidden]{display:none}
/* footer row pinned to the bottom edge: category pill by the link (operator,
   2026-09-16 — the pill lives HERE, not in the lightbox bar). NO reserved
   min-height (operator: "remove the padding below this element"): uniformity
   is kept by a container query instead — below the width where the longest
   pill ("Commercial Renovations" 169px) + gap + link (114px) fit one line
   (295px content + 34px card padding + slack = 334px card), EVERY card
   stacks pill-over-link; at/above it every card goes single-line. Both
   regimes are uniform and neither carries air. */
.ymp-item{container-type:inline-size}
.ymp-foot{display:flex;flex-direction:column;align-items:flex-start;gap:8px;
  margin-top:auto}
@container (min-width:334px){
  .ymp-foot{flex-direction:row;align-items:center;gap:12px}
}
/* line-height pinned like the chips — inherited it makes the link row 26px
   and the wrapped foot overshoot its reserve (pill 23 + gap 8 + link 17 = 48) */
.ymp-more{font-size:14px;line-height:1.2;font-weight:700;color:var(--ymp-deep)}
/* the trailing arrow is part of the judged K2 treatment — CSS-generated so it
   never becomes searchable text or part of the accessible name */
.ymp-more::after{content:" \2192"}

/* =========================================================================
   POPUP — P2 "immersive", approved 2026-08-26
   ========================================================================= */
.ymp-pop{position:fixed;inset:0;z-index:9000;display:none}
.ymp-pop[open]{display:block}
.ymp-scrim{position:absolute;inset:0;background:rgba(0,0,0,.92)}
.ymp-panel{position:absolute;inset:0;display:flex;flex-direction:column;
  min-width:0;min-height:0;font-family:var(--ymp-font)}

.ymp .ymp-x{position:absolute;top:12px;right:12px;z-index:6;width:44px;height:44px;
  border-radius:50%;cursor:pointer;font-size:26px;line-height:1;
  background:rgba(255,255,255,.16);color:#fff;border:1px solid rgba(255,255,255,.4)}
.ymp-x:focus-visible{outline:3px solid var(--ymp-brand);outline-offset:2px}

/* Title | Button, centred over the photo (category dropped from the bar
   2026-09-16 — the K2 card chip already carries it). Padding is SYMMETRIC so
   the centred group is actually centred — the close button floats at right:12px,
   and padding only on the right shifts the group visibly left of true centre. */
.ymp-bar{flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:14px;
  padding:18px 72px 14px;color:#fff;flex-wrap:wrap}
.ymp-bar h2{color:#fff;font-size:22px;line-height:1.25;margin:0;font-weight:700}
/* Real elements, not a border-left on each child: the button has its own fill and
   a border on it would read as part of the button. */
.ymp-bardiv{flex:0 0 auto;width:1px;height:20px;background:rgba(255,255,255,.38)}
/* Both CTAs (bar toggle + sheet quote) wear the SITE's own button spec —
   measured 2026-09-16 from the untouched hero button, and unanimous across
   all 23 captured button rules: 60px pill, brand fill under BLACK, 18px/600
   Raleway uppercase +0.3px, 15px 25px, hover -> slate under white (the kit's
   own hover pair). This SUPERSEDES the row-8 "square" adjustment — operator:
   "make sure the styling matches existing content on the site". Still one
   button shape on the component; the shape is now the site's. */
/* line-height:1 matches the hero button's 48px box exactly (15+18+15) — the
   kit's inherited line-height inflated the pill vertically, the third strike
   for that trap on this component (chips, card link, now this). */
.ymp .ymp-tog{flex:0 0 auto;font:inherit;font-family:var(--ymp-font);font-size:18px;
  line-height:1;font-weight:600;letter-spacing:.3px;text-transform:uppercase;cursor:pointer;
  background:var(--ymp-brand);color:#000;border:0;padding:15px 25px;border-radius:60px}
.ymp-tog:hover,.ymp-tog:focus{background:var(--ymp-slate);color:#fff}
.ymp-tog:focus-visible{outline:3px solid #fff;outline-offset:2px}

.ymp-stage{position:relative;flex:1;min-height:0;display:flex;align-items:center;
  justify-content:center;overflow:hidden}
.ymp-stage img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.ymp .ymp-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:4;
  width:46px;height:46px;border-radius:50%;border:0;cursor:pointer;font-size:28px;
  line-height:1;background:rgba(255,255,255,.9);color:#000}
.ymp-arrow.ymp-prev{left:14px}
.ymp-arrow.ymp-next{right:14px}
.ymp-arrow:focus-visible{outline:3px solid var(--ymp-brand);outline-offset:2px}
.ymp-counter{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);z-index:4;
  background:rgba(0,0,0,.66);color:#fff;font-size:14px;font-weight:700;padding:4px 12px;
  border-radius:999px}

/* rail must survive the 24-photo project */
.ymp-rail{display:flex;gap:8px;overflow-x:auto;padding:10px;flex:0 0 auto;
  justify-content:safe center;scrollbar-width:thin}
.ymp .ymp-rail button{flex:0 0 auto;width:76px;height:57px;padding:0;border:2px solid transparent;
  background:none;cursor:pointer;border-radius:3px;overflow:hidden}
.ymp-rail img{width:100%;height:100%;object-fit:cover;display:block}
.ymp-rail button[aria-current="true"]{border-color:var(--ymp-brand)}
.ymp-rail button:focus-visible{outline:3px solid var(--ymp-brand);outline-offset:1px}

/* the write-up slides up over the photo; photos lead, words are one tap away */
.ymp-sheet{position:absolute;left:0;right:0;bottom:0;z-index:5;background:#fff;
  max-height:74%;overflow-y:auto;padding:26px 28px 30px;color:var(--ymp-body);
  transform:translateY(100%);transition:transform .28s ease;
  box-shadow:0 -8px 30px rgba(0,0,0,.4)}
.ymp-pop[data-sheet="open"] .ymp-sheet{transform:translateY(0)}
.ymp-sheet h3{font-family:var(--ymp-font);font-size:26px;margin:0 0 .35em;
  color:var(--ymp-ink);font-weight:700}
.ymp-sheet p{margin:0 0 16px;font-size:17px;line-height:1.65}
.ymp-sheetcat{font-size:14px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--ymp-deep);margin:0 0 6px;font-weight:700}
.ymp-logo{max-height:46px;width:auto;margin:0 0 14px;object-fit:contain;display:block}
/* Details: write-up and testimonial side by side (operator 2026-09-22, option C
   judged at /_sheet-options/). The even split is MEASURED — at 1.5fr/1fr the
   quote is squeezed to ~406px, wraps into far more lines, and the sheet ends up
   taller than the old stacked layout. */
.ymp-sheet-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:30px;align-items:stretch}
/* 28 of 52 projects have no testimonial — one full-width column is the COMMON
   case here, not a fallback */
.ymp-sheet-cols.ymp-noquote{grid-template-columns:1fr}
.ymp-col{min-width:0}
/* the sticky box is this INNER div, never the grid item: a grid item stretches
   to the row height, so a sticky item has zero travel and silently never
   engages. portfolio.js sets `top` per project. */
.ymp-colin{min-width:0}
.ymp-colin.ymp-stuck{position:sticky}
.ymp-sheet-cols .ymp-col > .ymp-colin > *:last-child{margin-bottom:0}

.ymp-quote{margin:0;padding:14px 16px;background:var(--ymp-wash);
  border-left:3px solid var(--ymp-brand);font-size:15px;font-style:italic;
  color:var(--ymp-ink)}
/* Testimonials publish IN FULL — operator, 2026-09-22. They run to 314 words,
   so the quote is often the taller of the two columns; that is expected and is
   why the pin picks the shorter column rather than always the quote. */
.ymp-quote cite{display:block;margin-top:7px;font-style:normal;font-weight:700;
  font-size:14px;color:var(--ymp-slate)}
.ymp-sheet-cols + .ymp-cta{margin-top:20px}
.ymp .ymp-cta{display:inline-block;background:var(--ymp-brand);color:#000;font-weight:600;
  font-size:18px;line-height:1;letter-spacing:.3px;text-transform:uppercase;
  text-decoration:none;padding:15px 25px;border-radius:60px}
.ymp-cta:hover,.ymp-cta:focus{background:var(--ymp-slate);color:#fff}
.ymp-cta:focus-visible{outline:3px solid var(--ymp-deep);outline-offset:2px}

@media (max-width:820px){
  .ymp-bardiv{display:none}
  .ymp-bar{padding:16px 62px 12px 18px;gap:8px}
  .ymp-sheet{max-height:82%;padding:22px 20px 26px}
  /* one column on phones: nothing to sit beside, and nothing to pin */
  .ymp-sheet-cols{grid-template-columns:1fr;gap:18px}
  .ymp-colin.ymp-stuck{position:static}
  .ymp-search{margin-left:0;width:100%}
  .ymp .ymp-search input{min-width:0;width:100%}
}

/* Respect a user's reduced-motion preference — the sheet still opens, it just
   does not animate. */
@media (prefers-reduced-motion:reduce){
  .ymp-sheet{transition:none}
  .ymp-card{transition:none}
}

/* No JS: the popup can never open, so the cards must not pretend to be buttons.
   portfolio.js removes this class as its first act. */
.ymp-nojs .ymp-card{cursor:default}
.ymp-nojs .ymp-more,.ymp-nojs .ymp-filters{display:none}
.ymp-nojs .ymp-cb p{-webkit-line-clamp:unset;display:block;overflow:visible}
