/* ============================================================
   PEDALE MANZANESE — Main Stylesheet
   ============================================================ */

/* Fonts: assets/fonts/fonts.css, linked from index.html */

/* Elements hidden from admin settings stay hidden whatever their own display rule */
[hidden] { display: none !important; }

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #FF6200;
  --red-dark: #CC4E00;
  --black:    #0d0d0d;
  --dark:     #141414;
  --card:     #1a1a1a;
  --border:   #2a2a2a;
  --muted:    #888;
  --light:    #e0e0e0;
  --white:    #ffffff;

  --font-head: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;

  --nav-h: 72px;
  --radius: 4px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--black);
  color: var(--light);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Typography ───────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(3.5rem, 10vw, 8rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 3vw, 2rem); }
h4 { font-size: 1.1rem; }

/* ── Utilities ────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.section-header { margin-bottom: 3rem; }
.section-header h2 { color: var(--white); }
.section-header p { color: var(--muted); margin-top: 0.75rem; font-size: 1.05rem; max-width: 520px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: var(--transition);
  border-radius: var(--radius);
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--light);
}
.btn-outline:hover { border-color: var(--white); color: var(--white); }

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(255,98,0,0.15);
  color: var(--red);
  font-size: 0.7rem;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Navigation ───────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  background: rgba(13,13,13,0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* logo-pedale-manzanese.png = new official logo (2026-11) made transparent and cropped
   from assets/images/LogoSito.jpeg, orange recoloured to --red (#FF6200); 790x160 so it
   stays sharp on high-density screens */
.nav-logo-img {
  display: block;
  height: 48px;
  width: auto;
  max-width: 100%;
}

@media (max-width: 768px) {
  .nav-logo-img { height: 38px; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); }

.nav-links .nav-cta a {
  background: var(--red);
  color: var(--white);
  padding: 0.5rem 1.2rem;
}
.nav-links .nav-cta a:hover { background: var(--red-dark); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu a {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2.5rem;
  text-transform: uppercase;
  color: var(--white);
  letter-spacing: 0.05em;
  transition: color var(--transition);
}
.mobile-menu a:hover { color: var(--red); }

/* ── Hero ─────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--black);
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-photo img.loaded { opacity: 1; }

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(13,13,13,0.75) 35%, rgba(13,13,13,0.25) 100%),
    linear-gradient(to bottom, rgba(13,13,13,0.2) 0%, rgba(13,13,13,0.92) 100%);
  z-index: 1;
}

/* Abstract geometric background */
.hero-geo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-geo::before {
  content: '';
  position: absolute;
  right: -5%;
  top: 10%;
  width: 55vw;
  height: 80vh;
  background: linear-gradient(135deg, rgba(255,98,0,0.08) 0%, transparent 60%);
  transform: skewX(-8deg);
  border-left: 1px solid rgba(255,98,0,0.2);
}

.hero-geo::after {
  content: '';
  position: absolute;
  right: 5%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,98,0,0.4), transparent);
}

.hero-number {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(12rem, 22vw, 22rem);
  color: rgba(255,255,255,0.03);
  line-height: 1;
  user-select: none;
  z-index: 1;
  letter-spacing: -0.05em;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: var(--nav-h);
}

.hero-content .eyebrow {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hero-content .eyebrow::before {
  content: '';
  display: inline-block;
  flex: 0 0 auto;
  width: 32px;
  height: 2px;
  background: var(--red);
}
/* "Stagione 2026 · G.C.D. Pedale Manzanese": the two parts never break inside */
.eyebrow-season,
.eyebrow-club { white-space: nowrap; }
.hero-content .eyebrow-season { color: var(--white); }
/* Small phones: club name on its own line, line marker aligned with the first line */
@media (max-width: 600px) {
  .hero-content .eyebrow { align-items: flex-start; line-height: 1.6; }
  .hero-content .eyebrow::before { margin-top: 0.75em; }
  .eyebrow-sep { display: none; }
  .eyebrow-club { display: block; }
}

.hero-title {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.hero-title .accent { color: var(--red); }

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 2.5rem;
  font-weight: 300;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.hero-stat-value {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--white);
  line-height: 1;
}
.hero-stat-value span { color: var(--red); }
.hero-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
  font-family: var(--font-head);
  font-weight: 600;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-family: var(--font-head);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

.hero-scroll svg { width: 20px; height: 20px; }

/* ── Section: About ───────────────────────────────────────── */
#about {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-text h2 { color: var(--white); margin-bottom: 1.25rem; }
.about-text p { color: var(--muted); line-height: 1.8; margin-bottom: 1rem; }

.about-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.about-feature {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.about-feature:hover { border-color: var(--red); }

.about-feature-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,98,0,0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--red);
  font-size: 1.1rem;
}

