/* ===============================
   Grundlayout & Navigation
=============================== */

body {
  margin: 0;
  font-family: 'Cinzel', serif;
  background-color: #1e1b2c;
  color: #f5f5dc;
}

header {
  background-color: #2c2540;
  padding: 20px;
  text-align: center;
}

.logo img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  display: block;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 30px;
}

nav a {
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
  font-size: 1em;
}

footer {
  text-align: center;
  padding: 20px;
  background-color: #2c2540;
  font-size: 0.9em;
}

/* ===============================
   Container (für index.php)
=============================== */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
  box-sizing: border-box;
}

/* ===============================
   Main Layout (index.php)
=============================== */

main {
  padding: 18px 0 36px;
}

.community h2,
.news h2,
.features h2 {
  margin: 0 0 12px 0;
  color: #fff;
  font-size: 20px;
}

/* ===============================
   Community Grid (index.php)
   (wird für Fallbacks verwendet)
=============================== */

.community-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

.community-grid img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  object-fit: cover;
}

.community-text p {
  margin: 0 0 12px 0;
  color: #cfc7d6;
  font-size: 14px;
}

.card-link {
  color: #ffd700;
  font-weight: bold;
  text-decoration: none;
}

/* ===============================
   News Cards (index.php)
=============================== */

.news .cards {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  margin-top: 12px;
}

.card {
  background: #2b1a3a;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}

.card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
}

.card h3 {
  margin: 10px 0 6px;
  color: #fff;
  font-size: 15px;
}

/* ===============================
   Features Grid (index.php)
=============================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  margin-top: 12px;
}

.feature {
  background: rgba(255,255,255,0.04);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.03);
}

/* ===============================
   Wrapper & Tabs (Galerie)
=============================== */

.gallery-wrapper {
  padding: 40px 20px;
}

.gallery-tabs {
  text-align: center;
  margin-bottom: 30px;
}

.tab-button {
  background: none;
  border: none;
  color: #ffd700;
  font-family: 'Cinzel', serif;
  font-size: 1.2em;
  font-weight: bold;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s;
}

.tab-button.active {
  border-bottom: 2px solid #ffd700;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.gallery-title {
  font-size: 2em;
  color: #ffd700;
  text-align: center;
  margin-bottom: 30px;
  font-family: 'Cinzel', serif;
}

/* ===============================
   Upload-Bereich (Galerie)
=============================== */

.upload-section {
  text-align: center;
  margin-bottom: 40px;
  background-color: #2e2a3f;
  padding: 40px;
  border-radius: 8px;
}

