/*
  Design refinements — shared across every page.
  Unifies motion, materials and typography on top of the legacy
  template stylesheets (main.css / eventi.css). Loaded last so it can
  layer refinements without editing the legacy rules.

  Theme "Livrea '90": the racing liveries of the 125cc bikes in the hero
  photo (Cagiva, Gilera, Aprilia) translated into a dark editorial system —
  warm carbon surfaces, ivory type, the flag's own green and red, hard-edged
  tricolore bands, faceted corners and grain. The homepage hero and the
  "Chi siamo" section live in home.css; everything shared lives here.
*/

:root {
  /* Surfaces: stratified warm carbon */
  --color-bg: #0b0b0c;
  --color-bg-1: #0e0e10;
  --color-bg-2: #121214;
  --color-bg-3: #161618;
  --color-bg-4: #1b1b1e;
  --color-bg-5: #202024;

  /* Text: ivory down to warm greys (all >= 4.5:1 on --color-bg except muted-3) */
  --color-text: #f3efe6;
  --color-text-2: #e7e2d7;
  --color-text-3: #cdc7ba;
  --color-text-4: #b7b1a4;
  --color-muted: #949087;
  --color-muted-2: #85817a;
  --color-muted-3: #75716a;

  /* Verde bandiera: CTA, info. -light for small text on dark (8:1) */
  --color-green: #009246;
  --color-green-dark: #00753a;
  --color-green-light: #2fbf71;

  /* Rosso bandiera: graphics and large type only. -light for small text (6:1) */
  --color-red: #ce2b37;
  --color-red-dark: #a3202b;
  --color-red-dark-2: #861a23;
  --color-red-light: #ff4d58;

  /* Il bianco del tricolore, in avorio */
  --color-white: #f3efe6;
  --color-paper: #ffffff;

  --line: rgba(243, 239, 230, 0.08);
  --line-strong: rgba(243, 239, 230, 0.16);

  /* Hard-stop flag bands (no soft blends) */
  --tricolore: linear-gradient(90deg, var(--color-green) 0 33.34%, var(--color-white) 33.34% 66.67%, var(--color-red) 66.67% 100%);

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Poppins', sans-serif;
  --font-ui: 'Barlow', sans-serif;
  --font-label: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Legacy tokens kept for compatibility with anything still referencing them */
  --color-ink: #0b0b0c;
  --color-surface: #121214;
  --radius-card: 20px;
  --radius-pill: 22px;

  /* Angoli a taglio invece di arrotondati */
  --clip-card: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  --clip-chip: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --clip-btn: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  --clip-tag: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);

  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --duration-fast: 150ms;
  --duration-normal: 320ms;
  --duration-slow: 700ms;
  --duration-reveal: 1000ms;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sticky footer: the last section grows to fill any leftover viewport
   height, and its content column absorbs that extra space (not the
   footer itself) so short single-event pages don't leave the footer
   stranded mid-page, while the footer keeps its normal fixed gap
   above it on long pages like the homepage. */
section.meetings-page {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

section.meetings-page > .container {
  flex: 1 0 auto;
}

::selection {
  background: var(--color-green);
  color: var(--color-paper);
}

::-moz-selection {
  background: var(--color-green);
  color: var(--color-paper);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-green-light);
  outline-offset: 3px;
}

/* ---------------------------------------------
   Grain: a fixed film-noise layer over the whole site for atmosphere.
   Static image, no blend mode, so it costs nothing while scrolling.
--------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E");
}

/* ---------------------------------------------
   Page transitions (progressive enhancement): cross-document View
   Transitions fade between pages, and the clicked event card's photo
   morphs into the event page photo (custom.js names the clicked card's
   image "evento-foto"; each event page has a single .thumb).
--------------------------------------------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

::view-transition-group(evento-foto) {
  animation-duration: 650ms;
  animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

.header-area {
  view-transition-name: site-header;
}

.meeting-single-item .thumb {
  view-transition-name: evento-foto;
}

/* ---------------------------------------------
   Header: a compact floating chip ("dynamic island") holding the
   wordmark — the nav links are gone, so a full-width bar was mostly
   empty. Translucent carbon material, faceted corners, tricolore
   progress along its bottom edge.
--------------------------------------------- */
.header-area,
.header-area.header-sticky,
.header-area.background-header {
  top: 12px !important;
  left: 0;
  right: 0;
  width: -moz-fit-content;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin: 0 auto;
  height: 58px !important;
  min-height: 0;
  padding: 0;
  background-color: rgba(11, 11, 12, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line-strong) !important;
  clip-path: var(--clip-chip);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* visibility waits for the fade-out to finish before hiding */
  transition: opacity var(--duration-normal) var(--ease-standard),
    visibility 0s linear var(--duration-normal),
    background-color var(--duration-normal) var(--ease-standard);
}

