/* =========================================================
   MotoGP Misano 2026 – Stylesheet
   Day/Night theme via CSS custom properties + [data-theme]
   Cache-Busting: <link href="style.css?v=YYYYMMDD-NN"> wird beim
   Commit automatisch vom pre-commit-Hook hochgezaehlt.
   ========================================================= */

/* ---------- Theme tokens ---------- */
:root {
  /* Brand */
  --accent:        #e2231a;   /* MotoGP red */
  --accent-2:      #ff7a18;   /* Adriatic sunset orange */
  --accent-3:      #0a84ff;   /* Adriatic blue */

  /* Day (default) */
  --bg:            #f4f6fb;
  --bg-elev:       #ffffff;
  --bg-soft:       #eef1f7;
  --text:          #14181f;
  --text-soft:     #54606f;
  --border:        #e2e7ef;
  --shadow:        0 10px 30px rgba(20, 30, 50, .08);
  --shadow-sm:     0 4px 14px rgba(20, 30, 50, .07);
  --header-bg:     rgba(255, 255, 255, .82);
  --hero-grad:     linear-gradient(135deg, #1b2a4a 0%, #34507e 45%, #ff7a18 120%);
  --overlay:       linear-gradient(180deg, rgba(10,16,30,.20), rgba(10,16,30,.55));
}

[data-theme="night"] {
  --bg:            #0c1018;
  --bg-elev:       #151b27;
  --bg-soft:       #1b2230;
  --text:          #eef2f8;
  --text-soft:     #97a3b6;
  --border:        #26303f;
  --shadow:        0 12px 34px rgba(0, 0, 0, .45);
  --shadow-sm:     0 4px 16px rgba(0, 0, 0, .4);
  --header-bg:     rgba(12, 16, 24, .80);
  --hero-grad:     linear-gradient(135deg, #06090f 0%, #16233f 50%, #7a2b08 130%);
  --overlay:       linear-gradient(180deg, rgba(4,7,12,.45), rgba(4,7,12,.78));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

.container { width: min(1120px, 92%); margin-inline: auto; }

a { color: inherit; text-decoration: none; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background .35s ease, border-color .35s ease;
}
.nav {
  width: min(1120px, 92%); margin-inline: auto;
  display: flex; align-items: center; gap: 1rem;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; letter-spacing: .2px; order: 1; }
.brand-flag { font-size: 1.3rem; }
.brand-year { color: var(--accent); }

.nav-links {
  list-style: none; display: flex; gap: .25rem;
  margin-left: auto; align-items: center; order: 2;
}
.nav-links a {
  display: block; padding: .5rem .7rem; border-radius: 8px;
  font-size: .92rem; font-weight: 600; color: var(--text-soft);
  transition: color .2s ease, background .2s ease;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); }
.nav-links a.is-current { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.nav-controls { display: flex; align-items: center; gap: .6rem; margin-left: 1rem; order: 3; }

.lang-switch {
  display: inline-flex; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px;
}
.lang-btn {
  border: 0; background: transparent; cursor: pointer;
  font-weight: 700; font-size: .8rem; color: var(--text-soft);
  padding: .3rem .6rem; border-radius: 999px; transition: all .2s ease;
}
.lang-btn.is-active { background: var(--accent); color: #fff; }

.theme-toggle {
  position: relative; width: 56px; height: 30px; flex: none;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-soft); cursor: pointer; overflow: hidden;
}
.theme-icon { position: absolute; top: 50%; transform: translateY(-50%); font-size: .95rem; transition: opacity .3s ease, transform .3s ease; }
.theme-icon--sun  { left: 7px;  opacity: 1; }
.theme-icon--moon { right: 7px; opacity: .35; }
[data-theme="night"] .theme-icon--sun  { opacity: .35; }
[data-theme="night"] .theme-icon--moon { opacity: 1; }
.theme-toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform .3s cubic-bezier(.4,1.4,.6,1);
}
[data-theme="night"] .theme-toggle::after { transform: translateX(26px); background: var(--accent-3); }

/* mobile menu toggle */
.nav-toggle {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 88vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: #fff;
  background: var(--hero-grad);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 14px, transparent 14px 28px);
  pointer-events: none;
}
.hero-overlay { position: absolute; inset: 0; background: var(--overlay); }
.hero-content { position: relative; z-index: 2; padding: 2rem; width: min(900px, 92%); }
.hero-kicker {
  text-transform: uppercase; letter-spacing: 2px; font-size: .8rem; font-weight: 700;
  color: var(--accent-2); margin-bottom: .8rem;
}

/* Title artwork */
.hero-image {
  display: block; width: min(560px, 100%); height: auto; margin: 0 auto 1.6rem;
  border-radius: 16px; border: 3px solid rgba(255,255,255,.85);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

.hero-title {
  font-size: clamp(2.2rem, 8vw, 5.2rem); font-weight: 900; line-height: 1.04;
  letter-spacing: -1px; text-shadow: 0 4px 30px rgba(0,0,0,.35);
  /* allow the title to wrap cleanly on small screens */
  display: flex; flex-wrap: wrap; gap: .15em .35em;
  justify-content: center; align-items: baseline;
  overflow-wrap: anywhere;
}
.hero-title .accent { color: var(--accent-2); }
.hero-title .hero-year { color: var(--accent-2); }
.hero-sub { margin-top: 1rem; font-size: clamp(1rem, 2.4vw, 1.3rem); font-weight: 500; opacity: .95; }

/* Countdown */
.countdown { display: flex; gap: .7rem; justify-content: center; margin: 2rem 0 2.2rem; flex-wrap: wrap; }
.cd-box {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px); border-radius: 14px;
  padding: .9rem 1.1rem; min-width: 76px;
}
.cd-num { display: block; font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; line-height: 1; }
.cd-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; opacity: .85; margin-top: .35rem; }

