/* =============================================================================
   Hourly Still Gallery — inc/hourly-gallery.php + assets/js/hourly-gallery.js
   Loaded only on singular views that use [lww_hourly_gallery].
   ========================================================================== */

.lww-hg {
  margin: 28px 0;
  outline: none;
  /* Explicit, not inherited: in the player slot this sits outside the normal
     post-content wrapper, and inside it the editor may have dropped the tag into
     a block that carries a monospace font. */
  font-family: var(--font, 'Open Sans', sans-serif);
}

/* Player slot — the gallery replaces the video player entirely, so it starts
   flush against the post header instead of carrying content-flow spacing. */
.lww-hg-player .lww-hg { margin-top: 0; }

.lww-hg__title {
  font-size: 21px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px;
}

/* ── Stage ─────────────────────────────────────────────────────────────────── */
.lww-hg__stage {
  position: relative;
  aspect-ratio: var(--lww-hg-ratio, 16 / 9);
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.lww-hg__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.lww-hg.is-empty .lww-hg__stage::after {
  content: 'No stills available right now — check back within the hour.';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #cfd8e3;
  font-size: 14px;
}

/* ── Caption ───────────────────────────────────────────────────────────────── */
.lww-hg__caption {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(15, 31, 61, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.lww-hg__badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 3px;
  background: #e53935;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.lww-hg__badge[hidden] { display: none; }

/* ── Prev / next ───────────────────────────────────────────────────────────── */
.lww-hg__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: rgba(15, 31, 61, 0.6);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.lww-hg__nav svg { width: 20px; height: 20px; }
.lww-hg__nav--prev { left: 10px; }
.lww-hg__nav--next { right: 10px; }

.lww-hg__stage:hover .lww-hg__nav,
.lww-hg__nav:focus-visible { opacity: 1; }
.lww-hg__nav:hover { background: rgba(15, 31, 61, 0.85); }

.lww-hg__nav:disabled {
  opacity: 0 !important;
  pointer-events: none;
}

/* Touch devices get no hover — keep the arrows permanently visible. */
@media (hover: none) {
  .lww-hg__nav { opacity: 0.85; }
}

/* ── Loading ───────────────────────────────────────────────────────────────── */
.lww-hg__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lww-hg-spin 0.8s linear infinite;
  pointer-events: none;
}

@keyframes lww-hg-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .lww-hg__spinner { animation-duration: 2.4s; }
}

/* ── Controls ──────────────────────────────────────────────────────────────── */
.lww-hg__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.lww-hg__play {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-white);
  color: var(--navy);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.lww-hg__play svg { width: 15px; height: 15px; }
.lww-hg__play svg[hidden] { display: none; }

.lww-hg__play:hover,
.lww-hg.is-playing .lww-hg__play {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.lww-hg__range {
  flex: 1 1 auto;
  min-width: 0;
  height: 6px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  background: #dfe4ea;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.lww-hg__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
  cursor: pointer;
}

.lww-hg__range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
  cursor: pointer;
}

.lww-hg__range:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.lww-hg__count {
  flex: 0 0 auto;
  min-width: 58px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

/* ── Day jump ──────────────────────────────────────────────────────────────── */
.lww-hg__days {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.lww-hg__day {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-white);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.lww-hg__day:hover { border-color: var(--blue); color: var(--blue); }

.lww-hg__day.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ── Note ──────────────────────────────────────────────────────────────────── */
.lww-hg__note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .lww-hg__title { font-size: 18px; }
  .lww-hg__caption { top: 8px; left: 8px; font-size: 12px; padding: 5px 9px; }
  .lww-hg__nav { width: 34px; height: 34px; }
  .lww-hg__nav svg { width: 17px; height: 17px; }
  .lww-hg__count { min-width: 52px; font-size: 12px; }
}
