/* ═══════════════════════════════════════════════════════════════════════════
   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: #666666; /* >=4,5:1 sobre cream, bone, paper i stone (calculat; bone 4,56 és el pitjor cas) */
  --line: rgba(26, 26, 26, 0.12);
  /* Vora d'un control quan és l'únic que en delimita la forma (xips, paginadors):
     WCAG 1.4.11 demana 3:1 i --line en fa 1,05 a 1,3. #808080 fa 3,1 sobre bone, 3,5 sobre cream i 4,0 sobre blanc. */
  --line-strong: #808080;

  /* 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;

  /* Cadenat dels documents reservats als socis. Va aquí i no dins de cada full
     perquè l'han de fer servir dues pàgines —el portal de transparència i la
     porta d'accés— i han de dibuixar el mateix. És una màscara i no una imatge:
     així pren el color del text que l'acompanya i no cal un fitxer per cada to.
     Dibuixat a mà (cos tancat i arc); una icona de biblioteca no encaixa amb la
     resta del web, i un emoji de cadenat encara menys. */
  --ecd-cadenat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 13'%3E%3Cpath d='M2.1 5.4V3.7a3.4 3.4 0 0 1 6.8 0v1.7' fill='none' stroke='%23000' stroke-width='1.35' stroke-linecap='round'/%3E%3Crect x='.6' y='5.4' width='9.8' height='7' rx='1.1' fill='%23000'/%3E%3C/svg%3E");

  /* Moviment dels botons. Les durades són una escala de tres peus perquè abans
     n'hi havia cinc de barrejades (.2/.25/.3/.35/.45 s). --nudge és l'ÚNIC
     desplaçament permès a un control: el glif de fletxa d'un enllaç de text o
     d'una fila clicable llisca aquesta distància; cap botó es mou mai. Excepció
     documentada: els temps interns de .btn (0 s amb retard .11 s, .3 s i .35 s)
     estan afinats per evitar un parpelleig de contrast i no fan servir l'escala. */
  --dur-fast: .2s;
  --dur-base: .3s;
  --dur-slow: .45s;
  --nudge: 4px;

  /* 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, .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;
}
/* line-height 1.3: el .word-mask (overflow:hidden que embolica la
   reveal GSAP) ha de contenir el descendent de la «p»/«g»/«y» d'una
   Playfair (ascent ~1050 + descent ~245 sobre 1000 units-per-em: el
   line-box mínim per no tallar és 1.3× el font-size). Amb line-height 1
   la «p» de «portes» quedava tallada per sota. */
.sec-head h2 { font-size: clamp(36px, 5vw, 72px); line-height: 1.3; }
.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); } }

/* ─── Utilities ───────────────────────────────────────────────────────────── */
.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-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;
  /* El text canvia de color d'un cop, justament quan el farciment ve a mig camí
     (el farciment tarda .35 s amb ease: arriba al 50 % cap als .11 s). Abans el color s'animava en .25 s: en deixar el
     botó, el text ja era blanc quan el farciment blanc encara hi era, i durant
     ~100 ms el text desapareixia (contrast mesurat 1,01:1; amb els botons
     ghost, granat sobre granat). Així el pitjor instant és la barreja a meitat. */
  transition: color 0s linear .11s;
  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;
}
/* Només amb un punter que de debò passa per sobre. En una pantalla tàctil el :hover
   queda enganxat després del toc (i s'activa en començar a fer scroll amb el dit
   a sobre del botó), de manera que el farciment i el canvi de color apareixien
   sense que ningú hagués premut res. */
@media (hover: hover) {
  .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;
}
/* Sistema light: sempre viu sobre fons foscos (borgonya, ink) o clars. El
   hover NO canvia la tonalitat del bloc — mantindre-la fosca sobre fosc
   feia caure el contrast a <2:1 (WCAG 1.4.11 fallat, auditoria 2026-08-13).
   Ara el hover conserva blanc i guanya un anell d'or i una ombra. NO es mou: cap
   botó canvia de posició en hover/focus (M1); abans pujava 2 px. */
.btn.light {
  --btn-bg: #fff;
  --btn-fg: var(--burgundy);
  --btn-bd: #fff;
  --btn-fill: #fff;
  --btn-fill-fg: var(--burgundy);
}
.btn.light:focus-visible::before {
  box-shadow: inset 0 0 0 2px var(--gold), 0 10px 24px rgba(0,0,0,.18);
  border-color: var(--gold);
}
@media (hover: hover) {
  .btn.light:hover::before {
    box-shadow: inset 0 0 0 2px var(--gold), 0 10px 24px rgba(0,0,0,.18);
    border-color: var(--gold);
  }
}
.btn.outline-light {
  --btn-bg: transparent;
  --btn-fg: #fff;
  --btn-bd: rgba(255,255,255,.8);
  --btn-fill: #fff;
  --btn-fill-fg: var(--burgundy);
}