.about-feature-text h4 {
  color: var(--white);
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.about-feature-text p { color: var(--muted); font-size: 0.85rem; margin: 0; }

.about-visual {
  position: relative;
}

.about-visual-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  overflow: hidden;
}

.about-stat-box {
  background: var(--card);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Two boxes side by side: round the outer corners */
.about-stat-box:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.about-stat-box:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.about-stat-n {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 2.8rem;
  color: var(--white);
  line-height: 1;
}
.about-stat-n em { color: var(--red); font-style: normal; }
.about-stat-l { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ── Section: Team ────────────────────────────────────────── */
#team {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

.team-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.45rem 1.1rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--white);
  border-color: var(--red);
  background: rgba(255,98,0,0.1);
}

/* ── Category grid (team section) ─────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.category-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  aspect-ratio: 4/3;
  cursor: default;
  transition: border-color var(--transition);
}

.category-card:hover { border-color: var(--red); }

.category-card-photo {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
}

.category-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  transition: opacity var(--transition), transform 0.5s ease;
}

.category-card:hover .category-card-photo img {
  opacity: 0.9;
  transform: scale(1.04);
}

.category-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
}

.category-card-placeholder svg { width: 48px; height: 48px; }

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,13,13,0.92) 0%, rgba(13,13,13,0.2) 55%, transparent 100%);
}

.category-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1.75rem;
}

.category-card-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  text-transform: uppercase;
  color: var(--white);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.category-card-age {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  margin-bottom: 0.4rem;
}

.category-card-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease;
  opacity: 0;
}

.category-card:hover .category-card-desc {
  max-height: 80px;
  opacity: 1;
}

.category-card-accent {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--red);
  margin-bottom: 0.6rem;
  transition: width var(--transition);
}

.category-card:hover .category-card-accent { width: 48px; }

.category-hidden { display: none; }

@media (max-width: 768px) {
  .category-grid { grid-template-columns: 1fr; }
  .category-card { aspect-ratio: 16/9; }
}

/* ── Section: Category Details ───────────────────────────── */
#category-details {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

/* auto-fit: as many columns as categories (from team.json), no empty slots.
   Separators are drawn by the cards, so an incomplete last row shows no grey boxes. */
.category-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.category-detail-card {
  background: var(--card);
  padding: 2rem;
  /* left/top separator lines; the -1px shift hides them under the outer border */
  box-shadow: inset 1px 0 0 var(--border), inset 0 1px 0 var(--border);
  margin: -1px 0 0 -1px;
  transition: background var(--transition);
  position: relative;
}

