/* ==========================================================================
   Matsuri Barcelona — Design tokens ("Sumi Minimal")
   Colors, type, spacing, radii, shadows — mirrors the Figma variables 1:1.
   ========================================================================== */

:root {
  /* Palette — updated to the official brand style guide ("Matsuri basic
     style guide 2026"), per the user, 2026-10-29. Mapping: --ink (the
     site's dominant dark color — body text, dark sections, buttons) ←
     Deep Blue #221C43 (guide: 50–60% use); --vermillion (primary CTA) ←
     Cherry Red #C0282E (guide: 20–30% use); --amber (secondary CTA/
     accent) ← Ceremonial Gold #CE861D (guide: 5–10% use, "graphic
     details or short titles"). --muted-ink updated to the guide's own
     dark grey #3C3C3B (essentially identical to the previous value
     already). --ink-body-text (body copy color on dark sections)
     switched from a warm cream to the guide's secondary light
     lavender-grey #D1D3E0, which reads better against the new cooler
     Deep Blue than the old warm tone would. Fonts are NOT changed in
     this pass — the guide specifies Gotham (a licensed font, not
     available via Google Fonts/CDN and not supplied), so --font-sans
     below stays Outfit until font files are provided.

     --paper (the site's base page background) was initially kept as the
     original beige/cream, per the user — not one of the guide's named
     colors. Changed the same day, after seeing the new palette live, to
     the guide's own secondary color #EAEAF4 (light lavender-grey)
     instead, to read as part of the same cooler system as Deep Blue
     rather than clashing warm-beige-against-cool-navy. */
  --ink: #221c43;              /* Deep Blue — rgb(34,28,67) ≈ figma 0.133/0.110/0.263 */
  --paper: #eaeaf4;            /* light lavender-grey (brand secondary) — rgb(234,234,244) ≈ figma 0.918/0.918/0.957 */
  --vermillion: #c0282e;       /* Cherry Red — rgb(192,40,46) ≈ figma 0.753/0.157/0.180 */
  --amber: #ce861d;            /* Ceremonial Gold — rgb(206,134,29) ≈ figma 0.808/0.525/0.114 */
  --vermillion-dark: #a12227;  /* darker stop used in duotone gradients — same proportional darkening as the old vermillion→vermillion-dark relationship, applied to Cherry Red */
  --white: #ffffff;
  --muted-ink: #3c3c3b;        /* brand dark grey — giant display word on ink bg (e.g. "MUSUBI") */
  --ink-body-text: #d1d3e0;    /* body copy on ink/dark sections */

  /* Ink at common opacities (pre-mixed against paper/white for perf + crisp text) */
  --ink-04: rgba(34, 28, 67, 0.04);
  --ink-06: rgba(34, 28, 67, 0.06);
  --ink-08: rgba(34, 28, 67, 0.08);
  --ink-10: rgba(34, 28, 67, 0.10);
  --ink-12: rgba(34, 28, 67, 0.12);
  --ink-16: rgba(34, 28, 67, 0.16);
  --ink-18: rgba(34, 28, 67, 0.18);
  --ink-22: rgba(34, 28, 67, 0.22);
  --ink-35: rgba(34, 28, 67, 0.35);
  --ink-50: rgba(34, 28, 67, 0.50);
  --ink-55: rgba(34, 28, 67, 0.55);
  --ink-65: rgba(34, 28, 67, 0.65);
  --ink-70: rgba(34, 28, 67, 0.70);
  --ink-75: rgba(34, 28, 67, 0.75);
  --ink-78: rgba(34, 28, 67, 0.78);
  --ink-85: rgba(34, 28, 67, 0.85);

  --paper-55: rgba(234, 234, 244, 0.55);
  --paper-65: rgba(234, 234, 244, 0.65);
  --paper-75: rgba(234, 234, 244, 0.75);
  --paper-78: rgba(234, 234, 244, 0.78);

  /* Type */
  --font-sans: 'Outfit', 'Zen Kaku Gothic New', -apple-system, sans-serif;
  --font-jp: 'Zen Kaku Gothic New', 'Outfit', sans-serif;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card: 0 10px 26px rgba(34, 28, 67, 0.10);
  --shadow-card-hover: 0 10px 26px rgba(34, 28, 67, 0.28);
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.06);

  /* Layout */
  --page-max: 1440px;
  --content-pad-pc: 80px;
  --content-pad-sp: 16px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 160ms var(--ease-out);
  --transition-med: 200ms var(--ease-out);
  --transition-slow: 300ms var(--ease-out);
}