/* ─── Estats comuns dels botons i dels controls (:active, :disabled) ────────
   Cap estat mou ni redimensiona el control (M1): premut = el to s'enfosqueix.
   Les famílies de control que ja existien (xips, paginadors, fletxes) es
   llisten aquí perquè comparteixin el mateix comportament. */

/* Premut: una capa fosca per sobre del farciment, dins la mateixa forma
   esbiaixada. Va a ::before i a ::after perquè en hover el farciment (::after)
   tapa del tot el fons (::before), i en tàctil (sense hover) només hi ha el fons. */
.btn:active::before, .btn:active::after { box-shadow: inset 0 0 0 100vmax rgba(0,0,0,.1); }
.btn.light:active::before {
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 100vmax rgba(0,0,0,.08), 0 10px 24px rgba(0,0,0,.18);
}

/* Desactivat: opacitat única, cursor de no-permès i cap efecte de hover. Les
   regles de hover del component .ctl ja exclouen :disabled; els .btn i els
   xips no. */
:where(.btn, .pk-chip, .ctl):is(:disabled, [aria-disabled="true"]) { opacity: .45; }
/* El cursor va amb especificitat normal: amb :where() (0) perdia contra el
   «cursor: pointer» de cada component i el botó desactivat mostrava la mà. */
.btn:is(:disabled, [aria-disabled="true"]),
.pk-chip:is(:disabled, [aria-disabled="true"]),
.ctl:is(:disabled, [aria-disabled="true"]) { cursor: not-allowed; }
.btn:is(:disabled, [aria-disabled="true"]):hover { color: var(--btn-fg); }
.btn:is(:disabled, [aria-disabled="true"]):hover::after { opacity: 0; }
.btn.light:is(:disabled, [aria-disabled="true"]):hover::before { box-shadow: none; border-color: var(--btn-bd); }
.btn:is(:disabled, [aria-disabled="true"]):active::before,
.btn:is(:disabled, [aria-disabled="true"]):active::after { box-shadow: none; }
.pk-chip:is(:disabled, [aria-disabled="true"]):hover { border-color: var(--line-strong); color: var(--mute); }

/* ─── Component de control .ctl (K1) ─────────────────────────────────────────
   Un sol component per a fletxes i paginadors (abans: era-nav, honors-nav,
   rep-pager__*, cat-pager__* i acts-timeline__arrow, cinc còpies amb formes
   diferents). Rectangle de vora 1px amb la tipografia dels xips. Cap estat no
   mou ni canvia la mida del control (M1): el feedback és color, farciment i vora.
   Les classes antigues es mantenen a l'HTML només com a ganxos (JS, e2e);
   aquí no hi tenen estil.
     .ctl            base (text, o text + glif)
     .ctl--icon      només glif, quadrat
     .ctl--num       número de pàgina: sense vora fins que és l'actiu
     .ctl--dark      per a fons fosc (or suau)
     [aria-current] o .is-active   l'element actual, ple de granat
     .ctl__glyph     glif de fletxa (svg 14px, stroke currentColor)           */
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 40px; min-height: 40px; padding: 10px 16px; box-sizing: border-box;
  font-family: var(--ff-ui); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; line-height: 1.2;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 0;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease,
              background-color var(--dur-fast) ease, opacity var(--dur-fast) ease;
}
.ctl__glyph, .ctl svg { flex: 0 0 auto; width: 14px; height: 14px; }
.ctl--icon { padding: 0; width: 40px; }
.ctl--num {
  font-size: 14px; letter-spacing: 0; text-transform: none; padding: 0 6px;
  border-color: transparent; color: var(--mute);
}
@media (hover: hover) {
  .ctl:hover:where(:not(:disabled):not([aria-disabled="true"]):not(.is-active):not([aria-current])) { border-color: var(--burgundy); color: var(--burgundy); }
  .ctl--num:hover:where(:not(:disabled):not([aria-disabled="true"]):not(.is-active):not([aria-current])) { border-color: transparent; }
  .ctl--dark:hover:where(:not(:disabled):not([aria-disabled="true"]):not(.is-active):not([aria-current])) {
    background: var(--gold-soft); border-color: var(--gold-soft); color: var(--burgundy-ink);
  }
}
.ctl:active:where(:not(:disabled):not([aria-disabled="true"]):not(.is-active):not([aria-current])) {
  background: color-mix(in oklch, var(--burgundy) 12%, transparent);
}
.ctl--dark {
  border-color: rgba(245,213,166,.55); /* 3,5:1 o més: és l'únic indicador del botó (1.4.11) */
  color: var(--gold-soft);
}
.ctl--dark:focus-visible { outline-color: var(--gold-soft); }
.ctl--dark:active:where(:not(:disabled):not([aria-disabled="true"]):not(.is-active):not([aria-current])) {
  background: var(--gold); border-color: var(--gold); color: var(--burgundy-ink);
}
.ctl:is(.is-active, [aria-current]) { background: var(--burgundy); border-color: var(--burgundy); color: #fff; font-weight: 600; }
.ctl:is(.is-active, [aria-current]):active { background: var(--burgundy-dark); }
@media (max-width: 560px) {
  .ctl:not(.ctl--num):not(.ctl--icon) { padding-inline: 12px; }
}

/* H1: en tàctil, els controls independents arriben als 44 px. Només
   min-height/min-width: la mida visual en ratolí no canvia. Un sol lloc per a
   el component, els xips i el selector d'idioma. */
@media (pointer: coarse) {
  .pk-chip, .ctl, .lang button { min-height: 44px; }
  .ctl, .lang button { min-width: 44px; }
  .ctl--icon { width: 44px; }
}

/* Premut als xips: un to de granat suau; l'actiu s'enfosqueix. */
.pk-chip:active:not(:disabled) { background: color-mix(in oklch, var(--burgundy) 12%, transparent); }
.pk-chip.is-active:active { background: var(--burgundy-dark); }

/* ─── 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;
  /* 24x24 mínim (WCAG 2.5.8) sense engrandir el glif: l'àrea creix amb el flex. */
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; min-height: 24px;
  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;
}