.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: .8rem 1.5rem; border-radius: 999px;
  font-weight: 700; font-size: .95rem; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(226,35,26,.4); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.4); }

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
  position: relative; color: #fff; background: var(--hero-grad);
  padding: clamp(2.4rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem);
  overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 14px, transparent 14px 28px);
}
.page-hero > .container { position: relative; z-index: 2; }
.page-hero-back {
  display: inline-block; font-weight: 700; font-size: .9rem;
  color: #fff; opacity: .85; margin-bottom: 1rem;
  padding: .35rem .8rem; border: 1px solid rgba(255,255,255,.4); border-radius: 999px;
  transition: opacity .2s ease, background .2s ease;
}
.page-hero-back:hover { opacity: 1; background: rgba(255,255,255,.12); }
.page-hero .section-num { color: #fff; border-color: rgba(255,255,255,.6); background: transparent; }
.page-hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 900; letter-spacing: -.5px; margin-top: .6rem; }
.page-hero-lead { margin-top: .7rem; font-size: 1.08rem; opacity: .95; max-width: 760px; }

/* ---------- Overview (home) link cards ---------- */
.overview { padding: clamp(3rem, 7vw, 5rem) 0; }
.overview-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.3rem;
}
.ov-card {
  display: flex; flex-direction: column; gap: .4rem;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.6rem; box-shadow: var(--shadow-sm); color: inherit;
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
}
.ov-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent-2); }
.ov-card .ov-icon { font-size: 2rem; }
.ov-card h3 { font-size: 1.25rem; }
.ov-card p { color: var(--text-soft); font-size: .95rem; }
.ov-card .ov-go { margin-top: auto; font-weight: 700; color: var(--accent-2); }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-bottom: 1px solid var(--border); }
.section-head { max-width: 760px; margin-bottom: 2.5rem; }
.section-num {
  display: inline-block; font-size: .85rem; font-weight: 800; letter-spacing: 2px;
  color: var(--accent); border: 1.5px solid var(--accent); border-radius: 999px;
  padding: .15rem .7rem; margin-bottom: .9rem;
}
.section-head h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 800; letter-spacing: -.5px; }
.section-lead { margin-top: .7rem; color: var(--text-soft); font-size: 1.08rem; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.cards--two   { grid-template-columns: repeat(2, 1fr); }
.cards--three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 18px; padding: 1.6rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent-2); }
.card-icon { font-size: 1.9rem; margin-bottom: .6rem; }
.card h3 { font-size: 1.2rem; margin-bottom: .6rem; }
.card ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.card li { position: relative; padding-left: 1.2rem; color: var(--text-soft); font-size: .96rem; }
.card li::before { content: "›"; position: absolute; left: 0; color: var(--accent-2); font-weight: 800; }
.card p { color: var(--text-soft); }
.card--compact { padding: 1.3rem; }
.card--compact h3 { font-size: 1.05rem; }
.card--photo h3 { color: var(--text); }

