/* ========================================
   Grundeinstellungen
======================================== */

:root {
  --color-primary: #004d9f;
  --color-primary-hover: #003b7a;
  --color-navy: #102b40;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  color: #263238;
  font:
    16px/1.6 system-ui,
    sans-serif;
}

main {
  margin: 0;
}

label {
  display: block;
  margin: 1rem 0;
}

input {
  display: block;
  padding: 0.55rem;
  width: 100%;
  max-width: 350px;
}

button {
  padding: 0.6rem 1rem;
  cursor: pointer;
}

/* ========================================
   Gemeinsame Navigation
======================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;
  height: 82px;
  padding: 0 5%;
  border: none;

  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.site-logo img {
  display: block;
  width: auto;
  max-width: 170px;
  max-height: 58px;
}

.site-navigation {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-navigation a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.site-navigation a:hover {
  opacity: 0.7;
}
/* Dropdown-Menü Verein */

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.nav-dropdown[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 190px;
  padding: 10px 0;
  margin-top: 12px;
  background: var(--color-navy);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 1001;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 20px;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  background: var(--color-primary);
  opacity: 1;
}

.nav-dropdown summary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
}

/* Navigation auf der Startseite */

.home-body .site-header {
  background: rgba(12, 23, 35, 0.22);
}

.home-body .site-header.scrolled {
  background: rgba(12, 23, 35, 0.94);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Navigation auf Detailseiten */

.detail-page {
  padding-top: 82px;
}

.detail-page .site-header,
.detail-page .site-header.scrolled {
  background: var(--color-navy);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* ========================================
   Mobiles Menü
======================================== */

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #fff;
}

/* ========================================
   Startseite – Grundeinstellungen
======================================== */

.home-body {
  overflow-x: hidden;
}

/* ========================================
   Sticky-Parallax – Hallenbild
======================================== */

.home-body .home-hero-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
}

.home-body .home-hero {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;

  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 0;

  overflow: hidden;
  isolation: isolate;
}

.home-hero-background {
  position: absolute;
  inset: 0;
  z-index: -2;

  background-image: url("/assets/images/halle.jpg");
  background-size: cover;
  background-position: center;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;

  background: linear-gradient(
    90deg,
    rgba(7, 19, 32, 0.68) 0%,
    rgba(7, 19, 32, 0.28) 55%,
    rgba(7, 19, 32, 0.15) 100%
  );
}

/* ========================================
   Hero – Texte und Schaltflächen
======================================== */

.home-hero-content {
  position: absolute;
  left: max(6%, calc((100% - 1200px) / 2));
  bottom: 16%;

  max-width: 700px;
  padding-right: 24px;
  color: #fff;
}

.home-hero-eyebrow {
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #d4e9fa;
}

.home-hero-content h1 {
  margin: 0 0 20px;
  font-size: clamp(3.2rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #fff;
}

.home-hero-subtitle {
  max-width: 570px;
  margin-bottom: 30px;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.6;
  color: #f0f4f8;
}

.home-hero-button {
  display: inline-block;
  padding: 14px 26px;

  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.home-hero-button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
}

.home-scroll-hint {
  position: absolute;
  right: 6%;
  bottom: 40px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.home-scroll-hint span:last-child {
  font-size: 1.8rem;
}

/* ========================================
   Startseite – Inhaltsbereich
======================================== */

.home-body .home-page {
  position: relative;
  z-index: 2;

  width: 100%;
  max-width: none;
  margin: 0;

  padding: 90px max(30px, calc((100% - 1200px) / 2)) 110px;
  background: #fff;
}

.home-sports {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.home-section-heading {
  margin-bottom: 42px;
  text-align: center;
}

.home-section-eyebrow {
  margin: 0 0 10px;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 700;
}

.home-section-heading h2 {
  margin: 0 0 15px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.home-section-heading > p:last-child {
  color: #607080;
}

/* ========================================
   Sportarten-Kacheln
======================================== */

.sports-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.sport-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;

  border-radius: 12px;
  background: #dfe7ec;
  text-decoration: none;
  isolation: isolate;
}

.sport-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.sport-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72),
    rgba(0, 0, 0, 0.05) 65%
  );
  z-index: 1;
}

