/* 30 Story Coffee case study (staging page 2298): page-level rules only, from the approved page design
   "30 Story Coffee — Case Study" 1794363494-3979 (its sc.css) and the media manifest. Everything else is the design
   system (system.css) and the theme's WordPress glue (site.css, inc/case-study.php, inc/30-story-coffee.php).
   Nothing here restyles a shared component. Rules are the design's, with selectors mapped onto the published
   markup; inline span, ratio and focus properties from the design source are set here. */

/* Viewer: the logo-explorations SVG is black artwork on a transparent background, so in the viewer it sits on the
   same surface ground as on the page instead of the viewer's dark backdrop. */
.pswp__img[src$=".svg"]:not(.pswp__img--placeholder) { background-color: var(--pf-color-surface); }
.sc-swatch-name, .sc-typeset figcaption, .sc-level-name, .sc-labels figcaption, .sc-labels .sc-label-name, .sc-pair figcaption, .sc-level-envname { overflow-wrap: break-word; min-width: 0; }
.sc-outbound { display: inline-flex; align-items: center; min-height: 24px; }

/* Opening image (CaseHero): the frame's focal point. */
.sc-opener .pf-opener-frame { --pf-focus: 44% 52%; }

/* 1 · Evolution: Timeline in columns 1–4, the before/after pair in 5–12. Approved page exception: Timeline
   entry text at the lead size and weight. */
.sc-evo { row-gap: var(--pf-space-moderate); }
.sc-timeline { --pf-s12: 1 / span 4; }
.sc-pair { --pf-s12: 5 / -1; }
.sc-pair .pf-gallery-item { --pf-s4: span 2; --pf-s8: span 4; --pf-s12: span 4; }
.sc-pair .pf-frame { --pf-ratio: 4 / 5; }
.sc-before img { --pf-focus: 50% 50%; }
.sc-after img { --pf-focus: 50% 58%; }
.sc-timeline .pf-timeline-item > * { --pf-s12: 1 / -1; }
.sc-timeline .pf-timeline-when { padding-top: 0; }
.sc-tl-text { margin: 0; font-family: var(--font-sans); font-size: var(--pf-fs-lead); line-height: 1.45; font-weight: 300; letter-spacing: -0.005em; color: var(--pf-color-ink); text-wrap: pretty; }
@container pf-section (min-width: 600px) and (width < 1024px) { .sc-timeline .pf-timeline-when { padding-top: 0.3em; } }

