/* ============================================================
   Rich Media Styles (Phase 7)
   Video player, audio player, PDF viewer, gallery lightbox,
   playlist, map — Flutter-aligned branding
   ============================================================ */

/* --- Shared player controls (Flutter-aligned) --- */
.m-player-btn {
  background: none;
  border: none;
  color: #fff;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.m-player-btn:hover {
  background: none;
}
.m-player-btn--main {
  font-size: 1.75rem;
  padding: 0.625rem;
  min-width: 56px;
  min-height: 56px;
}
.m-player-btn--sm {
  font-size: 0.875rem;
  padding: 0.375rem;
}

/* --- Timestamps (Flutter: BasicGothicPro, weight 200, 10px, white) --- */
.m-player-time {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 200;
  font-size: 0.625rem;
  color: #fff;
  user-select: none;
}

/* --- Progress bar (Flutter: brand color, 8px, 4px radius) --- */
.m-player-progress-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}
.m-player-progress-played {
  height: 100%;
  border-radius: 4px;
  background: var(--kon-brand-color, #cf0015);
  transition: width 0.1s linear;
}
/* Flutter: white circle, 12px diameter */
.m-player-progress-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* --- Volume slider (web-only; brand color thumb + filled track) --- */
.m-player-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
}
.m-player-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--kon-brand-color, #cf0015);
  cursor: pointer;
}
.m-player-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--kon-brand-color, #cf0015);
  border: none;
  cursor: pointer;
}

/* --- Quality selector --- */
.m-player-quality-select {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  cursor: pointer;
}

/* ============================================================
   Video Player
   ============================================================ */
.m-video-player {
  border-radius: 0.375rem;
  overflow: hidden;
}
.m-video-player-surface {
  position: relative;
  background: #000;
}
.m-video-player-el {
  display: block;
  width: 100%;
}
/* Overlay: semi-transparent dark, controls appear on hover */
.m-video-player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.m-video-player-surface:hover .m-video-player-overlay,
.m-video-player-overlay.m-video-player-overlay--visible {
  opacity: 1;
}
.m-video-player-main-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
/* Bottom bar: black bg for progress + secondary */
.m-video-player-bottom {
  background: #000;
}
.m-video-player-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   Audio Player (Flutter: cover image bg, dark overlay)
   ============================================================ */
.m-audio-player {
  border-radius: 0.375rem;
  overflow: hidden;
}
.m-audio-player-surface {
  position: relative;
  min-height: 280px;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
}
.m-audio-player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
}
/* Flutter: title 23px, weight 200, white */
.m-audio-player-title {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 200;
  font-size: 1.4rem;
  color: #fff;
}
/* Flutter: artist 15px, weight 500, white */
.m-audio-player-artist {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: #fff;
}
.m-audio-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

/* ============================================================
   PDF Viewer
   ============================================================ */
.m-pdf-viewer {
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  overflow: hidden;
}
.m-pdf-viewer-toolbar {
  background: var(--bs-light, #f8f9fa);
}
.m-pdf-viewer-canvas-wrap {
  max-height: 480px;
  overflow-y: auto;
  background: #f5f5f5;
}

/* ============================================================
   Gallery — Inline Carousel (Flutter ArticleGalleryCarouselArea)
   ============================================================ */
.m-gallery-carousel {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.375rem;
  background: #f0f0f0;
}
.m-gallery-slide {
  position: absolute;
  inset: 0;
}
.m-gallery-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
/* Arrow buttons (desktop only, hidden on mobile — swipe there) */
.m-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
}
.m-gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.6);
}
.m-gallery-arrow--prev { left: 0.5rem; }
.m-gallery-arrow--next { right: 0.5rem; }

/* Page counter + info (Flutter: BasicGothicPro) */
.m-gallery-counter {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
}
.m-gallery-title {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 200;
  font-size: 1.5rem;
}
.m-gallery-caption {
  font-weight: 200;
  font-size: 0.95rem;
  color: var(--bs-secondary, #6c757d);
}

/* --- Fullscreen Lightbox (Flutter GalleryFullscreen) --- */
.m-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.m-gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
}
.m-gallery-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.7);
}
.m-gallery-lightbox-img {
  max-width: 90vw;
  max-height: 70vh;
  object-fit: contain;
  margin-bottom: 100px;
}
/* Bottom dock: stacks description, info bar, and toolbar vertically */
.m-gallery-lightbox-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--kon-brand-color, #cf0015);
  color: #fff;
}
/* Info bar (always visible: counter + title) */
.m-gallery-lightbox-info {
  padding: 0.5rem 1.5rem 0;
}
/* Description section (togglable: caption + copyright, below title) */
.m-gallery-lightbox-desc {
  padding: 0.25rem 1.5rem 0.5rem;
}
.m-gallery-lightbox-info .m-gallery-counter {
  color: inherit;
}
.m-gallery-lightbox-info .m-gallery-title {
  color: inherit;
}
.m-gallery-lightbox-desc .m-gallery-caption {
  color: inherit;
  opacity: 0.7;
  font-size: 0.8rem;
}
/* Lightbox side arrows */
.m-gallery-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
}
.m-gallery-lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}
.m-gallery-lightbox-arrow--prev { left: 1rem; }
.m-gallery-lightbox-arrow--next { right: 1rem; }

