/* ==========================================================================
   OAMC Reinheim – Website Preview (Racing theme)
   Shared stylesheet (desktop + mobile)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --red: #e30613;
  --red-dark: #b60510;
  --ink: #111114;
  --ink-soft: #1c1c22;
  --card-bg: #f3f4f6;
  --card-bg-alt: #ffffff;
  --submenu-bg: #f3f4f6;
  --text: #16181d;
  --muted: #5b6270;
  --white: #ffffff;
  --border: #e4e6eb;
  --shadow: 0 12px 34px rgba(15, 18, 30, 0.10);
  --shadow-sm: 0 6px 18px rgba(15, 18, 30, 0.08);
  --radius: 6px;
  --radius-lg: 10px;
  --max-width: 1360px;
  --header-h: 84px;
  /* red / white diagonal hazard stripes */
  --hazard: repeating-linear-gradient(-45deg, var(--red) 0 16px, #ffffff 16px 32px);
  --hazard-fine: repeating-linear-gradient(-45deg, var(--red) 0 10px, #ffffff 10px 20px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

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

h1,
h2,
h3 {
  font-family: "Archivo", "Inter", sans-serif;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
}

p {
  margin: 0 0 1rem;
  color: #3b4048;
}

p:last-child {
  margin-bottom: 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.brand-name {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
}

/* ----- Navigation ----- */
.main-nav {
  margin-left: auto;
  align-self: stretch; /* fill full header height */
  display: flex;
}

.main-nav > ul {
  display: flex;
  align-items: stretch; /* nav items fill full height */
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.main-nav > ul > li {
  display: flex;
  align-items: center;
}

.main-nav a {
  position: relative;
  font-family: "Archivo", sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 700;
  padding: 0 2px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}

/* red underline indicator on hover */
.main-nav > ul > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.main-nav > ul > li > a:hover::after,
.has-dropdown:hover > a::after {
  transform: scaleX(1);
}

/* The dropdown parent stretches full height so the mouse can travel
   from the label straight down into the panel without losing hover */
.has-dropdown {
  height: 100%;
}

.has-dropdown > a {
  height: 100%;
}

.main-nav a:hover {
  color: var(--red);
}

.main-nav .caret {
  font-size: 0.7rem;
  color: var(--red);
}

/* Dropdown / full-width mega submenu */
.has-dropdown {
  position: static;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--submenu-bg);
  border-top: 3px solid var(--red);
  box-shadow: 0 18px 34px rgba(15, 18, 30, 0.20);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.18s ease;
  z-index: 60;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 24px;
  display: flex;
  gap: 64px;
}

.dropdown-title {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  margin-bottom: 14px;
}

.dropdown-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropdown-col a {
  padding: 4px 0;
  font-weight: 600;
  color: var(--ink);
}

.dropdown-col a:hover {
  color: var(--red);
}

/* ADAC logo (right) */
.adac-logo {
  flex-shrink: 0;
  margin-left: 8px;
}

.adac-logo img {
  height: 75px;
  width: auto;
  object-fit: contain;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 3px;
  background: var(--ink);
  border-radius: 0;
  transition: all 0.25s ease;
}

.nav-toggle span + span {
  margin-top: 5px;
}

/* ==========================================================================
   Page title bar (red racing band with hazard-stripe corner)
   ========================================================================== */
.page-title-bar {
  position: relative;
  background: var(--red);
  overflow: hidden;
}

/* diagonal hazard-stripe block on the right edge (desktop) */
.page-title-bar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 160px;
  background: var(--hazard);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 0% 100%);
  opacity: 0.95;
}

.page-title-bar h1 {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 34px 24px;
  text-align: left;
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* ==========================================================================
   Generic sections / content rows
   ========================================================================== */
.page-main {
  padding: 60px 0 80px;
}

/* Alternating image/text rows (startpage) */
.content-rows {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.content-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.content-row.reverse .row-media {
  order: 2;
}

.content-row.reverse .row-text {
  order: 1;
}

.row-media {
  position: relative;
  overflow: hidden;
}

.row-media img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

/* small red corner flag on every media block */
.row-media::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 74px;
  height: 74px;
  background: var(--hazard-fine);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.content-row.reverse .row-media::after {
  left: auto;
  right: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.row-text {
  background: var(--card-bg);
  padding: 40px 44px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.row-text h2 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  position: relative;
  padding-left: 22px;
}

/* black square bullet accent before section headings */
.row-text h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 12px;
  height: 12px;
  background: var(--red);
}

/* First (intro) block: heading centered, body text left */
.content-row.intro .row-text h2 {
  font-size: 1.4rem;
  text-align: center;
}

/* ==========================================================================
   Prose (single-column article pages: Kart, Motorrad, Verein, Historie)
   ========================================================================== */
.prose {
  max-width: 980px;
  margin: 0 auto;
}

.prose h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  margin: 2.2rem 0 0.6rem;
  position: relative;
  padding-left: 22px;
}

.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 12px;
  height: 12px;
  background: var(--red);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.12rem;
  margin: 1.6rem 0 0.4rem;
}

.prose p {
  font-size: 1.02rem;
  line-height: 1.75;
}

.prose a {
  color: var(--red);
  font-weight: 700;
}

/* Historie timeline */
.timeline {
  margin-top: 2rem;
  border-left: 3px solid var(--red);
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 6px;
  width: 14px;
  height: 14px;
  background: var(--red);
  border: 3px solid var(--white);
  border-radius: 0;
  box-shadow: 0 0 0 2px var(--red);
}

.timeline-item h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  text-transform: none;
}

