/* ============================================================
   Corri Pedala Corri del Varaita - stile sportivo arancio
   Palette: arancio #e8730c (ufficiale CPC), verde MTB #2e8b57,
            blu corsa #1f5577, antracite #232a31
   Font: Lato + Roboto Mono
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&family=Roboto+Mono:wght@500;700&display=swap');

:root {
  --arancio: #e8730c;
  --arancio-scuro: #c45a00;
  --arancio-chiaro: #ff9838;
  --verde: #2e8b57;
  --blu: #1f5577;
  --antracite: #232a31;
  --bg: #f5f3ef;
  --card: #ffffff;
  --bordo: #e3ddd3;
  --testo: #2c2a26;
  --muted: #8a8175;
  --ombra: 0 4px 14px rgba(35,42,49,0.10);
  --ombra-hover: 0 10px 28px rgba(35,42,49,0.18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--testo);
  margin: 0; line-height: 1.55; font-weight: 400;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ============ HEADER ============ */
.main-header {
  background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.07);
  border-bottom: 4px solid var(--arancio);
  position: sticky; top: 0; z-index: 100;
}
.header-content {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { opacity: .9; }
.brand-logo { height: 52px; width: auto; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.brand-mark {
  display: flex; flex-direction: column; line-height: 1.1;
}
.brand-mark strong {
  font-weight: 900; font-size: 18px; letter-spacing: -0.4px; color: var(--arancio);
}
.brand-mark small {
  font-size: 10px; letter-spacing: 1.5px; font-weight: 700;
  color: var(--muted); margin-top: 3px; text-transform: uppercase;
}
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--antracite); text-decoration: none; padding: 9px 13px;
  border-radius: 6px; font-size: 13.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; transition: background .15s, color .15s;
}
.main-nav a:hover, .main-nav a.active { background: var(--arancio); color: #fff; }
.menu-toggle {
  display: none; font-size: 28px; background: none; border: none; cursor: pointer;
  color: var(--arancio); padding: 4px 10px; line-height: 1;
}

/* ============ TIPOGRAFIA ============ */
h1,h2,h3,h4 { font-family: 'Lato', sans-serif; font-weight: 900; letter-spacing: -0.5px; }
h2 {
  color: var(--antracite); margin: 30px 0 16px; padding-bottom: 8px;
  border-bottom: 4px solid var(--arancio); font-size: 1.5em;
  text-transform: uppercase; letter-spacing: 1px;
}
h3 { color: var(--arancio-scuro); margin: 18px 0 8px; font-size: 1.2em; }
p { margin: .6em 0; }
a { color: var(--arancio-scuro); }

/* ============ HERO ============ */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--antracite) 0%, #2f3a44 45%, var(--blu) 100%);
  border-radius: 16px; padding: 44px 32px; margin: 22px 0;
  box-shadow: var(--ombra);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(232,115,12,.55) 0%, transparent 70%);
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-block; background: var(--arancio); color: #fff;
  font-weight: 900; text-transform: uppercase; letter-spacing: 2px;
  font-size: 12px; padding: 6px 14px; border-radius: 20px; margin-bottom: 14px;
}
.hero h1 {
  color: #fff; font-size: 2.6em; line-height: 1.05; margin: 0 0 12px;
  text-transform: uppercase;
}
.hero h1 .accent { color: var(--arancio-chiaro); }
.hero p { font-size: 17px; opacity: .94; max-width: 680px; }
.hero .stat-row { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 22px; }
.hero .stat { line-height: 1.1; }
.hero .stat b { font-size: 2em; font-family: 'Roboto Mono', monospace; color: var(--arancio-chiaro); }
.hero .stat span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }

/* ============ BOTTONI ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
  background: #fff; color: var(--antracite); text-decoration: none; border-radius: 9px;
  font-size: 14px; font-weight: 800; border: 2px solid var(--bordo); cursor: pointer;
  min-height: 44px; transition: all .15s; text-transform: uppercase; letter-spacing: .5px;
}
.btn:hover { border-color: var(--arancio); transform: translateY(-2px); box-shadow: var(--ombra); }
.btn.primary {
  background: linear-gradient(135deg, var(--arancio) 0%, var(--arancio-scuro) 100%);
  color: #fff; border-color: var(--arancio); box-shadow: 0 3px 10px rgba(232,115,12,.35);
}
.btn.primary:hover { box-shadow: 0 8px 20px rgba(232,115,12,.5); }
.btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.btn.ghost:hover { background: rgba(255,255,255,.22); }
.btn.big { padding: 16px 30px; font-size: 16px; }

/* ============ GRID TAPPE ============ */
.tappe-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px; margin: 26px 0;
}
.tappa-card {
  background: var(--card); border-radius: 14px; box-shadow: var(--ombra);
  overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s;
  border-top: 6px solid var(--arancio);
}
.tappa-card:hover { transform: translateY(-5px); box-shadow: var(--ombra-hover); }
.tappa-card .tc-head {
  padding: 18px 20px 14px; position: relative;
  background: linear-gradient(135deg, #fff 0%, #fbf6ef 100%);
}
.tappa-card .tc-num {
  position: absolute; top: 14px; right: 18px; font-family: 'Roboto Mono', monospace;
  font-size: 46px; font-weight: 700; color: rgba(232,115,12,.16); line-height: 1;
}
.tappa-card .tc-tag {
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--arancio); margin-bottom: 6px;
}
.tappa-card h3 { margin: 0 0 4px; color: var(--antracite); font-size: 1.25em; }
.tappa-card .tc-sub { color: var(--muted); font-size: 14px; font-style: italic; }
.tappa-card .tc-body { padding: 4px 20px 18px; }
.tappa-card .tc-meta { font-size: 14.5px; font-weight: 700; color: var(--testo); margin: 8px 0 4px; }
.tappa-card .tc-meta .ico { color: var(--arancio); }
.tappa-card .frazioni-mini {
  display: flex; gap: 6px; margin: 12px 0 4px; flex-wrap: wrap;
}
.fraz-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg); border: 1px solid var(--bordo); border-radius: 18px;
  padding: 5px 11px; font-size: 12.5px; font-weight: 700;
  font-family: 'Roboto Mono', monospace;
}
.tappa-card .tc-foot {
  margin-top: auto; padding: 14px 20px;
  background: var(--antracite); color: #fff;
  font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
}
.tappa-card:hover .tc-foot { background: var(--arancio-scuro); }

/* ============ SEZIONE INFO CIRCUITO ============ */
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; margin: 18px 0; }
.info-card {
  background: var(--card); border-radius: 12px; padding: 20px; box-shadow: var(--ombra);
  border-left: 5px solid var(--arancio);
}
.info-card .ic-ico { font-size: 30px; }
.info-card h4 { margin: 8px 0 4px; color: var(--antracite); font-size: 1.05em; }
.info-card p { margin: 0; color: var(--muted); font-size: 14px; }