.category-detail-card:hover { background: #1e1e1e; }

.category-detail-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.category-detail-card:hover::before { transform: scaleX(1); }

.category-detail-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.6rem;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-detail-name span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.category-detail-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.category-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.category-detail-row:last-child { border-bottom: none; }

.category-detail-icon {
  width: 30px;
  height: 30px;
  background: rgba(255,98,0,0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--red);
}

.category-detail-icon svg { width: 14px; height: 14px; }

.category-detail-label {
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.category-detail-value {
  font-size: 0.88rem;
  color: var(--light);
  line-height: 1.4;
}

.category-detail-notes {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .category-details-grid { grid-template-columns: 1fr; }
}

/* ── Section: Direttivo ───────────────────────────────────── */
#direttivo {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

.board-empty {
  padding: 2rem 1.5rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.board-leaders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.board-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 2rem 1.25rem 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.board-card:hover { border-color: var(--red); }

/* President: highlighted */
.board-card--president {
  border-top: 3px solid var(--red);
  background: linear-gradient(180deg, rgba(255, 98, 0, 0.08), var(--card) 60%);
}

.board-avatar {
  width: 96px;
  height: 96px;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.04em;
  border: 2px solid var(--border);
}
.board-card--president .board-avatar { width: 120px; height: 120px; font-size: 2.5rem; }
.board-avatar { position: relative; }
.board-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.board-role {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}

.board-name {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.15;
}

.board-council { margin-top: 3rem; }
.board-council-title {
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--white);
  margin-bottom: 1rem;
}
.board-council-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.board-council-grid .board-card { padding: 1.5rem 1rem 1.25rem; }
.board-council-grid .board-avatar { width: 72px; height: 72px; font-size: 1.5rem; }
.board-council-grid .board-name { font-size: 1.1rem; }
@media (max-width: 600px) {
  .board-council-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .board-council-grid .board-card { padding: 1.25rem 0.75rem 1rem; }
  .board-council-grid .board-avatar { width: 60px; height: 60px; font-size: 1.25rem; }
  .board-council-grid .board-name { font-size: 1rem; }
}

/* ── Section: Races ───────────────────────────────────────── */
#races {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

.races-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.race-tab {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 1.2rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}

.race-tab:hover { color: var(--light); }
.race-tab.active { color: var(--white); border-bottom-color: var(--red); }

.races-table {
  width: 100%;
  border-collapse: collapse;
}

.races-table th {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.races-table td {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--light);
  transition: background var(--transition);
}

.races-table tr:hover td { background: var(--card); }

.race-date {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.race-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--white);
}

.race-result {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
}

.race-result.win { color: #f5c518; }
.race-result.podium { color: #b0b0b0; }

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-completed { background: rgba(255,255,255,0.06); color: var(--muted); }
.status-upcoming { background: rgba(255,98,0,0.15); color: var(--red); }

/* ── Section: News ────────────────────────────────────────── */
#news {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5px;
  background: var(--border);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.news-card {
  background: var(--card);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.news-card:hover { background: #1e1e1e; }

.news-card-image {
  aspect-ratio: 16/9;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.news-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--border) 0%, #222 100%);
  color: var(--muted);
  font-size: 2rem;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img { transform: scale(1.04); }

.news-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.news-date {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.news-card-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  flex: 1;
}

.news-card-excerpt { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }

.news-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-read-more {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap var(--transition);
}

.news-card:hover .news-read-more { gap: 0.7rem; }

/* ── News Modal ───────────────────────────────────────────── */
#news-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  overflow-y: auto;
}

#news-modal.open { opacity: 1; pointer-events: all; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  z-index: -1;
}

.modal-content {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  margin: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition);
}

#news-modal.open .modal-content { transform: translateY(0); }

.modal-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header .tag { margin-bottom: 0.75rem; }

.modal-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.modal-meta {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.modal-image {
  aspect-ratio: 16/9;
  background: var(--border);
  overflow: hidden;
}

.modal-image img { width: 100%; height: 100%; object-fit: cover; }

.modal-body {
  padding: 2rem;
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: var(--transition);
}

.modal-close:hover { background: var(--red); color: var(--white); }

/* ── Section: Sponsors ────────────────────────────────────── */
#sponsors {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.sponsor-card {
  perspective: 1000px;
  height: 140px;
}

.sponsor-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.sponsor-card:hover .sponsor-card-inner { transform: rotateY(180deg); }

.sponsor-front,
.sponsor-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.sponsor-front {
  background: var(--card);
}

.sponsor-back {
  background: var(--red);
  transform: rotateY(180deg);
  text-align: center;
}

/* Logos in their original colours on a white plate (black or dark logos stay readable) */
.sponsor-logo {
  box-sizing: border-box;
  width: 140px;           /* same white plate for every sponsor */
  height: 76px;
  max-width: 100%;
  object-fit: contain;    /* logo fitted inside, proportions kept */
  background: #fff;
  padding: 8px 10px;
  border-radius: 4px;
}
@media (max-width: 600px) {
  /* phones: two sponsors per row, smaller cards */
  .sponsors-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .sponsor-card { height: 104px; }
  .sponsor-front, .sponsor-back { padding: 0.6rem; }
  .sponsor-logo { width: 100%; height: 64px; padding: 6px; }
  .sponsor-logo-placeholder { font-size: 0.85rem; }
}

.sponsor-logo-placeholder {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.05em;
}

.sponsor-tier-label {
  font-family: var(--font-head);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.5rem;
}

.sponsor-back-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.sponsor-back-desc {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  text-align: center;
}

.sponsor-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-top: 0.75rem;
  transition: color var(--transition);
}
.sponsor-back-link:hover { color: var(--white); }

.sponsors-cta {
  margin-top: 3rem;
  padding: 2rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.sponsors-cta p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ── Section: 5x1000 ─────────────────────────────────────── */
#cinquexmille {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--dark);
}

.cinquexmille-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.cinquexmille-left {}

.cinquexmille-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border: 1.5px solid var(--red);
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
}