/* Duotone photo treatment — the recurring "hero photo" recipe.
   Usage: wrap an <img> or background photo element with .photo-duotone;
   the gradient + desaturation are layered via ::after and filter.

   Per the user, 2026-10-28: the site-wide "sepia" look first got a
   blanket lightening (grayscale + overlay opacity both turned down
   across every variant), but that weakened the contrast behind white
   banner text (section-hero.php's .hero__title/.hero-foot and
   content-intro.php's kicker/title/lead both sit directly on top of
   the photo with NO separate dark scrim of their own — see those
   files/CSS — so their legibility depends entirely on this overlay).
   The user asked to keep those "title" banners at their original
   strength and instead make non-text / already-protected photo spots
   clearer. So:
     - the BASE .photo-duotone (no modifier) — used by the homepage
       Hero and the Tickets CTA's single-photo mode — is back to its
       original grayscale(1)/opacity(0.85).
     - --content (the 6+1 content-page intro banners) is likewise back
       to its original alpha.
     - --light (small grid thumbnails/cards/galleries — none of which
       carry text directly on the photo without their own text-shadow
       or a separate scrim div, see front-page.css's .bento-grid__caption
       and .tickets-cta__photo::after) is now lightened FURTHER than the
       short-lived first pass.
     - a NEW --clear variant covers highlight-item.php's photo, the one
       default-variant usage that was never text-critical (its photo
       sits in its own column beside the text, never under it) — split
       out specifically so it could be lightened without touching the
       Hero's shared base class. */