.upload-intro {
  font-size: 1.1em;
  color: #c0b283;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

input[type="file"] {
  padding: 10px;
  background-color: #1e1b2c;
  color: #f5f5dc;
  border: 1px solid #ffd700;
  border-radius: 5px;
}

button[name="upload"] {
  background-color: #ffd700;
  color: #1e1b2c;
  padding: 10px 20px;
  border: none;
  font-weight: bold;
  border-radius: 5px;
  margin-left: 10px;
  cursor: pointer;
}

button[name="upload"]:hover {
  background-color: #e6c200;
}

.upload-hint,
.upload-feedback {
  font-size: 0.9em;
  color: #c0b283;
  margin-top: 10px;
}

.upload-feedback {
  color: #ffd700;
  font-weight: bold;
}

/* ===============================
   Bilder-Galerie (Galerie)
=============================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.gallery-item {
  position: relative;
  text-align: center;
}

.gallery-image {
  width: 100%;
  border: 2px solid #ffd700;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  cursor: pointer;
}

/* ===============================
   Lightbox (Galerie)
=============================== */

.lightbox {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 27, 44, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-img {
  height: 1500px;
  width: auto;
  max-width: 90%;
  max-height: 90%;
  border: 2px solid #ffd700;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  object-fit: contain;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1em;
  color: #ffd700;
  cursor: pointer;
  user-select: none;
  padding: 0 20px;
}

.nav.left { left: 0; }
.nav.right { right: 0; }

/* ===============================
   Voting (Galerie)
=============================== */

.vote-bar {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.vote-btn {
  background-color: #2c2540;
  color: #ffd700;
  border: 1px solid #ffd700;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.vote-btn:hover {
  background-color: #ffd700;
  color: #1e1b2c;
}

.vote-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ===============================
   Responsive (nur für index.php Bereiche)
=============================== */

@media (max-width: 900px) {
  .community-grid {
    grid-template-columns: 1fr;
  }
  .news .cards {
    grid-template-columns: 1fr;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .community-grid img {
    max-width: 100%;
  }
}

/* ===============================
   Community Slider – final, HTML-angepasst
   (Buttons links/rechts, Track in der Mitte, aktiver Slide zentriert)
   inkl. Fade-Animation
=============================== */

.community-slider {
  position: relative;
  max-width: 980px;               /* Gesamtbreite des Widgets */
  margin: 0 auto;
  padding: 20px 0;
  display: grid;
  grid-template-columns: 64px 1fr 64px; /* Pfeil – Track – Pfeil */
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
}

/* Buttons (links/rechts) */
.community-prev,
.community-next {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #ffd700;
  font-size: 34px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, transform 0.12s;
  user-select: none;
}

.community-prev:hover,
.community-next:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.community-prev:active,
.community-next:active {
  transform: translateY(0);
}

.community-prev { grid-column: 1; }
.community-next { grid-column: 3; }

/* Track in der Mitte: enthält alle Slides */
.community-track {
  grid-column: 2;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  min-height: 1px;
  overflow: visible;
}

/* Slides: übereinandergelegt, Fade gesteuert via opacity */
.community-slide {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  padding: 6px 12px;
  opacity: 0;
  transition: opacity 0.6s ease-in-out, transform 0.45s ease;
  pointer-events: none;
  will-change: opacity, transform;
  transform: translateY(6px);
}

/* aktiver Slide zeigt Bild + Text nebeneinander und ist zentriert */
.community-slide.active {
  position: relative;           /* normaler Flow innerhalb Track */
  display: grid;
  grid-template-columns: 275px 1fr; /* Bild 25% größer */
  gap: 24px;
  align-items: start;
  justify-items: start;
  max-width: 852px;             /* passt zur mittleren Spalte */
  margin: 0 auto;               /* zentriert den Inhalt innerhalb des Track */
  box-sizing: border-box;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Bild */
.community-slide img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  object-fit: cover;
  display: block;
}

/* Text */
.community-text p {
  margin: 0 0 12px 0;
  color: #cfc7d6;
  font-size: 15px;
  line-height: 1.55;
  white-space: normal;
}

/* Accessibility: non-active slides hidden from assistive tech without breaking transitions */
.community-slide[aria-hidden="true"] {
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

/* Fallback: wenn JS fehlt, zeigen wir Slides untereinander (progressive enhancement) */
.no-js .community-track { display: block; }
.no-js .community-slide { position: static; display: block; margin-bottom: 18px; opacity: 1; visibility: visible; transform: none; pointer-events: auto; }

/* Mobile: Buttons ober/unter dem Track, Slides stacked */
@media (max-width: 900px) {
  .community-slider {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 12px 0;
  }

  .community-prev,
  .community-next {
    width: auto;
    height: auto;
    padding: 8px 12px;
    margin: 6px auto;
  }

  .community-track {
    width: 100%;
  }

  .community-slide.active {
    grid-template-columns: 1fr;
    text-align: center;
    max-width: 100%;
  }

  .community-slide img {
    max-width: 80%;
    margin: 0 auto;
  }
}

/* ===============================
   Mobile: Menü-Layout ohne seitliches Scrollen
   (wrap statt horizontaler Scroll, größere Tap-Flächen)
=============================== */

@media (max-width: 900px) {
  /* Erlaube Umbruch der Menüitems statt horizontalem Scroll */
  .menu-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* zentriert mehrere Reihen */
    gap: 8px 12px;           /* vertikaler und horizontaler Abstand */
    padding: 8px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    background: transparent; /* optional: entferne Hintergrund falls gesetzt */
  }

  /* Jedes Listenelement nimmt nur so viel Platz wie nötig */
  .menu-list li {
    flex: 0 1 auto;
    width: auto;
    list-style: none;
  }

  /* Größere, gut erreichbare Links */
  .menu-list a {
    display: inline-block;
    padding: 12px 14px;
    font-size: 1.05rem;
    line-height: 1.2;
    border-radius: 8px;
    white-space: normal; /* erlaubt Zeilenumbruch innerhalb langer Labels */
    text-align: center;
  }

  /* Optional: wenn du lieber eine kompakte zweite Zeile vermeiden willst,
     begrenze die Breite einzelner Items (z.B. max 48% für zwei Spalten) */
  .menu-list li {
    max-width: 48%;
  }

  /* Für sehr schmale Bildschirme: eine Spalte */
  @media (max-width: 420px) {
    .menu-list li { max-width: 100%; }
    .menu-list a { padding: 14px 16px; font-size: 1.08rem; }
  }
}

/* ===============================
   Drei Feature-Boxen (dunkel, gold, Icon-Blase)
=============================== */

.feature-grid.three-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

/* Einzelne Box */
.feature-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.03);
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Hover-Effekt */
.feature-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.55);
}

/* Icon-Blase */
.feature-icon {
  flex: 0 0 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2b6fb3, #1f4f8a); /* blaues Icon-Feld */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 14px rgba(31,79,138,0.25), inset 0 -6px 12px rgba(0,0,0,0.12);
}

/* SVG innerhalb Icon: gold stroke */
.feature-icon svg {
  width: 28px;
  height: 28px;
  stroke: #ffd700;
  fill: none;
}

/* Textbereich */
.feature-body h4 {
  margin: 0 0 6px 0;
  color: #ffd700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  font-weight: 700;
}

.feature-body p {
  margin: 0;
  color: #d9d2e0;
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Responsive: auf Tablets 2 Spalten, auf Mobil 1 Spalte */
@media (max-width: 900px) {
  .feature-grid.three-boxes {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .feature-icon { flex: 0 0 52px; height: 52px; }
}

@media (max-width: 520px) {
  .feature-grid.three-boxes {
    grid-template-columns: 1fr;
  }
  .feature-box {
    padding: 14px;
    gap: 12px;
  }
  .feature-icon { flex: 0 0 48px; height: 48px; }
  .feature-body h4 { font-size: 1rem; }
  .feature-body p { font-size: 0.98rem; }
}

/* ===============================
   Abstand: mehr Freiraum über den Feature-Boxen
=============================== */

/* Mehr Platz zwischen vorherigem Abschnitt und der Features-Section */
.features {
  margin-top: 36px; /* erhöhten Außenabstand für die gesamte Section */
}

/* Zusätzlicher Abstand zwischen Überschrift und Boxen */
.features > .container > h2 {
  margin-bottom: 22px; /* Abstand unter der H2 (Features) */
}

/* Optional: mehr Innenabstand innerhalb der Container, falls gewünscht */
.features .container {
  padding-top: 8px;
}

/* ===============================
   Hover / Focus Effekt für News Cards
   (gleicher Stil wie .feature-box:hover)
=============================== */

.news .card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  will-change: transform, box-shadow;
}

.news .card:hover,
.news .card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.55);
}

/* Optional: leichtes Hervorheben des Bildes innerhalb der Card */
.news .card img {
  transition: transform 0.35s ease, filter 0.35s ease;
}

.news .card:hover img,
.news .card:focus-within img {
  transform: scale(1.02);
  filter: brightness(1.03);
}

/* Accessibility: sichtbarer Fokusrahmen für Tastaturbenutzer */
.news .card:focus-within {
  outline: 2px solid rgba(255,215,0,0.18);
  outline-offset: 6px;
}