/* Hidden over the hero on purpose — full attention on the hero image.
   It fades in once .background-header is toggled on scroll (see custom.js).
   While hidden it is also visibility:hidden, so its logo link is not an
   invisible first Tab stop. */
.header-area.background-header {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background-color: rgba(11, 11, 12, 0.78) !important;
  transition-delay: 0s;
}

.header-area .container {
  width: auto;
  max-width: none;
  padding: 0 clamp(22px, 3vw, 34px);
}

.header-area .row {
  margin: 0;
}

.header-area .row > .col-12 {
  width: auto;
  padding: 0;
}

.header-area .main-nav {
  min-height: 58px;
  text-align: center;
}

.header-area .main-nav .logo {
  float: none;
  display: inline-block;
  line-height: 58px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--color-text) !important;
}

.header-area .main-nav .logo .verde,
.hero-wordmark .verde {
  color: var(--color-green-light);
  border-bottom: none;
}

.header-area .main-nav .logo .bianco,
.hero-wordmark .bianco {
  color: var(--color-white);
  border-bottom: none;
}

.header-area .main-nav .logo .rosso,
.hero-wordmark .rosso {
  color: var(--color-red-light);
  border-bottom: none;
}

/* Undo the template's leftover mobile margin-left on the logo (main.css):
   it balanced the old hamburger button, which is gone with the nav. */
@media (max-width: 767px) {
  .header-area .logo {
    margin-left: 0;
  }

  .header-area .main-nav .logo {
    font-size: 21px;
  }
}

/* Scroll progress: scaled (compositor-only) rather than resized, so the
   flag bands grow together as the page scrolls. */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  pointer-events: none;
}

/* A smooth green → ivory → red gradient across the whole chip, uncovered
   from the left as the page scrolls (clip-path, set by custom.js). */
.scroll-progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-green), var(--color-white) 50%, var(--color-red));
  clip-path: inset(0 100% 0 0);
}

/* ---------------------------------------------
   Buttons: ivory plate with faceted corners; on hover a green band
   sweeps in from the left and the arrow slides on. Feedback on the
   press (scale) per apple-design §1.
--------------------------------------------- */
.main-button-green a,
.main-button-outline a {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px 16px 30px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: var(--clip-btn);
  transition: transform var(--duration-fast) var(--ease-standard),
    color var(--duration-normal) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard);
}

.main-button-green a::before,
.main-button-outline a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 560ms var(--ease-out-expo);
}

.main-button-green a:hover::before,
.main-button-green a:focus-visible::before,
.main-button-outline a:hover::before,
.main-button-outline a:focus-visible::before {
  transform: scaleX(1);
  transform-origin: left center;
}

.main-button-green a:active,
.main-button-outline a:active {
  transform: scale(0.96);
  transition-duration: 90ms;
}

.main-button-green a {
  color: var(--color-ink);
  background: var(--color-white);
  border: none;
}

.main-button-green a::before {
  background: var(--color-green-dark);
}

.main-button-green a:hover,
.main-button-green a:focus-visible {
  color: var(--color-paper);
  box-shadow: 0 16px 40px rgba(0, 146, 70, 0.28);
}