.photo-duotone {
  position: relative;
  overflow: hidden;
  background-color: var(--ink);
}
.photo-duotone > img,
.photo-duotone > .photo-duotone__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  display: block;
}
.photo-duotone::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Was amber → vermillion-dark → near-black-BROWN (#1c120d) — a warm
     gold/red/brown recipe built entirely from the amber+vermillion
     family, independent of --ink. That stayed warm/reddish even after
     the 2026-10-29 brand update (ink→Deep Blue, vermillion→Cherry Red,
     amber→Gold) swapped vermillion for an equally-warm Cherry Red, so
     every photo banner (Hero, content-intro pages) still read as
     orange/red while the rest of the site had gone cool/navy — reported
     by the user the same day ("it should probably change now that the
     whole site feels blue"). First pass swapped the middle/end stops for
     Deep Blue and a near-black NAVY (#0d0a1a) with gold still at the 0%
     (left) stop. The user then asked to flip the color ORDER itself —
     blue on the left, gold on the right ("左側が青くて、右に行くと黄色く
     なる感じ") — so this was first changed to a simple 2-stop --ink →
     --amber diagonal. The user then flagged the blue read as too faint
     ("青色が少し薄くなってない？") — with only 2 stops, linear RGB
     interpolation between a dark blue and a warm gold passes through a
     muddy brown almost immediately (Deep Blue and Gold aren't adjacent
     hues), so pure blue only showed in a thin sliver at the very left
     edge before the rest of the banner read as brown. Fixed by holding
     --ink solid through the first 30% before transitioning to --amber,
     confirmed via a Playwright side-by-side render — the left third now
     reads clearly as Deep Blue before fading to Gold on the right. Only
     this Hero/non-content-banner variant and its --light/--clear/
     placeholder siblings were flipped — the --content variant (other
     pages' vertical title banners) is unchanged, since the user's
     feedback was specifically about the Hero/FV. */
  background: linear-gradient(115deg, var(--ink) 0%, var(--ink) 30%, var(--amber) 100%);
  mix-blend-mode: multiply;
  opacity: 0.85;
}

/* Lighter variant used for small grid thumbnails/cards/galleries
   (Homepage "Descubre el Festival" cards, Tema/Sobre el festival/Gallery
   side photos, Tickets CTA's gallery tiles) — none of these carry text
   directly on the photo without their own independent protection (a
   caption text-shadow, or — for the Tickets gallery — a separate dark
   scrim layered on top), so this was pushed clearly lighter than the
   text-bearing variants above, per the user, 2026-10-28. */
.photo-duotone--light > img,
.photo-duotone--light > .photo-duotone__img {
  filter: grayscale(0.15) brightness(1.05);
}
.photo-duotone--light::after {
  /* Base recipe confirmed via get_design_context on the mobile
     Highlights card (116:16): amber → vermillion, 162.5deg, 0%–80%.
     Opacity lowered from its original 0.42 to 0.16, per the user,
     2026-10-28 — see the note on .photo-duotone above. End stop swapped
     from vermillion (Cherry Red) to --ink (Deep Blue), 2026-10-29, same
     reasoning as the base .photo-duotone::after above. Stop order then
     flipped (--ink first, --amber last) 2026-10-29 same day, to match
     the Hero's own left-blue/right-gold reversal above, and given the
     same "blue hold" treatment (--ink solid through ~25% before fading
     to --amber) so the blue doesn't wash out immediately — this stays a
     very light wash either way (0.16 opacity). */
  background: linear-gradient(162.5deg, var(--ink) 0%, var(--ink) 25%, var(--amber) 80%);
  opacity: 0.16;
}

/* "Clear" variant — purely decorative photos with no overlaid text and
   no legibility constraint: currently just template-parts/highlight-
   item.php's photo column (Zona infantil's "Juegos", Acerca de's
   "Historia", Colabora's "Participa" items), which always sits beside
   its text in its own column, never underneath it. Split out from the
   shared base .photo-duotone (used elsewhere for text-bearing banners)
   specifically so it could be lightened independently, per the user,
   2026-10-28 — see the long note on .photo-duotone above. */
.photo-duotone--clear > img,
.photo-duotone--clear > .photo-duotone__img {
  filter: grayscale(0.15) brightness(1.03);
}
.photo-duotone--clear::after {
  /* Same gold → Deep Blue → near-black-navy swap as .photo-duotone::after,
     2026-10-29 — see that rule's comment above. Then matched to the same
     --ink (0–30%) → --amber (100%) "blue hold" recipe as the base
     variant, same day, after the user reported the blue reading too
     faint with a plain 2-stop gradient. */
  background: linear-gradient(115deg, var(--ink) 0%, var(--ink) 30%, var(--amber) 100%);
  opacity: 0.22;
}

/* Gradient placeholder — used where a real photo hasn't been uploaded yet.
   End stop swapped from vermillion-dark to --ink (Deep Blue), 2026-10-29
   — same reasoning as .photo-duotone::after above. Stop order flipped
   (--ink first, --amber last) same day, matching the Hero reversal, then
   given the same --ink 0–30% "blue hold" as the base variant so the blue
   doesn't read as too thin a sliver. */
.photo-placeholder {
  background: linear-gradient(115deg, var(--ink) 0%, var(--ink) 30%, var(--amber) 100%);
}

/* "Content page" intro-banner variant — used by the photo+gradient intro
   banners on Artistas/Paradas/Programa/Zona infantil/Acerca de/Colabora/
   Barcelona Ondo (content-intro.php). Same 3 colors/opacity/blend-mode
   recipe as the default .photo-duotone above, just a steeper diagonal
   and different stop positions — confirmed via get_design_context on
   the first 6 of these pages' intro banners (they all use this exact
   recipe, not the default one). Kept at its ORIGINAL 0.85 alpha per the
   user, 2026-10-28 — see the long note on .photo-duotone above: this
   banner carries the kicker/title/lead text (and, on Colabora, the
   access-block row) directly on top of the photo across its full
   height, with no separate scrim, so it needs the same contrast as
   before. If a specific page's photo still reads as too busy behind its
   text, tune that page's own uploaded photo (crop/exposure) rather than
   lowering this site-wide. */
/* Middle/end stops swapped from a warm reddish-brown (rgba(158,66,43)/
   rgba(28,18,13) — a custom pair close to, but not exactly, the old
   vermillion-dark/near-black tokens, which is why the earlier site-wide
   brand-color sweep didn't catch them) to Deep Blue / near-black-navy,
   2026-10-29 — same reasoning as .photo-duotone::after above: every
   content-page intro banner (Artistas/Paradas/Programa/Zona infantil/
   Acerca de/Colabora/Barcelona Ondo) still read warm/orange-red after
   the brand update, out of step with the rest of the now blue-leaning
   site. First stop (gold) is unchanged.
   Reworked again, 2026-11-05, per the user, after the same "no amber /
   not black-and-white, make it clear" treatment was applied to the
   Hero banner (.hero .photo-duotone::after in front-page.css). At that
   point this banner's own gradient ran a different direction (175deg,
   near vertical — amber top, near-black bottom) because, on 6 of its 7
   pages, the kicker/title/lead ran almost the full banner height, with
   Colabora additionally running a 5-column button row across the
   BANNER FULL WIDTH at the bottom — unlike Hero's empty right
   two-thirds, there was no large text-free zone to safely fade to
   transparent without risking legibility. That landed on "clear at the
   top, ink at the bottom" (transparent above the kicker, solid ink by
   35% down, held for the rest of the height).
   Reworked AGAIN, 2026-11-08, per the user (screenshot of Acerca de's
   banner): that vertical recipe darkens the photo uniformly across its
   full width, which reads oddly once you notice the kicker/title/lead
   text only ever occupies the LEFT portion of the banner (.content-
   intro__inner is a flex column with align-items:flex-start, and
   .content-intro__title/__lead both cap out well under the container's
   full width) — the right side of the photo gets the same heavy
   ink-85 wash even though nothing sits on top of it there. The
   vertical recipe's own original justification (Colabora's access-row
   button row spanning the banner's full width) no longer applies
   either — that row moved OUT of this banner entirely on 2026-11-05
   (see page-colabora.php's own docblock), so nothing in this banner
   spans its full width on any of the 7 pages any more. Switched to a
   LEFT-to-right gradient instead: solid ink-85 under the text column
   on the left, fading out to fully transparent by the right edge, so
   the photo's own right-hand portion — which no page ever puts text
   over — shows through clearly instead of being darkened for no
   reason. A slight diagonal (100deg, not a flat 90deg) matches this
   site's other diagonal duotone recipes (.photo-duotone::after uses
   115deg) rather than a perfectly vertical-edge fade. Stop positions
   (0%/48%/92%) hold solid ink through roughly where .content-intro__
   lead's own max-width (760px) ends on a full 1440px container before
   fading out, so the text column keeps its protection at every
   breakpoint down to where .content-intro__lead is hidden outright
   (782px, content-pages.css) — below that only the shorter title sits
   on the photo, which the same solid-left-48% band still covers. */
.photo-duotone--content::after {
  background: linear-gradient(100deg, var(--ink-85) 0%, var(--ink-85) 48%, transparent 92%);
  opacity: 1; /* alpha is already baked into the stops above */
}

.photo-duotone--content > img,
.photo-duotone--content > .photo-duotone__img {
  filter: none;
}

/* Same recipe, opaque (no photo underneath to multiply against) — used
   when a content-intro banner has no background photo uploaded yet.
   Reworked alongside .photo-duotone--content::after above, 2026-11-05 —
   there's no photo here to reveal, so the "clear" top strip has nothing
   to show; kept as a flat var(--ink) fill (no amber) so a photo-less
   banner still reads as a deliberate, calm placeholder rather than
   fading to nothing at the top for no reason. */
.photo-placeholder--content {
  background: var(--ink);
}