.sport-tile-name {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;

  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.sport-tile:hover img {
  transform: scale(1.06);
}

.sport-tile:focus-visible {
  outline: 3px solid #146c43;
  outline-offset: 4px;
}

/* ========================================
   Termine-Karussell
======================================== */

.home-events {
  padding: 90px 5%;
  background: #fff;
}

.home-events .home-section-heading {
  margin-bottom: 45px;
  text-align: center;
}

.events-carousel {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 45px;
}

.events-carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;

  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.events-carousel-track::-webkit-scrollbar {
  display: none;
}

.event-card {
  flex: 0 0 calc((100% - 60px) / 4);
  min-width: 0;
  scroll-snap-align: start;
}

.event-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.event-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
}

.event-card-content {
  padding: 18px 8px;
  text-align: center;
}

.event-card-date {
  margin: 0 0 8px;
  color: #666;
  font-size: 0.9rem;
}

.event-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
}

.events-carousel-button {
  position: absolute;
  top: 35%;
  transform: translateY(-50%);

  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 50%;

  background: #fff;
  color: #222;
  cursor: pointer;
  z-index: 2;
}

.events-carousel-prev {
  left: 0;
}

.events-carousel-next {
  right: 0;
}

.events-carousel-button:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
}

.events-carousel-button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ========================================
   Sportarten-Detailseite
======================================== */

main.sport-profile {
  width: calc(100% - 48px);
  max-width: 1000px;
  margin: 2rem auto;
}

.sport-header {
  text-align: center;
  border-bottom: none;
  margin-bottom: 2rem;
}

.sport-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0;
  line-height: 1.3;
}

.sport-title-suffix {
  color: #c62828;
  font-size: 0.55em;
  font-weight: 600;
  white-space: nowrap;
}

.sport-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #edf1f5;
  margin-bottom: 1.5rem;
}

.sport-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sport-responsible {
  padding: 1rem 1.25rem;
  background: #f2f6fa;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.sport-label {
  display: block;
  font-weight: 700;
  color: var(--color-primary);
}

.sport-responsible-names {
  display: block;
  margin-top: 0.2rem;
  font-weight: 700;
}

.sport-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sport-info,
.sport-contact,
.sport-description {
  padding: 1.5rem;
  border: 1px solid #e1e7ec;
  border-radius: 10px;
  background: #fff;
}

.sport-info h2,
.sport-contact h2,
.sport-description h2 {
  color: var(--color-primary);
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.sport-contact,
.sport-description {
  margin-bottom: 1.5rem;
}

.sport-back {
  margin-top: 2rem;
}

.sport-back a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.sport-back a:hover {
  text-decoration: underline;
}

/* ========================================
   Gemeinsamer Footer
======================================== */

.site-footer {
  position: relative;
  z-index: 3;
  width: 100%;
  margin: 0;
  padding: 45px 24px;
  background: var(--color-navy);
  color: #fff;
}

.site-footer-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 35px;
}

.site-footer-brand img {
  display: block;
  width: 130px;
  max-width: 100%;
  height: auto;
}

.site-footer-links,
.site-footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ========================================
   Responsive – Tablet
======================================== */

@media (max-width: 1000px) {
  .event-card {
    flex-basis: calc((100% - 40px) / 3);
  }
}

@media (max-width: 850px) {
  .sports-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-toggle {
    display: block;
  }

  .site-navigation {
    display: none;
    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    padding: 20px 5% 30px;
    background: rgba(12, 23, 35, 0.97);

    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .site-navigation.open {
    display: flex;
  }
  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    margin-top: 10px;
    padding: 0 0 0 12px;
    background: transparent;
    box-shadow: none;
  }
}

