/* ============================================================
   Rich Media Styles
   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 parity: weight 200, 10px, white) --- */
.m-player-time {
  font-family: var(--omm-font-stack);
  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(--omm-brand-color, #193857);
  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(--omm-brand-color, #193857);
  cursor: pointer;
}
.m-player-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--omm-brand-color, #193857);
  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;
}

/* ============================================================
   Live Player (the video player's frame; these rules add only
   what live needs. data-live-state on the block picks the screen.)
   ============================================================ */
/* The frame takes the picture's shape: --m-live-ar is its width / height. The script sets the
   playing picture's own; before a picture, the stream's orientation nearest the screen's shape
   gives it. The picture is never taller than 80% of the screen's small height, so a phone's
   toolbars never push it off screen. Capped, the player narrows to the picture's width and
   centres, but never below what its controls need: below that, the picture letterboxes. Both
   values are custom properties, so a larger view of the same player can set its own. The
   corners are the player's own, the same everywhere it is drawn. */
.m-live-player {
  --m-live-ar: 16 / 9;
  --m-live-max-h: 80vh;
  max-width: max(min(100%, 18rem), calc(var(--m-live-max-h) * var(--m-live-ar)));
  margin-left: auto;
  margin-right: auto;
  border-radius: 0.25rem;
}
@supports (height: 1svh) {
  .m-live-player {
    --m-live-max-h: 80svh;
  }
}
/* The first paint, before the script runs: the stream's orientation nearest the viewport's shape,
   from the address attributes the block carries, in four bands of width / height. In each band the
   rules run from the least preferred orientation to the most, so the last that matches wins. Wide
   (4/3 and over) needs no query: landscape, then square, then portrait. A browser without the
   range syntax keeps the wide band until the script runs. */
.m-live-player[data-live-src-portrait] {
  --m-live-ar: 9 / 16;
}
.m-live-player[data-live-src-square] {
  --m-live-ar: 1;
}
.m-live-player[data-live-src-landscape] {
  --m-live-ar: 16 / 9;
}
@media (1/1 <= aspect-ratio < 4/3) {
  .m-live-player[data-live-src-portrait] {
    --m-live-ar: 9 / 16;
  }
  .m-live-player[data-live-src-landscape] {
    --m-live-ar: 16 / 9;
  }
  .m-live-player[data-live-src-square] {
    --m-live-ar: 1;
  }
}
@media (3/4 < aspect-ratio < 1/1) {
  .m-live-player[data-live-src-portrait] {
    --m-live-ar: 9 / 16;
  }
  .m-live-player[data-live-src-square] {
    --m-live-ar: 1;
  }
}
@media (aspect-ratio <= 3/4) {
  .m-live-player[data-live-src-square] {
    --m-live-ar: 1;
  }
  .m-live-player[data-live-src-portrait] {
    --m-live-ar: 9 / 16;
  }
}
/* Once the script runs, its choice wins (the same one at first, then following turns and
   resizes); the playing picture's own shape, set on the player itself, wins over all. */
.m-live-player[data-live-shape="landscape"] {
  --m-live-ar: 16 / 9;
}
.m-live-player[data-live-shape="portrait"] {
  --m-live-ar: 9 / 16;
}
.m-live-player[data-live-shape="square"] {
  --m-live-ar: 1;
}
/* The minimum height is in rem, so the screens' words never clip when the reader enlarges the
   text; at the floor's width the picture letterboxes inside the frame. The width is stated: left
   to the browser, a capped height narrows the frame to the picture's own width at the player's
   left (every browser at the floor's width; Safari also in the open lightbox's column), so the
   picture sits off centre. */
.m-live-player .m-video-player-surface {
  width: 100%;
  aspect-ratio: var(--m-live-ar);
  max-height: var(--m-live-max-h);
  min-height: 11rem;
  overflow: hidden;
}
.m-live-player .m-video-player-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
/* The screens: exactly one shows. The frame is the overlay's (absolute, inset 0, centred); inside, the post hero's
   media placeholder (a centred column, icon 2rem, words 0.9rem), light on the player's black. */
.m-live-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
}
.m-live-screen-icon {
  font-size: 2rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.6);
}
.m-live-screen-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.m-live-screen-text {
  margin: 0;
  max-width: 28rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}
/* Over a video frame (starting, buffering, switching, paused): the overlay's shade, darker than its 0.3 because words
   sit on it */
