/* ============================================
   Gemuese Bau Ewald - Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: #88b04d;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #6d8f3a;
}

/* --- Header & Navigation --- */
.site-header {
  background: #2c3e50;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo img {
  height: 60px;
  width: auto;
}

.main-nav {
  background: #1a252f;
}

.nav-list {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-list li a {
  display: block;
  padding: 0.8rem 1rem;
  color: #ecf0f1;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.3s, color 0.3s;
}

.nav-list li a:hover,
.nav-list li a.active {
  background: #88b04d;
  color: #fff;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: #88b04d;
  color: #fff;
  border: none;
  padding: 0.5rem 0.8rem;
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 3px;
}

/* --- Hero Sections --- */
.page-hero {
  position: relative;
  height: 300px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.page-hero h2 {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* --- Carousel (Homepage) --- */
.hero-section {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: #000;
}

.carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s;
}

.carousel-btn:hover {
  background: rgba(136, 176, 77, 0.8);
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

/* --- Content Sections --- */
.content-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.section-heading-wrapper {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-heading {
  font-size: 2rem;
  color: #2c3e50;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #88b04d;
  display: inline-block;
}

/* Hero text section (homepage) */
.hero-text {
  background: #f4f4f4;
  text-align: center;
}

.hero-text h2 {
  font-size: 1.8rem;
  color: #2c3e50;
  margin-bottom: 0.8rem;
}

.hero-text p {
  font-size: 1.1rem;
  color: #555;
}

/* --- Startnews (Homepage News Box) --- */
.startnews-wrapper {
  max-width: 700px;
  margin: 0.5rem auto 1rem;
  padding: 0;
  text-align: center;
  font-size: 1rem;
  color: #555;
}

.startnews-wrapper h1,
.startnews-wrapper h2,
.startnews-wrapper h3 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.startnews-wrapper p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* --- Calendar Hero (Saisonkalender) --- */
.calendar-hero {
  position: relative;
  height: 300px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-hero-text {
  text-align: center;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  padding: 2rem;
  position: relative;
  z-index: 5;
}

.calendar-hero-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.calendar-hero-text p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.calendar-bg img {
  width: 100%;
  max-width: 900px;
  display: block;
  margin: 0 auto;
}

/* --- Market Table --- */
.market-table-wrapper {
  overflow-x: auto;
}

.market-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.market-table th,
.market-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border: 1px solid #ddd;
}

.market-table th {
  background: #88b04d;
  color: #fff;
  font-weight: 600;
}

.market-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

.market-table tbody tr:hover {
  background: #f0f7e6;
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

.gallery-item {
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.3s;
}

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

.gallery-item {
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  display: block;
}

.gallery-item::after {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0;
  transition: opacity 0.3s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.gallery-item:hover::after {
  opacity: 1;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* Gallery loading/error states */
.gallery-loading,
.gallery-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
  color: #666;
}

.gallery-error {
  color: #c0392b;
}

/* --- About Content --- */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.about-image {
  text-align: center;
  margin: 1.5rem 0;
}

.about-image img {
  max-width: 600px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- Contact Grid --- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.contact-card {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 4px;
  border-left: 4px solid #88b04d;
}

.contact-card h3 {
  color: #2c3e50;
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
}

.contact-card p {
  line-height: 1.8;
}

.contact-map {
  margin-top: 2rem;
  text-align: center;
}

.contact-map iframe {
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- Legal Content --- */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h3 {
  color: #2c3e50;
  margin: 1.5rem 0 0.5rem;
  font-size: 1.2rem;
}

.legal-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.legal-content ul {
  margin: 0.5rem 0 1rem 0;
  padding-left: 2rem;
  line-height: 1.8;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

/* --- Footer --- */
.site-footer {
  background: #2c3e50;
  color: #ecf0f1;
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
}

.site-footer p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: #88b04d;
}

.site-footer a:hover {
  color: #a3cc6e;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #88b04d;
  color: #fff;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.3s;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #6d8f3a;
  color: #fff;
}


/* --- Timeline Section --- */
.timeline-section {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.timeline-section h3 {
  text-align: center;
  font-size: 1.8rem;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #88b04d;
  display: inline-block;
  width: 100%;
}

.timeline-entry {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.timeline-entry.reverse {
  flex-direction: row-reverse;
}

.timeline-image {
  flex: 1;
  min-width: 300px;
}

.timeline-image img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  height: 250px;
  object-fit: cover;
}

.timeline-text {
  flex: 1;
}

.timeline-text p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.timeline-text strong {
  color: #88b04d;
  font-size: 1.1em;
}

@media (max-width: 768px) {
  .timeline-entry,
  .timeline-entry.reverse {
    flex-direction: column;
  }
  
  .timeline-image {
    min-width: auto;
    width: 100%;
  }
  
  .timeline-image img {
    height: 200px;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
  }

  .main-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
  }

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

  .page-hero {
    height: 250px;
  }

  .page-hero h2 {
    font-size: 1.8rem;
  }

  .hero-section {
    height: 250px;
  }

  .section-heading {
    font-size: 1.5rem;
  }

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

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

@media (max-width: 480px) {
  .header-inner {
    padding: 0.5rem;
  }

  .site-logo img {
    height: 45px;
  }

  .page-hero h2 {
    font-size: 1.4rem;
  }

  .hero-section {
    height: 200px;
  }
}

/* ============================================================
   Lightbox (Full-Size Image Viewer)
   ============================================================ */

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: #ffffff;
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 3rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.2s;
  line-height: 1;
}

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

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 56px;
  height: 56px;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.2s;
  line-height: 1;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* Lightbox on mobile */
@media (max-width: 768px) {
  .lightbox-content {
    max-width: 95vw;
  }

  .lightbox-content img {
    max-height: 75vh;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .lightbox-caption {
    padding: 0 2rem;
    font-size: 0.8rem;
  }
}

/* --- Download Button --- */
.btn-download {
  display: inline-block;
  padding: 12px 28px;
  background-color: #4a7c59;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.25s, transform 0.15s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-download:hover {
  background-color: #3a6347;
  transform: translateY(-1px);
  color: #fff;
}

.btn-download:active {
  transform: translateY(0);
}

/* ── Market Photo Slider ── */
.market-slider {
  position: relative;
  width: 100%;
  height: 450px;
  overflow: hidden;
  background-color: #333;
}

.market-slider-track {
  display: flex;
  width: 300%;
  height: 100%;
  animation: marketSliderFade 12s infinite;
}

.market-slider-slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

@keyframes marketSliderFade {
  0%, 30%   { transform: translateX(0); }
  33.33%, 63.33% { transform: translateX(-33.33%); }
  66.66%, 96.66% { transform: translateX(-66.66%); }
  100%      { transform: translateX(0); }
}

/* ── Market Cards (3-column layout) ── */
.market-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.market-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(51, 51, 51, 0.25);
}

.market-card-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.market-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.market-card h3 {
  font-size: 1.25rem;
  font-weight: 400;
  color: #333333;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.market-card-separator {
  width: 60px;
  height: 2px;
  background-color: #36aede;
  margin: 0 auto 1rem auto;
}

.market-card-text {
  font-size: 1rem;
  line-height: 1.5;
  color: #8f8f8f;
  margin: 0;
}

/* ── Responsive adjustments ── */
@media (max-width: 900px) {
  .market-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .market-slider {
    height: 250px;
  }

  .market-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .market-card-image {
    height: 200px;
  }
}