/* ============================================================
   Playlist
   ============================================================ */
.m-playlist-track {
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  border-left: 4px solid transparent;
}
.m-playlist-track:last-child {
  border-bottom: none;
}
.m-playlist-track:hover {
  background: rgba(0, 0, 0, 0.03);
}
.m-playlist-track--active {
  border-left-color: var(--kon-brand-color, #cf0015);
}
.m-playlist-track-index {
  min-width: 1.5rem;
  text-align: center;
}

/* ============================================================
   Media Collection Layouts (Phase 7a)
   ============================================================ */

/* --- Grid / Masonry / Slideshow shared: thumbnail wrapper --- */
.o-block-mc-thumb-wrap {
  overflow: hidden;
  border-radius: 0.375rem;
  background: #f0f0f0;
  aspect-ratio: 1;
}
.o-block-mc-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.o-block-mc-item-title {
  font-size: 0.8rem;
}
[data-mc-item] {
  cursor: pointer;
}
.o-block-mc-placeholder {
  width: 100%;
  height: 100%;
  color: var(--bs-secondary, #6c757d);
}
/* Document icon sizing inside placeholders */
.o-block-mc-placeholder i {
  font-size: 2rem;
}
/* Format label (matches Studio format-label) */
.o-block-mc-format-label {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--bs-secondary, #6c757d);
  margin-top: 0.25rem;
}

/* --- List layout --- */
.o-block-mc-list-item {
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  cursor: pointer;
}
.o-block-mc-list-item:last-child {
  border-bottom: none;
}
.o-block-mc-list-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
.o-block-mc-list-thumb {
  width: 60px;
  height: 45px;
  border-radius: 0.25rem;
  overflow: hidden;
  background: #f0f0f0;
}
.o-block-mc-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Masonry layout (Masonry.js v4 — widths set by masonry-compiler.js) --- */
.o-block-mc-masonry {
  position: relative;
}
.o-block-mc-masonry .o-block-mc-item {
  margin-bottom: 8px;
}
/* Natural heights for staggered masonry effect */
.o-block-mc-masonry .o-block-mc-thumb-wrap {
  aspect-ratio: auto;
}
.o-block-mc-masonry .o-block-mc-thumb-wrap img {
  width: 100%;
  height: auto;
}
/* Masonry placeholders need a minimum height */
.o-block-mc-masonry .o-block-mc-placeholder {
  min-height: 120px;
}

/* --- Horizontal scroll layout (slideshow — matches Studio collection-scroll) --- */
.o-block-mc-hscroll {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 12px;
  padding-bottom: 8px;
}
.o-block-mc-hscroll-item {
  flex-shrink: 0;
  text-align: center;
  white-space: normal;
}
.o-block-mc-hscroll-item .o-block-mc-thumb-wrap {
  aspect-ratio: auto;
  height: 80px;
  width: 120px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 4px;
}
.o-block-mc-hscroll-item .o-block-mc-thumb-wrap img {
  object-position: top;
}
.o-block-mc-hscroll-item .o-block-mc-thumb-wrap img {
  object-fit: cover;
}
.o-block-mc-hscroll-item .o-block-mc-item-title {
  max-width: 100%;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

/* --- Active state for playlist items in all layouts --- */
.m-playlist-track--active .o-block-mc-thumb-wrap {
  outline: 2px solid var(--kon-brand-color, #cf0015);
}

/* ============================================================
   Lightbox Toolbar & Enhancements (Phase 8)
   ============================================================ */
.m-gallery-lightbox-toolbar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.5rem 0.75rem;
}
.m-gallery-lightbox-toolbar-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.8;
}
.m-gallery-lightbox-toolbar-btn:hover {
  opacity: 1;
}
.m-gallery-lightbox-toolbar-btn--placeholder {
  opacity: 0.4;
}

/* Copyright line in info panel */
.m-gallery-copyright {
  color: inherit;
  opacity: 0.6;
}

/* Description toggle state uses Bootstrap d-none utility */

/* Lightbox sub-modals: above lightbox (z-index 9999), pinned to bottom quarter */
#galleryMoreModal,
#gallerySlideshowModal,
#galleryMapModal,
#galleryReportModal {
  z-index: 10010;
}
#galleryMoreModal .modal-dialog,
#gallerySlideshowModal .modal-dialog,
#galleryMapModal .modal-dialog,
#galleryReportModal .modal-dialog {
  display: flex;
  align-items: flex-end;
  min-height: 100%;
  margin: 0 auto;
  max-width: 400px;
  padding-bottom: 6.25vh;
}
#galleryMoreModal .modal-content,
#gallerySlideshowModal .modal-content,
#galleryMapModal .modal-content,
#galleryReportModal .modal-content {
  border-radius: 0;
  border: none;
  width: 100%;
}
#galleryMoreModal + .modal-backdrop,
#gallerySlideshowModal + .modal-backdrop,
#galleryMapModal + .modal-backdrop,
#galleryReportModal + .modal-backdrop {
  z-index: 10005;
}