/* 2 · Identity: one composite row (mark set beside type set), then the colour roles. */
.sc-identity { row-gap: var(--pf-space-group); }
.sc-idrow { row-gap: var(--pf-space-group); align-items: stretch; }
.sc-markset { --pf-s12: 1 / span 6; margin: 0; }
.sc-typeset { --pf-s12: 7 / -1; }
/* Mark set: logo explorations above the formula (small, first), then the full vertical logo (large). */
.sc-markset .pf-gallery-stack { --pf-s12: span 2; }
.sc-logo-frame { --pf-ratio: 4 / 3; --pf-s12: span 4; display: flex; align-items: center; justify-content: center; padding: var(--pf-frame-pad); box-sizing: border-box; }
.sc-logo-frame img { display: block; width: auto; height: 72%; max-width: 100%; object-fit: contain; }
@container pf-section (min-width: 600px) { .sc-logo-frame { --pf-ratio: 16 / 9; } }
@container pf-section (min-width: 1024px) { .sc-logo-frame { --pf-ratio: 8 / 9; } }
@container pf-section (width < 1024px) {
  .sc-markset .pf-gallery-stack { contain: none; grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .sc-markset .pf-gallery-stack > .pf-frame { aspect-ratio: 3 / 2; height: auto; }
}
/* Type set: the two captioned specimens, then the shared annotation, pushed to the bottom of the row so it lines
   up with the logo frame's bottom edge (or 8px under the captions when the type set is the taller column). */
.sc-typeset { grid-template-rows: auto 1fr; row-gap: var(--pf-space-2xs); }
.sc-type-note { align-self: end; }
@container pf-section (width < 1024px) { .sc-typeset { grid-template-rows: auto auto; } }
.sc-type-a, .sc-type-b { --pf-s4: span 2; --pf-s8: span 4; --pf-s12: span 3; }
.sc-type-a > .pf-frame, .sc-type-b > .pf-frame { --pf-ratio: 4 / 5; }

/* 3 · Colour roles — approved page composition from the system's swatch chips. */
.sc-colour { row-gap: var(--pf-space-moderate); }
.sc-colour-row { row-gap: var(--pf-space-s); align-items: start; }
.sc-colour-row > .sc-colour-note { --pf-s8: 1 / span 6; --pf-s12: 1 / span 3; padding-top: var(--pf-space-s); border-top: 1px solid var(--pf-color-line); }
.sc-colour-row > .sc-colour-chips { --pf-s12: 4 / -1; }
@container pf-section (min-width: 1024px) { .sc-colour-row > .sc-colour-chips { padding-top: var(--pf-space-s); } }
.sc-strip { display: flex; }
.sc-strip > .pf-swatch-chip { flex: 1 1 0; border-radius: 0; }
.sc-strip > .pf-swatch-chip + .pf-swatch-chip { border-left: 0; }
.sc-strip > .pf-swatch-chip:first-child { border-top-left-radius: var(--pf-radius-s); border-bottom-left-radius: var(--pf-radius-s); }
.sc-strip > .pf-swatch-chip:last-child { border-top-right-radius: var(--pf-radius-s); border-bottom-right-radius: var(--pf-radius-s); }
.sc-swatch-name { margin: 0; font-size: var(--pf-fs-caption); line-height: 1.45; color: var(--pf-color-ink); }

.sc-foundation { display: flex; flex-wrap: wrap; gap: var(--pf-space-xs) var(--pf-grid-gap); margin: 0; padding: 0; list-style: none; }
.sc-foundation > li { flex: 1 1 auto; }
.sc-foundation > li[data-n="3"] { flex-basis: 150px; flex-grow: 3; }
.sc-foundation > li[data-n="2b"] { flex-basis: 100px; flex-grow: 2; }
.sc-foundation > li[data-n="1"] { flex-basis: 48px; flex-grow: 1; }
.sc-foundation .pf-swatch-chip { height: 40px; }

.sc-families { display: grid; gap: var(--pf-space-s) var(--pf-grid-gap); margin: 0; padding: 0; list-style: none; grid-template-columns: minmax(0, 1fr); }
.sc-family { display: flex; flex-direction: column; gap: var(--pf-space-2xs); margin: 0; }
.sc-family .sc-strip { flex-direction: column; }
.sc-family .sc-strip > .pf-swatch-chip { flex: none; width: auto; }
.sc-family .sc-strip > .pf-swatch-chip + .pf-swatch-chip { border-left: 1px solid var(--pf-color-line-strong); border-top: 0; }
.sc-family .sc-strip > .pf-swatch-chip:first-child { border-radius: var(--pf-radius-s) var(--pf-radius-s) 0 0; }
.sc-family .sc-strip > .pf-swatch-chip:last-child { border-radius: 0 0 var(--pf-radius-s) var(--pf-radius-s); }
.sc-family .sc-main { height: 44px; }
.sc-family .sc-tone { height: 14px; }
@container pf-section (min-width: 600px) { .sc-families--7 { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@container pf-section (width < 600px) {
  .sc-families { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pf-space-xs) var(--pf-grid-gap); }
  .sc-family { gap: 4px; }
  .sc-family .sc-strip { flex-direction: row; }
  .sc-family .sc-strip > .pf-swatch-chip + .pf-swatch-chip { border-top: 1px solid var(--pf-color-line-strong); border-left: 0; }
  .sc-family .sc-strip > .pf-swatch-chip:first-child { border-radius: var(--pf-radius-s) 0 0 var(--pf-radius-s); }
  .sc-family .sc-strip > .pf-swatch-chip:last-child { border-radius: 0 var(--pf-radius-s) var(--pf-radius-s) 0; }
  .sc-family .sc-strip > .sc-main { flex: 2 1 0; width: auto; height: 24px; }
  .sc-family .sc-strip > .sc-tone { flex: 1 1 0; width: auto; height: 24px; }
}

/* 4 · Level section — approved page composition: text column beside the banner at full viewport height on 12
   columns; below that the picture shows the close-up of the banner's Level band. */
.sc-levelsec { row-gap: var(--pf-space-group); align-items: center; }
.sc-levels-text { --pf-s12: 1 / span 7; display: flex; flex-direction: column; gap: var(--pf-space-moderate); }
.sc-banner { --pf-s12: 8 / -1; margin: 0; }
.sc-banner-frame { --pf-ratio: 4 / 5; }
.sc-banner-frame picture { display: block; width: 100%; height: 100%; }
.sc-banner-frame img { object-position: 50% 67%; }
@container pf-section (min-width: 600px) { .sc-banner-frame { --pf-ratio: 1 / 1; } }
@container pf-section (min-width: 1024px) {
  .sc-banner-frame { aspect-ratio: auto; height: 100svh; max-height: 1120px; background-color: transparent; }
  .sc-banner-frame img { object-fit: contain; object-position: 50% 50%; }
}
.sc-remarks { margin: 0; padding: 0; list-style: none; }
.sc-remarks > li { padding-top: var(--pf-space-s); border-top: 1px solid var(--pf-color-line); font-size: var(--pf-fs-lead); line-height: 1.45; font-weight: 300; letter-spacing: -0.005em; color: var(--pf-color-ink); text-wrap: pretty; }
@container pf-section (min-width: 600px) { .sc-remarks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sc-statement { margin-top: calc(var(--pf-space-group) - var(--pf-space-moderate)); padding-top: var(--pf-space-s); border-top: 1px solid var(--pf-color-ink); max-width: 22em; font-weight: 300; }

/* Compact Level specimen. Environment names stay in the eyebrow ink (Level 3's teal fails AA as 12px text).
   Its two layouts switch in rem (37.5rem is 600px at the default text size) and the environment column is 5.5rem
   (88px), so enlarged text keeps the stacked layout until five columns fit, and names never leave their column. */
.sc-levels { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--pf-space-s); margin: 0; padding: 0; list-style: none; }
.sc-level { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); column-gap: var(--pf-space-m); align-items: center; }
.sc-level-env { display: grid; grid-template-areas: "icon" "env" "bar"; justify-items: start; row-gap: 4px; }
.sc-level-icon { grid-area: icon; height: 26px; display: flex; align-items: flex-end; }
.sc-level-icon img { display: block; height: 100%; width: auto; }
.sc-level-envname { grid-area: env; }
.sc-level-bar { grid-area: bar; justify-self: stretch; height: 8px; border-radius: 2px; background: linear-gradient(to bottom, var(--sc-main) 0 5px, var(--sc-tint) 5px 8px); }
.sc-level-name { margin: 0; font-size: var(--pf-fs-body); line-height: 1.3; font-weight: 500; color: var(--pf-color-ink); }
.sc-level-num { font-weight: 600; font-variant-numeric: lining-nums tabular-nums; margin-right: 0.15em; }
@container pf-section (width < 37.5rem) {
  .sc-levels { gap: var(--pf-space-s); }
  .sc-level { grid-template-columns: 5.5rem minmax(0, 1fr); grid-template-areas: "icon ." "env name" "bar bar"; align-items: baseline; row-gap: 4px; }
  .sc-level-env { display: contents; }
  .sc-level-icon { align-self: end; }
  .sc-level-name { grid-area: name; }
  .sc-level-bar { margin-top: 4px; }
}
@container pf-section (width >= 37.5rem) {
  .sc-levels { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--pf-grid-gap); }
  .sc-level { grid-template-columns: minmax(0, 1fr); row-gap: var(--pf-space-xs); align-items: start; }
  .sc-level-env { grid-template-areas: "icon env" "bar bar"; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--pf-space-2xs); row-gap: var(--pf-space-2xs); align-items: end; }
  .sc-level-icon { height: 32px; }
  .sc-level-envname { padding-bottom: 2px; }
}

