/* ============================================================
   RYDERS4GOOD - Patch-System ("Aufnäher")
   Gemeinsame Basis für Startseite und Über-uns: Tokens, Denim-Grund,
   Typografie, Buttons, Patches, Reveal, Footer/WhatsApp.
   Seiten-spezifisches CSS bleibt im jeweiligen <style>-Block.
============================================================ */
/* ============================================================
   WELT: "Aufnäher" - die Startseite ist die Rückseite einer
   Fahrerweste. Ground = Denim (Twill-Diagonale), Inhalte sind
   aufgenähte Patches: Merrow-Rand + gestrichelte Naht.
   Farbrollen: Denim (Grund), Garn-Creme (Patch/Text-Fläche),
   Markenrot (Handlung), Sonnen-Amber (Wärme, sparsam).
   Radius: Patches 22px, Felder 12px, Buttons/Badges rund.
============================================================ */
:root {
  --denim: #0f1a2e; --denim-2: #15233c; --denim-3: #1d3150;
  --cream: #f4e8d4; --cream-2: #e8d6b8;
  --ink: #1a2236; --ink-soft: #46506a;
  --red-deep: #b5301e; --red-soft: #f2665a;
  --amber: #eab04a;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --r-patch: 22px; --r-field: 12px;
  --font-display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;
}
body {
  font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--denim);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.022) 0 2px, transparent 2px 6px);
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; }
p { text-wrap: pretty; }
a, button { touch-action: manipulation; }
::selection { background: var(--red-deep); color: #fff; }
input, textarea { caret-color: var(--red-deep); }
html { overflow-x: clip; }
html { scrollbar-color: rgba(244,232,212,0.35) var(--denim); scrollbar-width: thin; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }
.patch :focus-visible { outline-color: var(--ink); }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 1000; padding: 0.7rem 1.1rem; border-radius: 99px; background: var(--cream); color: var(--ink); font-weight: 800; transition: top 0.2s var(--ease-out); }
.skip-link:focus { top: 1rem; }

