/* ===== CSS Variables ===== */
:root {
  --color-bg: #f8f8f8;
  --color-surface: #ffffff;
  --color-dark: #1a1a2e;
  --color-dark-alt: #16213e;
  --color-accent: #e94560;
  --color-text: #222222;
  --color-text-muted: #666666;
  --color-border: #e0e0e0;
  --font-main: 'Segoe UI', Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
}

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

body {
  background-color: var(--color-bg);
  font-family: var(--font-main);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Header ===== */
header {
  background-color: var(--color-surface);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#logo img {
  height: 68px;
  width: auto;
}

/* ===== Nav ===== */
nav {
  background-color: var(--color-dark);
  border-top: none;
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: #ffffff;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: background-color var(--transition), color var(--transition);
  border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  background-color: rgba(255,255,255,0.08);
  border-bottom-color: var(--color-accent);
}

/* ===== Language Switcher ===== */
.lang-switcher {
  display: flex;
  gap: 4px;
  padding: 10px 0;
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.6);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all var(--transition);
}

.lang-btn:hover { border-color: rgba(255,255,255,0.6); color: #fff; }
.lang-btn.active { background-color: var(--color-accent); border-color: var(--color-accent); color: #fff; }

/* ===== Main Content ===== */
main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 12px 0 32px;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-dark);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

/* ===== Radio Widget ===== */
.radio-widget-wrap {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 32px;
}

#loader {
  text-align: center;
  color: var(--color-text-muted);
  padding: 24px;
  font-size: 0.9rem;
}

#radio-widget {
  display: none;
  width: 100%;
  min-height: 150px;
  border: none;
}

/* ===== Announcement Image ===== */
.announcement {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.announcement img {
  width: 100%;
  height: auto;
}

/* ===== Audio Cards (Children's Page) ===== */
.audio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.audio-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  outline: none;
}

.audio-card:hover,
.audio-card:focus {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.14);
}

.audio-card:focus { box-shadow: 0 0 0 3px var(--color-accent); }

.audio-card-thumb {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.audio-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.audio-card:hover .audio-card-thumb img,
.audio-card:focus .audio-card-thumb img {
  transform: scale(1.04);
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.audio-card:hover .play-overlay,
.audio-card:focus .play-overlay {
  opacity: 1;
}

.play-icon {
  width: 56px;
  height: 56px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon svg { fill: #fff; width: 24px; height: 24px; margin-left: 3px; }

/* Playing state */
.audio-card.playing .play-overlay { opacity: 1; background: rgba(233,69,96,0.35); }
.audio-card.playing .play-icon svg.icon-play { display: none; }
.audio-card.playing .play-icon svg.icon-pause { display: block !important; }

.audio-card-body {
  padding: 16px;
}

.audio-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.audio-progress {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.audio-progress-bar {
  height: 100%;
  background: var(--color-accent);
  width: 0%;
  transition: width 0.5s linear;
}

/* ===== Impressum ===== */
.impressum-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  max-width: 720px;
}

.impressum-card h1 {
  font-size: 1.8rem;
  margin-bottom: 24px;
  color: var(--color-dark);
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 12px;
  display: inline-block;
}

.impressum-card p {
  line-height: 1.75;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.impressum-section {
  margin-top: 28px;
}

.impressum-section h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.impressum-section dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
}

.impressum-section dt {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.impressum-section dd {
  color: var(--color-text-muted);
}

.impressum-section a {
  color: var(--color-accent);
}

/* ===== Program Section ===== */
.program-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.program-section-header {
  background: var(--color-dark);
  color: #fff;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ===== Footer ===== */
footer {
  background-color: var(--color-dark);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.85rem;
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

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

.footer-links a:hover { color: #fff; }
.footer-links span { color: rgba(255,255,255,0.3); }

/* ===== Hamburger Button ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Mobile Nav Overlay ===== */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.97);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mobile-overlay.open { display: flex; }

.mobile-overlay a {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 16px 40px;
  border-radius: 8px;
  transition: background var(--transition);
  width: 100%;
  max-width: 280px;
  text-align: center;
}

.mobile-overlay a:hover,
.mobile-overlay a.active {
  background: rgba(255,255,255,0.08);
  color: var(--color-accent);
}

.mobile-overlay .lang-switcher {
  margin-top: 24px;
  padding: 0;
}

.mobile-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .nav-links, nav .lang-switcher { display: none; }
  .hamburger { display: flex; }
  main { padding: 24px 16px; }
  .impressum-card { padding: 24px 20px; }
  .impressum-section dl { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.5rem; }
  .history-iframe { height: 380px !important; }
}

@media (min-width: 601px) {
  .history-iframe { height: 260px !important; }
}