.cinquexmille-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.cinquexmille-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.cinquexmille-title span { color: var(--red); }

.cinquexmille-desc {
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 2rem;
  max-width: 440px;
}

.cf-box {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cf-box-label {
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.cf-box-value {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--white);
}

.cf-copy-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255,98,0,0.1);
  border: 1px solid rgba(255,98,0,0.3);
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.cf-copy-btn svg { width: 13px; height: 13px; }
.cf-copy-btn:hover { background: var(--red); color: var(--white); border-color: var(--red); }
.cf-copy-btn.copied { background: rgba(0,194,111,0.1); color: #00c26f; border-color: rgba(0,194,111,0.3); }

.cinquexmille-steps {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cinquexmille-step {
  background: var(--card);
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: background var(--transition);
}

.cinquexmille-step:hover { background: #1e1e1e; }

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,98,0,0.12);
  border: 1.5px solid rgba(255,98,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1rem;
  color: var(--red);
  flex-shrink: 0;
}

.step-text h4 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.step-text p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
}

.cinquexmille-note {
  margin-top: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

.cinquexmille-note svg { width: 15px; height: 15px; color: var(--red); flex-shrink: 0; margin-top: 2px; }

@media (max-width: 768px) {
  .cinquexmille-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .cf-box { flex-direction: column; align-items: flex-start; }
}

/* ── Section: Contact ─────────────────────────────────────── */
#contact {
  padding: 6rem 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 5rem;
  align-items: start;
}

.contact-info h2 { color: var(--white); margin-bottom: 1rem; }
.contact-info p { color: var(--muted); margin-bottom: 2rem; line-height: 1.8; }

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.contact-detail[hidden],
.contact-group[hidden] { display: none; }

.contact-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Adjacent groups share a single separator line */
.contact-group + .contact-group {
  border-top: none;
  margin-top: -1rem;
}

.contact-group-title {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0;
}

.contact-detail-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,98,0,0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}

.contact-detail-text label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.1rem;
}

.contact-detail-text span,
.contact-detail-text a {
  font-size: 0.9rem;
  color: var(--light);
}

.contact-detail-text a {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.contact-detail-text a:hover,
.contact-detail-text a:focus-visible {
  color: var(--red);
  text-decoration-color: var(--red);
}

.contact-detail-text .contact-referent {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Fixed columns (name | number | WhatsApp) so icons line up across all sections */
.contact-phone-line {
  display: grid;
  grid-template-columns: minmax(4.5rem, 6.5rem) max-content 28px; /* name column shrinks on narrow phones */
  align-items: center;
  column-gap: 0.75rem;
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.contact-detail-text a.contact-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition);
}

.contact-detail-text a.contact-whatsapp:hover,
.contact-detail-text a.contact-whatsapp:focus-visible {
  color: #fff;
  background: #1ebe5b;
  transform: scale(1.08);
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  appearance: none;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--red);
}

.form-group textarea { resize: vertical; min-height: 130px; }

