@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Color Tokens - Default Light Theme */
  --bg-color: #fafaf6;
  --text-color: #1f2118;
  --text-muted: #5e6150;
  --primary-color: #e2de85;
  --primary-text: #1f2118; /* High contrast dark text on yellow-green background */
  --primary-hover: #d2ce73;
  --card-bg: #ffffff;
  --card-border: #e6e6dc;
  --accent-color: #383b2c;
  --dialog-bg: rgba(255, 255, 255, 0.9);
  --dialog-backdrop: rgba(31, 33, 24, 0.4);
  --shadow-sm: 0 2px 5px rgba(31, 33, 24, 0.05);
  --shadow-md: 0 8px 20px rgba(31, 33, 24, 0.08);
  --shadow-lg: 0 16px 36px rgba(31, 33, 24, 0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

[data-theme="dark"] {
  /* Color Tokens - Dark Theme */
  --bg-color: #12130f;
  --text-color: #f6f6f2;
  --text-muted: #9e9f94;
  --primary-color: #e2de85;
  --primary-text: #12130f;
  --primary-hover: #f1eda5;
  --card-bg: #1a1b16;
  --card-border: #2b2d24;
  --accent-color: #e2de85;
  --dialog-bg: rgba(26, 27, 22, 0.95);
  --dialog-backdrop: rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  scrollbar-gutter: stable;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-block-size: 100dvb;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

p, li, blockquote {
  text-wrap: pretty;
  font-weight: 300;
}

a {
  color: var(--text-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: opacity 0.2s ease, color 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

/* Base Layout Container */
.app-container {
  display: grid;
  grid-template-columns: 1fr;
  min-block-size: 100dvb;
}

@media (min-width: 992px) {
  .app-container {
    grid-template-columns: 280px 1fr;
  }
}

/* Navigation Sidebar (Desktop) */
.sidebar {
  display: none; /* Hide on mobile/tablets by default */
}

@media (min-width: 992px) {
  .sidebar {
    background-color: var(--card-bg);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    justify-content: flex-start;
    border-inline-end: 1px solid var(--card-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
}

.sidebar-logo-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-logo {
  max-inline-size: 160px;
  block-size: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo:hover {
  transform: rotate(-3deg) scale(1.05);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-item a {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item a:hover {
  background-color: var(--primary-color);
  color: var(--primary-text);
  transform: translateX(4px);
  opacity: 1;
}

.nav-item a.active {
  background-color: var(--primary-color);
  color: var(--primary-text);
  font-weight: 600;
}

/* Controls */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  align-self: flex-start;
}

.theme-toggle-btn:hover {
  background-color: var(--card-border);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Main Content Area */
.main-content {
  padding: 2rem;
  max-inline-size: 100%;
}

@media (min-width: 768px) {
  .main-content {
    padding: 3rem;
  }
}

.main-content h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-block-end: 2rem;
  position: relative;
  display: inline-block;
}

.main-content h1::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* Responsive Grid / Tiles (Startpage) */
.tile-grid-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card Tiles Styling */
.tile-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--primary-color);
  color: var(--primary-text);
  border-radius: var(--radius-md);
  padding: 2rem;
  min-height: 240px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
  z-index: 1;
}

.tile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 80%);
  z-index: -1;
}

.tile-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  background-color: var(--primary-hover);
  opacity: 1;
}

.tile-card.hero-tile {
  grid-column: span 1;
  background-color: var(--primary-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .tile-card.hero-tile {
    grid-column: span 2;
  }
}

.tile-card.image-tile {
  background-color: var(--card-bg);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-card.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tile-card.image-tile:hover img {
  transform: scale(1.03);
}

.tile-card.image-tile.contain img {
  object-fit: contain;
  padding: 2.5rem;
}

.tile-card.overlay-tile {
  padding: 0;
  position: relative;
  background-color: var(--primary-color);
}

.tile-card.overlay-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  transition: opacity 0.3s ease, transform 0.5s ease;
}

.tile-card.overlay-tile:hover img {
  opacity: 0.45;
  transform: scale(1.05);
}

.tile-card-overlay-content {
  position: absolute;
  inset: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
}

/* Card typography in tiles */
.tile-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tile-subtitle {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.tile-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
}

.tile-date {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  text-align: right;
  line-height: 1.2;
}

.tile-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--text-color);
  color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.tile-card:hover .tile-arrow {
  transform: translateX(4px);
}

/* Sponsor logo strip on startpage */
.sponsor-strip {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 2rem;
  border: 1px solid var(--card-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sponsor-strip a {
  display: flex;
  align-items: center;
}

.sponsor-strip img {
  max-height: 60px;
  max-width: 180px;
  width: auto;
  height: auto;
  filter: grayscale(1) opacity(0.7);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.sponsor-strip img:hover {
  filter: grayscale(0) opacity(1);
  transform: scale(1.05);
}

/* Page shell back buttons and generic sections */
.subpage-container {
  max-width: 900px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  text-decoration: none;
  font-size: 1rem;
  margin-bottom: 2rem;
}

.back-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.back-link:hover svg {
  transform: translateX(-4px);
}

/* Authors view */
.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.author-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.author-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.author-image-wrapper {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  position: relative;
  background-color: var(--card-border);
}

.author-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.author-card:hover .author-image-wrapper img {
  transform: scale(1.04);
}

.author-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
}

.author-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.author-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.author-action {
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: auto;
  padding-top: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.author-card:hover .author-action {
  color: var(--text-color);
}

/* Custom details styling (Tipps) */
.details-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.details-item {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.details-summary {
  list-style: none;
  padding: 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background-color 0.2s ease;
}

.details-summary:hover {
  background-color: var(--bg-color);
}

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

.details-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.details-item[open] .details-icon {
  transform: rotate(180deg);
}

.details-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--card-border);
  padding-top: 1.5rem;
}

.details-content p {
  margin-bottom: 1rem;
}

.details-content p:last-child {
  margin-bottom: 0;
}

.details-content h5 {
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  font-size: 1.1rem;
}

.details-content h5:first-of-type {
  margin-top: 0;
}

/* Modals (Native HTML Dialog) */
.author-dialog {
  border: none;
  background-color: var(--dialog-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 650px;
  width: 90%;
  margin: auto;
  overflow: auto;
  max-height: 85vh;
  color: var(--text-color);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.author-dialog::backdrop {
  background-color: var(--dialog-backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.dialog-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  background-color: var(--card-border);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.dialog-close-btn:hover {
  background-color: var(--primary-color);
  color: var(--primary-text);
  transform: rotate(90deg);
}

.dialog-close-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

.dialog-img-container {
  width: 100%;
  max-height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
}

.dialog-img-container img {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.dialog-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -1rem;
}

.dialog-bio {
  font-size: 1.05rem;
  line-height: 1.6;
}

.dialog-bio i {
  font-family: var(--font-serif);
}

/* Timeline Layout for Schedule (Programm) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 2rem;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: var(--card-border);
}

.timeline-day {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.timeline-day::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--accent-color);
  border: 3px solid var(--bg-color);
  box-shadow: 0 0 0 2px var(--card-border);
}

.timeline-day-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-events {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-event {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 576px) {
  .timeline-event {
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
  }
}

.timeline-event:hover {
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.event-time {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.event-location {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-muted);
}

.event-title {
  font-size: 1.25rem;
  font-family: var(--font-sans);
  font-weight: 500;
}

.event-title span {
  font-weight: 700;
}

/* Venues styling */
.venues-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .venues-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.venue-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  min-height: 180px;
}

.venue-number {
  background-color: var(--primary-color);
  color: var(--primary-text);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.venue-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.venue-address {
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.venue-link {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  margin-top: auto;
}

.map-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  margin-top: 2rem;
  background-color: var(--card-border);
}

.map-container iframe,
.map-container #map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none; /* Verhindert das Zoomen beim bloßen Drüberscrollen */
}

.map-container.active iframe,
.map-container.active #map {
  pointer-events: auto; /* Erlaubt die Interaktion nach einem Klick */
}

.map-attribution {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  font-family: var(--font-sans);
}

.map-attribution a {
  color: var(--text-color);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--primary-color);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.map-attribution a:hover {
  color: var(--accent-color);
  text-decoration-color: var(--accent-color);
}


/* Sponsors view styling */
.sponsors-hero {
  text-align: center;
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 3rem 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}

.sponsors-full-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

[data-theme="dark"] .sponsors-full-image {
  filter: invert(0.9) hue-rotate(180deg) brightness(1.2);
}

/* Mobile top header / bar */
.mobile-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

@media (min-width: 992px) {
  .mobile-header {
    display: none;
  }
}

.mobile-logo {
  max-height: 40px;
  width: auto;
}

.menu-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.menu-toggle-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Drawer Menu (Mobile Navigation) */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.mobile-nav-content {
  position: relative;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.mobile-nav-drawer.open .mobile-nav-content {
  transform: translateX(0);
}

.mobile-menu-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  background-color: var(--card-border);
}

/* Utilities */
.text-center { text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