.comuni-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; margin: 18px 0; }
.comune-card {
  background: var(--card); border-radius: 12px; padding: 20px; box-shadow: var(--ombra);
  border-top: 4px solid var(--arancio); text-decoration: none; display: block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.comune-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.comune-card img { height: 56px; width: auto; object-fit: contain; margin-bottom: 10px; }
.comune-card h4 { margin: 0 0 6px; color: var(--antracite); font-size: 1.05em; }
.comune-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.comune-info-card {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  background: var(--card); border-radius: 14px; box-shadow: var(--ombra);
  border-left: 6px solid var(--arancio); padding: 22px 26px; margin: 18px 0;
}
.comune-info-card .cic-logo {
  flex: 0 0 auto; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px; padding: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.comune-info-card .cic-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.comune-info-card .cic-body { flex: 1; min-width: 240px; }
.comune-info-card h2 { margin: 0 0 8px; color: var(--antracite); }
.comune-info-card p { margin: 0; line-height: 1.7; color: var(--testo); }

/* ============ PAGINA TAPPA ============ */
.tappa-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 16px;
  background: linear-gradient(135deg, var(--antracite) 0%, var(--arancio-scuro) 130%);
  padding: 36px 30px; margin: 22px 0; box-shadow: var(--ombra);
}
.tappa-hero .num-badge {
  display: inline-block; background: var(--arancio); color: #fff; font-weight: 900;
  font-family: 'Roboto Mono', monospace; padding: 4px 14px; border-radius: 8px;
  letter-spacing: 1px; margin-bottom: 12px; text-transform: uppercase; font-size: 13px;
}
.tappa-hero h1 { color: #fff; margin: 0 0 6px; font-size: 2.2em; line-height: 1.1; text-transform: uppercase; }
.tappa-hero .sub { font-size: 17px; opacity: .92; font-style: italic; }
.tappa-hero .when {
  display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px;
  font-weight: 700; font-size: 15px;
}
.tappa-hero .when .ico { color: var(--arancio-chiaro); }

/* frazioni grandi */
.frazioni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.fraz-box {
  background: var(--card); border-radius: 12px; box-shadow: var(--ombra); padding: 18px;
  text-align: center; border-bottom: 5px solid var(--arancio);
}
.fraz-box .fb-ico { font-size: 34px; }
.fraz-box .fb-tipo { text-transform: uppercase; letter-spacing: 1px; font-weight: 900; color: var(--muted); font-size: 12px; margin-top: 4px; }
.fraz-box .fb-dist { font-family: 'Roboto Mono', monospace; font-size: 1.7em; font-weight: 700; color: var(--arancio-scuro); }
.fraz-box .fb-extra { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.fraz-arrow { display: flex; align-items: center; justify-content: center; color: var(--arancio); font-size: 22px; font-weight: 900; }

/* layout due colonne */
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }

/* programma timeline */
.timeline { list-style: none; padding: 0; margin: 10px 0; }
.timeline li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--bordo); }
.timeline li:last-child { border-bottom: none; }
.timeline .t-ora {
  font-family: 'Roboto Mono', monospace; font-weight: 700; color: var(--arancio-scuro);
  min-width: 88px; flex-shrink: 0;
}
.timeline .t-txt { font-weight: 700; }

/* card generica */
.panel { background: var(--card); border-radius: 12px; box-shadow: var(--ombra); padding: 22px; margin: 16px 0; }
.panel h3 { margin-top: 0; }

/* mappa */
.map-wrap { border-radius: 12px; overflow: hidden; box-shadow: var(--ombra); margin: 12px 0; }
.map-wrap iframe { display: block; width: 100%; height: 320px; border: 0; }

/* immagini percorso / volantino */
.img-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 14px; margin: 14px 0; }
figure.img-card { margin: 0; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--ombra); }
figure.img-card img { width: 100%; display: block; }
figure.img-card figcaption { padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--muted); }
.volantino-img { max-width: 520px; width: 100%; border-radius: 12px; box-shadow: var(--ombra); display: block; margin: 0 auto; }

/* tabella iscrizione */
table.prezzi { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--ombra); }
table.prezzi td { padding: 12px 16px; border-bottom: 1px solid var(--bordo); }
table.prezzi tr:last-child td { border-bottom: none; }
table.prezzi td:first-child { font-weight: 700; }
table.prezzi td:last-child { text-align: right; font-family: 'Roboto Mono', monospace; font-weight: 700; color: var(--arancio-scuro); }