.form-group select option { background: var(--card); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-feedback {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.form-feedback.success {
  display: block;
  background: rgba(0,200,80,0.1);
  border: 1px solid rgba(0,200,80,0.3);
  color: #00c850;
}

.form-feedback.error {
  display: block;
  background: rgba(255,98,0,0.1);
  border: 1px solid rgba(255,98,0,0.3);
  color: var(--red);
}

/* "Scrivici": message under the "Invia messaggio" button */
#contact-feedback { margin: 1rem 0 0; } /* id: showFeedback() rewrites the classes */

/* Newsletter strip */
#newsletter {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0;
}

.newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.newsletter-text h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--white);
  margin-bottom: 0.4rem;
}

.newsletter-text p { color: var(--muted); font-size: 0.9rem; }

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 0 0 auto;
  width: 460px; /* same width in subscribe and unsubscribe mode */
  max-width: 100%;
}

.newsletter-row {
  display: flex;
  gap: 0.75rem;
}

.newsletter-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  cursor: pointer;
}

.newsletter-consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 0.15rem;
  accent-color: var(--red);
  cursor: pointer;
}

.newsletter-consent[hidden] { display: none; }

.newsletter-switch {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.newsletter-switch:hover { color: var(--white); }
.newsletter-switch[hidden] { display: none; }

/* Anti-spam field: off screen, never visible */
.newsletter-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.newsletter-form input[type="email"] {
  flex: 1;
  background: var(--dark);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  outline: none;
}

.newsletter-form input[type="email"]:focus { border-color: var(--red); }
.newsletter-form input[type="email"]::placeholder { color: var(--muted); }

/* Notice shown after confirming the newsletter (?newsletter=confermata) */
.site-notice {
  position: fixed;
  left: 50%;
  top: calc(var(--nav-h, 72px) + 1rem + env(safe-area-inset-top, 0px));
  z-index: 1000;
  width: min(560px, calc(100% - 2rem));
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 1rem 1rem 1rem 1.1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.site-notice.show { opacity: 1; transform: translate(-50%, 0); }
.site-notice-icon { flex: 0 0 auto; width: 22px; height: 22px; color: var(--red); margin-top: 0.1rem; }
.site-notice p { flex: 1; margin: 0; color: var(--white); font-size: 0.95rem; line-height: 1.5; }
.site-notice-close {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.site-notice-close:hover { color: var(--white); }

/* ── Contact form: consent + "form switched off" layout ───── */
.contact-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  cursor: pointer;
}
.contact-consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 0.15rem;
  accent-color: var(--red);
  cursor: pointer;
}
#contact-form-wrap[hidden] { display: none; }
.contact-grid--no-form { grid-template-columns: 1fr; }
.contact-grid--no-form .contact-info { max-width: 720px; }

/* ── Privacy policy window (#privacy) ───────────────────────── */
.privacy-inline-link,
.footer-privacy {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.privacy-inline-link:hover,
.footer-privacy:hover { color: var(--white); }

body.privacy-open { overflow: hidden; }

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.75);
}
.privacy-modal[hidden] { display: none; }

.privacy-dialog {
  width: min(760px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  outline: none;
}

.privacy-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.privacy-dialog-head h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--white);
  margin: 0;
}
.privacy-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.privacy-close:hover { color: var(--white); }

.privacy-dialog-body {
  overflow-y: auto;
  padding: 1.5rem;
  -webkit-overflow-scrolling: touch;
}
.privacy-updated { color: var(--muted); font-size: 0.8rem; margin-bottom: 1rem; }

.privacy-content { color: var(--light); font-size: 0.92rem; line-height: 1.7; }
.privacy-content h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  margin: 1.5rem 0 0.5rem;
}
.privacy-content h3:first-child { margin-top: 0; }
.privacy-content p { margin: 0 0 0.9rem; }
.privacy-content ul { margin: 0 0 0.9rem 1.25rem; }
.privacy-content li { margin-bottom: 0.3rem; }
.privacy-content strong { color: var(--white); }
.privacy-content a { color: var(--red); text-decoration: underline; word-break: break-word; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.footer-brand p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-top: 1rem;
  max-width: 280px;
}

.footer-nav h5 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-nav ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.footer-nav a {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color var(--transition);
}