.timeline-item .year {
  color: var(--red);
  font-weight: 800;
}

/* ==========================================================================
   Kontakt page
   ========================================================================== */
.kontakt-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

.kontakt-photo {
  position: relative;
}

.kontakt-photo img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.kontakt-photo::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 84px;
  height: 84px;
  background: var(--hazard-fine);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  border-radius: var(--radius-lg) 0 0 0;
}

.kontakt-info {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 34px 36px;
  border-left: 4px solid var(--red);
}

.kontakt-info .lead {
  color: var(--muted);
  margin-bottom: 22px;
}

.info-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.info-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--red);
}

.info-item address {
  font-style: normal;
}

.info-item a:hover {
  color: var(--red);
}

.kontakt-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.kontakt-photo-2 {
  position: relative;
}

.kontakt-photo-2 img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.kontakt-photo-2::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 84px;
  height: 84px;
  background: var(--hazard-fine);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  border-radius: 0 0 var(--radius-lg) 0;
}

/* ----- Form ----- */
.contact-form {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 36px 38px;
}

.contact-form h2 {
  margin: 0 0 22px;
  font-size: 1.4rem;
}

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2d333d;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid #d7dced;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.18);
}

/* Black chevron button (racing style) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--white);
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.92rem;
  border: 0;
  border-radius: var(--radius);
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn::before {
  content: "›";
  font-size: 1.25em;
  line-height: 0;
  font-weight: 800;
}

.btn:hover {
  background: var(--red);
}

.btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Floating action buttons (docked to the right, reveal label on hover)
   ========================================================================== */
.fab-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 40;
}

.fab-rail a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius) 0 0 var(--radius); /* flat on the docked (right) side */
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: background 0.15s ease;
}

.fab-rail a:hover {
  background: var(--ink);
}

.fab-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-label {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.86rem;
  transition: max-width 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
}

.fab-rail a:hover .fab-label,
.fab-rail a:focus-visible .fab-label,
.fab-rail a.revealed .fab-label {
  max-width: 170px;
  opacity: 1;
  padding-left: 16px;
}

.fab-rail svg {
  width: 19px;
  height: 19px;
}

/* Mobile variant of the rail lives inline in the page (hidden on desktop) */
.fab-rail-mobile {
  display: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  position: relative;
  border-top: 4px solid var(--red);
  background: var(--ink);
  color: #d7dae1;
  padding: 46px 0;
  margin-top: 48px;
}

/* thin hazard stripe just under the red top border */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--hazard-fine);
  opacity: 0.9;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--radius);
  padding: 4px;
}

.footer-name {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.3rem;
  color: var(--white);
}

.footer-tag {
  color: #a7adba;
  font-size: 0.92rem;
}

