/* =========================================================================
   SV Raadt 1967 – Vollbild-Landing (Hub)
   Logo + Name mittig, 4 Abteilungen symmetrisch in den Ecken (Quadrat).
   Nutzt Variablen/Reset aus styles.css. Isoliert, betrifft keine Unterseite.
   ========================================================================= */

.landing-body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /* Vereinsfarbe als echte, nahtlos wiederholte Textur – jetzt auf ALLEN Geräten (auch Handy). */
  background-color: #125424;
  background-image:
    linear-gradient(135deg, rgba(3,42,20,.18), rgba(3,30,15,.48)),
    url("../assets/vereinsgruen-textur.webp");
  background-repeat: no-repeat, repeat;
  background-position: center, top center;
  background-size: cover, 1440px 184px;
  background-attachment: scroll, scroll;   /* Mobil: scroll (iOS stellt fixed nicht zuverlässig dar) */
  color: #fff;
  overflow-x: hidden;
}

/* Desktop: Textur als Parallax (fixiert) für mehr Tiefe. */
@media (min-width: 821px) {
  .landing-body {
    background-attachment: fixed, fixed;
  }
}

main.landing {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
}

/* Dezente Lichtpunkte im Hintergrund */
.landing-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(360px 360px at 12% 88%, rgba(255,255,255,.06), transparent 70%),
    radial-gradient(360px 360px at 88% 12%, rgba(255,255,255,.06), transparent 70%);
  z-index: 0;
}

.landing-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 30vw) 1fr;
  grid-template-areas:
    "t1 center t3"
    "t2 center t4";
  gap: clamp(1rem, 2.6vw, 2.4rem);
  align-items: center;
  justify-items: center;
}

/* ---------- Zentrum: Logo, Name, Jahr, Slogan ---------- */
.landing-center {
  grid-area: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
}

