@import url("../fonts/fonts.css");

/* ============================================================
   AE SIGALTAS · sistema visual
   Base fosca amb el taronja del club (#E08300) com a únic accent.
   Display condensat (Barlow Condensed) per als titulars, Inter per al text.
   ============================================================ */

:root {
  --ink:        #0E1013;
  --ink-2:      #16191E;
  --ink-3:      #1E232A;
  --paper:      #FFFFFF;
  --paper-2:    #F4F5F7;
  --text:       #F2F3F5;
  --text-mute:  #A2A8B2;
  --text-dark:  #12151A;
  --text-dark-mute: #5A626E;
  --accent:     #E08300;
  --accent-hi:  #F59A1F;
  --line:       rgba(255, 255, 255, 0.10);
  --line-dark:  rgba(18, 21, 26, 0.12);

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap: 1200px;
  --gut: clamp(20px, 5vw, 56px);
  /* Alçada del header · la subnav s'hi enganxa just a sota */
  --headerh: 92px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

/* ---------- Tipografia ---------- */
.display {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.94;
  letter-spacing: -0.005em;
  margin: 0;
}
h1.display { font-size: clamp(2.75rem, 8vw, 6rem); }
h2.display { font-size: clamp(2rem, 5vw, 3.5rem); }
h3.display { font-size: clamp(1.4rem, 2.6vw, 2rem); }

.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.9rem;
  color: var(--accent);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--accent);
  flex: none;
}

.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.6; color: var(--text-mute); }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 16, 19, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--headerh);
}
.nav__logo { flex: none; margin-right: auto; display: flex; align-items: center; }
.nav__logo img { height: 64px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 1.02rem;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .16s, border-color .16s;
  white-space: nowrap;
}
.nav__links a:hover { color: var(--accent-hi); }
.nav__links a[aria-current="page"] { border-bottom-color: var(--accent); }
/* CTA "Accés Soci" dins el menú: només al desplegable mòbil (a l'escriptori ja hi ha el botó del header) */
.nav__links > .nav__cta-m { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1.02rem;
  padding: 12px 24px;
  border-radius: 3px;
  text-decoration: none;
  border: 2px solid transparent;
  /* Sense això, un <button class="btn"> agafa el fons gris/blanc del navegador
     i el text clar hi desapareix (els <a> no tenien el problema). */
  background: transparent;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); color: #14161A; }
.btn--accent:hover { background: var(--accent-hi); }
/* Botó secundari: només vora i text en taronja, sense farciment. */
.btn--ghost { border-color: var(--accent); color: var(--accent); }
.btn--ghost:hover { border-color: var(--accent-hi); color: var(--accent-hi); background: rgba(255,255,255,.05); }
.btn--dark { background: var(--ink); color: var(--text); }
.btn--dark:hover { background: var(--ink-3); }
.btn--sm { padding: 9px 17px; font-size: 0.94rem; }

.nav__burger {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
}
.nav__burger svg { display: block; }

