/* Highlights — Remmy layout notes: dark, quiet, amber accent. */
:root {
  --bg: #0f1114;
  --panel: #171a1f;
  --panel-2: #1c2026;
  --panel-3: #252a32;
  --text: #f3efe8;
  --muted: #9a9388;
  --accent: #e89c4a;
  --accent-ink: #1a1206;
  --line: rgba(243, 239, 232, 0.08);
  --radius: 14px;
  --gap: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }

.hl-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
}

.hl-back { margin: 0 0 10px; font-size: 0.92rem; }
.hl-back a { color: var(--muted); text-decoration: none; }
.hl-back a:hover { color: var(--text); }

/* Header */
.hl-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 22px;
}
.hl-sticker {
  width: 72px;
  height: auto;
  flex: 0 0 auto;
  border-radius: 10px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}
.hl-title { min-width: 0; flex: 1 1 auto; }
.hl-title h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.hl-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.hl-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.hl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.hl-btn:active { transform: scale(0.97); }
.hl-btn-ghost:hover { border-color: rgba(243, 239, 232, 0.22); }
.hl-btn-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.hl-btn-accent:hover { background: #f0a85a; }

/* Lifestyle auth (family mode only) on dark */
.user-badge { flex: 0 0 auto; }
.life-auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 18px;
}
.life-auth-panel p { margin: 0 0 10px; }
.life-auth-panel label { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
.life-auth-panel input {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.life-auth-panel .ask-row { display: flex; flex-wrap: wrap; gap: 8px; }
.life-auth-panel .btn-sticker,
.life-auth-panel .btn-tiny {
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
}
.life-auth-panel .btn-sticker:first-child { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.life-auth-panel .life-err { color: #f09a8a; font-size: 0.9rem; margin: 8px 0 0; }
.life-auth-panel .life-chip { color: var(--muted); }
.hl-gate { color: var(--muted); margin: 0 0 18px; }

/* Layout */
.hl-layout { display: block; }
.hl-main { min-width: 0; }

/* Week rail — desktop only */
.hl-rail {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px;
  align-self: start;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.hl-rail-head {
  margin: 2px 8px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.hl-rail ol { list-style: none; margin: 0; padding: 0; }
.hl-rail button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
}
.hl-rail button:hover { background: rgba(243, 239, 232, 0.04); }
.hl-rail button.is-active { background: rgba(232, 156, 74, 0.14); }
.hl-rail-week { display: block; font-weight: 650; font-size: 0.92rem; }
.hl-rail-title { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Week sections */
.hl-week { margin: 0 0 34px; scroll-margin-top: 18px; }
.hl-week-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.hl-week-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.hl-week-count { color: var(--muted); font-size: 0.86rem; white-space: nowrap; }
.hl-week-title { margin: 6px 0 2px; font-size: 1.2rem; font-weight: 650; line-height: 1.25; }
.hl-week-caption { margin: 0 0 12px; color: var(--muted); font-size: 0.94rem; }
.hl-week-title + .hl-grid { margin-top: 12px; }

/* Masonry: CSS multi-column pack (natural heights, no overlapping spans).
   Hero sits above the columns; see https://css-tricks.com/css-masonry-css-grid/ */
.hl-hero {
  display: block;
  width: 100%;
  margin-top: 12px;
  margin-bottom: var(--gap);
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
}
.hl-hero img,
.hl-hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hl-grid {
  column-count: 2;
  column-gap: var(--gap);
  margin-top: 0;
}
.hl-week-title + .hl-hero { margin-top: 12px; }
.hl-week-title + .hl-grid { margin-top: 12px; }
.hl-tile {
  position: relative;
  display: inline-block;
  width: 100%;
  height: auto;
  margin: 0 0 var(--gap);
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.hl-tile img,
.hl-tile video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.25s ease;
  opacity: 0;
}
.hl-tile video:not([poster]) {
  min-height: 140px;
  background: var(--panel-2);
}
.hl-tile img.is-in, .hl-tile video.is-in { opacity: 1; }
.hl-tile:hover img { transform: scale(1.02); }
.hl-tile.is-broken img { display: none; }
.hl-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hl-pill {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(15, 17, 20, 0.72);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 650;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hl-tile:not(.hl-hero) .hl-pill { left: auto; right: 8px; bottom: 8px; }
.hl-pill svg { width: 10px; height: 10px; fill: currentColor; }
.hl-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(232, 156, 74, 0.92);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.hl-play svg { width: 20px; height: 20px; fill: var(--accent-ink); margin-left: 3px; }
.hl-tile:not(.hl-hero) .hl-play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
.hl-tile:not(.hl-hero) .hl-play svg { width: 15px; height: 15px; }

/* Empty / skeleton / error */
.hl-empty {
  text-align: center;
  padding: 60px 16px 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.hl-empty img { width: 140px; height: auto; border-radius: 12px; opacity: 0.9; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4)); }
.hl-empty-title { margin: 16px 0 4px; font-size: 1.1rem; font-weight: 650; }
.hl-empty-sub { margin: 0; color: var(--muted); font-size: 0.92rem; }
.hl-error { color: #f09a8a; margin: 14px 0; }

.hl-skeleton { display: none; }
.is-loading .hl-skeleton { display: block; }
.sk {
  border-radius: 12px;
  background: linear-gradient(100deg, #1c2026 30%, #252a32 50%, #1c2026 70%);
  background-size: 300% 100%;
  animation: sk 1.3s ease-in-out infinite;
}
.sk-line { height: 14px; width: 120px; margin: 4px 0 14px; border-radius: 6px; }
.sk-hero { aspect-ratio: 16 / 10; border-radius: var(--radius); margin-bottom: var(--gap); }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.sk-grid .sk { aspect-ratio: 1; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Parent card — under the weeks */
.hl-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(232, 156, 74, 0.08);
  border: 1px solid rgba(232, 156, 74, 0.28);
}
.hl-card-kicker { margin: 0; color: var(--accent); font-weight: 700; font-size: 0.86rem; }
.hl-card-text { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

.hl-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--panel-3);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  z-index: 60;
}

/* Lightbox */
.hl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 17, 20, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}
.hl-lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 14px 8px;
}
.hl-lb-count { margin: 0; color: var(--muted); font-size: 0.9rem; }
.hl-lb-tools { display: flex; gap: 8px; }
.hl-lb-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(23, 26, 31, 0.85);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
}
.hl-lb-btn:hover { border-color: rgba(243, 239, 232, 0.25); }
.hl-lb-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
}
.hl-lb-stage img,
.hl-lb-stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.hl-lb-caption {
  margin: 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  min-height: 1.4em;
}
.hl-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(23, 26, 31, 0.8);
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: none;
}
.hl-lb-prev { left: 14px; }
.hl-lb-next { right: 14px; }
body.lb-open { overflow: hidden; }

/* Share mode: no login chrome anywhere */
.is-share [data-family-only] { display: none !important; }

@media (min-width: 640px) {
  .hl-sticker { width: 88px; }
  .hl-title h1 { font-size: 2rem; }
}

@media (min-width: 900px) {
  .hl-shell { padding: 30px 32px 40px; }
  .hl-layout.has-rail {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    gap: 24px;
  }
  .hl-layout.has-rail .hl-rail { display: block; }
  .hl-grid { column-count: 3; }
  .hl-lb-nav { display: block; }
  .hl-lb-stage { padding: 6px 72px; }
}

@media (max-width: 420px) {
  .hl-btn span { display: none; }
  .hl-btn { padding: 10px; }
  .hl-sticker { width: 60px; }
  .hl-title h1 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  .hl-tile img { transition: none; }
}

@media (max-width: 899px) {
  #hl-download-week { display: none !important; }
}

/* Week parts: cover, then Photos (deck + masonry), then Videos (heading + deck + masonry) */
.hl-part + .hl-part { margin-top: 26px; }
.hl-part-head {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