/* ── El compte ─────────────────────────────────────────────────────────────
   Sense sessió, una paraula amb el mateix pes que la resta de la barra d'utilitats.
   Amb sessió, el cercle d'inicials: és l'única cosa de la barra que va plena de
   granat, perquè l'estat de sessió s'ha de poder llegir de reüll i sense llegir. */
/* A plena tinta i amb un filet al davant: sense separar-lo, «Socis» s'enganxa a
   CA/ES/EN i es llegeix com un quart idioma. */
.nav-compte__entra {
  color: inherit; padding: 4px 0 4px 15px; margin-left: 2px; position: relative;
  transition: color .2s;
}
.nav-compte__entra::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 15px; background: currentColor; opacity: .25;
}
.nav-compte__entra:hover { color: var(--burgundy); }
.nav.hero-mode:not(.scrolled) .nav-compte__entra:hover { color: var(--gold-soft); }
.nav-compte { position: relative; display: flex; }
.nav-compte__avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--burgundy); color: #fff;
  font-family: var(--ff-ui); font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.nav-compte__avatar:hover, .nav-compte__avatar.open { background: var(--burgundy-dark); }
.nav.hero-mode:not(.scrolled) .nav-compte__avatar { box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.nav-compte__menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 70; min-width: 232px;
  background: var(--paper); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.12);
  padding: 4px 0; text-transform: none; letter-spacing: 0;
}
.nav-compte__qui {
  padding: 12px 16px 13px; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.nav-compte__qui strong { font-family: var(--ff-body); font-size: 14px; font-weight: 600; color: var(--ink); }
.nav-compte__qui span { font-family: var(--ff-mono); font-size: 11px; color: var(--mute); }
.nav-compte__menu a, .nav-compte__menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font-family: var(--ff-body); font-size: 14px; color: var(--ink);
  padding: 11px 16px; transition: background .15s, color .15s;
}
.nav-compte__menu a:hover, .nav-compte__menu button:hover { background: var(--cream); color: var(--burgundy); }
.nav-compte__menu button { border-top: 1px solid color-mix(in oklch, var(--line) 60%, transparent); color: var(--mute); }

.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);
}
/* L'accés de socis no és una secció del web: va a part i més avall, en el cos
   de la interfície i no en el de titulars. */
.mobile-menu a.mm-compte {
  font-family: var(--ff-ui); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.72); border-bottom: 0; margin-top: 26px; padding: 0;
}
/* El cercador, a dalt de tot del menú: és el que més serveix a qui no sap on és
   una cosa, i en mòbil la lupa de la barra no hi cap. */
.mobile-menu .mm-cerca {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.28); border-radius: 4px;
  color: rgba(255,255,255,.9); font-family: var(--ff-ui); font-size: 16px; text-align: left;
  padding: 15px 16px; margin: 0 0 18px; cursor: pointer;
}
.mobile-menu .mm-cerca:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.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;
}

/* ─── 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; } }
/* El PNG és quadrat (400×400) però el dibuix només n'ocupa el rectangle 22,87 → 373,304:
   ~46 px transparents sota el rètol, ~42 a sobre i ~10 a l'esquerra. Es retalla a
   la caixa del dibuix (104 px d'alt a 192 d'ample) perquè la distància al títol i
   l'alineació amb el text siguin les del dibuix, no les del full transparent. */
.foot-brand img {
  display: block; width: 192px; height: 104px;
  object-fit: cover; object-position: 50% 47.5%;
  margin: 0 0 20px -10px;
  filter: brightness(0) invert(1);
}
.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-contact a {
  color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35);
  text-underline-offset: 3px; transition: color .18s, text-decoration-color .18s;
}
.foot-contact a:hover { color: #fff; text-decoration-color: currentColor; }
.foot-contact a:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; border-radius: 2px; }
.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; } }