.m-live-screen--over {
  background: rgba(0, 0, 0, 0.6);
}
.m-live-spinner {
  width: 2.25rem;
  height: 2.25rem;
  color: #fff;
}
[data-live-state="checking"] [data-live-screen="checking"],
[data-live-state="not_live"] [data-live-screen="not_live"],
[data-live-state="live"] [data-live-screen="live"],
[data-live-state="starting"] [data-live-screen="starting"],
[data-live-state="buffering"] [data-live-screen="buffering"],
[data-live-state="paused"] [data-live-screen="paused"],
[data-live-state="ended"] [data-live-screen="ended"],
[data-live-state="cant_play"] [data-live-screen="cant_play"],
[data-live-state="switching"] [data-live-screen="switching"],
[data-live-state="archived"] [data-live-screen="archived"] {
  display: flex;
}
/* The LIVE badge copies the draft badge (omm_owner.css m-post-card-draft-badge) number for number; only its colour
   differs: red at the live moment, grey while paused (behind it) */
.m-live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: none;
  background: #dc3545;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
[data-live-state="live"] .m-live-badge,
[data-live-state="starting"] .m-live-badge,
[data-live-state="playing"] .m-live-badge,
[data-live-state="buffering"] .m-live-badge,
[data-live-state="switching"] .m-live-badge,
[data-live-state="paused"] .m-live-badge {
  display: block;
}
[data-live-state="paused"] .m-live-badge {
  background: #6c757d;
}
/* The centre pause (the overlay, on hover or tap): while playing; paused has its own screen. It stays in place while
   the video waits or changes orientation, so keyboard focus on it is never lost to a stall or a switch. Every rule
   here names the live player, so the media block's video player, which shares these classes, is untouched. */
.m-live-player .m-video-player-overlay {
  display: none;
}
.m-live-player[data-live-state="playing"] .m-video-player-overlay,
.m-live-player[data-live-state="buffering"] .m-video-player-overlay,
.m-live-player[data-live-state="switching"] .m-video-player-overlay {
  display: flex;
}
/* While the video waits or changes, no mouse or tap reveals it (this outweighs the shared hover rule and the tap
   class), and a click passes through it to the state's screen, its words and its shade, which pauses nothing: a click
   never reaches the video, as while playing, where the overlay takes it and only its centre button pauses. */
.m-live-player[data-live-state="buffering"] .m-video-player-surface .m-video-player-overlay,
.m-live-player[data-live-state="switching"] .m-video-player-surface .m-video-player-overlay {
  pointer-events: none;
  opacity: 0;
}
/* It shows, in every state that draws it, while a key has put focus on a button in the picture (a mouse click leaves no
   dimmed picture behind). */
.m-live-player .m-video-player-surface:has(.m-player-btn:focus-visible) .m-video-player-overlay {
  opacity: 1;
}
/* A focus ring that shows on black and on a bright picture: white outside, black inside. The shared slider rule
   removes the slider's outline; the live player gives it back under keyboard focus. */
.m-live-player .m-player-btn:focus-visible,
.m-live-player .m-player-volume-slider:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #000;
}
/* The bottom bar: only while there is video */
.m-live-player .m-live-controls {
  display: none;
}
[data-live-state="playing"] .m-live-controls,
[data-live-state="paused"] .m-live-controls,
[data-live-state="buffering"] .m-live-controls,
[data-live-state="switching"] .m-live-controls {
  display: block;
}

/* ============================================================
   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: var(--omm-font-stack);
  font-weight: 200;
  font-size: 1.4rem;
  color: #fff;
}
/* Flutter: artist 15px, weight 500, white */
.m-audio-player-artist {
  font-family: var(--omm-font-stack);
  font-weight: 500;
  font-size: 0.95rem;
  color: #fff;
}
.m-audio-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

/* ============================================================
   Live lightbox (a post's own live block, opened over the page
   with the post's chat beside the player. The player is never
   moved or copied, so it keeps playing.)
   ============================================================ */
/* The bottom bar in every state of a block that can open as a lightbox, so Expand is always there; Mute, Volume and
   Fullscreen only while there is video. They are hidden by visibility, not display, so they keep their place and the
   bar's height never changes (the left group's d-flex is display: flex !important, which would beat display: none).
   Every other live player keeps its bar for video only. */
.m-live-lightbox .m-live-player .m-live-controls {
  display: block;
}
.m-live-lightbox .m-live-player:not([data-live-state="playing"]):not([data-live-state="paused"]):not([data-live-state="buffering"]):not([data-live-state="switching"]) [data-live-video-only] {
  visibility: hidden;
}
/* Open: a black box over the whole viewport, as the media lightbox's. The sizes inside read the box's own height
   (container units), so a phone's toolbars never push anything off screen. */
.m-live-lightbox--open {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  container-type: size;
}
/* The page behind stays still, even when another script removes the body's scroll lock */
html:has(.m-live-lightbox--open) {
  overflow: hidden;
}
/* The header: the post's title, then Hide chat and Close at its right edge. The screen's safe areas are added to
   its top, right and left padding, and the top one to its height, so on a screen with a notch or rounded corners
   the title and Close stay clear of them and keep their full height. */