.main-button-green a::after {
  content: "→";
  content: "→" / "";
  display: inline-block;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.main-button-green a:hover::after,
.main-button-green a:focus-visible::after {
  transform: translateX(5px);
}

.main-button-outline a {
  color: var(--color-text);
  background: rgba(243, 239, 230, 0.03);
  border: none;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.main-button-outline a::before {
  background: var(--color-white);
}

.main-button-outline a:hover,
.main-button-outline a:focus-visible {
  color: var(--color-ink);
}

/* "Torna alla home" label: plain inline text now that the plate itself
   carries the hover; the back arrow slides the other way. */
.main-button-outline .btn-label {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: inherit;
}

.main-button-outline .btn-label::before {
  content: "←";
  content: "←" / "";
  display: inline-block;
  margin-right: 12px;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.main-button-outline a:hover .btn-label::before,
.main-button-outline a:focus-visible .btn-label::before {
  transform: translateX(-5px);
}

/* ---------------------------------------------
   Site-wide cursor halo: tricolor light that tracks the pointer
   anywhere on the page. Three soft wedges (green/ivory/red,
   left-center-right) offset from --cursor-x/--cursor-y (custom.js).
   Fixed + pointer-events:none so it never blocks clicks or scrolling.
--------------------------------------------- */
body {
  --cursor-x: 50vw;
  --cursor-y: 50vh;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(130px 160px at calc(var(--cursor-x) - 90px) var(--cursor-y), rgba(0, 146, 70, 0.09), transparent 70%),
    radial-gradient(130px 160px at var(--cursor-x) var(--cursor-y), rgba(243, 239, 230, 0.05), transparent 70%),
    radial-gradient(130px 160px at calc(var(--cursor-x) + 90px) var(--cursor-y), rgba(206, 43, 55, 0.09), transparent 70%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-standard);
  pointer-events: none;
  z-index: 9999;
}

body.cursor-active::after {
  opacity: 1;
}

/* ---------------------------------------------
   Counter in home ("Prossimamente" / "Non mancare!"), gestiti dal
   pannello. Ogni counter ha un colore d'accento (classe counter--verde,
   counter--blu, counter--rosso) usato solo per gli elementi in primo
   piano — badge, countdown, pulsante — mentre lo sfondo resta il
   carbonio del sito. Il blu è quello di Padova Moto Days.
--------------------------------------------- */
:root {
  --color-pmd-blue: #1f9dff;
  --color-pmd-blue-dark: #0a6ed6;
  --color-pmd-blue-light: #4fb3ff;
  --color-pmd-blue-lighter: #9dd4ff;
  --color-pmd-yellow: #ffd21e;
}

.counter-next,
.counter-card,
.counter--verde {
  --counter-accent: var(--color-green);
  --counter-accent-dark: var(--color-green-dark);
  --counter-accent-light: var(--color-green-light);
  --counter-accent-rgb: 0, 146, 70;
}

.counter--blu {
  --counter-accent: var(--color-pmd-blue);
  --counter-accent-dark: var(--color-pmd-blue-dark);
  --counter-accent-light: var(--color-pmd-blue-lighter);
  --counter-accent-rgb: 31, 157, 255;
}

.counter--rosso {
  --counter-accent: var(--color-red);
  --counter-accent-dark: var(--color-red-dark);
  --counter-accent-light: var(--color-red-light);
  --counter-accent-rgb: 206, 43, 55;
}

/* Same surface as the rest of the page and no dividing lines: on the
   homepage the section sits between two photo strips, which already
   separate it. Order: kicker, countdown, then title/text/button. */
.counter-next {
  position: relative;
  overflow: hidden;
  padding: clamp(70px, 9vw, 130px) 0;
  background-color: var(--color-bg);
}

@keyframes counterPulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.06);
  }
}

.counter-kicker {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 18px;
  margin-bottom: 22px;
  border: 1px solid rgba(var(--counter-accent-rgb), 0.45);
  background: rgba(var(--counter-accent-rgb), 0.08);
  clip-path: var(--clip-chip);
}

.counter-kicker-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--counter-accent);
  animation: counterPulse 2.4s ease-in-out infinite;
}

.counter-kicker span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--counter-accent-light);
}

.counter-kicker strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-paper);
}

.counter-text {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--color-text-4);
}

/* Countdown protagonista: cifre in display grande su quattro colonne a
   tutta larghezza, ognuna aperta da un filo (colore del counter sui giorni). */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2.4vw, 40px);
  margin: clamp(10px, 2vw, 24px) 0 clamp(40px, 5vw, 72px);
}

/* Sotto il countdown: titolo e testo a sinistra, bottone a destra. */
.counter-info {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px clamp(28px, 5vw, 80px);
}

.counter-copy {
  flex: 1 1 520px;
  max-width: 760px;
}

.counter-next .counter-heading h2 {
  margin-bottom: 18px;
  font-size: clamp(30px, 4.2vw, 56px);
}

.countdown-item {
  min-width: 0;
  padding-top: clamp(12px, 1.4vw, 18px);
  overflow: hidden;
  border-top: 2px solid var(--line-strong);
}

.countdown-item:first-child {
  border-top-color: var(--counter-accent);
}

