/* ═══════════════════════════════════════════════════════════════════════════
   ESBART CATALÀ DE DANSAIRES — DESIGN SYSTEM
   Shared styles for all pages. Edit tokens here to re-skin the whole site.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  /* Brand palette */
  --burgundy: #8B2332;
  --burgundy-light: #A63D4D;
  --burgundy-dark: #6B1A26;
  --burgundy-ink: #3d0f15;
  --gold: #C79A3A;
  --gold-soft: #f5d5a6;
  --gold-deep: #80611D; /* AA-compliant gold for small text on light bg (≥5:1 on cream) */

  /* Neutrals */
  --ink: #1A1A1A;
  --paper: #FFFFFF;
  --cream: #F6F1EA;
  --bone: #EDE4D6;
  --stone: #F8F8F8;
  --mute: #6B6B6B;
  --line: rgba(26, 26, 26, 0.12);

  /* Type */
  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body: 'Lora', Georgia, serif;
  --ff-ui: 'Inter', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --wrap-max: 1320px;
  --wrap-pad: 32px;
  --wrap-pad-sm: 20px;
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga", "kern";
}
h1, h2, h3, h4, h5 {
  font-family: var(--ff-display);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ui, nav, button { font-family: var(--ff-ui); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--burgundy); color: #fff; }

/* ─── Accessibility: skip-link + keyboard focus ───────────────────────────── */
/* Skip-to-content — first tab stop on every page that mounts the shared Nav. */
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  transform: translateY(calc(-100% - 16px));
  background: var(--burgundy); color: #fff;
  font-family: var(--ff-ui); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  padding: 13px 22px; border-radius: 3px; text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform .2s cubic-bezier(.2,.7,.2,1);
}
.skip-link:focus { transform: none; outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }

/* Programmatic focus target for the skip-link — no visible ring on the region,
   and clear the fixed nav when focus scrolls it into view. */
#main-content { scroll-margin-top: 90px; }
#main-content:focus, #main-content:focus-visible { outline: none; }

/* System keyboard-focus ring. Specificity kept at 0 via :where() so page-level
   rules can refine it; :focus-visible means mouse clicks stay clean. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 3px;
  border-radius: 2px;
}
/* On dark surfaces the burgundy ring disappears — switch to a light ring. */
:where(.nav.hero-mode:not(.scrolled), footer, .mobile-menu, .ticker, .pk-section--dark)
  :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline-color: var(--gold-soft);
}

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.wrap { max-width: var(--wrap-max); margin: 0 auto; padding: 0 var(--wrap-pad); }
@media (max-width: 700px) { .wrap { padding: 0 var(--wrap-pad-sm); } }

section { padding: 120px 0; }
@media (max-width: 700px) { section { padding: 80px 0; } }

.sec-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: end; margin-bottom: 60px;
}
.sec-head h2 { font-size: clamp(36px, 5vw, 72px); line-height: 1; }
.sec-head h2 em { font-style: italic; color: var(--burgundy); font-weight: 400; }
.sec-head .sub { color: var(--mute); max-width: 460px; font-size: 17px; line-height: 1.6; }
@media (max-width: 820px) {
  .sec-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 40px; }
}

/* ─── Reveals (used with IntersectionObserver) ────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity .9s cubic-bezier(.2,.7,.2,1),
    transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* ─── Keyframes ───────────────────────────────────────────────────────────── */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

/* ─── Utilities ───────────────────────────────────────────────────────────── */
.noscrollbar::-webkit-scrollbar { display: none; }
.noscrollbar { scrollbar-width: none; }

.eyebrow {
  font-family: var(--ff-ui); font-weight: 500; font-size: 12px;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--burgundy); display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; display: inline-block; }
.eyebrow.on-dark { color: var(--gold-soft); }
.eyebrow-white { color: var(--gold-soft); }
.eyebrow-white::before { background: var(--gold-soft); }