.m-live-lightbox-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  height: calc(48px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 calc(1rem + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.m-live-lightbox-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Close keeps its full size however long the title: the title gives up its width instead and ends in an ellipsis */
.m-live-lightbox-header .m-media-lightbox-hdr-btn {
  flex-shrink: 0;
}
/* Hide chat: a word button beside Close, white on the black box, as tall as the header */
.m-live-lightbox-chattoggle {
  flex-shrink: 0;
  height: 48px;
  padding: 0 0.75rem;
  border: 0;
  background: none;
  color: #fff;
  font-size: 0.875rem;
  text-decoration: underline;
  white-space: nowrap;
}
/* The box's inside is laid out only while it is open: closed, the block draws as any live block does. Stacked (the
   default): the player above, the chat filling what is left below it. */
.m-live-lightbox--open .m-live-lightbox-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.m-live-lightbox--open .m-live-lightbox-pair {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.m-live-lightbox--open .m-live-lightbox-chat {
  position: relative;
  flex: 1 1 auto;
  min-height: 12rem;
  background: #fff;
}
/* Expand is hidden inside the lightbox (Close closes it), by visibility, so the bar keeps its full height in every
   state and the row never jumps when the video starts */
.m-live-lightbox--open [data-live-expand] {
  visibility: hidden;
}
/* The player in the open box: its centring margins zeroed (in a flex row they would take the row's free space), and a
   column whose surface grows to the row's height, the picture letterboxed, so its bar is always the row's bottom.
   Stacked, the picture takes at most 45% of the box's height. */
.m-live-lightbox--open .m-live-player {
  --m-live-max-h: 45cqh;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  border-radius: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.m-live-lightbox--open .m-live-player .m-video-player-surface {
  flex: 1 0 auto;
}
/* The player alone (Hide chat pressed, or no chat at all: the slot hidden or absent): centred, and as tall as the box
   allows, stacked too. Its cap is the box's height less the header and the bar, and less the body's bottom padding
   from 768 px wide or side by side (none below 768 px stacked). */
.m-live-lightbox--open .m-live-lightbox-pair:not(:has(> .m-live-lightbox-chat:not([hidden]))) {
  justify-content: safe center;
}
.m-live-lightbox--open .m-live-lightbox-pair:not(:has(> .m-live-lightbox-chat:not([hidden]))) > .m-live-player {
  --m-live-max-h: calc(100cqh - var(--m-live-lightbox-head-h, 48px) - var(--m-live-lightbox-bar-h, 49px));
}
@media (min-width: 768px), (min-aspect-ratio: 4/3) and (min-width: 640px) {
  .m-live-lightbox--open .m-live-lightbox-pair:not(:has(> .m-live-lightbox-chat:not([hidden]))) > .m-live-player {
    --m-live-max-h: calc(100cqh - var(--m-live-lightbox-head-h, 48px) - 1rem - var(--m-live-lightbox-bar-h, 49px));
  }
}
/* A focus ring that shows on black and on a bright picture: white outside, black inside */
.m-live-lightbox--open .m-player-btn:focus-visible,
.m-live-lightbox--open .m-media-lightbox-hdr-btn:focus-visible,
.m-live-lightbox--open .m-live-lightbox-chattoggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #000;
}
/* From 768 px wide: a margin of black around the pair, and rounded corners; below it, edge to edge and square */
@media (min-width: 768px) {
  .m-live-lightbox--open .m-live-lightbox-body {
    padding: 0 1rem 1rem;
  }
  .m-live-lightbox--open .m-live-lightbox-pair {
    gap: 1rem;
  }
  .m-live-lightbox--open .m-live-player,
  .m-live-lightbox--open .m-live-lightbox-chat {
    border-radius: 0.375rem;
  }
}
/* Side by side: wide, or landscape-shaped from 640 px. The row is the player's height and the chat is stretched to
   it, never under the smaller of the body's height and 22rem, so a short card still holds two messages. The header's
   and the bar's heights are the script's measure of them (the fallbacks, their usual 48 and 49 px, only until it
   writes them). The pair is centred "safe", so an overflow scrolls from its start and never under the header. The
   chat's column leaves its message field at least 140 px beside chat's own buttons; the player's floor is 13rem
   here, so a turned phone's row fits. */
@media (min-width: 992px), (min-aspect-ratio: 4/3) and (min-width: 640px) {
  .m-live-lightbox--open .m-live-lightbox-body {
    padding: 0 1rem 1rem;
    justify-content: safe center;
  }
  .m-live-lightbox--open .m-live-lightbox-pair {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 1rem;
    align-items: stretch;
    justify-content: safe center;
    max-width: 100%;
    min-height: min(calc(100cqh - var(--m-live-lightbox-head-h, 48px) - 1rem), 22rem);
  }
  .m-live-lightbox--open .m-live-player {
    flex: 0 1 auto;
    --m-live-max-h: calc(100cqh - var(--m-live-lightbox-head-h, 48px) - 1rem - var(--m-live-lightbox-bar-h, 49px));
    width: calc(var(--m-live-max-h) * var(--m-live-ar));
    min-width: min(100%, 13rem);
    border-radius: 0.375rem;
  }
  .m-live-lightbox--open .m-live-lightbox-chat {
    flex: 0 0 clamp(24rem, 55%, 25rem);
    min-height: 0;
    border-radius: 0.375rem;
  }
}
/* A browser without container units reads the same caps and the pair's floor from the screen's height: its small
   height where it has one, else its whole height. The open box fills the screen, so the two agree. */
@supports not (height: 1cqh) {
  .m-live-lightbox--open .m-live-player {
    --m-live-max-h: 45vh;
  }
  .m-live-lightbox--open .m-live-lightbox-pair:not(:has(> .m-live-lightbox-chat:not([hidden]))) > .m-live-player {
    --m-live-max-h: calc(100vh - var(--m-live-lightbox-head-h, 48px) - var(--m-live-lightbox-bar-h, 49px));
  }
  @media (min-width: 768px), (min-aspect-ratio: 4/3) and (min-width: 640px) {
    .m-live-lightbox--open .m-live-lightbox-pair:not(:has(> .m-live-lightbox-chat:not([hidden]))) > .m-live-player {
      --m-live-max-h: calc(100vh - var(--m-live-lightbox-head-h, 48px) - 1rem - var(--m-live-lightbox-bar-h, 49px));
    }
  }
  @media (min-width: 992px), (min-aspect-ratio: 4/3) and (min-width: 640px) {
    .m-live-lightbox--open .m-live-lightbox-pair {
      min-height: min(calc(100vh - var(--m-live-lightbox-head-h, 48px) - 1rem), 22rem);
    }
    .m-live-lightbox--open .m-live-player {
      --m-live-max-h: calc(100vh - var(--m-live-lightbox-head-h, 48px) - 1rem - var(--m-live-lightbox-bar-h, 49px));
    }
  }
}
@supports (not (height: 1cqh)) and (height: 1svh) {
  .m-live-lightbox--open .m-live-player {
    --m-live-max-h: 45svh;
  }
  .m-live-lightbox--open .m-live-lightbox-pair:not(:has(> .m-live-lightbox-chat:not([hidden]))) > .m-live-player {
    --m-live-max-h: calc(100svh - var(--m-live-lightbox-head-h, 48px) - var(--m-live-lightbox-bar-h, 49px));
  }
  @media (min-width: 768px), (min-aspect-ratio: 4/3) and (min-width: 640px) {
    .m-live-lightbox--open .m-live-lightbox-pair:not(:has(> .m-live-lightbox-chat:not([hidden]))) > .m-live-player {
      --m-live-max-h: calc(100svh - var(--m-live-lightbox-head-h, 48px) - 1rem - var(--m-live-lightbox-bar-h, 49px));
    }
  }
  @media (min-width: 992px), (min-aspect-ratio: 4/3) and (min-width: 640px) {
    .m-live-lightbox--open .m-live-lightbox-pair {
      min-height: min(calc(100svh - var(--m-live-lightbox-head-h, 48px) - 1rem), 22rem);
    }
    .m-live-lightbox--open .m-live-player {
      --m-live-max-h: calc(100svh - var(--m-live-lightbox-head-h, 48px) - 1rem - var(--m-live-lightbox-bar-h, 49px));
    }
  }
}

/* ============================================================
   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 parity) */
.m-gallery-counter {
  font-family: var(--omm-font-stack);
  font-weight: 500;
  font-size: 0.95rem;
}
.m-gallery-title {
  font-family: var(--omm-font-stack);
  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(--omm-brand-color, #193857);
  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(--omm-brand-color, #193857);
}
.m-playlist-track-index {
  min-width: 1.5rem;
  text-align: center;
}

/* ============================================================
   Media Collection Layouts
   ============================================================ */

/* --- 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(--omm-brand-color, #193857);
}

/* ============================================================
   Lightbox Toolbar & Enhancements
   ============================================================ */
.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
   ============================================================ */
.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 (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: var(--omm-font-stack);
  font-weight: 200;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 0.5rem;
}
.m-media-lightbox-audio-artist {
  font-family: var(--omm-font-stack);
  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: var(--omm-font-stack);
  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: var(--omm-font-stack);
  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(--omm-brand-color, #193857);
  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(--omm-brand-color, #193857));
  cursor: pointer;
}
.m-media-lightbox-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ml-brand-color, var(--omm-brand-color, #193857));
  border: none;
  cursor: pointer;
}

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

/* ============================================================
   Media Playlist Overlay (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(--omm-brand-color, #193857);
}
.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);
}
