/* Galerie-spezifisches Styling – Header/Footer liegen in shared-layout.css, Hero liegt in hero.css */

:root {
  --green: #1c6f47;
  --green-dark: #10482d;
  --gold: #d7b15b;
  --cream: #f7f3e8;
  --paper: #ffffff;
  --ink: #17211b;
  --muted: #637169;
  --shadow: 0 24px 70px rgba(23, 33, 27, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --content: 1180px;
}
* {
  box-sizing: border-box;
}
body.gallery-redesign {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(
      circle at top left,
      rgba(215, 177, 91, 0.18),
      transparent 30rem
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.86),
      rgba(247, 243, 232, 0.96)
    ),
    url("bilder/site-bg.jpg");
  background-size: auto, auto, cover;
  background-attachment: fixed;
}
.gallery-hero {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  isolation: isolate;
}
.gallery-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-image, url("bilder/eroeffnung23.JPG")) center 28% /
    cover no-repeat;
  z-index: -3;
  transform: scale(1.02);
}
.gallery-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at center,
      rgba(28, 111, 71, 0.12),
      rgba(8, 18, 12, 0.68)
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.52));
  z-index: -2;
}
.gallery-hero__inner {
  width: min(100% - 32px, 950px);
  padding: 48px 20px;
}
.gallery-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 900;
}
.gallery-hero h1 {
  margin: 10px 0 0;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}
.gallery-hero p {
  max-width: 760px;
  margin: 18px auto 0;
  font-size: clamp(1.05rem, 2.3vw, 1.35rem);
  color: rgba(255, 255, 255, 0.9);
}
.gallery-actions-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.gallery-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.gallery-button.primary {
  background: var(--gold);
  color: #2d2308;
}
.gallery-button.secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(8px);
}
.gallery-button.green {
  background: var(--green);
  color: #fff;
}
.gallery-main,
.gallery-shell,
.upload-shell {
  width: min(100% - 32px, var(--content));
  margin: 0 auto;
}
.gallery-main {
  padding: 0 0 72px;
}