/* ---------- Nav-Buttons (nav_public.php) ---------- */
.btn-nav-login { padding: 0.45rem 1.1rem; border-radius: 99px; font-size: 0.85rem; font-weight: 700; border: 1px solid rgba(148,163,184,0.3); color: var(--light); background: transparent; transition: border-color 0.2s, color 0.2s; cursor: pointer; }
.btn-nav-cta { padding: 0.45rem 1.2rem; border-radius: 99px; font-size: 0.85rem; font-weight: 700; background: var(--red); color: #fff; border: none; cursor: pointer; transition: background-color 0.2s, transform 0.16s var(--ease-out); }
.btn-nav-cta:active { transform: scale(0.97); }
.btn-nav-cta:hover { background: var(--red2); }
.nav-hamburger { display: none; }
.nav-mobile { display: none !important; }
.app-bar-item:hover, .app-bar-item.active { color: var(--white); background: rgba(255,255,255,0.04); }
.app-bar-item.wa-item svg { stroke: none; fill: #25d366; }

/* ---------- Buttons ---------- */
.btn, .link-more {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-weight: 800; white-space: nowrap; cursor: pointer;
  transition: transform 0.16s var(--ease-out), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn { padding: 0.95rem 1.8rem; border-radius: 99px; font-size: 1rem; border: 2px solid transparent; }
.btn-red { background: var(--red); color: #fff; }
.btn-line { background: transparent; color: var(--cream); border-color: rgba(244,232,212,0.5); }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn:active { transform: scale(0.97); }
.btn svg, .link-more svg { transition: transform 0.25s var(--ease-out); }
.link-more { padding: 0.4rem 0; font-size: 0.95rem; color: var(--cream); border-bottom: 2px solid rgba(244,232,212,0.4); }
.link-more:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn-red:hover { background: var(--red-deep); }
  .btn-line:hover { border-color: var(--cream); background: rgba(244,232,212,0.08); }
  .btn-ink:hover { background: #000; }
  .link-more:hover { border-color: var(--cream); }
  .btn:hover svg, .link-more:hover svg { transform: translateX(3px); }
}

/* ---------- Patch-Grundform ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.pad { padding-block: 7.5rem 8.5rem; }
.patch {
  position: relative; background: var(--cream); color: var(--ink);
  border: 6px solid var(--cream-2); border-radius: var(--r-patch);
  box-shadow: 0 18px 22px -18px rgba(2,6,23,0.85);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.4s var(--ease-out);
}
.patch::after { /* Naht */
  content: ''; position: absolute; inset: 7px; border-radius: 14px; pointer-events: none;
  border: 2px dashed rgba(26,34,54,0.28);
}
.patch-red { background: var(--red-deep); color: #fff; border-color: #cf4a37; }
.patch-red::after { border-color: rgba(255,255,255,0.45); }
.patch-amber { background: var(--amber); color: var(--ink); border-color: #f2c676; }
.patch-navy { background: var(--denim-3); color: var(--cream); border-color: #2c466e; }
.patch-navy::after { border-color: rgba(244,232,212,0.4); }
@media (hover: hover) and (pointer: fine) {
  .patch.lift:hover { transform: rotate(0deg) translateY(-5px); }
}
.section-title { font-size: clamp(2.2rem, 4.6vw, 3.8rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; color: var(--cream); margin-bottom: 1.1rem; }
.section-lead { font-size: 1.1rem; line-height: 1.75; color: rgba(244,232,212,0.78); max-width: 52ch; }

.js .reveal { opacity: 0; transform: translateY(18px) rotate(calc(var(--r, 0deg) - 2deg)); transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: rotate(var(--r, 0deg)); }
@media (hover: hover) and (pointer: fine) { .js .reveal.in.lift:hover { transform: rotate(0deg) translateY(-5px); transition-delay: 0ms; transition-duration: 0.4s; } }

/* ---------- Footer / WhatsApp ---------- */
.footer-bottom-links { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-bottom-links a { display: flex; align-items: center; gap: 0.35rem; }
.wa-float { position: fixed; bottom: 2rem; right: 2rem; z-index: 800; width: 58px; height: 58px; border-radius: 50%; background: #25d366; box-shadow: 0 10px 24px -10px #020617; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s var(--ease-out); }
.wa-float:active { transform: scale(0.94); }


/* ---------- Intro (Unterseiten) ---------- */
    .intro { position: relative; overflow: hidden; isolation: isolate; padding: 9rem 0 5rem; }
    .intro::before { content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: radial-gradient(40% 60% at 85% 30%, rgba(234,176,74,0.2), transparent 70%), radial-gradient(45% 55% at 0% 100%, rgba(217,63,44,0.15), transparent 70%); }
    .intro-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; align-items: center; }
    .intro-copy { grid-column: 1 / 8; }
    .intro-title { font-size: clamp(2.8rem, 6vw, 5.2rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.035em; color: var(--cream); }
    .intro-title-sub { display: block; margin-top: 0.6rem; font-family: var(--font-hand); font-weight: 700; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1; letter-spacing: 0; color: var(--amber); transform: rotate(-2deg); transform-origin: left center; }
    .intro-lead { margin-top: 1.7rem; font-size: 1.2rem; line-height: 1.7; color: rgba(244,232,212,0.86); max-width: 48ch; }
    .intro-motto { margin-top: 1.1rem; font-family: var(--font-hand); font-weight: 700; font-size: 1.7rem; color: var(--cream); }
    .intro-logo { grid-column: 9 / 13; justify-self: center; width: min(100%, 340px); transform: rotate(-5deg); filter: drop-shadow(0 22px 24px rgba(2,6,23,0.55)); }
    .intro-logo img { width: 100%; height: auto; display: block; }

@media (prefers-reduced-motion: no-preference) {
  .intro-copy > *, .intro-logo { animation: settle 0.8s var(--ease-out) both; animation-delay: var(--d, 0ms); }
  .intro-title { --d: 60ms; } .intro-lead { --d: 160ms; } .intro-motto { --d: 220ms; }
  .intro-logo { --d: 200ms; animation-name: settle-logo; }
}
@keyframes settle { from { opacity: 0; transform: translateY(22px) rotate(calc(var(--r, 0deg) - 4deg)); } to { opacity: 1; transform: rotate(var(--r, 0deg)); } }
@keyframes settle-logo { from { opacity: 0; transform: translateY(30px) rotate(8deg); } to { opacity: 1; transform: rotate(-5deg); } }

/* ---------- Rechtliche Seiten (Impressum, Datenschutz): Akkordeon aus Patches ---------- */
.intro-version { margin-top: 1.6rem; display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.45rem 1.1rem 0.5rem 0.9rem; border-radius: 99px; background: var(--amber); color: var(--ink); border: 4px solid #f2c676; font-weight: 800; font-size: 0.95rem; line-height: 1.35; transform: rotate(-1.5deg); max-width: 100%; }
.intro-version svg { flex-shrink: 0; }
.legal { padding-top: 1rem; }
.legal .wrap { max-width: 900px; }
.legal-tools { display: none; justify-content: flex-end; margin-bottom: 1.4rem; }
.js .legal-tools { display: flex; }
.legal-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 1.2rem; border-radius: 99px; border: 2px solid rgba(244,232,212,0.5); background: transparent; color: var(--cream); font: inherit; font-weight: 800; font-size: 0.92rem; cursor: pointer; transition: transform 0.16s var(--ease-out), border-color 0.2s, background-color 0.2s; }
.legal-toggle:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .legal-toggle:hover { border-color: var(--cream); background: rgba(244,232,212,0.08); } }
.legal-content .club-rules-accordion { display: grid; gap: 1.2rem; }
.legal-content .rule-item {
  position: relative; background: var(--cream); color: var(--ink); border: 6px solid var(--cream-2); border-radius: var(--r-patch);
  box-shadow: 0 18px 22px -18px rgba(2,6,23,0.85); padding: 0 2rem; transform: rotate(var(--r, 0deg));
}
.legal-content .rule-item::after { content: ''; position: absolute; inset: 7px; border-radius: 14px; pointer-events: none; border: 2px dashed rgba(26,34,54,0.28); }
.legal-content .rule-item:nth-child(odd) { --r: -0.25deg; }
.legal-content .rule-item:nth-child(even) { --r: 0.25deg; }
.legal-content .rule-item:first-child { background: var(--amber); border-color: #f2c676; }
.legal-content .rule-item > summary {
  position: relative; z-index: 1; list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 64px; padding: 1.1rem 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink);
}
.legal-content .rule-item > summary::-webkit-details-marker { display: none; }
.legal-content .rule-item > summary::marker { content: ''; }
.legal-content .rule-item > summary::after { /* Plus/Minus */
  content: '+'; flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--cream); font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1; padding-bottom: 2px;
  transition: transform 0.25s var(--ease-out);
}
.legal-content .rule-item[open] > summary::after { content: '\2212'; transform: rotate(180deg); }
.legal-content .rule-item > :not(summary) { position: relative; z-index: 1; }
.legal-content .rule-item[open] { padding-bottom: 1.6rem; }
.legal-content .rule-item p { font-size: 1.02rem; line-height: 1.75; color: var(--ink); margin-bottom: 0.9rem; max-width: 70ch; }
.legal-content .rule-item p:last-child { margin-bottom: 0; }
.legal-content .rule-item ul, .legal-content .rule-item ol { margin: 0.4rem 0 0.9rem 1.3rem; }
.legal-content .rule-item li { font-size: 1.02rem; line-height: 1.7; color: var(--ink); margin-bottom: 0.35rem; max-width: 70ch; }
.legal-content .rule-item li::marker { color: var(--red-deep); }
.legal-content .rule-item strong, .legal-content .rule-item b { font-weight: 800; }
.legal-content .rule-item a { color: var(--red-deep); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; overflow-wrap: anywhere; }
.legal-content .rule-item code { padding: 0.1rem 0.4rem; border-radius: 6px; background: rgba(26,34,54,0.1); font-size: 0.92em; overflow-wrap: anywhere; }
@media (max-width: 768px) {
  .legal-content .rule-item { padding: 0 1.2rem; }
  .legal-content .rule-item > summary { font-size: 1.15rem; min-height: 60px; }
  .legal-content .rule-item[open] { padding-bottom: 1.3rem; }
}

/* ---------- Gemeinsame Responsive-Regeln ---------- */
@media (max-width: 1024px) {
  .intro { padding-top: 8rem; }
  .intro-grid { grid-template-columns: 1fr; row-gap: 3rem; }
  .intro-copy, .intro-logo { grid-column: 1; }
  .intro-logo { width: min(70%, 300px); justify-self: start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links, .nav-actions { display: none; }
  .nav-mobile-login { display: flex; }
  .mobile-app-bar { display: block; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .wa-float { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .wrap { padding-inline: 1.25rem; }
  .pad { padding-block: 5rem 5.5rem; }
  .intro { padding: 7.5rem 0 3.5rem; }
  .intro-logo { width: min(64%, 260px); }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .footer-bottom-links { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
@media (max-width: 480px) {
  .intro-title { font-size: 2.7rem; }
  .r4g-nav { padding: 0 1.25rem; }
  .wa-float { right: 1.25rem; width: 52px; height: 52px; }
  .wa-float svg { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .patch, .reveal { transition: none; }
}