.countdown-value {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(40px, 12vw, 176px);
  line-height: 0.84;
  letter-spacing: -0.02em;
  color: var(--color-paper);
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  margin-top: 12px;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.main-button-counter a {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 30px;
  min-height: 56px;
  background: linear-gradient(100deg, var(--counter-accent), var(--counter-accent-dark));
  color: var(--color-paper);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  clip-path: var(--clip-btn);
  box-shadow: 0 12px 40px rgba(var(--counter-accent-rgb), 0.3);
  transition: transform var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard);
}

.main-button-counter a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--counter-accent-dark);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 560ms var(--ease-out-expo);
}

.main-button-counter a:hover::before,
.main-button-counter a:focus-visible::before {
  transform: scaleX(1);
  transform-origin: left center;
}

.main-button-counter a:hover,
.main-button-counter a:focus-visible {
  box-shadow: 0 18px 52px rgba(var(--counter-accent-rgb), 0.45);
  color: var(--color-paper);
}

.main-button-counter a:active {
  transform: scale(0.96);
  transition-duration: 90ms;
}

.counter-arrow {
  font-size: 15px;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.main-button-counter a:hover .counter-arrow,
.main-button-counter a:focus-visible .counter-arrow {
  transform: translateX(5px);
}

/* ---------------------------------------------
   Section headings: condensed italic display type behind a mask that
   lifts on reveal.
--------------------------------------------- */
.section-heading h2 {
  border-bottom: none;
  padding-bottom: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  font-size: clamp(34px, 5.4vw, 72px);
  line-height: 0.92;
  color: var(--color-text);
}

.section-heading[data-reveal] h2 {
  clip-path: inset(0 -10% 100% -10%);
  transform: translateY(35%);
  transition: clip-path var(--duration-reveal) var(--ease-out-expo) 120ms,
    transform var(--duration-reveal) var(--ease-out-expo) 120ms;
}

.section-heading.is-revealed h2 {
  clip-path: inset(-20% -10% -20% -10%);
  transform: none;
}

section.meetings-page {
  background-color: var(--color-bg);
  background-image: none;
  position: relative;
}

section.meetings-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 100%);
  height: 600px;
  background: radial-gradient(closest-side, rgba(0, 146, 70, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

section.meetings-page > .container {
  position: relative;
  z-index: 1;
}

section.immagini,
section.our-courses {
  background-color: var(--color-bg);
  background-image: none;
}

/* ---------------------------------------------
   Eventi grid: real CSS grid with a gap, replacing the Bootstrap
   column-padding gutter hack (which left uneven leftover space).
--------------------------------------------- */
.eventi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 32px;
  margin-left: 0;
  margin-right: 0;
}

.eventi-grid > .evento-item-col {
  width: auto;
  max-width: none;
  padding: 0;
  flex: none;
}

@media (max-width: 992px) {
  .eventi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .eventi-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---------------------------------------------
   Event cards: carbon surface with faceted corners, a numbered tag,
   a tricolore livery line that runs out along the top on hover, and
   the photo uncovered by a rising curtain on reveal.
--------------------------------------------- */
.meeting-item,
.meeting-single-item {
  position: relative;
  clip-path: var(--clip-card);
  background-color: var(--color-bg-2);
  transition: transform var(--duration-normal) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard);
}

.meeting-item::before,
.meeting-single-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 3;
  background: var(--tricolore);
  pointer-events: none;
}

.meeting-item::before {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 640ms var(--ease-out-expo);
}

.meeting-item:hover::before,
.meeting-item:focus-within::before {
  transform: scaleX(1);
}

/* Event detail card: at full container width (up to 1320px) the 16:9
   photo scales up to ~740px tall, forcing a scroll just to see one
   photo. Cap the card's width on desktop so title, meta, photo and
   description come closer to fitting in one screen. */
@media (min-width: 992px) {
  .meeting-single-item {
    max-width: 840px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* "Torna alla home": centered at the end of the card, below the
   description — still inside the card, with matching left/right and
   bottom clearance. */
.meeting-single-item .back-link {
  text-align: center;
  padding: 8px 40px 40px;
}

/* All cards the same height and aligned across the row: compact
   fixed-ratio thumb (cropped via object-fit) + a content column that
   grows to fill the row, giving the description more room to breathe. */
.meeting-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.meeting-item .thumb {
  flex: none;
  aspect-ratio: 16 / 9;
}

.meeting-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reference date of each event (homepage cards), on the photo. */
.meeting-item .evento-data {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 2;
  padding: 7px 10px 6px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-text);
  background: rgba(11, 11, 12, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  clip-path: var(--clip-tag);
  pointer-events: none;
}

.meeting-item .down-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto;
  margin-bottom: 0;
}

.meeting-item .down-content > a {
  flex: none;
}

.meeting-item .down-content p {
  margin-left: 0px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meeting-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 146, 70, 0.16), 0 24px 48px rgba(0, 0, 0, 0.4);
}