/* Toast (brief "Coming soon" message) */
.m-gallery-lightbox-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.m-gallery-lightbox-toast--fade {
  opacity: 1;
}
.m-gallery-lightbox-toast--out {
  opacity: 0;
}

/* Clickable individual images */
.o-block-media-image-wrap {
  cursor: pointer;
}

/* ============================================================
   Gallery Grid Page (Phase 8)
   ============================================================ */
.o-gallery-grid-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.25rem;
  cursor: pointer;
  background: #f0f0f0;
}
.o-gallery-grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.o-gallery-grid-item:hover {
  opacity: 0.85;
}

/* Map container in modal */
.o-gallery-map {
  height: 300px;
}

/* Report icon in placeholder modal */
.o-gallery-report-icon {
  font-size: 2rem;
}

/* ============================================================
   Media Lightbox (Phase 9 — fullscreen video/audio player)
   Flutter-aligned: VideoPlayerWithControls, AudioPlayerWithControls
   ============================================================ */

/* --- Root lightbox container (fullscreen black) --- */
.m-media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   VIDEO MODE — overlay controls ON the video
   ============================================================ */

/* Video wrap: position-relative container for the video + all overlays */
.m-media-lightbox-video-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* The <video> element — constrained so controls are always reachable */
.m-media-lightbox-video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #000;
}

/* Overlay layers (header top, transport center, controls bottom) */
.m-media-lightbox-overlay {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 0 1rem;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.m-media-lightbox-overlay--top {
  top: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
  padding-top: 0.25rem;
  padding-bottom: 2rem;
}
.m-media-lightbox-overlay--center {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0;
  background: none;
}
.m-media-lightbox-overlay--bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  padding-bottom: 0.75rem;
  padding-top: 2rem;
}

/* Auto-hide: when --controls-hidden is set, fade out overlays + arrows + cursor */
.m-media-lightbox--controls-hidden .m-media-lightbox-overlay,
.m-media-lightbox--controls-hidden .m-media-lightbox-arrow {
  opacity: 0;
  pointer-events: none;
}
.m-media-lightbox--controls-hidden {
  cursor: none;
}

/* ============================================================
   AUDIO MODE — full-viewport cover image with dark overlay
   ============================================================ */

/* Audio wrap: fills the viewport */
.m-media-lightbox-audio-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Cover image (background layer, fills entire audio wrap) */
.m-media-lightbox-audio-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
}
.m-media-lightbox-audio-cover--empty {
  background-image: none !important;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

/* Dark overlay on top of cover for readability.
   padding-bottom clears the overlay--bottom gradient so volume row doesn't overlap. */
.m-media-lightbox-audio-overlay {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 3.5rem 1.5rem 4.5rem;
}

/* Audio center: grows to fill, shows title + artist centered */
.m-media-lightbox-audio-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Audio info (track title + artist) */
.m-media-lightbox-audio-info {
  text-align: center;
  padding: 0 3rem;
}
.m-media-lightbox-audio-title {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 200;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 0.5rem;
}
.m-media-lightbox-audio-artist {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: #fff;
  opacity: 0.8;
}

/* Audio bottom row (likes, like, playlist) */
.m-media-lightbox-audio-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0 0.75rem;
}

/* ============================================================
   SHARED: Header, arrows, controls, progress, volume
   ============================================================ */

