/* =====================================================
   Kulturverein Blidegg — Main Stylesheet
   Palette: terra / steel / forest-green / slate + white
   ===================================================== */

/* Custom Properties */
:root {
  --dark:       #2D4A35;   /* forest green — header, footer */
  --charcoal:   #3D5E46;   /* medium forest green — nav bar */
  --slate:      #515658;   /* muted UI elements */
  --terra:      #B05631;   /* terracotta — primary accent */
  --terra-dark: #8f4427;   /* darker terracotta — hover states */
  --steel:      #709DB7;   /* steel blue — secondary accent */
  --steel-lt:   #d1e4ef;   /* light steel — borders / subtle bg */
  --terra-lt:   #f7ede6;   /* light terracotta — callout bg */
  --text:       #2D4A35;
  --text-muted: #515658;
  --bg:         #ffffff;
  --bg-alt:     #f5f4f4;
  --border:     #d4cfd0;
  --white:      #ffffff;

  --font: 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --max-w: 1100px;
  --nav-h: 60px;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terra); text-decoration: none; }
a:hover { color: var(--terra-dark); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; color: var(--terra); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem; margin-top: 1.25rem; margin-bottom: 0.4rem; }
h4 { font-size: 1.1rem; margin-top: 1rem; margin-bottom: 0.3rem; }
p { margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.25rem; }
b, strong { font-weight: 600; }

/* =====================================================
   HEADER
   ===================================================== */
#site-header {
  background: var(--dark);
  color: var(--white);
}

.site-header-image {
  background-image: url('/images/3703a1e4_Unknown.jpeg');
  background-size: cover;
  background-position: center;
  aspect-ratio: 6 / 1;
}

.site-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-title-bar {
  padding: 1rem 0 0.5rem;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-title:hover { color: var(--steel); text-decoration: none; }

.site-tagline {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.1rem;
}

/* =====================================================
   NAVIGATION
   ===================================================== */
.site-nav {
  background: var(--charcoal);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-list li a {
  display: block;
  padding: 0.75rem 0.85rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-bottom: 3px solid transparent;
}

.nav-list li a:hover,
.nav-list li a.active,
.nav-list li a[aria-current="page"] {
  background: rgba(255,255,255,0.10);
  color: var(--white);
  border-bottom-color: var(--terra);
  text-decoration: none;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem 0;
  color: var(--white);
}

.nav-toggle-icon {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: background var(--transition);
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: currentColor;
  left: 0;
  transition: transform var(--transition), top var(--transition);
}

.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after  { top:  7px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0; transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0; transform: rotate(-45deg);
}

/* =====================================================
   PAGE LAYOUT
   ===================================================== */
.page-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 2rem;
  flex: 1;
  align-items: start;
}

main {
  min-width: 0;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  min-width: 0;
}

.sidebar h2 {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  margin-top: 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--steel-lt);
}

.sponsor-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sponsor-list li a,
.sponsor-list li span {
  display: block;
}

.sponsor-list img {
  max-width: 180px;
  max-height: 100px;
  object-fit: contain;
  filter: grayscale(20%);
  transition: filter var(--transition);
}

.sponsor-list a:hover img { filter: grayscale(0%); }

.sponsor-label {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #666);
}

.sponsor-list li.sponsor-separator {
  border-top: 1px solid var(--border, #ddd);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.facebook-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--terra);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.facebook-link img { width: 32px; height: 32px; }

/* =====================================================
   POSTS & CARDS
   ===================================================== */
.post {
  margin-bottom: 2.5rem;
}

.post + .post {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-title {
  font-size: 1.6rem;
  color: var(--terra);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.post-body {
  font-size: 1rem;
}

.post-body .highlight-box {
  background: var(--terra-lt);
  border-left: 4px solid var(--terra);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.25rem;
}

/* =====================================================
   IMAGES & FIGURES
   ===================================================== */
figure {
  margin: 1.5rem auto;
  text-align: center;
}

figure img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto;
}

figcaption {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* =====================================================
   PHOTO GALLERY
   ===================================================== */
.gallery-section {
  margin-bottom: 3rem;
}

.gallery-section h2 {
  font-size: 1.3rem;
  color: var(--terra);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--steel-lt);
}

.gallery-section h3 {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.25rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.photo-grid a {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
  background: var(--bg-alt);
  position: relative;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.photo-grid a:not(.loaded) {
  background: linear-gradient(90deg, var(--bg-alt) 25%, #e8e6e6 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.photo-grid a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-grid a:hover img { transform: scale(1.04); }

.photo-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.25rem;
}

/* =====================================================
   LIGHTBOX
   ===================================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: zoom-out;
}

.lightbox-overlay img {
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  cursor: default;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  color: white;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  z-index: 1001;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 3rem;
  line-height: 1;
  background: rgba(0,0,0,0.35);
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  z-index: 1001;
  border-radius: var(--radius);
  transition: background var(--transition);
  user-select: none;
}

.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(0,0,0,0.65); }

.lightbox-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: rgba(255,255,255,0.85);
  border-radius: 50%;
  animation: lb-spin 0.65s linear infinite;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@keyframes lb-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =====================================================
   YOUTUBE CONSENT
   ===================================================== */
.youtube-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}

.youtube-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-size: cover;
  background-position: center;
}

.youtube-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.youtube-play-btn {
  position: relative;
  width: 68px;
  height: 48px;
  background: #ff0000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.youtube-placeholder:hover .youtube-play-btn { background: #cc0000; }

.youtube-play-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 11px 0 11px 20px;
  border-color: transparent transparent transparent white;
  margin-left: 4px;
}

.youtube-consent-text {
  position: relative;
  color: rgba(255,255,255,0.9);
  font-size: 0.8rem;
  text-align: center;
  max-width: 300px;
  margin-top: 0.75rem;
  padding: 0 1rem;
  line-height: 1.4;
}

.youtube-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

/* =====================================================
   SCHEDULE / TERMINE
   ===================================================== */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.month-block {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1rem;
  border-top: 3px solid var(--terra);
}

.month-block h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--terra);
  margin: 0 0 0.5rem;
}

.month-block .dates {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
}

.month-block .dates li {
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.month-block .dates li:last-child { border-bottom: none; }

.month-block .dates li.special {
  color: var(--terra);
  font-weight: 600;
}

/* =====================================================
   BOARD MEMBERS
   ===================================================== */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.board-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1rem;
  border-left: 3px solid var(--terra);
}

.board-card .role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--steel);
  margin-bottom: 0.2rem;
}