/* Feststehendes Vektor-Wappen mit maskiertem Lichtschimmer */
.landing-crest-wrap {
  appearance: none;
  position: relative;
  display: block;
  width: clamp(150px, 19vw, 230px);
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.32));
}
.landing-crest-wrap:focus-visible {
  outline: 3px solid rgba(255,255,255,.95);
  outline-offset: 7px;
}
.landing-crest {
  display: block;
  width: 100%;
  height: auto;
}
.landing-crest-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(108deg, transparent 34%, rgba(255,255,255,.72) 49%, transparent 64%);
  background-position: 160% 0;
  background-size: 250% 100%;
  -webkit-mask: url("../assets/sv-raadt-wappen.svg") center / contain no-repeat;
  mask: url("../assets/sv-raadt-wappen.svg") center / contain no-repeat;
  animation: svr-shimmer 5.5s ease-in-out infinite;
}
.landing-title {
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  font-weight: 800;
  letter-spacing: .01em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.landing-meta {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  margin: 0;
  color: rgba(255,255,255,.94);
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.landing-since {
  font-family: var(--font-heading);
  font-size: clamp(.95rem, 1.35vw, 1.1rem);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.landing-place {
  font-size: clamp(.9rem, 1.15vw, 1rem);
  font-weight: 500;
  letter-spacing: .045em;
}
.landing-slogan {
  margin: .2rem 0 0;
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  font-style: italic;
  color: rgba(255,255,255,.92);
}

/* Jubiläums-Countdown */
.landing-countdown {
  margin-top: clamp(.7rem, 1.8vw, 1.1rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.landing-countdown__label {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(.78rem, 1.2vw, .95rem);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.28);
}
.landing-countdown__grid { display: flex; gap: clamp(.4rem, 1.2vw, .75rem); }
.cd-unit {
  min-width: clamp(54px, 9vw, 74px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .12rem;
  padding: .5rem .35rem;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.cd-num {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0,0,0,.28);
}
.cd-lbl {
  font-size: clamp(.6rem, 1vw, .72rem);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
}
@media (max-width: 420px) {
  .landing-countdown__grid { width: 100%; }
  .cd-unit { min-width: 0; flex: 1; }
}

/* Große Flyer-Vorschau: Hover am Desktop, Antippen auf Touch-Geräten. */
.landing-flyer-preview {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(.75rem, 3vw, 2rem);
  background: rgba(4,15,8,.82);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.landing-flyer-preview__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 1120px);
  max-height: 86dvh;
  object-fit: contain;
  border: 3px solid rgba(255,255,255,.92);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  transform: scale(.965);
  transition: transform .22s ease;
}
.landing-flyer-preview__hint {
  position: absolute;
  inset-inline: 1rem;
  bottom: max(.65rem, env(safe-area-inset-bottom));
  color: rgba(255,255,255,.9);
  font-size: clamp(.75rem, 2.8vw, .9rem);
  text-align: center;
  text-shadow: 0 1px 5px rgba(0,0,0,.7);
}
.landing-body.flyer-preview-open .landing-flyer-preview {
  opacity: 1;
  visibility: visible;
}
.landing-body.flyer-preview-open .landing-flyer-preview__image {
  transform: scale(1);
}
.landing-body.flyer-preview-pinned .landing-flyer-preview {
  pointer-events: auto;
}

/* ---------- Abteilungs-Kacheln (4 Ecken) ---------- */
.ab-tile {
  --tile-padding: clamp(1rem, 1.8vw, 1.4rem);
  grid-row: auto;
  width: 100%;
  max-width: 260px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,.97);
  border-radius: 18px;
  padding: var(--tile-padding);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  border-top: 5px solid var(--tile, var(--brand));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-align: center;
  min-height: 44px;
  transition: transform .18s ease, box-shadow .18s ease;
  animation: svr-rise .8s both;
}
.ab-tile:hover, .ab-tile:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 44px rgba(0,0,0,.32);
}
.ab-tile .ab-icon {
  width: clamp(48px, 5vw, 62px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  background: var(--tile-soft, #eee);
}
.ab-tile .ab-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
}
.ab-tile .ab-name { font-weight: 800; font-size: 1.15rem; color: var(--tile); }
.ab-tile .ab-sub { font-size: .9rem; color: var(--text-muted); }
.ab-tile .ab-cta { margin-top: .2rem; font-weight: 700; font-size: .85rem; color: var(--tile); }

/* Ecken-Zuordnung + Akzentfarben je Abteilung */
.ab-tile--1 { grid-area: t1; }
.ab-tile--2 { grid-area: t2; }
.ab-tile--3 { grid-area: t3; }
.ab-tile--4 { grid-area: t4; }
.ab-tile[data-ab="fussball"]    { --tile: #1f7a3d; --tile-soft: #e6f3ea; }
.ab-tile[data-ab="tischtennis"] { --tile: #c85a12; --tile-soft: #fcefe3; }
.ab-tile[data-ab="tauchen"]     { --tile: #0a7395; --tile-soft: #e2f1f6; }
.ab-tile[data-ab="gymnastik"]   { --tile: #9e2b63; --tile-soft: #f8e6ef; }

/* Vollflächige Bildkarten mit kontrastreichem Text-Overlay */
.ab-tile--photo {
  position: relative;
  isolation: isolate;
  min-height: 244px;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  color: #fff;
  background: #18231b;
  border-top: 0;
}
.ab-tile--photo::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8,18,11,.05) 24%, rgba(8,18,11,.94) 100%);
}
.ab-tile--photo .ab-photo {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
  transition: transform .35s ease;
}
.ab-tile--1 .ab-photo { object-position: center 78%; } /* Bild nach oben: Ball über den Schriftzug "Fußball" heben */
.ab-tile--3 .ab-photo { object-position: 38% 64%; }     /* Taucher etwas weiter rechts oben */
.ab-tile--4 .ab-photo { object-position: center 58%; }
.ab-tile--photo .ab-copy,
.ab-tile--photo .ab-cta {
  position: relative;
  z-index: 2;
}
.ab-tile--photo .ab-copy { align-items: flex-start; }
.ab-tile--photo .ab-name {
  color: #fff;
  font-size: 1.35rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.ab-tile--photo .ab-sub { color: rgba(255,255,255,.92); }
.ab-tile--photo .ab-cta {
  color: #fff;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 999px;
  padding: .35rem .7rem;
  backdrop-filter: blur(5px);
}
.ab-tile--photo:hover .ab-photo,
.ab-tile--photo:focus-visible .ab-photo { transform: scale(1.06); }

/* Großer Desktop: großzügiges Zentrum mit ausgewogenem Außenabstand. */
@media (min-width: 1200px) {
  main.landing { padding-inline: clamp(2rem, 3vw, 3.5rem); }

  .landing-grid {
    width: calc(100% - clamp(4rem, 9vw, 9rem));
    max-width: 1440px;
    grid-template-columns: minmax(280px, 300px) minmax(360px, 1fr) minmax(280px, 300px);
    gap: clamp(2rem, 4vw, 5rem);
  }

  .ab-tile {
    --tile-padding: 1.5rem;
    max-width: 300px;
  }
  .ab-tile--photo { min-height: 280px; }
  .ab-tile--1,
  .ab-tile--2 { justify-self: start; }
  .ab-tile--3,
  .ab-tile--4 { justify-self: end; }

  .landing-center { gap: .85rem; }
  .landing-crest-wrap { width: clamp(265px, 20vw, 310px); }
  .landing-title { font-size: clamp(2.5rem, 3.6vw, 3.65rem); }
  .landing-since { font-size: 1.1rem; }
  .landing-place { font-size: 1rem; }
  .landing-slogan { font-size: clamp(1.35rem, 1.7vw, 1.65rem); }

  .ab-tile--photo .ab-name { font-size: 1.55rem; }
  .ab-tile--photo .ab-sub { font-size: 1rem; }
  .ab-tile--photo .ab-cta {
    padding: .45rem .85rem;
    font-size: .92rem;
  }
}

/* Gestaffelter Auftritt */
.ab-tile--1 { animation-delay: .10s; }
.ab-tile--3 { animation-delay: .18s; }
.ab-tile--2 { animation-delay: .26s; }
.ab-tile--4 { animation-delay: .34s; }

/* dezente Fußzeile */
.landing-foot {
  position: relative;
  z-index: 1;
  text-align: center;
  color: rgba(255,255,255,.8);
  font-size: .85rem;
  padding: .8rem 1rem 1.2rem;
}
.landing-foot a { color: #fff; }

/* ---------- Keyframes ---------- */
@keyframes svr-shimmer {
  0%, 58% { opacity: 0; background-position: 160% 0; }
  64% { opacity: .78; }
  82% { opacity: .46; background-position: -65% 0; }
  88%, 100% { opacity: 0; background-position: -65% 0; }
}
@keyframes svr-rise {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- Mobil: gestapelt, scrollbar ---------- */
@media (max-width: 820px) {
  main.landing { padding-block: clamp(1.5rem, 6vw, 2.5rem); }
  .landing-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "center"
      "t1"
      "t2"
      "t3"
      "t4";
    gap: 1rem;
  }
  .ab-tile { max-width: 420px; flex-direction: row; text-align: left; align-items: center; }
  .ab-tile .ab-icon { flex: 0 0 auto; }
  .ab-tile .ab-copy { flex: 1 1 auto; align-items: flex-start; }
  .ab-tile .ab-cta { margin-top: 0; margin-left: auto; }
  .ab-tile--photo {
    min-height: 210px;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
  }
  .ab-tile--photo .ab-photo { width: 100%; height: 100%; border-radius: 0; }
  .ab-tile--photo .ab-copy { flex: 0 0 auto; }
  .ab-tile--photo .ab-cta { margin-top: .25rem; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ab-tile, .landing-crest-wrap::after { animation: none; }
  .landing-crest-wrap::after { opacity: 0; }
  .landing-flyer-preview,
  .landing-flyer-preview__image { transition: none; }
}

/* Flyer-Pop-up am Wappen: Zeiger nur, wenn angepinnte Flyer vorhanden sind (js/landing.js setzt .has-flyer) */
.landing-crest-wrap.has-flyer { cursor: zoom-in; }
.landing-crest-wrap.has-flyer:focus-visible { outline: 3px solid rgba(255,255,255,.95); outline-offset: 7px; border-radius: 14px; }
.landing-flyer-preview__nav, .landing-flyer-preview__close {
  position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.9); color: #125424; font-size: 1.6rem; line-height: 1; display: grid; place-items: center;
}
.landing-flyer-preview__nav[hidden] { display: none; }
.landing-flyer-preview__nav--prev { left: max(.5rem, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.landing-flyer-preview__nav--next { right: max(.5rem, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.landing-flyer-preview__close { top: max(.6rem, env(safe-area-inset-top)); right: max(.6rem, env(safe-area-inset-right)); font-size: 1.2rem; }
.landing-flyer-preview__link {
  position: absolute; bottom: calc(max(.65rem, env(safe-area-inset-bottom)) + 2rem); left: 50%; transform: translateX(-50%);
  background: #1f7a3d; color: #fff; text-decoration: none; font-weight: 700; padding: .65rem 1.2rem; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.landing-flyer-preview__link[hidden] { display: none; }
.landing-flyer-preview__nav, .landing-flyer-preview__close, .landing-flyer-preview__link { pointer-events: none; }
.landing-body.flyer-preview-pinned .landing-flyer-preview__nav,
.landing-body.flyer-preview-pinned .landing-flyer-preview__close,
.landing-body.flyer-preview-pinned .landing-flyer-preview__link { pointer-events: auto; }