.meeting-item .thumb,
.meeting-single-item .thumb {
  overflow: hidden;
  position: relative;
}

.meeting-item .thumb img,
.meeting-single-item .thumb img {
  border-radius: 0;
  transition: transform 700ms var(--ease-standard);
  filter: brightness(0.82) contrast(1.07) saturate(1.02);
}

.meeting-item:hover .thumb img {
  transform: scale(1.06);
}

.meeting-item .thumb::after,
.meeting-single-item .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 12, 0) 45%, rgba(11, 11, 12, 0.85) 100%);
  pointer-events: none;
}

.meeting-item .down-content,
.meeting-single-item .down-content {
  background-color: var(--color-bg-2);
  border-radius: 0;
}

.meeting-item .down-content h3,
.meeting-item .down-content h4,
.meeting-single-item .down-content h1,
.meeting-single-item .down-content h4 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  /* Color as a left-to-right wipe rather than a flat swap: a hard-edge
     two-tone gradient twice the element's width, clipped to the glyphs,
     slid into view on hover instead of just flipping `color`. */
  background-image: linear-gradient(to right, var(--color-green-light) 50%, var(--color-text) 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: background-position var(--duration-normal) var(--ease-standard);
}

.meeting-item .down-content h3,
.meeting-item .down-content h4 {
  font-size: 22px;
}

.meeting-item:hover .down-content h3,
.meeting-item:hover .down-content h4 {
  background-position: 0 0;
}

/* Event page title: bigger and centered, ahead of the photo(s) —
   the card-grid title on the homepage keeps its smaller inline style. */
.meeting-single-item .down-content h1,
.meeting-single-item .down-content h4 {
  display: block;
  text-align: center;
  font-size: clamp(38px, 6vw, 76px);
  font-weight: 800;
  line-height: 0.92;
  margin-bottom: 14px;
}

/* Edition subtitle right under the title (e.g. "Edizioni 2016-2017-2018-2019") —
   centered to match the title above it, without touching the description below. */
.meeting-single-item .down-content > a + p {
  text-align: center;
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.meeting-item .down-content p,
.meeting-single-item .down-content p {
  color: var(--color-text-3);
}

/* Edizioni collegate sulla card evento e nella pagina evento */
.evento-edizioni {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.evento-edizioni-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.evento-edizioni-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.evento-edizione-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  min-height: 28px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--color-text);
  background: var(--color-bg-3);
  border: 1px solid var(--line-strong);
  text-decoration: none;
  transition: all 180ms var(--ease-standard);
  clip-path: var(--cut-sm);
}

.evento-edizione-btn:hover {
  background: var(--color-green);
  border-color: var(--color-green-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 146, 70, 0.35);
}

.event-parent-ref {
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-top: 4px;
}

.event-parent-ref a {
  color: var(--color-green-light);
  text-decoration: underline;
  font-weight: 600;
}

.event-edizioni-bar {
  margin: 16px auto 28px;
  padding: 14px 20px;
  max-width: 680px;
  background: var(--color-bg-1);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
}

.event-edizioni-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.event-edizioni-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-edizione-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  min-height: 32px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg-2);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: all 180ms var(--ease-standard);
  clip-path: var(--cut-sm);
}

.event-edizione-pill:hover {
  background: var(--color-green);
  border-color: var(--color-green-light);
  color: #fff;
  transform: translateY(-2px);
}

.event-edizione-pill--current {
  background: var(--color-green-dark);
  border-color: var(--color-green-light);
  color: #fff;
  pointer-events: none;
}

.meeting-single-item .down-content h5 {
  color: var(--color-text);
}

.meeting-single-item .down-content .description {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--color-text-3);
}

/* Event pages (the card holds a photo slot): a comfortable measure (~66
   characters), larger type, generous leading and a drop cap. The text
   comes from the panel as paragraphs and lists (shared/richtext.js). */
.meeting-single-item:has(.thumb) .down-content .description {
  max-width: 66ch;
  margin: 40px auto;
  padding: 0;
  border: 0;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.8;
  letter-spacing: 0.005em;
  color: var(--color-text-2);
}