@media (max-width: 700px) {
  .event-card {
    flex-basis: calc((100% - 20px) / 2);
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer-brand img {
    margin: 0 auto;
  }

  .site-footer-links,
  .site-footer-contact {
    align-items: center;
  }
}

/* ========================================
   Responsive – Smartphone
======================================== */

@media (max-width: 550px) {
  .sports-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sport-tile-name {
    font-size: 1.25rem;
  }

  .home-hero-content {
    left: 7%;
    bottom: 20%;
  }

  .home-body .home-page {
    padding: 65px 20px 80px;
  }

  .site-logo img {
    max-width: 130px;
  }

  .sport-details {
    grid-template-columns: 1fr;
  }

  .sport-info,
  .sport-contact,
  .sport-description {
    padding: 1.25rem;
  }

  .sport-header h1 {
    font-size: 2rem;
  }
}

@media (min-width: 551px) and (max-width: 650px) {
  .sport-details {
    grid-template-columns: 1fr;
  }

  .sport-info,
  .sport-contact,
  .sport-description {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .home-events {
    padding: 60px 15px;
  }

  .events-carousel {
    padding: 0 30px;
  }

  .event-card {
    flex-basis: 100%;
  }
}

/* ========================================
   Barrierefreiheit
======================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .sport-tile img,
  .home-hero-button {
    transition: none;
  }

  .events-carousel-track {
    scroll-behavior: auto;
  }
}

/* Zählerbereich */

.home-counters {
  position: relative;
  z-index: 3;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  padding: 75px 24px;
  background-image:
    linear-gradient(rgba(10, 30, 45, 0.25), rgba(10, 30, 45, 0.25)),
    url("/assets/images/netz.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.home-counters-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  max-width: 1000px;
  margin: 0 auto;
}

.counter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 24px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.counter-value {
  color: #172b3a;
  font-size: clamp(2.8rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.counter-label {
  margin-top: 12px;
  color: #172b3a;
  font-size: 1.35rem;
  font-weight: 400;
}

@media (max-width: 650px) {
  .home-counters {
    padding: 45px 18px;
    background-attachment: scroll;
  }

  .home-counters-inner {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 400px;
  }

  .counter-card {
    min-height: 140px;
  }
}

/* Bildergalerie */

.home-gallery {
  position: relative;
  z-index: 3;
  max-width: 1200px;
  margin: 0 auto;
  padding: 90px 24px;
  background: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 40px;
}

.gallery-item {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #e8edf0;
  cursor: pointer;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .home-gallery {
    padding: 65px 18px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
}

@media (max-width: 400px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Galerie – Lightbox */

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
}

.gallery-lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 160px);
  max-height: calc(100dvh - 100px);
}

.gallery-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.gallery-lightbox-counter {
  margin-top: 18px;
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
}

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  opacity: 0.65;
}

.gallery-lightbox-close {
  top: 20px;
  right: 30px;
  width: 45px;
  height: 45px;
  font-size: 2.5rem;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 70px;
  font-size: 2rem;
}

.gallery-lightbox-prev {
  left: 20px;
}

.gallery-lightbox-next {
  right: 20px;
}

.gallery-lightbox button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (max-width: 600px) {
  .gallery-lightbox-content {
    max-width: calc(100vw - 70px);
    max-height: calc(100dvh - 100px);
  }

  .gallery-lightbox-image {
    max-height: calc(100dvh - 130px);
  }

  .gallery-lightbox-close {
    top: 10px;
    right: 12px;
  }

  .gallery-lightbox-prev,
  .gallery-lightbox-next {
    width: 32px;
    font-size: 1.5rem;
  }

  .gallery-lightbox-prev {
    left: 2px;
  }

  .gallery-lightbox-next {
    right: 2px;
  }
}

/* Galerie – Pagination */

.gallery-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 35px;
}

.gallery-page-button {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d5dce2;
  border-radius: 5px;
  background: #fff;
  color: #34495e;
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.gallery-page-button:hover {
  background: #edf2f6;
}

.gallery-page-button.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.gallery-page-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Ausgeblendete Galeriebilder dürfen keinen Platz belegen */

.gallery-item[hidden] {
  display: none;
}