/* contatti */
.contatti { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.contatto {
  display: flex; flex-direction: column; background: var(--card); border-radius: 10px;
  padding: 12px 18px; box-shadow: var(--ombra); border-left: 4px solid var(--verde);
}
.contatto .c-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.contatto .c-num { font-family: 'Roboto Mono', monospace; font-size: 1.15em; font-weight: 700; color: var(--antracite); }

.callout {
  background: linear-gradient(90deg, #fff5e9 0%, #fff 100%);
  border-left: 5px solid var(--arancio); border-radius: 10px;
  padding: 14px 18px; margin: 14px 0; font-size: 14.5px;
}
.tbd {
  background: #fff; border: 2px dashed var(--bordo); border-radius: 12px;
  padding: 26px; text-align: center; color: var(--muted); margin: 14px 0;
}

/* nav tappe in fondo */
.tappe-nav { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0; }
.tappe-nav a {
  flex: 1; min-width: 220px; background: var(--card); border-radius: 10px; padding: 14px 18px;
  text-decoration: none; box-shadow: var(--ombra); border-left: 4px solid var(--arancio);
  color: var(--antracite); font-weight: 700; transition: transform .15s;
}
.tappe-nav a:hover { transform: translateY(-2px); }
.tappe-nav a.current { background: var(--arancio); color: #fff; border-left-color: var(--arancio-scuro); }
.tappe-nav a small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.tappe-nav a.current small { color: rgba(255,255,255,.85); }

/* ============ PARTNER / LOGHI ============ */
.partner-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 22px 34px; padding: 8px 0 22px; margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.partner-strip img {
  height: 54px; width: auto; max-width: 150px; object-fit: contain;
  background: #fff; border-radius: 8px; padding: 6px 10px;
}
.loghi-section { background: var(--card); border-radius: 14px; box-shadow: var(--ombra); padding: 24px; margin: 18px 0; }
.loghi-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 30px; }
.loghi-row .lr-lbl { width: 100%; text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 900; margin-bottom: 4px; }
.loghi-row img, .loghi-row a img { height: 64px; width: auto; max-width: 170px; object-fit: contain; }
.loghi-divider { height: 1px; background: var(--bordo); margin: 18px 0; }

/* ============ PREMI ============ */
.premi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 12px; margin: 12px 0; }
.premio-card {
  background: var(--card); border-radius: 10px; box-shadow: var(--ombra);
  padding: 14px 16px; border-left: 5px solid var(--verde);
}
.premio-card .pc-cat { font-weight: 900; color: var(--antracite); font-size: 14.5px; }
.premio-card .pc-pos { color: var(--muted); font-size: 13px; font-weight: 700; font-family: 'Roboto Mono', monospace; margin-top: 2px; }

/* ============ REGOLAMENTO ============ */
.reg-list { list-style: none; padding: 0; margin: 8px 0; }
.reg-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--bordo); }
.reg-list li:last-child { border-bottom: none; }
.reg-list li::before { content: "▸"; color: var(--arancio); font-weight: 900; flex-shrink: 0; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 14px; margin: 12px 0; }
.cat-card { background: var(--card); border-radius: 10px; box-shadow: var(--ombra); padding: 16px 18px; border-top: 4px solid var(--arancio); }
.cat-card h4 { margin: 0 0 6px; color: var(--arancio-scuro); }
.cat-card p { margin: 0; font-size: 14px; color: var(--testo); }

/* stemma comune nella tappa hero */
.tappa-hero .comune-badge {
  position: absolute; top: 22px; right: 26px; background: #fff; border-radius: 10px;
  padding: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.tappa-hero .comune-badge img { height: 64px; width: auto; display: block; }

/* ============ FOOTER ============ */
footer { background: var(--antracite); color: #c5c2bb; padding: 28px 0; margin-top: 50px; text-align: center; }
footer .leotec { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; }
footer .leotec img { height: 26px; }
footer a { color: var(--arancio-chiaro); text-decoration: none; }
footer small { opacity: .85; font-size: 13px; }

/* ============ MOBILE ============ */
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 100%; right: 0; left: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15); border-top: 2px solid var(--arancio);
  }
  body.nav-open .main-nav { display: flex; }
  .main-nav a { padding: 14px 18px; border-bottom: 1px solid var(--bordo); border-radius: 0; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.9em; }
  .frazioni { grid-template-columns: 1fr; }
  .fraz-arrow { display: none; }
}