.board-card .name {
  font-weight: 600;
  font-size: 1rem;
}

.voice-section {
  margin-top: 2rem;
}

.voice-section h3 {
  color: var(--terra);
  border-bottom: 1px solid var(--steel-lt);
  padding-bottom: 0.3rem;
}

.voice-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  columns: 2;
  gap: 1rem;
}

.voice-list li {
  margin-bottom: 0.25rem;
  break-inside: avoid;
}

/* =====================================================
   CONTACT
   ===================================================== */
.contact-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--terra);
  max-width: 480px;
}

.contact-card p { margin-bottom: 0.5rem; }

.contact-card a {
  color: var(--terra);
  font-weight: 500;
}

/* =====================================================
   FOOTER
   ===================================================== */
#site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--white);
  text-decoration: none;
}

/* =====================================================
   CONSENT BANNER
   ===================================================== */
#consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark);
  color: var(--white);
  z-index: 500;
  padding: 1rem;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
}

.consent-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.consent-text {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.5;
  min-width: 220px;
}

.consent-text a { color: var(--steel); }

.consent-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--terra);
  color: var(--white);
  border-color: var(--terra);
}

.btn-primary:hover {
  background: var(--terra-dark);
  border-color: var(--terra-dark);
  color: var(--white);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.5);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
  color: white;
  text-decoration: none;
}

.btn-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover { color: white; }

/* Consent Settings Modal */
#consent-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.consent-modal-box {
  background: var(--white);
  border-radius: 10px;
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.consent-modal-box h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  margin-top: 0;
  color: var(--terra);
}

.consent-option {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.consent-option:last-of-type { border-bottom: none; }

.consent-option-info h3 {
  font-size: 0.95rem;
  margin: 0 0 0.2rem;
  color: var(--text);
}

.consent-option-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 1rem;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  transition: transform var(--transition);
}

.toggle input:checked + .toggle-slider { background: var(--steel); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle input:disabled + .toggle-slider { opacity: 0.6; cursor: not-allowed; }

.consent-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.consent-modal-actions .btn-primary { background: var(--terra); border-color: var(--terra); color: var(--white); }
.consent-modal-actions .btn-outline { color: var(--text); border-color: var(--slate); }
.consent-modal-actions .btn-outline:hover { background: var(--bg-alt); color: var(--text); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .page-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-top: 2px solid var(--border);
    padding-top: 1.5rem;
  }

  .sponsor-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .sponsor-list img {
    max-width: 120px;
    max-height: 60px;
  }
}

@media (max-width: 768px) {
  .nav-inner { flex-wrap: wrap; }

  .nav-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    order: 1;
    margin-left: auto;
  }

  .nav-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
  }

  .nav-list {
    order: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
  }

  .nav-list.open {
    max-height: 500px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .nav-list li a {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-left: 3px solid transparent;
    padding: 0.85rem 1rem;
  }

  .nav-list li a:hover,
  .nav-list li a.active {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-left-color: var(--terra);
    border-bottom-color: transparent;
  }

  .site-title { font-size: 1.3rem; }

  .youtube-grid { grid-template-columns: 1fr; }

  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .consent-inner { flex-direction: column; align-items: flex-start; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .schedule-grid { grid-template-columns: 1fr 1fr; }
  .board-grid    { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  .site-header-image {
    aspect-ratio: 4 / 1;
    background-position: top center;
  }
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
  #site-header, .site-nav, #site-footer,
  #consent-banner, #consent-modal, .sidebar { display: none; }

  .page-wrapper { display: block; }
  main { max-width: 100%; }
}