/* Header bar (used in both video + audio overlays) */
.m-media-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}
.m-media-lightbox-header-left,
.m-media-lightbox-header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Header/toolbar buttons (48px hit area) */
.m-media-lightbox-hdr-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.9;
  padding: 0.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-media-lightbox-hdr-btn:hover {
  opacity: 1;
}
/* Greyed-out placeholder icons (cast, like, etc.) */
.m-media-lightbox-hdr-btn--disabled {
  opacity: 0.35;
  cursor: default;
}
.m-media-lightbox-hdr-btn--disabled:hover {
  opacity: 0.35;
}

/* Likes text (header area) */
.m-media-lightbox-likes-text {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 200;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* Side arrows (prev/next track) */
.m-media-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: opacity 0.3s ease, background 0.2s ease;
}
.m-media-lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}
.m-media-lightbox-arrow--prev { left: 1rem; }
.m-media-lightbox-arrow--next { right: 1rem; }

/* Transport buttons (centered play row on video — rewind, prev, play, next, forward) */
.m-media-lightbox-transport-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}
.m-media-lightbox-transport-btn:hover {
  opacity: 1;
}
.m-media-lightbox-transport-btn--main {
  font-size: 2.5rem;
  width: 64px;
  height: 64px;
}

/* Controls row (shuffle, prev, play, next, repeat — used in both modes) */
.m-media-lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

/* Control buttons (used in bottom overlay and audio controls) */
.m-media-lightbox-ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.375rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}
.m-media-lightbox-ctrl-btn:hover {
  opacity: 1;
}
.m-media-lightbox-ctrl-btn--main {
  font-size: 1.75rem;
  width: 56px;
  height: 56px;
}

/* Ctrl row (shuffle + repeat, shown above progress in video bottom overlay) */
.m-media-lightbox-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding-bottom: 0.25rem;
}

/* Shuffle/repeat active/inactive state */
.m-media-lightbox-btn--active {
  opacity: 1;
}
.m-media-lightbox-btn--inactive {
  opacity: 0.35;
}

/* Progress bar */
.m-media-lightbox-progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
}
.m-media-lightbox-time {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 200;
  font-size: 0.625rem;
  color: #fff;
  user-select: none;
  white-space: nowrap;
  min-width: 2.5rem;
}
.m-media-lightbox-progress-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}
.m-media-lightbox-progress-played {
  height: 100%;
  border-radius: 4px;
  background: var(--kon-brand-color, #cf0015);
  transition: width 0.1s linear;
}
.m-media-lightbox-progress-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Bottom row (volume left, counter + like + playlist right) */
.m-media-lightbox-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.25rem;
}
.m-media-lightbox-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Volume group */
.m-media-lightbox-vol-group,
.m-media-lightbox-vol-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.m-media-lightbox-vol-row {
  justify-content: center;
  padding: 0.25rem 0;
}
.m-media-lightbox-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
}
.m-media-lightbox-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ml-brand-color, var(--kon-brand-color, #cf0015));
  cursor: pointer;
}
.m-media-lightbox-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ml-brand-color, var(--kon-brand-color, #cf0015));
  border: none;
  cursor: pointer;
}

/* Counter (1/3 style) */
.m-media-lightbox-counter {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: #fff;
  opacity: 0.7;
  padding: 0 0.25rem;
}

/* ============================================================
   Media Playlist Overlay (Phase 9 — second layer above lightbox)
   ============================================================ */
.m-media-playlist-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
}
.m-media-playlist-panel {
  background: #252525;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 0.5rem;
}
.m-media-playlist-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.m-media-playlist-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.m-media-playlist-close-btn:hover {
  opacity: 1;
}
.m-media-playlist-track {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-left: 4px solid transparent;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}
.m-media-playlist-track:hover {
  background: rgba(255, 255, 255, 0.05);
}
.m-media-playlist-track--active {
  border-left-color: var(--kon-brand-color, #cf0015);
}
.m-media-playlist-track-info {
  flex: 1;
  min-width: 0;
}
.m-media-playlist-track-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-media-playlist-track-artist {
  display: block;
  opacity: 0.6;
  font-size: 0.8rem;
}
.m-media-playlist-track-duration {
  opacity: 0.6;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Media lightbox sub-modals (map, report) */
#mediaMapModal,
#mediaReportModal {
  z-index: 10010;
}
#mediaMapModal .modal-dialog,
#mediaReportModal .modal-dialog {
  display: flex;
  align-items: flex-end;
  min-height: 100%;
  margin: 0 auto;
  max-width: 400px;
  padding-bottom: 6.25vh;
}
#mediaMapModal .modal-content,
#mediaReportModal .modal-content {
  border-radius: 0;
  border: none;
  width: 100%;
}
#mediaMapModal + .modal-backdrop,
#mediaReportModal + .modal-backdrop {
  z-index: 10005;
}