.meeting-single-item:has(.thumb) .down-content .description :is(p, ul, ol) {
  margin: 0 0 1.1em;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.meeting-single-item:has(.thumb) .down-content .description :is(p, ul, ol):last-child {
  margin-bottom: 0;
}

.meeting-single-item:has(.thumb) .down-content .description :is(ul, ol) {
  padding-left: 1.4em;
}

.meeting-single-item:has(.thumb) .down-content .description ul li {
  list-style: square;
}

.meeting-single-item:has(.thumb) .down-content .description ol li {
  list-style: decimal;
}

.meeting-single-item:has(.thumb) .down-content .description li {
  margin-bottom: 0.35em;
}

.meeting-single-item:has(.thumb) .down-content .description li::marker {
  color: var(--color-green-light);
}

.meeting-single-item:has(.thumb) .down-content .description b {
  color: var(--color-paper);
}

.meeting-single-item:has(.thumb) .down-content .description a {
  color: var(--color-green-light);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) var(--ease-standard);
}

.meeting-single-item:has(.thumb) .down-content .description a:hover,
.meeting-single-item:has(.thumb) .down-content .description a:focus-visible {
  color: var(--color-paper);
}

.meeting-single-item:has(.thumb) .down-content .description > p:first-child::first-letter {
  float: left;
  margin: 0.08em 0.12em 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 3.7em;
  line-height: 0.78;
  color: var(--color-green-light);
}

/* Event pages: the card is the first thing on screen, so instead of the
   scroll-reveal fade (excluded in the reveal rules below) it stays
   visible and its parts rise in on load. The photo slot is left still on
   purpose: it is the destination of the card-to-page morph, and fading it
   in would wash out that transition. */
.meeting-single-item > :not(.thumb) {
  animation: rise-in 900ms var(--ease-out-expo) both;
}

.meeting-single-item > :nth-child(2) {
  animation-delay: 90ms;
}

.meeting-single-item > :nth-child(n + 3) {
  animation-delay: 180ms;
}

.meeting-single-item .down-content h1 {
  animation: mask-up 1100ms var(--ease-out-expo) 60ms both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mask-up {
  from {
    clip-path: inset(0 -6% 100% -6%);
    transform: translate3d(0, 40%, 0);
  }
  to {
    clip-path: inset(-20% -6% -20% -6%);
    transform: none;
  }
}

/* Info lines: Data, Location — plain rows instead of boxed chips.
   Stacked on mobile; side by side on desktop with Location left / Data
   right (row-reverse plays off the hours-then-location markup order so
   the DOM/reading order stays Data-then-Location for screen readers). */
.meeting-single-item .event-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 40px 24px;
}

@media (min-width: 768px) {
  .meeting-single-item .event-meta {
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
  }
}

.meeting-single-item .event-meta p {
  color: var(--color-text-3);
}

/* Phones: tighter side padding for the whole event card. Placed after the
   base .event-meta / .back-link rules so it wins on equal specificity. */
@media (max-width: 575.98px) {
  .meeting-single-item .down-content {
    padding: 28px 20px;
  }

  .meeting-single-item .event-meta {
    padding: 0 20px 22px;
  }

  .meeting-single-item .back-link {
    padding: 8px 20px 32px;
  }
}

.meeting-single-item .hours h2,
.meeting-single-item .hours h5,
.meeting-single-item .location h2,
.meeting-single-item .location h5 {
  font-family: var(--font-label);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--color-green-light);
  margin-bottom: 4px;
}

/* ---------------------------------------------
   Event page photo slot: fixed ratio so a single photo
   and a multi-photo carousel size identically. When a
   meeting has more than one photo, the same slot holds
   an .event-photo-carousel instead of a lone <img>.
--------------------------------------------- */
.meeting-single-item .thumb {
  aspect-ratio: 16 / 9;
}

.meeting-single-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meeting-single-item .thumb .owl-carousel,
.meeting-single-item .thumb .owl-stage-outer,
.meeting-single-item .thumb .owl-stage,
.meeting-single-item .thumb .owl-item,
.meeting-single-item .thumb .item {
  height: 100%;
}

.meeting-single-item .thumb .owl-nav,
.meeting-single-item .thumb .owl-dots {
  z-index: 2;
}

.meeting-single-item .thumb .owl-nav {
  position: absolute;
  inset: 0;
  width: auto;
  margin: 0;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  pointer-events: none;
}

.meeting-single-item .thumb .owl-nav .owl-prev,
.meeting-single-item .thumb .owl-nav .owl-next {
  position: static;
  margin: 0;
  pointer-events: auto;
}

