/**
 * Radio Nostalgi – Huvudstylesheet
 *
 * Importerar alla CSS-moduler i korrekt ordning.
 *
 * Modulstruktur:
 * 1. Base        – Reset, variabler, utilities
 * 2. Cookiebot   – Tredjepartsanpassning
 * 3. Layout      – Containers, logo
 * 4. Components  – Live, väder, nyheter, banner, låtar, tablå, player, nav, footer
 * 5. Effects     – Animationer, snö
 * 6. Themes      – Mörkt läge
 * 7. Responsive  – Mobil/surfplatta
 */

/* Base styles (must be loaded first) */
@import url('base.css');

/* Third-party customizations */

/* Layout */
@import url('layout.css');

/* Components */
@import url('components/live.css');
@import url('components/weather.css');
@import url('components/news.css');
@import url('components/banner.css');
@import url('components/songs.css');
@import url('components/schedule.css');
@import url('components/player.css');
@import url('components/footer.css');
@import url('components/nav.css');
@import url('components/cookie-banner.css');

/* Effects and animations */
@import url('effects.css');

/* Responsive styles (must be loaded last among imports) */
@import url('responsive.css');

/* SPA page containers */
.spa-page[hidden] { display: none !important; }

/* Gemensam länkstyling för undersidornas textinnehåll */
.page-section a:not(.btn-primary):not(.link-card):not(.link-card-arrow) {
  color: #c8922a;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.page-section a:not(.btn-primary):not(.link-card):not(.link-card-arrow):hover {
  color: #a87820;
}

/* Inline UI icons (replace emojis in headings/badges) */
.ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-right: 0.45em;
}

/* News page modal */
.nyheter-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 5, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.nyheter-modal.hidden { display: none !important; }
.nyheter-modal-box {
  background: #f5ead5;
  border: 1px solid #e8d9c0;
  border-radius: 14px;
  max-width: 760px;
  width: 100%;
  max-height: calc(100dvh - 80px);
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.nyheter-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(26, 14, 5, 0.7);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  padding: 0;
  transition: background 0.2s;
}
.nyheter-modal-close:hover { background: #EF2E24; }
.nyheter-modal-image {
  position: relative;
  background: #1a0e05;
}
.nyheter-modal-image img {
  display: block;
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  object-position: center top;
}
.nyheter-modal-credit {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-style: italic;
}
.nyheter-modal-text {
  padding: 28px 32px 32px;
}
.nyheter-modal-text .news-date {
  color: #c8922a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.nyheter-modal-text h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a0e05;
  margin: 0 0 16px;
  line-height: 1.3;
}
.nyheter-modal-text p {
  font-size: 15px;
  line-height: 1.7;
  color: #4a3520;
  margin: 0 0 14px;
}
.nyheter-modal-text p:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .nyheter-modal { padding: 0; align-items: stretch; justify-content: stretch; }
  .nyheter-modal-box {
    border-radius: 0;
    max-height: 100dvh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
  }
  .nyheter-modal-text { padding: 20px; }
}

/* Senaste program — grupperade program */
.recordings-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recording-group {
  background: #f5ead5;
  border: 1px solid #e8d9c0;
  border-radius: 12px;
  overflow: hidden;
}

.recording-group-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}

.recording-group-header::-webkit-details-marker { display: none; }

.recording-group-header:hover {
  background: #efe6d1;
}

.recording-group-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #4a2d12;
}

.recording-group-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recording-group-text {
  flex: 1;
  min-width: 0;
}

.recording-group-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a0e05;
  line-height: 1.2;
}

.recording-group-host {
  font-size: 13px;
  color: #6b5538;
  margin-top: 2px;
}

.recording-group-count {
  font-size: 12px;
  color: #8c7a5c;
  margin-top: 4px;
}

.recording-group-arrow {
  font-size: 18px;
  color: #c8922a;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.recording-group[open] .recording-group-arrow {
  transform: rotate(180deg);
}

.recording-group-body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recording-episode {
  padding-top: 10px;
  border-top: 1px solid #e8d9c0;
}

.recording-episode-label {
  font-size: 12px;
  color: #6b5538;
  margin-bottom: 6px;
  font-weight: 600;
}

.recording-card {
  background: #f5ead5;
  border: 1px solid #e8d9c0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #1a0e05;
}

.recording-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #4a2d12;
}

.recording-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recording-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recording-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a0e05;
}

.recording-host {
  font-size: 14px;
  color: #6b5538;
}

.recording-meta {
  font-size: 12px;
  color: #8c7a5c;
  margin-bottom: 8px;
}

/* Custom audio player */
.rn-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #2a1608 0%, #4a2d12 60%, #5a2b18 100%);
  border: 1px solid rgba(200, 146, 42, 0.35);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.rn-audio-play {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(26, 14, 5, 0.35);
  background: linear-gradient(135deg, #d4a044 0%, #c8922a 55%, #a87820 100%);
  color: #1a0e05;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.rn-audio-play:active { transform: scale(0.96); }

.rn-audio-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0);
  pointer-events: none;
}

.rn-audio-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rn-audio-progress {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  outline: none;
}