@media (max-width: 1000px) {
  .nav__links, .nav .btn { display: none; }
  .nav__burger { display: block; }
  .nav__links.is-open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gut) 22px;
  }
  .nav__links.is-open li { width: 100%; }
  .nav__links.is-open a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
  .nav__links.is-open > .nav__cta-m { display: block; }
  .nav__links.is-open .btn { display: inline-flex; margin-top: 16px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; }
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(14,16,19,.62) 0%, rgba(14,16,19,.42) 38%, rgba(14,16,19,.96) 100%),
    linear-gradient(90deg, rgba(14,16,19,.78) 0%, rgba(14,16,19,.12) 68%);
}
.hero__inner {
  min-height: min(84vh, 760px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 120px;
  padding-bottom: clamp(48px, 8vw, 96px);
}
.hero__title { max-width: 16ch; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__sub { max-width: 52ch; margin-top: 24px; font-size: clamp(1.05rem, 1.7vw, 1.35rem); color: #D7DAE0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* ---------- Hero en carrusel (home) ----------
   Les diapositives comparteixen una sola cel·la de grid: totes s'hi apilen i
   l'alçada del hero la marca la més alta, sense posicionar res en absolut.
   La que no es veu queda `visibility: hidden` perquè els seus enllaços no
   siguin tabulables. */
.hero--slider .hero__slides { display: grid; }
.hero--slider .hero__slide {
  grid-area: 1 / 1;
  position: relative; isolation: isolate;
  opacity: 0; visibility: hidden;
  transition: opacity .7s var(--ease, ease), visibility .7s;
}
.hero--slider .hero__slide.is-on { opacity: 1; visibility: visible; }
/* El vel fosc viatja amb la imatge, no amb la secció: cada diapositiva té la
   seva (és el mateix degradat que el hero d'una sola imatge). */
.hero--slider .hero__slide::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(14,16,19,.62) 0%, rgba(14,16,19,.42) 38%, rgba(14,16,19,.96) 100%),
    linear-gradient(90deg, rgba(14,16,19,.78) 0%, rgba(14,16,19,.12) 68%);
}
.hero--slider::after { display: none; } /* el vel ja el posa cada diapositiva */

/* El text entra amb la diapositiva · només un pèl, prou per notar el canvi */
.hero--slider .hero__slide .hero__inner > * {
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.hero--slider .hero__slide.is-on .hero__inner > * { opacity: 1; transform: none; }
.hero--slider .hero__slide.is-on .hero__inner > *:nth-child(2) { transition-delay: .06s; }
.hero--slider .hero__slide.is-on .hero__inner > *:nth-child(3) { transition-delay: .12s; }
.hero--slider .hero__slide.is-on .hero__inner > *:nth-child(4) { transition-delay: .18s; }

.hero__nav {
  position: absolute; left: 0; right: 0;
  /* Just sota el header enganxat: són el sumari del hero i han de veure's
     d'entrada, no trobar-se al final baixant. */
  top: calc(var(--headerh) + 14px);
  display: flex; justify-content: center;
  z-index: 5;
}
.hero__dots { display: flex; gap: 8px; flex-wrap: wrap; }
.hero__dot {
  border: 1px solid rgba(255,255,255,.28); background: rgba(14,16,19,.35);
  color: #D7DAE0; border-radius: 999px; cursor: pointer;
  padding: 7px 14px; font: inherit; font-size: .8rem; line-height: 1;
  letter-spacing: .04em; text-transform: uppercase;
  transition: background .25s, color .25s, border-color .25s;
  backdrop-filter: blur(4px);
}
.hero__dot:hover { border-color: var(--accent); color: #fff; }
.hero__dot.is-on { background: var(--accent); border-color: var(--accent); color: #14161A; font-weight: 600; }

/* A mòbil el text del botó no hi cap: es queden com a punts. */
@media (max-width: 640px) {
  .hero__dot { padding: 0; width: 9px; height: 9px; }
  .hero__dot span { display: none; }
}

/* Hero compacte per a pàgines interiors */
.hero--page .hero__inner { min-height: min(52vh, 460px); padding-top: 96px; }
/* Hero amb el focus una mica més amunt que la resta (que van al 32%): la banda
   que interessa és la de les mans i el ganivet, no el taulell. */
.hero--centrat .hero__media img { object-position: center 38%; }

/* ---------- Seccions ---------- */
/* Amb dues barres enganxades a dalt, el salt d'àncora ha de deixar-hi lloc. */
[id] { scroll-margin-top: calc(var(--headerh) + 60px); }
.section { padding: clamp(64px, 9vw, 118px) 0; }
.section--light { background: var(--paper); color: var(--text-dark); }
.section--light .lede { color: var(--text-dark-mute); }
.section--light .eyebrow { color: #A85F00; }
.section--light .eyebrow::before { background: #A85F00; }
.section--tint { background: var(--ink-2); }

.section__head { max-width: 720px; margin-bottom: clamp(34px, 5vw, 56px); }
.section__head p { margin-top: 18px; }

.two-col {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.two-col--flip .two-col__media { order: -1; }
@media (max-width: 860px) { .two-col--flip .two-col__media { order: 0; } }

.figure { position: relative; }
.figure img { border-radius: 4px; width: 100%; }
.figure--tall img { aspect-ratio: 4/5; object-fit: cover; }
.figure--wide img { aspect-ratio: 16/10; object-fit: cover; }
.figure::before {
  content: "";
  position: absolute;
  left: -14px; bottom: -14px;
  width: 96px; height: 96px;
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
}

/* ---------- Targetes d'àrea ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 20px; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: var(--ink-3);
  isolation: isolate;
}
.card img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(14,16,19,.20) 0%, rgba(14,16,19,.55) 52%, rgba(14,16,19,.94) 100%);
}
.card:hover img { transform: scale(1.05); }
.card__body { margin-top: auto; padding: 28px 26px; }
.card__kicker {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 0.82rem; color: var(--accent); display: block; margin-bottom: 8px;
}
.card__body p { margin: 10px 0 0; font-size: 0.98rem; color: #CFD3DA; }
.card__more {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 0.95rem; color: var(--text);
}
.card:hover .card__more { color: var(--accent-hi); }

/* ---------- Valors ---------- */
.values {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.values div {
  padding: clamp(26px, 4vw, 44px) 14px;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: clamp(1rem, 2vw, 1.6rem);
  border-right: 1px solid var(--line);
}
.values div:last-child { border-right: 0; }
.values div:nth-child(odd) { color: var(--accent); }
@media (max-width: 760px) {
  .values { grid-template-columns: repeat(2, 1fr); }
  .values div { border-bottom: 1px solid var(--line); }
  .values div:nth-child(5) { grid-column: 1 / -1; border-right: 0; }
}

/* ---------- Xifres ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px; }
.stat { background: var(--ink-2); padding: 34px 26px; border-radius: 3px; }
.section--light .stat { background: var(--paper-2); }
.stat b {
  display: block; font-family: var(--display); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; color: var(--accent);
}
.stat span {
  display: block; margin-top: 10px; font-size: 0.92rem;
  text-transform: uppercase; letter-spacing: 0.11em; color: var(--text-mute);
}
.section--light .stat span { color: var(--text-dark-mute); }

/* ---------- Notícies ---------- */
.news { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.news__item { display: flex; flex-direction: column; }
.news__item img { border-radius: 4px; aspect-ratio: 16/10; object-fit: cover; }
.news__item h3 { margin: 20px 0 10px; }
.news__item p { color: var(--text-mute); font-size: 1rem; }
.section--light .news__item p { color: var(--text-dark-mute); }

/* ---------- Cronologia ---------- */
.timeline { position: relative; margin: 0; padding: 0 0 0 34px; list-style: none; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line-dark);
}
.section--tint .timeline::before, .section:not(.section--light) .timeline::before { background: var(--line); }
.timeline li { position: relative; padding-bottom: 44px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -34px; top: 9px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(224,131,0,.18);
}
.timeline time {
  display: block; font-family: var(--display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.9rem;
  color: var(--accent); margin-bottom: 6px;
}
.timeline h3 { margin: 0 0 10px; }
.timeline p { color: var(--text-mute); }
.section--light .timeline p { color: var(--text-dark-mute); }

/* ---------- Llistes de contingut ---------- */
.tick { list-style: none; margin: 0; padding: 0; }
.tick li { position: relative; padding-left: 30px; margin-bottom: 13px; }
.tick li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 12px; height: 2px; background: var(--accent);
}

.prose h3 { margin: 40px 0 14px; }
.prose h3:first-child { margin-top: 0; }
.prose { max-width: 74ch; }

/* ---------- Programes (4 en una sola línia) ---------- */
/* Quatre blocs sempre a la mateixa fila a escriptori; 2+2 a tauleta i 1 al mòbil.
   Els números fan de guia visual i donen ritme sense afegir text. */
.progs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.prog {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 26px 22px 24px;
  transition: transform .16s;
}
.prog:hover { transform: translateY(-3px); }
.prog__num {
  display: block;
  font-family: var(--display); font-weight: 700; font-size: 2.4rem; line-height: 1;
  color: var(--accent); opacity: .5; margin-bottom: 12px;
}
.prog h3 { margin: 0; font-size: 1.25rem; }
.prog p { margin: 10px 0 0; font-size: 0.95rem; color: var(--text-mute); }
.section--light .prog { background: var(--paper-2); border-color: var(--line-dark); border-top-color: var(--accent); }
.section--light .prog p { color: var(--text-dark-mute); }
@media (max-width: 1000px) { .progs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .progs { grid-template-columns: 1fr; } }

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: clamp(26px, 4vw, 40px);
}
.section--light .panel { background: var(--paper-2); border-color: var(--line-dark); border-left-color: var(--accent); }

/* ---------- CTA ---------- */
.cta { text-align: center; }
.cta .display { margin-bottom: 20px; }
.cta .lede { margin: 0 auto 32px; max-width: 60ch; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- Peu ---------- */
.site-footer { background: #0A0C0E; border-top: 1px solid var(--line); padding: 64px 0 34px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 44px; }
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr; gap: 32px; } }
.site-footer img { height: 56px; width: auto; margin-bottom: 18px; }
.site-footer h4 {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 0.92rem; color: var(--accent); margin: 0 0 14px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--text-mute); text-decoration: none; }
.site-footer a:hover { color: var(--accent-hi); }
.site-footer p { color: var(--text-mute); font-size: 0.96rem; }
.footer__bar {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 0.87rem; color: #6F757F;
}

/* ---------- Accessibilitat ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #14161A; padding: 12px 20px;
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
}
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent-hi); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
   DADES EN DIRECTE DEL CLUB · rosters, calendari i resultats
   Els pinta assets/js/club.js des de /api/public/club/site.
   ============================================================ */
.empty {
  padding: 26px 0;
  color: var(--text-mute);
  font-size: 1rem;
}
.section--light .empty { color: var(--text-dark-mute); }

/* ---------- Rosters ---------- */
#roster { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.team {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 24px 24px 12px;
}
.section--light .team { background: var(--paper-2); border-color: var(--line-dark); border-top-color: var(--accent); }
.team__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.team__head h3 { margin: 0; }
.team__count {
  margin-left: auto; font-family: var(--display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; color: var(--text-mute);
}
.section--light .team__count { color: var(--text-dark-mute); }
.team__desc { margin: 10px 0 0; font-size: 0.96rem; color: var(--text-mute); }
.section--light .team__desc { color: var(--text-dark-mute); }

.roster { list-style: none; margin: 16px 0 0; padding: 0; }
.roster li {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.section--light .roster li { border-top-color: var(--line-dark); }
.roster__num {
  flex: none; width: 34px; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  color: var(--accent);
}
.roster__foto {
  flex: none;
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink-3);
  border: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.section--light .roster__foto { background: var(--paper-2); border-color: var(--line-dark); color: var(--text-dark-mute); }
/* La foto tapa les inicials; si no carrega, les inicials ja hi són a sota. */
.roster__foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.roster__nom { font-weight: 500; }
.roster__rol {
  margin-left: auto; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-mute);
}
.section--light .roster__rol { color: var(--text-dark-mute); }
.roster__buit { color: var(--text-mute); font-size: .95rem; }

/* ---------- Hall of Fame (dorsals retirats) ---------- */
/* Amplada topada a 220px: amb poques llegendes les targetes verticals no s'han
   d'estirar, o cada imatge 2:3 faria gairebé un metre d'alt. Al mòbil en caben 2. */
#halloffame { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 220px)); gap: 18px; }
.hof {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 28px 20px 24px;
  overflow: hidden;
}
/* El dorsal, gegant i molt tènue, fa de fons de la targeta. */
.hof__num {
  position: absolute; top: -18px; right: 6px;
  font-family: var(--display); font-weight: 700; font-size: 7rem; line-height: 1;
  color: var(--accent); opacity: .13; pointer-events: none;
}
.hof__foto {
  position: relative;
  width: 92px; height: 92px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--ink-3); border: 2px solid var(--accent);
  font-family: var(--display); font-weight: 700; font-size: 1.5rem;
  color: var(--text-mute); text-transform: uppercase;
}
.hof__foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hof__nom { margin: 14px 0 0; font-size: 1.15rem; }
.hof__esport {
  margin: 4px 0 0;
  font-family: var(--display); font-weight: 700; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.hof__nota { margin: 8px 0 0; font-size: .9rem; color: var(--text-mute); }
.section--light .hof { background: var(--paper-2); border-color: var(--line-dark); border-top-color: var(--accent); }
.section--light .hof__nota { color: var(--text-dark-mute); }

/* Amb imatge de fons: targeta vertical (la imatge és 2:3) i la foto i el nom
   baixen al peu, sobre un degradat fosc que els fa llegibles. */
.hof--fons { aspect-ratio: 2 / 3; justify-content: flex-end; padding: 14px 12px 16px; background: #000; }
.hof__fons { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hof--fons::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.94) 0%, rgba(0,0,0,.6) 32%, rgba(0,0,0,0) 58%);
}
.hof--fons > :not(.hof__fons) { position: relative; z-index: 1; }
/* La cara, gran: la meitat de la targeta. Queda just sota el "MATARÓ" de la samarreta. */
.hof--fons .hof__foto { width: 52%; height: auto; aspect-ratio: 1; font-size: 1.6rem; border-width: 3px; }
.hof--fons .hof__nom { margin-top: 10px; font-size: 1rem; color: #fff; }
.hof--fons .hof__nota { color: rgba(255,255,255,.75); }
.section--light .hof--fons { background: #000; }
.section--light .hof--fons .hof__nota { color: rgba(255,255,255,.75); }

/* ---------- Junta directiva (pàgina de l'associació) ---------- */
/* Targetes amb la cara rodona: 4 per fila a escriptori, 2 al mòbil. */
#junta-membres, .junta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 700px) { #junta-membres, .junta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
/* Càrrecs interns · segon nivell, separat de la junta i amb títol més petit. */
.junta__sub { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--line); }
.junta__sub h3 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0; }
.junta {
  text-align: center;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 24px 14px 20px;
}
.junta__foto {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 140px; aspect-ratio: 1; margin: 0 auto;
  border-radius: 50%; overflow: hidden;
  background: var(--ink-3); border: 3px solid var(--accent);
  font-family: var(--display); font-weight: 700; font-size: 2.4rem;
  color: var(--text-mute); text-transform: uppercase;
}
.junta__foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Nom sencer i en una sola línia: si no hi cap, club.js (ajustaNoms) li redueix la lletra. */
.junta__nom { margin: 12px 0 0; font-size: .7rem; letter-spacing: .01em; line-height: 1.25; white-space: nowrap; overflow: hidden; }
@media (max-width: 700px) { .junta__nom { font-size: .66rem; } }
.junta__carrec {
  margin: 4px 0 0;
  font-family: var(--display); font-weight: 700; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}

/* ---------- Àrea Social · esdeveniments de l'associació ---------- */
/* Cada acte és una banda foto + text que alterna de costat: dona ritme a una
   llista que pot ser llarga sense necessitar cap separador. */
#social { display: flex; flex-direction: column; gap: 40px; }
.acte {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.acte--flip .acte__media { order: 2; }
.acte__media { border-radius: 4px; overflow: hidden; }
.acte__media img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; display: block; }
.acte__sensefoto {
  aspect-ratio: 3 / 2; background: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px;
}
.acte__cos h3 { margin: 6px 0 0; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.acte__lloc { margin: 6px 0 0; font-size: .92rem; color: var(--text-mute); }
.acte__text { margin-top: 14px; }
.acte__text p { margin: 0 0 10px; color: var(--text-mute); }
.acte__galeria { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.acte__galeria img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 3px;
  border: 1px solid var(--line); transition: transform .16s;
}
.acte__galeria a:hover img { transform: scale(1.05); }
.section--light .acte__text p, .section--light .acte__lloc { color: var(--text-dark-mute); }
@media (max-width: 760px) {
  .acte { grid-template-columns: 1fr; gap: 16px; }
  .acte--flip .acte__media { order: 0; }
}

/* ---------- Últim resultat per equip ---------- */
/* Una targeta per equip, amb el marcador com a element dominant. La franja de
   dalt diu com va anar sense haver de llegir els números. */
.ultims {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.ultims__titol {
  grid-column: 1 / -1; margin: 0;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .14em; font-size: .78rem; color: var(--text-mute);
}
.ultim {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px 16px;
}
.ultim.win { border-top-color: #4ec97f; }
.ultim.loss { border-top-color: #e56a6a; }
.ultim.draw { border-top-color: var(--accent); }
.ultim__cap { display: flex; align-items: baseline; gap: 10px; }
.ultim__equip {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.ultim__tag {
  margin-left: auto;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; font-size: .7rem; color: var(--text-mute);
}
.ultim.win .ultim__tag { color: #7ee2a8; }
.ultim.loss .ultim__tag { color: #ff9d9d; }
.ultim__marcador {
  display: flex; align-items: baseline; gap: 10px; margin: 10px 0 8px;
  font-family: var(--display); font-weight: 700; line-height: 1;
}
.ultim__gols { font-size: 3rem; }
.ultim__sep { font-size: 1.6rem; color: var(--text-mute); }
.ultim__rival { display: flex; align-items: center; gap: 8px; font-size: .96rem; }
.ultim__rival img { width: 24px; height: 24px; object-fit: contain; }
.ultim__meta { font-size: .82rem; color: var(--text-mute); margin-top: 6px; }
.section--light .ultim { background: var(--paper-2); border-color: var(--line-dark); }
.section--light .ultim__meta, .section--light .ultim__tag { color: var(--text-dark-mute); }

/* ---------- Segments (Propers / Resultats) ---------- */
.segments { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; }
.segments__btn {
  border: 0; background: none; cursor: pointer;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; font-size: .9rem; color: var(--text-mute);
  padding: 8px 20px; border-radius: 999px;
  transition: background .16s, color .16s;
}
.segments__btn:hover { color: var(--text); }
.segments__btn.is-on { background: var(--accent); color: #14161A; }
.section--light .segments { background: var(--paper-2); border-color: var(--line-dark); }
.section--light .segments__btn { color: var(--text-dark-mute); }
.section--light .segments__btn.is-on { color: #14161A; }

/* ---------- Calendari ---------- */
#calendari { display: flex; flex-direction: column; gap: 12px; }
/* Els blocs de Partits s'amaguen amb l'atribut hidden; sense això el
   `display:flex` de l'ID guanyaria la regla del navegador i no s'amagaria mai. */
[hidden] { display: none !important; }
.match {
  display: flex; align-items: center; gap: 20px;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 16px 20px;
}
.section--light .match { background: var(--paper-2); border-color: var(--line-dark); }
.match__date {
  flex: none; width: 62px; text-align: center;
  border-right: 1px solid var(--line); padding-right: 16px;
}
.section--light .match__date { border-right-color: var(--line-dark); }
.match__date b {
  display: block; font-family: var(--display); font-weight: 700;
  font-size: 2rem; line-height: 1; color: var(--accent);
}
.match__date span {
  display: block; font-size: 0.76rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--text-mute); margin-top: 3px;
}
.match__main { min-width: 0; }
.match__teams { margin: 0; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.3rem; line-height: 1.1; }
.match__vs { color: var(--accent); }
.match__meta { margin: 5px 0 0; font-size: 0.88rem; color: var(--text-mute); }
.section--light .match__meta { color: var(--text-dark-mute); }
.match__tag {
  margin-left: auto; flex: none;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 0.78rem;
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-mute);
}
.section--light .match__tag { border-color: var(--line-dark); color: var(--text-dark-mute); }
@media (max-width: 620px) {
  .match { flex-wrap: wrap; gap: 14px; }
  .match__tag { margin-left: 0; }
}

/* ---------- Resultats ---------- */
.season { margin-bottom: 42px; }
.season:last-child { margin-bottom: 0; }
.season__title {
  padding-bottom: 10px; margin: 0 0 6px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.result {
  display: grid;
  grid-template-columns: 88px 1fr auto 150px;
  align-items: center; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.section--light .result { border-bottom-color: var(--line-dark); }
.result__date {
  font-family: var(--display); text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.86rem; color: var(--text-mute);
}
.section--light .result__date { color: var(--text-dark-mute); }
.result__teams { font-weight: 500; }
.result__teams em { font-style: normal; color: var(--accent); padding: 0 4px; }
.result__score {
  font-family: var(--display); font-weight: 700; font-size: 1.5rem;
  letter-spacing: 0.02em; padding: 2px 12px; border-radius: 3px;
  background: var(--ink-3); min-width: 92px; text-align: center;
}
.section--light .result__score { background: #E8EAEE; }
.result.win  .result__score { background: rgba(47,125,79,.22); color: #6FD79A; }
.result.loss .result__score { background: rgba(192,57,43,.18); color: #F09287; }
.result.draw .result__score { background: rgba(224,131,0,.20); color: var(--accent-hi); }
.section--light .result.win  .result__score { background: rgba(47,125,79,.16); color: #1F6B3C; }
.section--light .result.loss .result__score { background: rgba(192,57,43,.13); color: #A32A1D; }
.section--light .result.draw .result__score { background: rgba(224,131,0,.16); color: #A85F00; }
.result__comp { font-size: 0.84rem; color: var(--text-mute); text-align: right; }
.section--light .result__comp { color: var(--text-dark-mute); }
@media (max-width: 760px) {
  .result { grid-template-columns: 1fr auto; grid-template-areas: "date score" "teams score" "comp score"; gap: 4px 16px; }
  .result__date { grid-area: date; }
  .result__teams { grid-area: teams; }
  .result__score { grid-area: score; align-self: center; }
  .result__comp { grid-area: comp; text-align: left; }
}

/* ============================================================
   Zona de socis (soci.js) · formularis d'entrada i la zona de dins
   ============================================================ */
.wrap--estret { max-width: 720px; }

.formcard {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: clamp(22px, 3vw, 32px);
  display: flex; flex-direction: column; gap: 14px;
}
.formcard .btn { align-self: flex-start; }
.camp { display: flex; flex-direction: column; gap: 6px; }
.camp > span {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; font-size: .78rem; color: var(--text-mute);
}
.camp input {
  font: inherit; color: var(--text);
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 11px 13px;
  width: 100%;
}
.camp input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.camp input:disabled { opacity: .55; cursor: not-allowed; }
.camps2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 560px) { .camps2 { grid-template-columns: 1fr; } }
.formcard__err { margin: 0; color: #ff8f8f; font-size: .92rem; }
.formcard__ok { margin: 0; color: var(--accent-hi); font-size: .92rem; }
.formcard__peu { margin: 0; font-size: .88rem; color: var(--text-mute); }
.formcard__peu a { color: var(--accent-hi); }

.perfil { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: start; }
@media (max-width: 720px) { .perfil { grid-template-columns: 1fr; justify-items: center; } }
.perfil__foto { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.perfil__foto .hof__foto { width: 140px; height: 140px; font-size: 2.2rem; }
.perfil__btnfoto { cursor: pointer; }
.perfil__accions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Partits del soci · la targeta duu la data, el rival i la convocatòria */
.partits { display: flex; flex-direction: column; gap: 12px; }
.partit {
  display: flex; align-items: center; gap: 18px;
  background: var(--ink-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px; padding: 14px 18px;
}
.partit--jugat { border-left-color: var(--line); opacity: .82; }
.partit__data {
  flex: none; width: 52px; text-align: center; line-height: 1.05;
  font-family: var(--display);
}
.partit__data b { display: block; font-size: 1.7rem; }
.partit__data span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); }
.partit__cos { flex: 1; min-width: 0; }
.partit__rival { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.partit__escut { width: 26px; height: 26px; object-fit: contain; }
.partit__meta { font-size: .86rem; color: var(--text-mute); margin-top: 4px; }
.partit__marcador { font-family: var(--display); font-weight: 700; font-size: 1.4rem; white-space: nowrap; }
.partit__conv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.partit__pagament { flex-basis: 100%; font-size: .82rem; color: var(--text-mute); }

.tag {
  display: inline-flex; align-items: center;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; font-size: .74rem;
  padding: 4px 10px; border-radius: 999px;
  background: var(--ink-3); color: var(--text-mute); border: 1px solid var(--line);
}
.tag--ok { background: rgba(80, 200, 120, .16); color: #7ee2a8; border-color: rgba(80, 200, 120, .4); }
.tag--no { background: rgba(230, 90, 90, .16); color: #ff9d9d; border-color: rgba(230, 90, 90, .4); }

/* El propi soci, destacat dins la llista de l'equip */
.roster__jo { background: rgba(255, 255, 255, .04); }
.roster__jo .roster__nom { color: var(--accent-hi); }

/* ============================================================
   Modals que bloquegen (consentiment legal i alta de la fitxa)
   No es tanquen: no hi ha creu ni clic fora. Són una porta, no un avís.
   ============================================================ */
body.modal-obert { overflow: hidden; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 9, 11, .82);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(16px, 5vh, 56px) var(--gut);
  overflow-y: auto;
}
.modal__caixa {
  width: 100%; max-width: 680px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: clamp(22px, 4vw, 38px);
}
.modal__caixa > h2 { margin: 0 0 10px; }
.modal__intro { margin: 0 0 20px; color: var(--text-mute); }
.modal__peu { margin: 14px 0 0; font-size: .82rem; color: var(--text-mute); }
.modal__falten {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 3px;
  background: rgba(255, 176, 0, .12); border: 1px solid rgba(255, 176, 0, .35);
  font-size: .9rem;
}
.modal .btn { width: 100%; justify-content: center; }
.modal .btn:disabled { opacity: .4; cursor: not-allowed; }

/* Un document del paquet legal · plegat per defecte */
.legaldoc {
  border: 1px solid var(--line); border-radius: 3px;
  margin-bottom: 8px; background: var(--ink-3);
}
.legaldoc summary {
  cursor: pointer; padding: 13px 16px; list-style: none;
  display: flex; flex-direction: column; gap: 2px;
}
.legaldoc summary::-webkit-details-marker { display: none; }
.legaldoc summary::after {
  content: "Llegir-lo ▾"; font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-top: 4px;
}
.legaldoc[open] summary::after { content: "Plegar ▴"; }
.legaldoc__titol { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.legaldoc__curt { font-size: .85rem; color: var(--text-mute); }
.legaldoc__ok {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 4px 4px 16px; font-size: .93rem; cursor: pointer;
}
.legaldoc__ok input { margin-top: 3px; flex: none; width: 17px; height: 17px; accent-color: var(--accent); }

/* Text legal · el mateix estil a la pàgina pública i dins el modal */
.legal { font-size: 1rem; line-height: 1.7; }
.legal h3 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; font-size: 1.05rem; margin: 26px 0 8px; color: var(--accent-hi);
}
.legal h3:first-child { margin-top: 0; }
.legal p, .legal ul { margin: 0 0 12px; color: var(--text-mute); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 5px; }
.legal a { color: var(--accent-hi); }
.legal b { color: var(--text); }
/* Dins el modal el document va en una caixa amb scroll propi: la finestra no
   ha de fer 4.000 píxels perquè algú desplegui els tres. */
.legal--modal {
  max-height: 46vh; overflow-y: auto;
  padding: 0 16px 16px; font-size: .93rem;
  border-top: 1px solid var(--line);
  margin-top: 4px; padding-top: 14px;
}
.footer__legal { display: flex; gap: 16px; flex-wrap: wrap; }
.footer__legal a { color: inherit; text-decoration: none; }
.footer__legal a:hover { color: var(--accent-hi); }

.legal__altres { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 20px; }
.legal__altres h4 {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .1em;
  font-size: .8rem; color: var(--text-mute); margin: 0 0 8px;
}
.legal__altres ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.legal__altres a { color: var(--accent-hi); }

.alta__foto { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.alta__foto .hof__foto { width: 84px; height: 84px; font-size: 1.4rem; }
.alta__foto .btn { width: auto; cursor: pointer; }
.formcard--net { background: none; border: 0; padding: 0; }

/* Avís del dashboard · el que et falta respondre */
.avis {
  border: 1px solid rgba(255, 176, 0, .35);
  background: rgba(255, 176, 0, .07);
  border-radius: 4px; padding: 18px; margin-bottom: 24px;
}
.avis__titol {
  margin: 0 0 12px; font-family: var(--display); font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; color: var(--accent-hi);
}

/* ---------- Visor de fotos (galeria de l'Àrea Social) ---------- */
/* Clicar una foto no se't emporta de la pàgina: s'obre a sobre, amb fletxes,
   Escape i clic al fons per tancar. */
body.visor-obert { overflow: hidden; }
.visor {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(8, 9, 11, .94);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 4vw, 48px);
  gap: 8px;
}
.visor__figura {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.visor__figura img {
  max-width: 100%; max-height: calc(100vh - 140px);
  object-fit: contain; border-radius: 3px;
}
.visor__figura figcaption {
  font-size: .85rem; color: var(--text-mute); text-align: center;
  letter-spacing: .04em;
}
.visor__tanca, .visor__fletxa {
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s, border-color .16s;
}
.visor__tanca:hover, .visor__fletxa:hover { background: rgba(255,255,255,.14); border-color: var(--accent); }
.visor__tanca {
  position: absolute; top: clamp(10px, 2vw, 20px); right: clamp(10px, 2vw, 20px);
  width: 42px; height: 42px; font-size: 1.6rem; line-height: 1;
}
.visor__fletxa { flex: none; width: 48px; height: 48px; font-size: 2rem; line-height: 1; }
@media (max-width: 640px) {
  .visor { padding: 8px; }
  .visor__fletxa { position: absolute; bottom: 18px; width: 54px; height: 54px; }
  .visor__fletxa--prev { left: 18px; }
  .visor__fletxa--next { right: 18px; }
  .visor__figura img { max-height: calc(100vh - 170px); }
}

/* ---------- Sub-navegació d'àrea ---------- */
/* Va just sota el menú principal i s'hi queda enganxada en baixar: és el menú
   de l'àrea, no una secció més de la pàgina. */
.subnav-bar {
  position: sticky;
  top: var(--headerh);
  z-index: 40;
  background: rgba(14, 16, 19, 0.9);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.subnav-bar .subnav { border-bottom: 0; margin-bottom: 0; }
.subnav {
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.section--light .subnav { border-bottom-color: var(--line-dark); }
.subnav a {
  text-decoration: none; padding: 12px 18px;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 1rem; color: var(--text-mute);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav a:hover { color: var(--accent-hi); }
/* Pestanya activa · el subratllat en accent diu on ets */
.subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.section--light .subnav a { color: var(--text-dark-mute); }
@media (max-width: 560px) {
  .subnav { gap: 0; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { padding: 12px 14px; font-size: .92rem; white-space: nowrap; }
}

/* ============================================================
   Carril de partits de la home (games.js) · estil euroleague
   Targetes en fila amb scroll-snap. El carril sagna fins al marge
   de la finestra a mòbil perquè es vegi que hi ha més coses a la
   dreta; a partir de --wrap es queda dins de la caixa.
   ============================================================ */
/* Carril de partits dins la diapositiva de bàsquet del hero · va al peu de la
   diapositiva, sobre un degradat perquè les targetes es llegeixin damunt la foto. */
.hero__rail {
  margin-top: auto;
  padding: 14px 0 18px;
  background: linear-gradient(to top, rgba(10,11,13,.92), rgba(10,11,13,.55) 60%, transparent);
}
.hero__rail .rail-head { align-items: center; margin-bottom: 10px; }
.hero__rail .eyebrow { margin: 0; }
.hero--slider .hero__slide { display: flex; flex-direction: column; }
/* El hero de la home ocupa just la finestra (svh = sense la barra del mòbil):
   així el carril de resultats de la diapositiva de bàsquet entra a la primera
   pantalla i no cal baixar per veure'l. */
.hero--slider .hero__slides { min-height: calc(100vh - var(--headerh)); }
.hero--slider .hero__slides { min-height: calc(100svh - var(--headerh)); } /* svh: sense la barra del mòbil */
.hero--slider .hero__inner {
  min-height: 0;
  flex: 1;
  /* Centrat, no arran de baix: amb el hero a tota la pantalla el text quedava
     enfonsat. Així totes les diapositives el porten a la mateixa alçada, també
     la de bàsquet, que a sota hi té el carril de resultats. */
  justify-content: center;
  padding-top: clamp(70px, 12vh, 130px);
  padding-bottom: clamp(20px, 3vh, 40px);
}
/* Amb el carril a sota, el text de la diapositiva de bàsquet té menys aire. */
.hero--slider .hero__slide .hero__sub { margin-top: 16px; }
.hero--slider .hero__slide .hero__actions { margin-top: 22px; }
@media (max-height: 720px) {
  .hero--slider .hero__title { font-size: clamp(2rem, 6vw, 3rem); }
  .hero--slider .hero__sub { display: none; }
}
@media (max-width: 760px) { .hero__rail { display: none; } }

.rail-sec { padding: clamp(46px, 6vw, 72px) 0; background: var(--ink-2); }
.rail-sec .section__head { margin-bottom: 26px; }
.rail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.rail-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.rail-head__link { font-size: 0.9rem; color: var(--text-mute); text-decoration: none; white-space: nowrap; }
.rail-head__link:hover { color: var(--accent-hi); }

#games-slider { position: relative; }
.rail {
  display: flex; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 2px 0 14px;
  margin: 0 calc(var(--gut) * -1); padding-left: var(--gut); padding-right: var(--gut);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (min-width: 1312px) { .rail { margin: 0; padding-left: 0; padding-right: 0; } }

.gcard {
  scroll-snap-align: start;
  flex: 0 0 288px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-top: 2px solid rgba(255,255,255,.16);
  border-radius: 4px;
  padding: 14px 16px 12px;
  display: flex; flex-direction: column; gap: 12px;
}
/* Els que venen porten la franja del club: separen el futur del passat d'un cop d'ull. */
.gcard.is-next { border-top-color: var(--accent); background: var(--ink-2); }

.gcard__hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gcard__comp {
  font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gcard__pill {
  flex: none; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-mute);
}
.gcard.is-next .gcard__pill { border-color: rgba(224,131,0,.45); color: var(--accent-hi); }

.gcard__teams { display: flex; flex-direction: column; gap: 10px; }
.gteam { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 11px; }
.gteam__nom {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1.12rem; line-height: 1.05; color: var(--text-mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gteam__pts {
  font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1;
  color: var(--text-mute); min-width: 30px; text-align: right;
}
/* Guanyador en blanc i punts en taronja · la resta queda apagada. */
.gteam.is-win .gteam__nom { color: var(--text); }
/* En un partit per jugar encara no hi ha guanyador: els dos equips a plena llum. */
.gcard.is-next .gteam__nom { color: var(--text); }
.gteam.is-win .gteam__pts { color: var(--accent-hi); }

.gcrest {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: rgba(255,255,255,.06);
}
.gcrest img { width: 100%; height: 100%; object-fit: contain; }
/* L'escut del club és una imatge quadrada amb fons: ha d'omplir el xip sencer,
   no quedar-hi encaixada amb voreres. Els escuts dels rivals, en canvi, són
   retallats i van amb `contain`. */
.gcrest--foto { background: #0b0b0c; }
.gcrest--foto img { object-fit: cover; }
.gcrest--mono {
  font-family: var(--display); font-weight: 700; font-size: 0.92rem; letter-spacing: .02em;
  color: var(--crest-fg, var(--text-mute)); background: var(--crest, rgba(255,255,255,.08));
}

.gcard__ft {
  display: flex; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 9px;
  font-size: 0.78rem; color: var(--text-mute);
}
.gcard__ft span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail__nav { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.rail__btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--text);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  transition: border-color .2s, color .2s, opacity .2s;
}
.rail__btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-hi); }
.rail__btn:disabled { opacity: .3; cursor: default; }

@media (max-width: 520px) {
  .gcard { flex-basis: 82vw; }
  .rail__nav { display: none; }
}

/* Logo propi d'una àrea al hero (Gastroclub): sobre la foto fosca, alineat amb el text. */
.hero__logo { display: block; align-self: flex-start; width: clamp(150px, 20vw, 230px); height: auto; margin-bottom: 18px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); }
.hero__logo--petit { width: clamp(120px, 15vw, 180px); }

/* Tema Academy (academy.html, academy-nll.html · body[data-tema] a build_site.py): el verd del
   logo de l'Academy en lloc del taronja del club. Sobre fons fosc, el llima del logo; a les
   seccions clares, un verd fosc perquè el text i els botons es llegeixin. */
body[data-tema="academy"] { --accent: #C3FF00; --accent-hi: #D2FF3F; }
body[data-tema="academy"] .section--light { --accent: #4F7D00; --accent-hi: #5E9200; }
body[data-tema="academy"] .section--light .btn--accent { color: #fff; }
body[data-tema="academy"] .section--light .eyebrow { color: #4F7D00; }
body[data-tema="academy"] .section--light .eyebrow::before { background: #4F7D00; }