.meeting-single-item .thumb .owl-nav .owl-prev span,
.meeting-single-item .thumb .owl-nav .owl-next span {
  opacity: 0;
}

.meeting-single-item .thumb .owl-nav .owl-prev:before,
.meeting-single-item .thumb .owl-nav .owl-next:before {
  display: inline-block;
  font-family: 'FontAwesome';
  font-size: 16px;
  font-weight: 700;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  border-radius: 0;
  clip-path: var(--clip-tag);
  background-color: rgba(11, 11, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--color-text);
  border: 1px solid var(--line-strong);
  transition: background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.meeting-single-item .thumb .owl-nav .owl-prev:before {
  content: '\f104';
}

.meeting-single-item .thumb .owl-nav .owl-next:before {
  content: '\f105';
}

.meeting-single-item .thumb .owl-nav .owl-prev:hover:before,
.meeting-single-item .thumb .owl-nav .owl-next:hover:before {
  background-color: var(--color-white);
  color: var(--color-ink);
}

.meeting-single-item .thumb .owl-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.meeting-single-item .thumb .owl-dots .owl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: rgba(243, 239, 230, 0.35);
  transition: all var(--duration-fast) var(--ease-standard);
}

.meeting-single-item .thumb .owl-dots .owl-dot.active {
  width: 22px;
  border-radius: 4px;
  background-color: var(--color-white);
}

/* ---------------------------------------------
   Gallery / interviews carousels (mip22/23/24)
--------------------------------------------- */
.immagini .item,
.our-courses .item {
  clip-path: var(--clip-card);
  overflow: hidden;
  background: var(--color-bg-2);
}

.immagini img,
.our-courses img {
  border-radius: 0;
  filter: brightness(0.82) contrast(1.07) saturate(1.02);
}

.our-courses .item .down-content {
  background-color: var(--color-bg-2);
  border-radius: 0;
}

.our-courses .item .down-content h3,
.our-courses .item .down-content h4 {
  color: var(--color-text);
  border-color: var(--line);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.our-courses .item .down-content .info p {
  color: var(--color-text-3);
}

.our-courses .item .down-content .info span {
  color: var(--color-red-light);
}

/* ---------------------------------------------
   Event photo carousel: per-slide edition-year badge.
   Reuses the .thumb .date positioning already defined in
   eventi.css but scoped to each carousel .item so it
   follows the active slide.
--------------------------------------------- */
.event-photo-carousel .item {
  position: relative;
}

/* Fluid motion: owl drives the slide with an inline 'ease' transition;
   a slower, symmetric curve reads as a glide instead of a jolt. Each
   photo rests slightly zoomed and settles while it is on screen (a slow
   Ken Burns), so the change of slide never jumps. */
.event-photo-carousel .owl-stage {
  transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1) !important;
}

.meeting-single-item .event-photo-carousel .item {
  overflow: hidden;
}

