:root {
  --primary: #1a3d1a;
  --primary-dark: #0d1f0d;
  --secondary: #006400;
  --secondary-dark: #004d00;
  --accent: #c0a060;
  --light: #fff8dc;
  --text: #2d1e10;
  --bg-overlay: rgba(255, 255, 255, 0.92);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: url('background.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, #1a3d1a 0%, #0d1f0d 50%, #1a3d1a 100%);
  color: var(--light);
  padding: 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 4px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: headerShine 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes headerShine {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20%, 20%); }
}

header h1 {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  margin-bottom: 0.25rem;
  font-weight: 700;
}

header p {
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  opacity: 0.9;
}

.site-logo {
  max-width: 120px;
  height: auto;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

nav {
  background-color: var(--secondary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.5rem;
  padding: 0.75rem;
  cursor: pointer;
  width: 100%;
}

.nav-toggle::before {
  content: "☰ Menü";
}

.nav-toggle[aria-expanded="true"]::before {
  content: "✕ Schließen";
}

nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0.5rem;
  gap: 0.25rem;
}

nav li {
  margin: 0;
}

nav a {
  color: var(--light);
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  display: block;
}

nav a:hover, nav a:focus {
  background-color: var(--secondary-dark);
  color: #ffd700;
}

main {
  flex: 1;
  padding: 1.5rem 1rem;
  max-width: 800px;
  margin: 1rem auto;
  width: calc(100% - 2rem);
  background-color: var(--bg-overlay);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border: 2px solid var(--accent);
  border-radius: 8px;
}

section {
  margin-bottom: 2rem;
}

section:last-child {
  margin-bottom: 0;
}

h2 {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
}

h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

p {
  margin-bottom: 0.75rem;
}

.link-external {
  margin: 1rem 0;
  padding: 0.75rem;
  background-color: #f5f5f5;
  border-radius: 4px;
  text-align: center;
}

.link-external a {
  color: var(--secondary);
  font-weight: 600;
  text-decoration: none;
}

.link-external a:hover {
  color: var(--secondary-dark);
  text-decoration: underline;
}

.event {
  padding: 1rem;
  background-color: #fffaf0;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
  border-radius: 0 4px 4px 0;
}

.event h3 {
  margin-top: 0;
}

address {
  font-style: normal;
  background-color: #fffaf0;
  padding: 1.25rem;
  border: 1px solid #d2b48c;
  border-radius: 4px;
}

address a {
  color: var(--primary);
  text-decoration: underline;
}

address a:hover {
  color: var(--primary-dark);
}

iframe {
  width: 100%;
  height: 300px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  margin-top: 1rem;
}

footer {
  background: linear-gradient(135deg, #1a3d1a 0%, #0d1f0d 100%);
  color: var(--light);
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  border-top: 4px solid var(--accent);
  margin-top: auto;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--light);
  text-decoration: underline;
}

footer a:hover {
  color: #ffd700;
}

@media (max-width: 600px) {
  .nav-toggle {
    display: block;
  }

  nav ul {
    display: none;
    flex-direction: column;
    gap: 0;
  }

  nav ul.show {
    display: flex;
  }

  nav a {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  main {
    margin: 0.5rem;
    padding: 1rem;
    width: calc(100% - 1rem);
  }

  .event {
    padding: 0.75rem;
  }

  address {
    padding: 1rem;
  }

  iframe {
    height: 250px;
  }
}

/* === Ostereierschießen / Event Highlight === */
.event-highlight {
  border-left: 4px solid #c0a060;
  background: linear-gradient(135deg, #fffaf0 0%, #fff8dc 100%);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-flyer img.flyer-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 2px solid var(--accent);
  display: block;
}

.event-info h3 {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.event-prize {
  font-size: 1.05rem;
  color: var(--secondary-dark);
  margin-top: 0.5rem;
}

.event-award {
  background: #fff3cd;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.event-invite {
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.5rem;
}

@media (min-width: 600px) {
  .event-highlight {
    flex-direction: row;
    align-items: flex-start;
  }
  .event-flyer {
    flex: 0 0 240px;
  }
  .event-flyer img.flyer-img {
    width: 240px;
    max-width: 240px;
  }
  .event-info {
    flex: 1;
  }
}

/* === Schützenjugend Fotos === */
.photo-gallery {
  display: flex;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
}

.photo-item {
  flex: 1 1 0;
  min-width: 0;
}

.photo-item img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 2px solid var(--accent);
  display: block;
}

/* === Ergebnisse-Tabellen === */
.ergebnisse-hint {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

details {
  border: 1px solid #d2b48c;
  border-radius: 6px;
  margin-bottom: 1rem;
  overflow: hidden;
}

details summary {
  background: var(--primary);
  color: var(--light);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

details summary::before {
  content: "▶";
  font-size: 0.75rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary::-webkit-details-marker {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  padding: 0.75rem;
  background: #fffaf0;
}

.ergebnisse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ergebnisse-table th {
  background: var(--secondary);
  color: var(--light);
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.ergebnisse-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid #e8d8b0;
}

.ergebnisse-table tr:last-child td {
  border-bottom: none;
}

.ergebnisse-table .jg-header td {
  background: #e8d8b0;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  letter-spacing: 0.03em;
}

.ergebnisse-table tr.vils td {
  background: #e8f5e9;
  font-weight: 700;
  color: var(--secondary-dark);
}

.ergebnisse-table tr.vils:hover td {
  background: #c8e6c9;
}

.ergebnisse-table td.vils-label {
  color: var(--primary-dark);
}

.ergebnisse-table tr:not(.jg-header):not(.vils):hover td {
  background: #faf5e4;
}

@media (max-width: 600px) {
  .ergebnisse-table {
    font-size: 0.8rem;
  }
  .ergebnisse-table th,
  .ergebnisse-table td {
    padding: 0.3rem 0.4rem;
  }
  .photo-item {
    flex: 1 1 100%;
  }
}

/* === Lightbox === */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#lightbox.active {
  display: flex;
}

#lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  animation: lbFadeIn 0.2s ease;
}

@keyframes lbFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

#lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
  #lightbox-img {
    animation: none;
  }
}