.gallery-toplikes-card {
  margin: -110px 0 28px;
  position: relative;
  z-index: 20;
}
.gallery-intro-card,
.upload-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(28, 111, 71, 0.1);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 42px);
}
.gallery-intro-card::after,
.gallery-year-wrap::before,
.upload-card::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -190px;
  top: -180px;
  background: url("bilder/SG_Wappen.jpg") center / contain no-repeat;
  opacity: 0.035;
  pointer-events: none;
  border-radius: 50%;
}
.gallery-intro-card h2,
.gallery-section-heading h2,
.upload-card h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}
.gallery-intro-card p,
.upload-card p {
  max-width: 820px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.08rem;
}
.gallery-year-wrap {
  position: relative;
  margin-top: 34px;
  isolation: isolate;
}
.gallery-year-wrap::before {
  left: 50%;
  right: auto;
  top: 45%;
  transform: translate(-50%, -50%);
  width: 650px;
  height: 650px;
  opacity: 0.04;
  z-index: -1;
}
.gallery-year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.gallery-year-card {
  min-height: 420px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  text-decoration: none;
  box-shadow: var(--shadow);
  isolation: isolate;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.gallery-year-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 86px rgba(23, 33, 27, 0.22);
}
.gallery-year-card::before,
.gallery-year-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
}
.gallery-year-card::before {
  background: var(--card-image) center / cover no-repeat;
  transform: scale(1.03);
  transition: transform 0.22s ease;
}
.gallery-year-card:hover::before {
  transform: scale(1.08);
}
.gallery-year-card::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.82)),
    radial-gradient(
      circle at top left,
      rgba(28, 111, 71, 0.45),
      transparent 55%
    );
}
.gallery-year-card .year {
  position: absolute;
  top: 22px;
  left: 24px;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.14em;
}
.gallery-year-card h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin: 0;
}
.gallery-year-card p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}
.gallery-badge {
  display: inline-flex;
  width: max-content;
  margin-top: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 800;
}
.gallery-upload-teaser {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1.3fr auto;
  gap: 20px;
  align-items: center;
  background: linear-gradient(
    135deg,
    rgba(28, 111, 71, 0.95),
    rgba(16, 72, 45, 0.98)
  );
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 36px);
  box-shadow: var(--shadow);
}
.gallery-upload-teaser h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.08;
}
.gallery-upload-teaser p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.82);
}
.gallery-shell {
  padding: 42px 0 70px;
}
.gallery-titlebar {
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}
.gallery-titlebar h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}
.gallery-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 500px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 700px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 950px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #f3f5f4;
  aspect-ratio: 4/3;
  display: block;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(23, 33, 27, 0.08);
}
.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease;
}
@media (hover: hover) {
  .gallery-item:hover img {
    transform: scale(1.04);
  }
}
.gallery-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}
.btn-more {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  background: var(--green);
  color: #fff;
  font:
    800 16px/1 system-ui,
    Segoe UI,
    Arial,
    sans-serif;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(28, 111, 71, 0.2);
}
.btn-more:hover {
  filter: brightness(1.08);
}
.btn-more[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
body.lb-disable-scrolling {
  overflow: hidden;
}
.lb {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.lb.is-hidden {
  display: none;
}
.lb__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}
.lb__stage {
  position: relative;
  max-width: 96vw;
  max-height: 92vh;
  display: grid;
  place-items: center;
}
.lb__img {
  max-width: 96vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 4px solid #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.lb__btn {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  cursor: pointer;
  font-size: 0;
}
.lb__btn::before {
  font-size: 34px;
  line-height: 1;
  color: #fff;
}
.lb__btn--close {
  top: 12px;
  right: 12px;
}
.lb__btn--close::before {
  content: "×";
}
.lb__btn--prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.lb__btn--prev::before {
  content: "‹";
}
.lb__btn--next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.lb__btn--next::before {
  content: "›";
}
.lb__caption {
  margin-top: 10px;
  text-align: center;
  color: #fff;
  font:
    700 14px/1.35 system-ui,
    Segoe UI,
    Arial,
    sans-serif;
}
.upload-shell {
  padding: 54px 0 78px;
}
.upload-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  max-width: 760px;
}
.upload-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}
.upload-form input,
.upload-form textarea,
.upload-form select {
  width: 100%;
  border: 1px solid rgba(28, 111, 71, 0.18);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: #fff;
}
.upload-form textarea {
  min-height: 110px;
  resize: vertical;
}
.upload-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}
.upload-status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 800;
}
.upload-status.ok {
  background: #e8f5ee;
  color: #0e5a36;
}
.upload-status.err {
  background: #feecec;
  color: #9d2222;
}
@media (max-width: 900px) {
  .gallery-year-grid,
  .gallery-upload-teaser {
    grid-template-columns: 1fr;
  }
  .gallery-year-card {
    min-height: 320px;
  }
  .gallery-titlebar {
    display: block;
  }
  .gallery-titlebar .gallery-actions-row {
    justify-content: flex-start;
    margin-top: 16px;
  }
}
@media (max-width: 540px) {
  body.gallery-redesign {
    background-attachment: scroll;
  }
  .gallery-hero {
    min-height: 360px;
  }
  .gallery-actions-row {
    flex-direction: column;
  }
  .gallery-button {
    width: 100%;
  }
  .gallery-intro-card,
  .upload-card {
    padding: 20px;
  }
}

/* =========================================================
   Galerie Mobile Overflow Fix
   verhindert seitliches Wischen / horizontales Überlaufen
   ========================================================= */