/* Placeholder imagery (for when no real photo is available) */
.ph {
  background:
    repeating-linear-gradient(135deg, rgba(139,35,50,.08) 0 14px, rgba(139,35,50,.03) 14px 28px),
    linear-gradient(180deg, #efe6d8, #e6d9c4);
  color: var(--burgundy-dark);
  display: flex; align-items: flex-end; justify-content: flex-start;
  position: relative; overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  font-family: var(--ff-mono);
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 10px; background: rgba(255,255,255,.8); margin: 10px;
  border: 1px solid rgba(139,35,50,.2);
}

/* ─── Buttons (skewed editorial, inspired by filipz) ──────────────────────── */
/*
  Usage:
    <a class="btn">Primary</a>                burgundy filled, hovers to lighter burgundy
    <a class="btn ghost">Ghost</a>            outline burgundy on light bg
    <a class="btn light">Light</a>            white on dark bg, hovers to dark burgundy
    <a class="btn outline-light">Outline</a>  transparent on dark bg with white border
*/
.btn {
  --btn-bg: var(--burgundy);
  --btn-fg: #fff;
  --btn-bd: var(--burgundy);
  --btn-fill: var(--burgundy-light);
  --btn-fill-fg: #fff;
  position: relative;
  display: inline-block;
  padding: 16px 30px;
  background: transparent;
  border: none;
  color: var(--btn-fg);
  font-family: var(--ff-ui);
  font-size: 12px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: color .25s ease;
  z-index: 0;
  margin: 0 8px;
  isolation: isolate;
  will-change: transform;
  transform: translateZ(0);
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  transform: skewX(-12deg);
  transition: background-color .3s ease, border-color .3s ease;
  z-index: -2;
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--btn-fill);
  transform: skewX(-12deg);
  opacity: 0;
  transition: opacity .35s ease;
  z-index: -1;
  will-change: opacity, transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.btn:hover { color: var(--btn-fill-fg); }
.btn:hover::after { opacity: 1; }
/* Keyboard focus ring (the base .btn sets outline:none for mouse use). */
.btn:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 4px; }
.btn.light:focus-visible, .btn.outline-light:focus-visible { outline-color: #fff; }

.btn.ghost {
  --btn-bg: transparent;
  --btn-fg: var(--burgundy);
  --btn-bd: var(--burgundy);
  --btn-fill: var(--burgundy);
  --btn-fill-fg: #fff;
}
.btn.light {
  --btn-bg: #fff;
  --btn-fg: var(--burgundy);
  --btn-bd: #fff;
  --btn-fill: var(--burgundy-dark);
  --btn-fill-fg: #fff;
}
.btn.outline-light {
  --btn-bg: transparent;
  --btn-fg: #fff;
  --btn-bd: rgba(255,255,255,.8);
  --btn-fill: #fff;
  --btn-fill-fg: var(--burgundy);
}

/* ─── Navbar ──────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 14px 0;
  transition:
    background .3s ease,
    backdrop-filter .3s ease,
    border-color .3s ease,
    padding .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom-color: var(--line);
  padding: 10px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-logo { display: flex; align-items: center; gap: 14px; }
.nav-logo img { width: 46px; height: 46px; object-fit: contain; transition: filter .3s; }
.nav-logo .word {
  font-family: var(--ff-display); font-weight: 700; font-size: 18px;
  line-height: 1.05; letter-spacing: .02em; color: var(--ink);
}
.nav-logo .word small {
  display: block; font-family: var(--ff-ui); font-weight: 500;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--burgundy); margin-top: 2px;
}

/* Hero-mode nav (white text over dark hero) */
.nav.hero-mode:not(.scrolled) .nav-logo img { filter: invert(1) brightness(2); }
.nav.hero-mode:not(.scrolled) .nav-logo .word { color: #fff; }
.nav.hero-mode:not(.scrolled) .nav-logo .word small { color: var(--gold-soft); }
.nav.hero-mode:not(.scrolled) .nav-links a { color: rgba(255,255,255,.92); }
.nav.hero-mode:not(.scrolled) .nav-util { color: #fff; }

.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-links a {
  font-family: var(--ff-ui); font-weight: 500; font-size: 14px; color: var(--ink);
  padding: 10px 14px; position: relative; transition: color .25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 1.5px;
  background: var(--burgundy); transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.nav-links a:hover { color: var(--burgundy); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--burgundy); font-weight: 600; }
.nav-links a.active::after { transform: scaleX(1); }
.nav.hero-mode:not(.scrolled) .nav-links a.active { color: var(--gold-soft); }
.nav.hero-mode:not(.scrolled) .nav-links a.active::after { background: var(--gold-soft); }
.nav-links a.cta {
  color: #fff; background: var(--burgundy); border-radius: 2px; margin-left: 10px;
  letter-spacing: .06em; text-transform: uppercase; font-size: 12px; font-weight: 600;
  padding: 10px 16px;
}
.nav-links a.cta::after { display: none; }
.nav-links a.cta:hover { background: var(--burgundy-light); color: #fff; }
.nav-links a.cta.active { background: var(--burgundy-dark); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

.nav-util {
  display: flex; align-items: center; gap: 14px; color: var(--ink);
  font-family: var(--ff-ui); font-size: 12px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
}
.lang { display: flex; gap: 6px; }
.lang button {
  background: none; border: none; padding: 4px 6px; font: inherit; color: inherit;
  cursor: pointer; opacity: .55; transition: opacity .2s; letter-spacing: .12em;
}
.lang button.active { opacity: 1; color: var(--burgundy); }
.nav.hero-mode:not(.scrolled) .lang button.active { color: var(--gold-soft); }
.lang button:hover { opacity: 1; }
.icon-btn {
  background: none; border: none; cursor: pointer; color: inherit; padding: 6px;
  display: inline-flex;
}

.burger { display: none; background: none; border: none; color: inherit; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 1.5px; background: currentColor; margin: 5px 0; transition: transform .3s, opacity .3s; }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-util .lang { display: flex; }
  .nav-util .util-hide { display: none; }
  .burger { display: block; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; background: var(--burgundy-dark); color: #fff; z-index: 60;
  transform: translateY(-100%); transition: transform .45s cubic-bezier(.6,.1,.2,1);
  display: flex; flex-direction: column; padding: 24px; overflow-y: auto;
}
.mobile-menu.open { transform: none; }
.mobile-menu .mm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.mobile-menu a {
  font-family: var(--ff-display); font-size: 34px; padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.1); color: #fff; display: block;
}
.mobile-menu a.cta { color: var(--gold-soft); }
.mobile-menu a[aria-current="page"] { color: var(--gold-soft); padding-left: 18px; position: relative; }
.mobile-menu a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 1.5px;
  background: var(--gold-soft);
}
.mobile-menu .close {
  background: none; border: 1px solid rgba(255,255,255,.3); color: #fff;
  width: 44px; height: 44px; border-radius: 50%; font-size: 22px; cursor: pointer;
}

/* ─── Ticker (horizontal marquee bar) ─────────────────────────────────────── */
.ticker {
  background: var(--ink); color: #fff; overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.1);
}
.ticker-track {
  display: flex; gap: 60px; padding: 14px 0; width: max-content;
  animation: marquee 48s linear infinite;
  font-family: var(--ff-display); font-style: italic; font-size: 20px;
}
.ticker-track span { display: inline-flex; align-items: center; gap: 60px; }
.ticker-track span::after { content: "✦"; color: var(--burgundy-light); font-style: normal; }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
footer {
  background: var(--burgundy-dark); color: #fff; padding: 80px 0 0;
  position: relative; overflow: hidden;
}
footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, rgba(245,213,166,.4), transparent);
}
.foot-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 60px; border-bottom: 1px solid rgba(255,255,255,.12);
}
@media (max-width: 980px) { .foot-top { grid-template-columns: 1fr 1fr; gap: 40px 32px; } }
@media (max-width: 540px) { .foot-top { grid-template-columns: 1fr; } }
.foot-brand img { width: 64px; filter: brightness(0) invert(1); margin-bottom: 20px; }
.foot-brand h3 { font-size: 22px; margin-bottom: 14px; max-width: 340px; line-height: 1.2; }
.foot-brand p { color: rgba(255,255,255,.7); font-size: 14px; line-height: 1.6; max-width: 340px; margin: 0 0 24px; }
.foot-brand .addr {
  font-family: var(--ff-display); font-style: italic;
  font-size: 16px; line-height: 1.5; color: var(--gold-soft);
}
.foot-col h4 {
  font-family: var(--ff-ui); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold-soft); margin-bottom: 20px; font-weight: 600;
}
.foot-col a {
  display: block; padding: 6px 0; color: rgba(255,255,255,.85); font-size: 14px;
  font-family: var(--ff-ui); transition: color .2s, padding .2s;
}
.foot-col a:hover { color: #fff; padding-left: 6px; }
.foot-mid {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 40px 0; border-bottom: 1px solid rgba(255,255,255,.12);
  flex-wrap: wrap; gap: 40px;
}
.foot-support { flex: 1; min-width: 320px; }
.foot-support__title {
  font-family: var(--ff-ui); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold-soft); margin: 0 0 22px; font-weight: 600;
}
/* Optical logo wall — equal-area white logos, large & legible, last row centred */
.foot-support__grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  max-width: 884px;
}
.foot-support__item {
  flex: 0 1 262px; min-height: 140px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px 28px; border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.025); transition: background .25s ease;
}
.foot-support__item:hover { background: rgba(255,255,255,.06); }
.foot-wordmark {
  font-family: var(--ff-ui); font-size: 14px; font-weight: 500;
  letter-spacing: .015em; line-height: 1.35; color: rgba(255,255,255,.82);
  transition: color .25s ease;
}
.foot-support__item:hover .foot-wordmark { color: #fff; }
.foot-logo {
  display: block; width: 100%; max-width: 228px; height: auto;
  /* logos are pre-rendered white; brightness(0)+invert keeps them white and
     also normalises any colour logo a future editor might drop in. */
  filter: brightness(0) invert(1); opacity: .85; transition: opacity .25s ease;
}
.foot-support__item:hover .foot-logo { opacity: 1; }
@media (max-width: 600px) {
  .foot-support__item { flex: 1 1 44%; min-height: 110px; padding: 16px; }
}
.foot-social { display: flex; gap: 10px; padding-top: 30px; }
.foot-social a {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  transition: all .25s;
}
.foot-social a:hover { background: #fff; color: var(--burgundy-dark); border-color: #fff; }
.foot-bottom {
  padding: 28px 0; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; font-family: var(--ff-ui); font-size: 12px;
  color: rgba(255,255,255,.6);
}
.foot-bottom .links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-bottom a:hover { color: #fff; }

/* ─── Affiliations / memberships — editorial colophon ─────────────────────────
   Label + legend on the left rail, entities in two airy columns on the
   right, historical note as an italic footnote with a short gold rule. */
.foot-affil {
  margin-top: 48px; padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: grid; grid-template-columns: 220px 1fr; gap: 20px 64px;
  align-items: start;
}
.foot-affil__title {
  font-family: var(--ff-ui); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold-soft); margin: 6px 0 0; font-weight: 600;
}
.foot-affil__legend {
  margin: 14px 0 0; font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.42);
}
.foot-affil__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: 56px;
}
.foot-affil__item a {
  display: block; padding: 8px 0;
  font-family: var(--ff-body); font-size: 15.5px; line-height: 1.45;
  color: rgba(255,255,255,.72); transition: color .2s ease;
  text-decoration: none;
}
.foot-affil__item a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.foot-affil__star { color: var(--gold-soft); font-size: .72em; margin-left: 3px; }
.foot-affil__note {
  margin: 26px 0 0; max-width: 66ch;
  font-family: var(--ff-body); font-style: italic;
  font-size: 13.5px; line-height: 1.7;
  color: rgba(255,255,255,.55);
}
.foot-affil__note::before {
  content: ""; display: inline-block;
  width: 26px; height: 1px; background: var(--gold);
  vertical-align: middle; margin-right: 14px;
}
@media (max-width: 900px) {
  .foot-affil { grid-template-columns: 1fr; gap: 22px; }
  .foot-affil__title { margin-top: 0; }
  .foot-affil__legend { margin-top: 8px; }
  .foot-affil__list { grid-template-columns: 1fr; }
  .foot-affil__item a { font-size: 15px; padding: 7px 0; }
}

