/* ============================================================
   safe-race.de – zentrales Stylesheet
   Design nach Vorlage der Originalseite (Racing-Grün / Dunkel)
   ============================================================ */

/* ---------- Schriften (lokal, DSGVO-konform) ---------- */
@font-face {
  font-family: "Audiowide";
  src: url("../fonts/audiowide.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design-Token ---------- */
:root {
  --color-primary: #7db927;      /* Racing-Grün */
  --color-primary-dark: #6ca221;
  --color-dark: #131313;
  --color-text: #313131;
  --color-muted: #585858;
  --color-bg: #ffffff;
  --color-bg-alt: #f2f2f2;
  --font-head: "Audiowide", "Arial Black", sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  --container: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary-dark); }
a:hover { color: var(--color-primary); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-dark);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.45rem); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding: 70px 0; }
.section.alt { background: var(--color-bg-alt); }
.section-title { text-align: center; margin-bottom: 45px; }
.section-title .kicker {
  display: block;
  color: var(--color-primary);
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff !important;
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--color-primary-dark); transform: translateY(-2px); }
.btn.outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary) !important;
}
.btn.outline:hover { background: var(--color-primary); color: #fff !important; }

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}
.brand img { width: 180px; height: auto; }

.nav-list {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  display: block;
  padding: 26px 14px;
  color: var(--color-dark);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active { color: var(--color-primary); }
.caret {
  display: inline-block;
  margin-left: 6px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  padding: 3px;
  transform: rotate(45deg) translateY(-2px);
}

.has-dropdown { position: relative; }
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 300px;
  background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s;
}
.has-dropdown:hover .dropdown,
.has-dropdown.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 10px 20px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.92rem;
}
.dropdown a:hover { background: var(--color-bg-alt); color: var(--color-primary-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  background: var(--color-dark);
}
.hero .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55));
}
/* Hero-Carousel */
.hero-carousel { position: absolute; inset: 0; }
.carousel-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 1s ease;
  will-change: transform, opacity;
}
.carousel-slide.is-active { opacity: 1; }

/* Ken-Burns-Varianten (zufällig pro Slide gewählt) */
.carousel-slide.kb-tl.is-active      { animation: kb-tl 9s ease-out forwards; }
.carousel-slide.kb-tr.is-active      { animation: kb-tr 9s ease-out forwards; }
.carousel-slide.kb-bl.is-active      { animation: kb-bl 9s ease-out forwards; }
.carousel-slide.kb-br.is-active      { animation: kb-br 9s ease-out forwards; }
.carousel-slide.kb-zoom-in.is-active { animation: kb-zoom-in 9s ease-out forwards; }
.carousel-slide.kb-zoom-out.is-active{ animation: kb-zoom-out 9s ease-out forwards; }

@keyframes kb-tl {
  from { transform: scale(1.35) translate(4%, 3%); }
  to   { transform: scale(1.05) translate(-2%, -1%); }
}
@keyframes kb-tr {
  from { transform: scale(1.35) translate(-4%, 3%); }
  to   { transform: scale(1.05) translate(2%, -1%); }
}
@keyframes kb-bl {
  from { transform: scale(1.35) translate(4%, -3%); }
  to   { transform: scale(1.05) translate(-2%, 1%); }
}
@keyframes kb-br {
  from { transform: scale(1.35) translate(-4%, -3%); }
  to   { transform: scale(1.05) translate(2%, 1%); }
}
@keyframes kb-zoom-in {
  from { transform: scale(1); }
  to   { transform: scale(1.3); }
}
@keyframes kb-zoom-out {
  from { transform: scale(1.35); }
  to   { transform: scale(1); }
}

/* Kachel-Flip-Übergang */
.carousel-tiles {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  perspective: 1400px;
  pointer-events: none;
}
.carousel-tile {
  backface-visibility: hidden;
  transform-origin: center;
  animation: tile-flip 0.65s cubic-bezier(0.55, 0, 0.55, 1) forwards;
}
@keyframes tile-flip {
  from { transform: rotateY(0deg); opacity: 1; }
  to   { transform: rotateY(95deg) scale(0.85); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide,
  .carousel-tile { animation: none !important; transition: opacity 0.5s ease; }
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.carousel-arrow:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.carousel-arrow.prev { left: 22px; }
.carousel-arrow.next { right: 22px; }
.carousel-dots {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 10px;
}
.carousel-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.2);
}
@media (max-width: 600px) {
  .carousel-arrow { width: 40px; height: 40px; }
  .carousel-arrow.prev { left: 10px; }
  .carousel-arrow.next { right: 10px; }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 40px 56px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
}
.hero-content h1,
.hero-content .subtitle {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
@media (max-width: 600px) {
  .hero-content { padding: 32px 24px; margin-inline: 16px; }
}
.hero-content h1 { color: #fff; }
.hero-content .subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  margin-bottom: 32px;
}
.hero.small { min-height: 44vh; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
}
.card h3 { color: var(--color-primary-dark); }
.card p { flex: 1; }
.card .btn { align-self: flex-start; margin-top: 18px; }

/* ---------- CTA-Band ---------- */
.cta-band {
  background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)),
    url("../images/nhztol0u0de-edited.jpg") center/cover fixed;
  color: #fff;
  text-align: center;
  padding: 90px 20px;
}
.cta-band h2 { color: #fff; }

/* ---------- Listen mit Häkchen ---------- */
.check-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5em;
}
.check-list li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 10px;
}
.check-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
}

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.data th,
table.data td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #e6e6e6;
}
table.data thead th {
  background: var(--color-dark);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 0.9rem;
}
table.data tbody tr:nth-child(even) { background: var(--color-bg-alt); }

/* ---------- Zwei-Spalten-Layout ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Partner-Logos ---------- */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 24px;
  align-items: center;
}
.partner-grid img {
  width: 100%;
  max-width: 140px;
  margin-inline: auto;
  filter: grayscale(35%);
  transition: filter 0.25s, transform 0.25s;
}
.partner-grid img:hover { filter: none; transform: scale(1.06); }

/* ---------- Kontakt-Boxen ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.contact-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.contact-box h3 { color: var(--color-primary-dark); }

/* ---------- Rechtstexte ---------- */
.legal { max-width: 860px; }
.legal h2 { margin-top: 1.8em; }
.legal h3 { margin-top: 1.4em; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-dark);
  color: #cfcfcf;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 36px;
  padding-block: 56px;
}
.site-footer h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.site-footer a { color: var(--color-primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid #2c2c2c;
  padding-block: 18px;
  font-size: 0.88rem;
}
.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .site-nav.open { max-height: 80vh; overflow-y: auto; }
  .nav-list { flex-direction: column; padding: 10px 0; }
  .nav-link { padding: 14px 24px; }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: hidden;
    transform: none;
    box-shadow: none;
    max-height: 0;
    padding: 0;
    overflow: hidden;
  }
  .has-dropdown.open .dropdown {
    visibility: visible;
    max-height: 500px;
    padding: 0 0 8px;
  }
  .dropdown a { padding-left: 44px; }
  .split { grid-template-columns: 1fr; }
}