/* ---------- Schedule ---------- */
.schedule { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.day-col {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.day-col--highlight { border-color: var(--accent-3); }
.day-col--race { border-color: var(--accent); }
.day-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1rem 1.3rem; background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.day-name { font-weight: 800; font-size: 1.15rem; }
.day-date { font-size: .85rem; color: var(--text-soft); font-weight: 600; }
.day-list { list-style: none; padding: .6rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: .2rem; }
.day-list li { display: flex; gap: .9rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.day-list li:last-child { border-bottom: 0; }
.day-list .t { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent); min-width: 48px; font-size: .95rem; }
.day-list .e { font-size: .95rem; }
.day-list .badge { font-weight: 800; }

/* ---------- Info box / notes ---------- */
.info-box {
  margin-top: 1.8rem; padding: 1.1rem 1.4rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-3) 12%, var(--bg-elev)), var(--bg-elev));
  border: 1px solid var(--border); border-left: 4px solid var(--accent-3);
  border-radius: 12px; font-size: .98rem;
}
.note { margin-top: 1.2rem; font-size: .9rem; color: var(--text-soft); font-style: italic; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 1.2rem; padding-left: .5rem; }
.timeline::before { content: ""; position: absolute; left: 22px; top: 12px; bottom: 12px; width: 2px; background: var(--border); }
.tl-item { display: flex; gap: 1.1rem; align-items: flex-start; position: relative; }
.tl-dot {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.2rem;
  background: var(--bg-elev); border: 2px solid var(--accent-2); z-index: 1;
}
.tl-body {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem 1.3rem; flex: 1; box-shadow: var(--shadow-sm);
}
.tl-body h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.tl-body p { color: var(--text-soft); font-size: .96rem; }

/* ---------- Map (Leaflet) ---------- */
.map-section { margin-top: 2rem; }
.map-section h3 { font-size: 1.3rem; margin-bottom: .8rem; }
.map-wrap {
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
#map { height: 440px; width: 100%; background: var(--bg-soft); }
.leaflet-container { font: inherit; }
.map-hint { margin-top: .7rem; font-size: .85rem; color: var(--text-soft); }
@media (max-width: 600px) { #map { height: 340px; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-elev); border-top: 1px solid var(--border); padding: 2.5rem 0; margin-top: 0; }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; align-items: center; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.footer-links { list-style: none; display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--accent-3); font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }
.footer-note { color: var(--text-soft); font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--header-bg); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); padding: .5rem 0;
    transform: translateY(-130%); transition: transform .3s ease; margin-left: 0;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .9rem 1.5rem; border-radius: 0; }
  .nav-links a.is-current { background: var(--bg-soft); }
  .nav-toggle { display: flex; }
  .nav-controls { margin-left: auto; }
  .cards, .cards--two, .cards--three, .schedule { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .brand-text { font-size: .98rem; }
}
@media (max-width: 480px) {
  .nav-links li a { font-size: 1rem; }
  .cd-box { min-width: 64px; padding: .7rem .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}