.meeting-single-item .event-photo-carousel .item img {
  transform: scale(1.06);
  transition: transform 6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.meeting-single-item .event-photo-carousel .owl-item.active .item img {
  transform: scale(1);
}

.event-photo-carousel .item .date {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  background-color: var(--color-white);
  padding: 10px 20px;
  clip-path: var(--clip-chip);
}

.event-photo-carousel .item .date span {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0.02em;
  color: var(--color-red-dark);
  text-transform: uppercase;
}

.our-courses .item .down-content a {
  color: var(--color-green-light);
  transition: color var(--duration-fast) var(--ease-standard);
}

.our-courses .item .down-content a:hover {
  color: var(--color-white);
}

.immagini .owl-nav .owl-prev:before,
.immagini .owl-nav .owl-next:before,
.our-courses .owl-nav .owl-prev:before,
.our-courses .owl-nav .owl-next:before {
  background-color: var(--color-bg-3);
  color: var(--color-text);
  border: 1px solid var(--line-strong);
}

.immagini .owl-dots .owl-dot,
.our-courses .owl-dots .owl-dot {
  background-color: rgba(243, 239, 230, 0.25);
}

.immagini .owl-dots .owl-dot.active,
.our-courses .owl-dots .owl-dot.active {
  background-color: var(--color-green);
}

/* ---------------------------------------------
   Reveal on scroll ([data-reveal], custom.js adds .is-revealed).
   A keyframe animation rather than a transition, so the stagger delay
   only applies to the entrance — a transition-delay would also hold back
   the cards' hover lift afterwards. The resting state declares no
   transform, so hover effects keep working once revealed.
--------------------------------------------- */
[data-reveal]:not(.is-revealed):not(.meeting-single-item) {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
}

[data-reveal].is-revealed:not(.meeting-single-item) {
  animation: reveal-rise var(--duration-reveal) var(--ease-out-expo) var(--reveal-delay, 0ms) backwards;
}

@keyframes reveal-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Card photos: uncovered by a curtain rising from the bottom edge,
   slightly after the card itself starts to rise. */
.meeting-item[data-reveal]:not(.is-revealed) .thumb img {
  clip-path: inset(100% 0 0 0);
}

.meeting-item.is-revealed .thumb img {
  animation: photo-curtain 1200ms var(--ease-out-expo) calc(var(--reveal-delay, 0ms) + 140ms) backwards;
}

@keyframes photo-curtain {
  from {
    clip-path: inset(100% 0 0 0);
    transform: scale(1.18);
  }
  to {
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}

.evento-item-col:nth-child(3n + 2) {
  --reveal-delay: 90ms;
}

.evento-item-col:nth-child(3n) {
  --reveal-delay: 180ms;
}

/* ---------------------------------------------
   Footer: tricolore band on top and an outlined wordmark across the
   full width (generated content, hidden from assistive tech). The
   copyright and the .footer-legal row stay as they are.
--------------------------------------------- */
.footer {
  position: relative;
  overflow: hidden;
  margin-top: clamp(80px, 10vw, 140px);
  padding: clamp(110px, 15vw, 230px) 16px 44px;
  background: var(--color-bg-1);
  border-top: 0;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--tricolore);
}

.footer::after {
  content: "125 TEAM ITALIA";
  content: "125 TEAM ITALIA" / "";
  position: absolute;
  top: clamp(34px, 4.5vw, 64px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(52px, 12.5vw, 220px);
  line-height: 0.82;
  letter-spacing: -0.005em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243, 239, 230, 0.16);
  pointer-events: none;
  user-select: none;
}

.footer p {
  position: relative;
  font-family: var(--font-label);
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--color-muted);
}

.footer p a {
  color: var(--color-green-light);
  transition: color var(--duration-fast) var(--ease-standard);
}

.footer p a:hover {
  color: var(--color-white);
}

/* Colore, corpo e link della riga arrivano già da `.footer p` e
   `.footer p a`: qui serve solo lo stacco dalla riga di copyright. */
p.footer-legal {
  margin-top: 8px;
}

/* ---------------------------------------------
   Responsive hardening
--------------------------------------------- */

/* section.meetings-page's 140px top padding (eventi.css) is sized
   for desktop. On event pages meetings-page IS the first section, so
   that much padding just pushes the title down on smaller screens. */
@media (max-width: 767px) {
  section.meetings-page {
    padding-top: 100px;
  }
}

@media (max-width: 480px) {
  section.meetings-page {
    padding-top: 86px;
  }
}

/* On the homepage, .meetings-page (#eventi) follows "Chi siamo" rather
   than the header — it doesn't need header clearance. */
.chi-siamo + .meetings-page {
  padding-top: clamp(24px, 4vw, 56px);
}

/* The event-photo-carousel's owl-nav buttons render at 40x36px —
   under the 44x44 minimum touch target — on every screen size. Extends
   through tablet-landscape widths (up to 1200px), which are still touch
   devices even though they're past the 991px tablet-portrait breakpoint. */
@media (max-width: 1200px) {
  .meeting-single-item .thumb .owl-nav .owl-prev:before,
  .meeting-single-item .thumb .owl-nav .owl-next:before {
    width: 44px;
    height: 44px;
    line-height: 44px;
  }
}

/* ---------------------------------------------
   Accessibility: honor reduced motion / transparency
   (apple-design §14) — never remove feedback, just soften it.
--------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  @view-transition {
    navigation: none;
  }

  .main-button-green a,
  .main-button-outline a,
  .main-button-counter a,
  .meeting-item,
  .meeting-single-item,
  .meeting-item .thumb img,
  .meeting-single-item .thumb img {
    transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease !important;
    transform: none !important;
  }

  .counter-kicker-dot {
    animation: none !important;
  }

  [data-reveal],
  [data-reveal] *,
  .meeting-single-item > *,
  .meeting-single-item .down-content h1 {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .header-area,
  .header-area.background-header {
    background-color: var(--color-bg) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