html,
body {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.gallery-redesign {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.gallery-redesign * {
  max-width: 100%;
}

.gallery-main,
.gallery-shell,
.upload-shell,
.gallery-intro-card,
.gallery-year-wrap,
.gallery-year-grid,
.gallery-upload-teaser,
.upload-card {
  max-width: 100% !important;
}

.gallery-year-card,
.gallery-item,
.gallery-button {
  max-width: 100% !important;
}

.gallery-intro-card::after,
.gallery-year-wrap::before,
.upload-card::after {
  max-width: none !important;
}

@media (max-width: 900px) {
  .gallery-main,
  .gallery-shell,
  .upload-shell {
    width: min(100% - 24px, var(--content)) !important;
  }

  .gallery-year-grid {
    grid-template-columns: 1fr !important;
  }

  .gallery-upload-teaser {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 540px) {
  .gallery-main,
  .gallery-shell,
  .upload-shell {
    width: calc(100% - 24px) !important;
  }

  .gallery-intro-card,
  .upload-card,
  .gallery-upload-teaser {
    padding: 20px !important;
  }

  .gallery-intro-card::after,
  .upload-card::after {
    width: 300px !important;
    height: 300px !important;
    right: -130px !important;
    top: -110px !important;
  }

  .gallery-year-wrap::before {
    width: 340px !important;
    height: 340px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }

  .gallery-year-card {
    min-height: 300px !important;
    padding: 22px !important;
  }
}

/* Mobile: Galerie-Wasserzeichen entfernen */
@media (max-width: 768px) {
  .gallery-intro-card::after,
  .gallery-year-wrap::before,
  .upload-card::after {
    display: none !important;
    content: none !important;
    background: none !important;
  }
}

/* =========================================================
   Galerie: Gruppierung nach Schützenfest-Jahr
   ========================================================= */

.gallery-festival-list {
  margin-top: 34px;
  display: grid;
  gap: 28px;
}

.gallery-festival-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(28, 111, 71, 0.12);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.9)
  );
  padding: clamp(22px, 4vw, 38px);
  isolation: isolate;
}

.gallery-festival-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.97) 0%,
      rgba(255, 255, 255, 0.86) 48%,
      rgba(255, 255, 255, 0.35) 100%
    ),
    var(--festival-image) center / cover no-repeat;
  z-index: -2;
}

.gallery-festival-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at right top,
    rgba(215, 177, 91, 0.28),
    transparent 28rem
  );
  z-index: -1;
  pointer-events: none;
}

.gallery-festival-card__head {
  max-width: 720px;
  margin-bottom: 22px;
}

.gallery-festival-card__head h2 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.gallery-festival-card__head p:not(.gallery-kicker) {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.gallery-day-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.gallery-day-card {
  min-height: 145px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(23, 33, 27, 0.18);
  isolation: isolate;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.gallery-day-card::before,
.gallery-day-card::after {
  content: "";
  position: absolute;
  inset: 0;
}

.gallery-day-card::before {
  background: var(--day-image) center / cover no-repeat;
  z-index: -2;
  transform: scale(1.04);
  transition: transform 0.22s ease;
}

.gallery-day-card::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.78));
  z-index: -1;
}

.gallery-day-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(23, 33, 27, 0.24);
}

.gallery-day-card:hover::before {
  transform: scale(1.1);
}

.gallery-day-card span {
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.gallery-day-card small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

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

@media (max-width: 640px) {
  .gallery-festival-card {
    padding: 20px;
  }

  .gallery-festival-card::before {
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.98),
        rgba(255, 255, 255, 0.88)
      ),
      var(--festival-image) center / cover no-repeat;
  }

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

  .gallery-day-card {
    min-height: 118px;
    border-radius: 16px;
    padding: 13px;
  }
}


/* =========================================================
   Mobile: Galerie-Jahre einklappbar
   Desktop bleibt unverändert offen.
   ========================================================= */

.gallery-mobile-toggle {
  display: none;
}

@media (max-width: 768px) {
  .gallery-festival-card__head {
    margin-bottom: 14px;
  }

  .gallery-mobile-toggle {
    width: 100%;
    min-height: 46px;
    margin: 4px 0 0;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    font: 900 0.95rem/1 "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(28, 111, 71, 0.18);
  }

  .gallery-mobile-toggle::after {
    content: "▾";
    margin-left: 8px;
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.18s ease;
  }

  .gallery-mobile-toggle__close {
    display: none;
  }

  .gallery-day-grid {
    display: none !important;
    margin-top: 14px;
  }

  .gallery-festival-card.is-open .gallery-day-grid {
    display: grid !important;
  }

  .gallery-festival-card.is-open .gallery-mobile-toggle {
    background: #edf6f0;
    color: var(--green-dark);
  }

  .gallery-festival-card.is-open .gallery-mobile-toggle::after {
    transform: rotate(180deg);
  }

  .gallery-festival-card.is-open .gallery-mobile-toggle__open {
    display: none;
  }

  .gallery-festival-card.is-open .gallery-mobile-toggle__close {
    display: inline;
  }
}
