/* ==========================================================================
 * highlights2.css — PRESET 2's highlight + story-player styling.
 * ==========================================================================
 * A scoped copy of the highlight CSS that lives in site.css. Every rule here
 * is prefixed with `html.preset2`, so it applies ONLY when preset 2 is active
 * (AZ_MODE === 2) and overrides the unscoped originals by specificity. Preset
 * 1's rules in site.css are never touched — edit this file freely to reshape
 * preset 2's highlights. The class names match stories2.js (a copy of
 * stories.js), so no markup changes are needed.
 * ========================================================================== */

/* Highlight row */
html.preset2 #highlights {
  display: flex;
  gap: 1.6rem;
  padding: 2.75rem 1.5rem;
  max-width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

html.preset2 #highlights::-webkit-scrollbar {
  display: none;
}

/* ---------- highlight items ---------- */

html.preset2 .hl-item {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  font: inherit;
}

/* position:relative is REQUIRED — the aura canvas centers itself inside. */
html.preset2 .hl-circle {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow: visible;
}

html.preset2 .hl-cover {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

/* Fallback dot when a highlight has no cover image (stories2.js sets color inline). */
html.preset2 .hl-glyph {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  background: currentColor;
  box-shadow: 0 0 10px currentColor, 0 0 24px currentColor;
}

html.preset2 .hl-label {
  font: 500 12px/1.2 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #b9b9c4;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

/* ---------- story player overlay (z:100) ---------- */

html.preset2 .story-player {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

html.preset2 .sp-progress {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 5;
}

html.preset2 .sp-bar {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

html.preset2 .sp-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #f2f2f5;
}

html.preset2 .sp-close,
html.preset2 .sp-sound {
  position: absolute;
  z-index: 6;
  top: calc(24px + env(safe-area-inset-top));
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

html.preset2 .sp-close {
  right: 10px;
  font-size: 26px;
}

html.preset2 .sp-sound {
  right: 54px;
  font-size: 18px;
}

/* the display:grid above would defeat the hidden attribute's UA rule */
html.preset2 .sp-sound[hidden] {
  display: none;
}

html.preset2 .sp-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

html.preset2 .sp-media img,
html.preset2 .sp-media video {
  /* FILL the frame, not letterbox. width/height 100% + object-fit:cover makes
     the media cover the whole viewport; a portrait video on a portrait phone
     of the same aspect (e.g. the 1170x2532 story on a ~1:2.16 screen) fills it
     exactly with no bars and no visible crop. Wider/narrower frames crop the
     overflow rather than showing black bars. */
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tap zones for prev/next navigation. */
html.preset2 .sp-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33%;
  z-index: 4;
}

html.preset2 .sp-zone-left {
  left: 0;
}

html.preset2 .sp-zone-right {
  right: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 480px) {
  html.preset2 #highlights {
    gap: 1.1rem;
  }

  html.preset2 .hl-circle {
    width: 66px;
    height: 66px;
  }
}