/* 5 · Packaging: the constraints as the plain bulleted List, with tightened line spacing. */
.sc-constraints { gap: 2px; line-height: 1.45; }

/* Seven-label family — approved page composition: seven across on 12 columns; four columns below, with the
   shared caption in the eighth cell on tablet and full width on phones (names visually hidden there). */
.sc-labels { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pf-space-moderate) var(--pf-grid-gap); align-items: start; }
.sc-labels > .pf-gallery-item { gap: var(--pf-space-2xs); }
.sc-labels img { display: block; width: 100%; height: auto; }
.sc-labels > figcaption { align-self: end; }
.sc-labels > figcaption > p { margin: 0; }
@container pf-section (min-width: 1024px) {
  .sc-labels { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .sc-labels > figcaption { grid-column: 1 / -1; align-self: start; margin-top: calc(var(--pf-space-2xs) - var(--pf-space-moderate)); }
}
@container pf-section (width < 600px) {
  .sc-labels { gap: var(--pf-space-s) 10px; }
  .sc-labels > figcaption { grid-column: 1 / -1; align-self: start; margin-top: calc(var(--pf-space-2xs) - var(--pf-space-s)); }
  .sc-labels .sc-label-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Label detail — approved page exception: a presentation overlay (inc/30-story-coffee.php) dims the label except
   the two areas the notes describe. The crop window (label y 490–1278 of 1501) is set by offsetting the image so the
   overlay's coordinates match the artwork. Two columns from 600px. */
.sc-detail { row-gap: var(--pf-space-moderate); align-items: center; }
.sc-detail > .sc-detail-frame { --pf-s8: 1 / span 4; --pf-s12: 1 / span 6; }
.sc-detail > .sc-detail-notes { --pf-s8: 5 / -1; --pf-s12: 7 / -1; display: flex; flex-direction: column; gap: var(--pf-space-moderate); }
.sc-crop { --pf-ratio: 4 / 3; }
.pf-frame.sc-crop img, .sc-crop .sc-highlight { position: absolute; left: 0; top: -62.2%; width: 100%; height: auto; object-fit: fill; }
.sc-highlight > path { fill: rgba(25, 25, 25, 0.62); }
.sc-hl-ring { fill: none; stroke: #191919; stroke-width: 3; }

/* 6 · Market: full width, caption beneath. 16:10 on 8 and 12 columns; on phones a 4:5 frame with the approved CSS
   crop (scale 1.22 about 48% 47%). */
.sc-market .pf-frame { --pf-ratio: 16 / 10; --pf-focus: 50% 50%; }
@container pf-section (width < 600px) {
  .sc-market .pf-frame { --pf-ratio: 4 / 5; }
  .sc-market .pf-frame img { transform: scale(1.22); transform-origin: 48% 47%; }
}

/* 7 · Digital gallery: frames share one height (the shop page's 4:3 frame sets it) and captions share the row
   beneath. The two device mockups use approved CSS crops of the originals. */
.sc-d1 { --pf-s8: span 4; --pf-s12: span 6; }
.sc-d1 > .pf-frame { --pf-ratio: 4 / 3; --pf-ratio-4: 4 / 3; --pf-focus: 50% 40%; }
.sc-d2, .sc-d3 { --pf-s8: span 2; --pf-s12: span 3; }
.sc-d2 > .pf-frame { --pf-ratio-4: 4 / 5; }
.sc-d3 > .pf-frame { --pf-ratio-4: 4 / 5; --pf-focus: 50% 50%; }
.sc-zoom-laptop img { transform: scale(1.16); transform-origin: 50% 42%; }
.sc-zoom-phone img { transform: scale(1.45); transform-origin: 50% 52%; }
@container pf-section (min-width: 600px) {
  .sc-digital .pf-gallery-grid { grid-template-rows: auto auto; row-gap: var(--pf-space-2xs); }
  .sc-digital .pf-gallery-item { grid-row: span 2; display: grid; grid-template-rows: subgrid; }
  .sc-digital .pf-gallery-grid--match > .pf-fill { contain: none; }
  .sc-digital .pf-gallery-grid--match > .pf-fill > .pf-frame { contain: size; height: 100%; aspect-ratio: auto; }
}