/* Map container in media lightbox modal */
.o-media-map {
  height: 300px;
}

/* ============================================================
   Media Lightbox — Responsive
   ============================================================ */

/* Mobile: < 768px */
@media (max-width: 767.98px) {
  .m-media-lightbox-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .m-media-lightbox-arrow--prev { left: 0.5rem; }
  .m-media-lightbox-arrow--next { right: 0.5rem; }

  .m-media-lightbox-transport-btn {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
  }
  .m-media-lightbox-transport-btn--main {
    font-size: 2rem;
    width: 56px;
    height: 56px;
  }

  .m-media-lightbox-overlay {
    padding: 0 0.5rem;
  }

  .m-media-lightbox-audio-overlay {
    padding: 3.5rem 1rem 4.5rem;
  }
  .m-media-lightbox-audio-info {
    padding: 0 2rem;
  }
  .m-media-lightbox-audio-title {
    font-size: 1.15rem;
  }
}

/* Audio mode: gradient overlays must not block clicks on transport controls underneath.
   pointer-events: none on the gradient, auto on interactive children. */
.m-media-lightbox-audio-wrap > .m-media-lightbox-overlay--top,
.m-media-lightbox-audio-wrap > .m-media-lightbox-overlay--bottom {
  pointer-events: none;
}
.m-media-lightbox-audio-wrap > .m-media-lightbox-overlay--top .m-media-lightbox-header,
.m-media-lightbox-audio-wrap > .m-media-lightbox-overlay--bottom .m-media-lightbox-bottom-row {
  pointer-events: auto;
}

/* Desktop: >= 1200px — constrain only cover + overlay to 50%, wrap stays full-width
   so arrows/header/footer sit at viewport edges (matching video/text modes) */
@media (min-width: 1200px) {
  .m-media-lightbox-audio-wrap > .m-media-lightbox-audio-cover,
  .m-media-lightbox-audio-wrap > .m-media-lightbox-audio-overlay {
    left: 25%;
    right: 25%;
    width: 50%;
  }
  .m-media-lightbox-audio-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
  }
}

/* ============================================================
   Location Map (Leaflet)
   ============================================================ */
.m-location-map {
  height: 300px;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  overflow: hidden;
}

/* ============================================================
   Media Lightbox — Text-Only Mode
   Same overlay structure as video mode: position:relative wrap with
   absolute-positioned top/center/bottom overlays. Cover as background.
   ============================================================ */
.m-media-lightbox-text-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Text center overlay: fills the viewport behind header/footer.
   pointer-events: none so clicks pass through to top/bottom overlays. */
.m-media-lightbox-text-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  transform: none;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
/* Top/bottom overlays render above the center overlay in text mode */
.m-media-lightbox-text-wrap > .m-media-lightbox-overlay--top,
.m-media-lightbox-text-wrap > .m-media-lightbox-overlay--bottom {
  z-index: 4;
}

.m-media-lightbox-text-info {
  pointer-events: auto;
  text-align: center;
  padding: 0 3rem;
  color: #fff;
}

/* Desktop: constrain cover + center overlay to 50% width, centered */
@media (min-width: 1200px) {
  .m-media-lightbox-text-wrap > .m-media-lightbox-audio-cover,
  .m-media-lightbox-text-center {
    left: 25%;
    right: 25%;
  }
}

.m-media-lightbox-text-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.6);
  margin-top: 0.5rem;
}

.m-media-lightbox-text-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  margin-top: 1rem;
  max-height: 40vh;
  overflow-y: auto;
}

/* ============================================================
   Media Lightbox — Episode Info Slide-Up Panel
   Triggered by 'i' button. Z-index above playlist overlay.
   ============================================================ */
.m-media-lightbox-info-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10002;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.m-media-lightbox-info-panel--open {
  transform: translateY(0);
  pointer-events: auto;
}

.m-media-lightbox-info-panel-content {
  max-width: 500px;
  margin: 0 auto;
  background: #252525;
  color: #fff;
  border-radius: 1rem 1rem 0 0;
  max-height: 50vh;
  overflow-y: auto;
}

.m-media-lightbox-info-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.m-media-lightbox-info-panel-body {
  padding: 1rem;
}

/* ============================================================
   Media Lightbox — Playlist Season Headers
   ============================================================ */
.m-media-playlist-season-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
  padding: 0.75rem 1rem 0.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