/* ─── Tweaks panel ────────────────────────────────────────────────────────── */
.tweaks-panel {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  background: #fff; border: 1px solid var(--line); padding: 20px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15); width: 280px;
  font-family: var(--ff-ui); font-size: 13px;
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h5 {
  font-family: var(--ff-ui); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--burgundy); margin-bottom: 16px; font-weight: 600;
}
.tweaks-panel label {
  display: block; margin-bottom: 14px; color: var(--mute);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.tweaks-panel select,
.tweaks-panel input[type=color] {
  width: 100%; margin-top: 6px; padding: 8px; font: inherit;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.tweaks-panel .row { display: flex; gap: 8px; }
.tweaks-panel .sw { flex: 1; aspect-ratio: 1; border: 2px solid transparent; cursor: pointer; }
.tweaks-panel .sw.active { border-color: var(--ink); }

/* ─── Custom cursor (optional; activated by adding .ecd-cursor elements) ──── */
.ecd-cursor { pointer-events: none; position: fixed; top: 0; left: 0; z-index: 9999; mix-blend-mode: difference; }
.ecd-cursor-dot, .ecd-cursor-ring { position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none; }
.ecd-cursor-dot { width: 6px; height: 6px; background: #fff; margin: -3px 0 0 -3px; }
.ecd-cursor-ring { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.6); margin: -18px 0 0 -18px; transition: width .2s, height .2s; }
@media (hover: none), (pointer: coarse) { .ecd-cursor { display: none; } }