.footer-nav a:hover { color: var(--white); }

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--muted);
}

.social-links { display: flex; gap: 0.5rem; }

.social-link {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  transition: var(--transition);
}

.social-link:hover { border-color: var(--red); color: var(--red); }

/* Official coloured logos (Facebook, Instagram): no ring, lift on hover */
.social-link--brand { border: 0; overflow: hidden; }
.social-link--brand svg { width: 34px; height: 34px; display: block; }
.social-link--brand:hover { transform: translateY(-2px); opacity: 0.9; }
.contact-detail-icon--brand { background: none; }
.contact-detail-icon--brand svg { width: 32px; height: 32px; display: block; }

/* ── Photo viewer (full screen) ───────────────────────────── */
.category-card--zoom { cursor: zoom-in; }
.category-card--zoom:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.category-card-zoom {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 13, 13, 0.6);
  color: var(--white);
  opacity: 0.85;
  transition: opacity var(--transition), background var(--transition);
  pointer-events: none;
}
.category-card--zoom:hover .category-card-zoom { opacity: 1; background: var(--red); }

body.lightbox-open { overflow: hidden; }
body.lightbox-open .back-to-top { visibility: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.97);
  padding: calc(3.5rem + env(safe-area-inset-top, 0px)) 4.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100% - 2.5rem);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  touch-action: pinch-zoom;          /* two fingers zoom on phones */
  user-select: none;
}
.lightbox-caption {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
}
.lightbox-counter { color: var(--muted); font-size: 0.8rem; }

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--transition);
}
.lightbox-close:hover,
.lightbox-nav:hover { background: var(--red); }
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.lightbox-close:focus:not(:focus-visible) { outline: none; }
.lightbox-close {
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: calc(0.75rem + env(safe-area-inset-right, 0px));
  width: 46px;
  height: 46px;
  font-size: 2rem;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2.4rem;
  padding-bottom: 0.2rem;
}
.lightbox-prev { left: calc(0.75rem + env(safe-area-inset-left, 0px)); }
.lightbox-next { right: calc(0.75rem + env(safe-area-inset-right, 0px)); }
.lightbox-nav[hidden] { display: none; }

/* Phones: photo uses the full width, swipe to change; smaller side arrows at the bottom */
@media (max-width: 600px) {
  .lightbox { padding: calc(3.75rem + env(safe-area-inset-top, 0px)) 0.5rem calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
  .lightbox-nav {
    top: auto;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    transform: none;
    width: 46px;
    height: 46px;
    font-size: 2rem;
  }
  .lightbox-prev { left: calc(25% - 23px); }
  .lightbox-next { right: calc(25% - 23px); }
  .lightbox-caption { font-size: 0.85rem; }
}

/* ── Back to top button ───────────────────────────────────── */
.back-to-top {
  position: fixed;
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 900;                 /* under navbar (1000), mobile menu (999) and windows */
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--red-dark); }
.back-to-top:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
body.privacy-open .back-to-top { visibility: hidden; }
@media (max-width: 768px) {
  .back-to-top { width: 46px; height: 46px; right: calc(1rem + env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1150px) {
  .nav-links a { padding: 0.5rem 0.6rem; letter-spacing: 0.06em; font-size: 0.8rem; }
  .nav-links .nav-cta a { padding: 0.5rem 0.9rem; }
}

@media (max-width: 1020px) { /* hamburger: 9 menu items need ~1020px */
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 1024px) {
  .about-grid { gap: 3rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .contact-grid { gap: 3rem; }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; }


  .about-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  .hero-stats { gap: 2rem; flex-wrap: wrap; }
  .hero-number { display: none; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .newsletter-inner { flex-direction: column; align-items: flex-start; }
  .newsletter-form { min-width: 0; width: 100%; }

  .form-row { grid-template-columns: 1fr; }

  .races-table th:nth-child(3),
  .races-table td:nth-child(3),
  .races-table th:nth-child(5),
  .races-table td:nth-child(5) { display: none; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  h1 { font-size: 3rem; }

  .footer-grid { grid-template-columns: 1fr; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