/* Ortsclub im ADAC logo shown in footer only on mobile (own full-width row) */
.footer-adac {
  display: none;
  width: 100%;
  max-width: 250px;
  height: auto;
  align-self: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 8px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 140px;
}

.footer-links a {
  color: #c7ccd6;
  font-size: 0.98rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--red);
}

/* ==========================================================================
   Responsive / Mobile
   ========================================================================== */
@media (max-width: 860px) {
  :root {
    --header-h: 68px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  /* Brand can shrink (and truncate) so the burger never wraps */
  .brand-name {
    font-size: clamp(0.95rem, 4.6vw, 1.25rem);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ADAC logo is moved out of the header on mobile (shown in footer) */
  .adac-logo {
    display: none;
  }

  .nav-toggle {
    display: block;
    order: 4;
    margin-left: 0;
    flex-shrink: 0;
  }

  /* Slide-down mobile menu */
  .main-nav {
    order: 5;
    margin-left: 0;
    align-self: auto;
    display: block;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-header.nav-open .main-nav {
    max-height: 620px;
  }

  .header-inner {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
    row-gap: 6px;
  }

  .brand {
    margin-right: auto;
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  .main-nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 14px;
    height: auto;
  }

  .main-nav > ul > li,
  .has-dropdown {
    display: block;
    height: auto;
    border-top: 1px solid var(--border);
  }

  .main-nav a,
  .has-dropdown > a {
    padding: 14px 4px;
    height: auto;
    width: 100%;
    justify-content: space-between;
    font-size: 1rem;
  }

  /* underline indicator not needed on stacked mobile nav */
  .main-nav > ul > li > a::after {
    display: none;
  }

  /* Dropdown becomes static/expanded on mobile */
  .dropdown {
    position: static;
    width: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    margin: 0;
  }

  .dropdown-inner {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0 0 6px 16px;
  }

  .dropdown-title {
    display: none;
  }

  .dropdown-col ul {
    gap: 0;
  }

  .dropdown-col a {
    padding: 12px 4px;
    display: block;
  }

  /* Nav toggle animation */
  .site-header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }
  .site-header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Stack all two-column layouts */
  .kontakt-top,
  .kontakt-bottom {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Content rows: image + text become one seamless unit */
  .content-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .content-row.reverse .row-media,
  .row-media {
    order: 1;
  }

  .content-row.reverse .row-text,
  .row-text {
    order: 2;
  }

  .row-media img {
    min-height: 0;
    height: 240px;
  }

  .content-row.reverse .row-media::after,
  .row-media::after {
    left: 0;
    right: auto;
    clip-path: polygon(0 0, 100% 0, 0 100%);
  }

  .page-main {
    padding: 36px 0 48px;
  }

  .content-rows {
    gap: 30px;
  }

  .row-text,
  .kontakt-info,
  .contact-form {
    padding: 28px 24px;
  }

  .page-title-bar h1 {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
    padding: 22px 20px;
  }

  .page-title-bar::after {
    width: 90px;
  }

  /* Hide the fixed desktop rail; use the inline mobile copy instead */
  .fab-rail {
    display: none;
  }

  .fab-rail-mobile {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: flex-start;
    gap: 8px;
    padding: 46px 16px 10px;
    position: static;
    transform: none;
  }

  /* Each button = icon with its label centered ABOVE it (plain, no pill) */
  .fab-rail-mobile a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }

  .fab-rail-mobile a:hover {
    background: transparent;
    color: var(--red);
  }

  /* Icons a touch bigger than before (between the two prior sizes) */
  .fab-rail-mobile .fab-icon {
    width: 40px;
    height: 40px;
  }

  .fab-rail-mobile svg {
    width: 24px;
    height: 24px;
  }

  .fab-rail-mobile .fab-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-bottom: 8px;
    max-width: none;
    padding: 0;
    line-height: 1;
    opacity: 0;
    color: var(--ink);
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .fab-rail-mobile a.revealed .fab-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  .footer-inner {
    flex-direction: column;
    gap: 26px;
  }

  /* Center the logo + text combo (text stays left-aligned within it) */
  .footer-brand {
    align-self: center;
  }

  .footer-adac {
    display: block;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .prose p {
    font-size: 0.98rem;
  }
}