.rn-audio-progress:focus-visible {
  box-shadow: 0 0 0 2px rgba(200, 146, 42, 0.6);
}

.rn-audio-buffer {
  position: absolute;
  inset: 0;
  width: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.rn-audio-played {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #c8922a, #EF2E24);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.rn-audio-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.rn-audio:hover .rn-audio-thumb,
.rn-audio.is-playing .rn-audio-thumb,
.rn-audio-progress:focus-visible .rn-audio-thumb {
  opacity: 1;
}

.rn-audio-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: 'Outfit', sans-serif;
  color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
}

.rn-audio-volume {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-direction: row-reverse;
}

.rn-audio-mute {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rn-audio-vol-icon {
  width: 25px;
  height: 25px;
  cursor: pointer;
  filter: brightness(0) invert(1);
}

.rn-audio.is-muted .rn-audio-vol-icon {
  opacity: 0.4;
}

.rn-audio-vol-slider-wrap {
  display: flex;
  align-items: center;
  height: 15px;
  width: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  overflow: visible;
}

.rn-audio-volume.show-slider .rn-audio-vol-slider-wrap {
  width: 80px;
  opacity: 1;
  pointer-events: auto;
}

.rn-audio-vol-slider-wrap .rn-audio-vol-slider {
  width: 80px;
  flex-shrink: 0;
}

.rn-audio-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 1px;
  background-color: #fff;
  cursor: pointer;
  border-radius: var(--box-radius);
}

.rn-audio-vol-slider::-moz-range-thumb,
.rn-audio-vol-slider::-webkit-slider-thumb {
  background: #fff;
  width: 15px;
  height: 15px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.rn-audio-vol-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 5px;
  cursor: pointer;
  background: #fff;
  border-radius: var(--box-radius);
}

@media (max-width: 480px) {
  .rn-audio-volume {
    display: none;
  }
}

/* News / Events card grid (used on pages/nyheter.html & pages/events.html) */
.news-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.news-page-card {
  background: #f5ead5;
  border: 1px solid #e8d9c0;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  color: #1a0e05;
}

.news-page-card img {
  color: transparent;
  font-size: 0;
}

/* Dölj alt-text visuellt på alla Firebase-laddade bilder (syns fortfarande för screen readers) */
.played-songs img,
.played-song-item img,
.schedule-item img,
.schedule-album-art img,
.news-list img,
.news-item img,
.weather-box img,
#current-host-image,
#live-album-art,
#player-bar-album-art,
#program-image-player {
  color: transparent;
  font-size: 0;
}
.news-page-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(200, 146, 42, 0.12);
}
.news-page-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
  background: #e8d9c0;
  display: block;
}
.news-page-card-body { padding: 16px; }
.news-page-card-body .news-date {
  font-size: 12px;
  color: #c8922a;
  font-weight: 600;
  margin-bottom: 6px;
}
.news-page-card-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1a0e05;
  margin: 0 0 8px;
  line-height: 1.4;
}
.news-page-card-body p {
  font-size: 14px;
  color: #4a3520;
  line-height: 1.5;
  margin: 0;
}

.news-note {
  background: #f5ead5;
  border: 1px solid #e8d9c0;
  border-radius: 12px;
  padding: 20px;
  font-size: 15px;
  color: #4a3520;
  line-height: 1.7;
}

/* News card media wrapper + badge */
.news-page-card-media {
  position: relative;
  overflow: hidden;
}

.news-page-card-media video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
  background: #1a0e05;
  display: block;
}

.news-media-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

/* Media gallery (används i nyheter/events-modaler) */
.rn-gallery {
  position: relative;
  background: #1a0e05;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rn-gallery-slide {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.rn-gallery-slide.is-active {
  display: flex;
}

.rn-gallery-slide img,
.rn-gallery-slide video {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.rn-gallery-prev,
.rn-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
  padding: 0;
}

.rn-gallery-prev { left: 10px; }
.rn-gallery-next { right: 10px; }

.rn-gallery-prev:hover,
.rn-gallery-next:hover {
  background: rgba(200, 146, 42, 0.85);
}

.rn-gallery-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 2;
}

@media (max-width: 480px) {
  .rn-gallery-prev,
  .rn-gallery-next {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
}

.hof-intro p {
  margin: 0 0 16px;
}

.hof-intro p:last-child {
  margin-bottom: 0;
}

/* Relaterade länk-kort (Utforska mer på undersidor) */
.link-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.link-card {
  display: flex;
  flex-direction: column;
  background: #f5ead5;
  border: 1px solid #e8d9c0;
  border-radius: 12px;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.link-card:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 146, 42, 0.5);
  box-shadow: 0 8px 24px rgba(200, 146, 42, 0.12);
  text-decoration: none;
}
.link-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #1a0e05;
  display: flex;
  align-items: center;
  gap: 8px;
}
.link-card h3 .ico {
  width: 20px;
  height: 20px;
  margin-right: 0;
}
.link-card p {
  margin: 0;
  font-size: 14px;
  color: #4a3520;
  line-height: 1.5;
  flex: 1;
}
.link-card-arrow {
  display: inline-block;
  margin-top: 12px;
  color: #c8922a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.link-card:hover .link-card-arrow {
  color: #a87820;
}
