:root {
  /* Color palette inspired by traditional Thai temples */
  --primary-color: #800f0f; /* deep red reminiscent of temple roofs */
  --secondary-color: #ffe39f; /* soft gold accent */
  --background-color: #f6e9cc; /* warm ivory backdrop */
  --text-color: #3b2800; /* dark brown for legibility */
  --light-color: #ffffff; /* white for contrast */
}


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

body {
  font-family: 'Noto Sans', 'Noto Sans Thai', sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
}

/* ----- Header / Navigation (Index) ----- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--primary-color);
  color: var(--light-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-weight: bold;
  font-size: 1.6rem;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--light-color);
  text-decoration: none;
  padding: 0.5rem;
  transition: background-color 0.3s;
  border-radius: 4px;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.lang-toggle {
  display: flex;
  gap: 0.5rem;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--light-color);
  border-radius: 4px;
  color: var(--light-color);
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s, color 0.3s;
}

.lang-btn.active,
.lang-btn:hover {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border-color: var(--secondary-color);
}

#menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--light-color);
  font-size: 1.8rem;
  cursor: pointer;
}

/* Responsive navigation (Index) */
@media screen and (max-width: 768px) {
  nav {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: var(--primary-color);
    flex-direction: column;
    width: 200px;
    display: none;
    padding: 1rem;
    border-bottom-left-radius: 8px;
  }
  nav.active { display: flex; }
  #menu-toggle { display: block; }
}

@media screen and (max-width: 480px) {
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 1.2rem;
  }

  nav {
    gap: 0.5rem;
  }

  nav a {
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
  }

  .lang-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }
}

/* ----- Hero Section (Index) ----- */
#hero {
  position: relative;
  height: 30vh;
  background-image: url('Bilder/Header_Hintergrund.png');
  background-size: cover;
  background-position: center;
  color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#hero .hero-content {
  position: relative;
  z-index: 1;
  padding: 0 1rem;
}

#hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

#hero p { font-size: 1.2rem; }

.hero-logo {
  display: block;
  margin: 0 auto 1rem auto;
  max-width: 600px;
  height: auto;
}

/* Figur links & rechts (Index-Hero) */
#hero::before,
#hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: clamp(40px, 100vw, 320px);
  aspect-ratio: 1 / 1;
  background: url('Bilder/Figur.png') bottom/contain no-repeat;
  z-index: 1;
}
#hero::before { left: 2%; }
#hero::after  { right: 2%; }

@media (max-width: 1023px) {
  #hero::before, #hero::after { display: none; }
}

/* ----- Content Sections (Index) ----- */
.content-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.content-section h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-align: center;
}

.content-section p { margin-bottom: 1rem; text-align: center; }

.cite {
  font-size: 0.8rem;
  color: #555;
  margin-top: 1rem;
  text-align: center;
  font-style: italic;
}

.map-container iframe {
  width: 100%;
  height: 450px;
  border: none;
  border-radius: 8px;
}

/* ----- Calendar Section (Index) ----- */
#calendar {
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 12px;   /* Ecken abrunden */
  overflow: hidden;      /* Inhalt passt sich an Radius an */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* optional: leichter Schatten */
}

/* FullCalendar: Standard weiß */
#calendar .fc-daygrid-day { background: #ffffff; }

/* --- Events nicht anzeigen; Logo per Overlay (Zellenhöhe bleibt fix) --- */
#calendar .fc-daygrid-event { display: none; }
#calendar .fc-daygrid-day-frame { position: relative; }
#calendar .has-event-logo .fc-daygrid-day-frame::after {
  content: '';
  position: absolute;
  top: 60%;
  left: 50%;
  width: 60%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  background: url('Bilder/Logo.png') center / contain no-repeat;
  pointer-events: none;
}

/* Toolbar-Titel */
#calendar .fc-toolbar-title {
  text-align: center;
  margin-top: 5%;
  width: 100%;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
}

/* FullCalendar Navigationspfeile anpassen */
#calendar .fc-prev-button,
#calendar .fc-next-button {
  background-color: #b01e00;  /* Dunkelrot */
  border: none;

  color: #ffffff;             /* Weißer Pfeil */
  font-size: 1.2rem;

  border-radius: 6px;
  cursor: pointer;
}

#calendar .fc-prev-button:hover,
#calendar .fc-next-button:hover {
  background-color: #8a1800;  /* etwas dunkler beim Hover */
}

/* Optional: Optik des "+n mehr"-Links etwas dezenter */
#calendar .fc-daygrid-more-link {
  font-size: 0.8rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,0.05);
}

/* Gold-Hintergrund + Logo über die ganze Kachel */
#calendar .has-event-logo {
  background-color: #D4AF37;   /* Gold-Hintergrund */
  position: relative;
}

#calendar .has-event-logo::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  background: url('Bilder/Logo.png') center / contain no-repeat;
  pointer-events: none;
}


/* Event-Liste unter dem Kalender */
#event-list {
  margin-top: 2rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

#event-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#event-list li {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#event-list .event-title {
  font-weight: bold;
  color: #3b2800;
}

#event-list .event-date {
  font-size: 1rem;
  font-weight: bold;
  color: #555;
}


/* --- Event-Liste: Handy = Titel oben, Datum unten; Desktop = nebeneinander --- */
@media screen and (max-width: 600px) {
  #event-list li {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 4px;
    padding: 10px 12px;
  }

  /* WICHTIG: span -> block, damit 100% Breite & echter Zeilenumbruch wirken */
  #event-list .event-title,
  #event-list .event-date {
    display: block !important;
    width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  #event-list .event-title {
    font-size: 0.95rem;
    line-height: 1.25;
    margin: 0;
    order: 1;
  }

  #event-list .event-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    order: 2;
  }
}

/* Desktop: einzeilig links|rechts mit Ellipsis */
@media screen and (min-width: 601px) {
  #event-list .event-title,
  #event-list .event-date {
    display: inline-block;     /* für max-width + Ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48%;
  }
}



/* ----- Gallery preview on Index ----- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* Wrapper + Overlay (generisch, wird auch für Index genutzt) */
.image-wrapper {
  position: relative;
  display: block;
  width: 100%;
}
.image-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  z-index: 1;
  -webkit-user-drag: none;
}
.image-wrapper .overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: auto;
  z-index: 2;
}

/* Einheitliche Höhe für Index-Vorschau */
#dynamic-gallery .image-wrapper {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 10px;
  position: relative;
}
#dynamic-gallery .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Platzhalter (Index) */
.photo-placeholder {
  background-color: var(--secondary-color);
  padding-top: 75%;
  position: relative;
  border: 2px dashed var(--primary-color);
  border-radius: 8px;
  overflow: hidden;
}
.photo-placeholder::after {
  content: 'Foto folgt';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: bold;
}

/* ----- Footer (Index) ----- */
footer {
  background-color: var(--primary-color);
  color: var(--light-color);
  text-align: center;
  padding: 1rem 2rem;
  margin-top: 3rem;
}
footer a {
  color: var(--light-color);
  text-decoration: none;
  margin: 0 0.3rem;
}
footer a:hover { text-decoration: underline; }
