@import url("../fonts.css");

/* Grundlagen */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: #F3EEE6; color: #2E3B30; font-family: Jost, sans-serif; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img, video { max-width: 100%; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid #A8744A; outline-offset: 3px; }

/* Ladebildschirm, bis die Seite gerendert ist */
#dc-loading { position: fixed; inset: 0; z-index: 999; background: #F3EEE6; display: flex; align-items: center; justify-content: center; transition: opacity .4s; }
.dc-ready #dc-loading { opacity: 0; pointer-events: none; }
.dc-loading-logo { width: 72px; height: 76px; background: #2E3B30; -webkit-mask: url(../assets/BAUM-ANKER_Logo_Original_v2_schwarz.svg) center/contain no-repeat; mask: url(../assets/BAUM-ANKER_Logo_Original_v2_schwarz.svg) center/contain no-repeat; animation: dc-pulse 1.6s ease-in-out infinite; }
@keyframes dc-pulse { 50% { opacity: .35; } }

/* Mobil: mitlaufende Spalten (FAQ-Einleitung, Produktgalerie, Bestellübersicht) nicht über den Inhalt legen */
@media (max-width: 960px) {
  [style*="position: sticky"] { position: static !important; top: auto !important; }
}
/* Mobil: Hero = kurzer Text oben auf Waldgrün, darunter das Video vollständig (16:9, nichts abgeschnitten) */
@media (max-width: 760px) {
  section#top { height: auto !important; padding-top: 84px; background: #2E3B30; display: flex; flex-direction: column; }
  section#top > img, section#top > div[aria-hidden="true"] { display: none !important; }
  section#top > video { position: relative !important; inset: auto !important; order: 2; width: 100%; height: auto !important; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 50% !important; }
  section#top > div[style*="justify-content: flex-end"] { order: 1; height: auto !important; }
  section#top div[style*="max-width: 600px"] { gap: 18px !important; padding-bottom: 28px !important; }
  section#top div[style*="max-width: 600px"] > div:first-child,
  section#top div[style*="max-width: 600px"] > p,
  section#top div[style*="border-top: 1px solid #F3EEE640"] { display: none !important; }
  section#top h1 { font-size: 42px !important; }
  section#top div[style*="max-width: 600px"] button { min-height: 50px !important; padding: 0 20px !important; font-size: 15px !important; }

  /* Umschalter Meditations-Timer / Atmen: volle Breite, beide gleich groß */
  [role="tablist"][aria-label="Übung wählen"] { flex-wrap: nowrap !important; width: 100%; align-self: stretch !important; border-radius: 16px !important; }
  [role="tablist"][aria-label="Übung wählen"] > button { flex: 1 1 0; min-width: 0; padding: 8px 10px !important; min-height: 52px !important; font-size: 14px !important; line-height: 1.25; border-radius: 12px !important; }

  /* Waldbild über dem Footer: Bild komplett zeigen, Text darunter statt über dem Gesicht */
  section:has(> img[src*="Waldlichtung"]) { height: auto !important; display: block !important; background: #2E3B30; }
  section:has(> img[src*="Waldlichtung"]) > img { position: relative !important; inset: auto !important; display: block; height: auto !important; aspect-ratio: 16 / 9; }
  section:has(> img[src*="Waldlichtung"]) > div[aria-hidden="true"] { display: none !important; }
  section:has(> img[src*="Waldlichtung"]) > div:last-child { padding-top: 28px !important; padding-bottom: 36px !important; }
  section:has(> img[src*="Waldlichtung"]) p { font-size: 34px !important; text-shadow: none !important; }

  /* Produktseite: Unikat-Auswahl als richtige Bildkarten statt kleiner Kreise */
  fieldset div[style*="repeat(2, minmax(0, 1fr))"] > button[aria-pressed] { flex-direction: column !important; align-items: stretch !important; gap: 8px !important; padding: 6px 6px 10px !important; }
  fieldset div[style*="repeat(2, minmax(0, 1fr))"] > button[aria-pressed] > img { width: 100% !important; height: auto !important; aspect-ratio: 1 / 1; border-radius: 4px !important; }
  fieldset div[style*="repeat(2, minmax(0, 1fr))"] > button[aria-pressed] > span { padding: 0 4px; }
}
/* FAQ: Antworttext auf schmalen Bildschirmen nicht unnötig einrücken */
@media (max-width: 640px) {
  #fragen p[style*="padding: 0 64px 26px 0"] { padding: 0 0 26px 0 !important; }
}

/* Einblenden beim Scrollen */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); transition-delay: var(--rvd, 0s); }
img.rv, figure.rv { transform: scale(1.035); transition-duration: 1.2s, 1.6s; }
.rv.rv-in { opacity: 1; transform: none; }

/* Hero: gestaffelt beim Laden */
@keyframes ba-up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes ba-fade { from { opacity: 0; } to { opacity: 1; } }
.dc-ready section#top video { animation: ba-fade 1.8s ease both; }
.dc-ready section#top div[style*="max-width: 600px"] > * { animation: ba-up 1.1s cubic-bezier(.2,.7,.2,1) both; }
.dc-ready section#top div[style*="max-width: 600px"] > :nth-child(1) { animation-delay: .25s; }
.dc-ready section#top div[style*="max-width: 600px"] > :nth-child(2) { animation-delay: .4s; }
.dc-ready section#top div[style*="max-width: 600px"] > :nth-child(3) { animation-delay: .55s; }
.dc-ready section#top div[style*="max-width: 600px"] > :nth-child(4) { animation-delay: .7s; }
.dc-ready section#top div[style*="border-top: 1px solid #F3EEE640"] { animation: ba-fade 1.4s ease .9s both; }
.dc-ready header { animation: ba-fade 1s ease .1s both; }

/* Video ruhig darstellen */
section#top video { transform: translateZ(0); backface-visibility: hidden; }

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