/* AhantaPulse — theme tokens + semantic utilities.
   Default theme is LIGHT. Dark mode is opt-in via [data-theme="dark"] on <html>. */

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg-page:      #ffffff;
  --bg-elevated:  #f8fafc;   /* slate-50 */
  --bg-surface:   #ffffff;
  --bg-muted:     #f1f5f9;   /* slate-100 */
  --bg-hover:     #f1f5f9;
  --text-base:    #0f172a;   /* slate-900 */
  --text-muted:   #475569;   /* slate-600 */
  --text-subtle:  #64748b;   /* slate-500 */
  --text-inverse: #ffffff;
  --border-base:  #e2e8f0;   /* slate-200 */
  --border-soft:  #f1f5f9;   /* slate-100 */
  --shadow-card:  0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 8px 30px -12px rgba(2, 132, 199, 0.18);
  --accent:        #0284c7;  /* sky-600 */
  --accent-strong: #0369a1;  /* sky-700 */
  --accent-soft:   #e0f2fe;  /* sky-100 */
  --accent-on:     #ffffff;
  --success-text:  #047857;  /* emerald-700 */
  --success-bg:    #ecfdf5;  /* emerald-50 */
  --warn-text:     #b45309;  /* amber-700 */
  --warn-bg:       #fffbeb;  /* amber-50 */
  --danger-text:   #b91c1c;  /* red-700 */
  --danger-bg:     #fef2f2;  /* red-50 */
  --code-bg:       #f1f5f9;
  --ring:          rgba(2, 132, 199, 0.28);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-page:      #161a26;   /* eye-friendly desaturated slate */
  --bg-elevated:  #1c2030;
  --bg-surface:   #1f2434;
  --bg-muted:     #1a1e2c;
  --bg-hover:     #232838;
  --text-base:    #e6e8ee;   /* warm-ish off-white, not pure */
  --text-muted:   #b6bccb;
  --text-subtle:  #8a91a3;
  --text-inverse: #0f172a;
  --border-base:  #2a3042;
  --border-soft:  #222738;
  --shadow-card:  0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 12px 32px -16px rgba(56, 189, 248, 0.18);
  --accent:        #38bdf8;  /* sky-400 */
  --accent-strong: #7dd3fc;  /* sky-300 */
  --accent-soft:   rgba(56, 189, 248, 0.12);
  --accent-on:     #0f172a;
  --success-text:  #6ee7b7;
  --success-bg:    rgba(16, 185, 129, 0.10);
  --warn-text:     #fcd34d;
  --warn-bg:       rgba(245, 158, 11, 0.10);
  --danger-text:   #fca5a5;
  --danger-bg:     rgba(239, 68, 68, 0.10);
  --code-bg:       #1a1e2c;
  --ring:          rgba(56, 189, 248, 0.28);
}

html, body { background-color: var(--bg-page); color: var(--text-base); }
:root { --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html, body { font-family: var(--font-sans); }
body { -webkit-font-smoothing: antialiased; letter-spacing: -0.005em; }

/* Smooth theme transition (but not on first paint or layout-affecting props). */
body, .bg-page, .bg-surface, .bg-elevated, .bg-muted, .border-app, .border-soft, .text-fg, .text-muted, .text-subtle {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

/* ───── Semantic background / text / border utilities ───── */
.bg-page     { background-color: var(--bg-page); }
.bg-surface  { background-color: var(--bg-surface); }
.bg-elevated { background-color: var(--bg-elevated); }
.bg-muted    { background-color: var(--bg-muted); }
.bg-hover    { background-color: var(--bg-hover); }
.text-fg     { color: var(--text-base); }
.text-muted  { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-accent { color: var(--accent); }
.text-accent-strong { color: var(--accent-strong); }
.text-accent:hover, a.text-accent:hover { color: var(--accent-strong); }
.bg-accent   { background-color: var(--accent); color: var(--accent-on); }
.bg-accent:hover { background-color: var(--accent-strong); }
.bg-accent-soft { background-color: var(--accent-soft); color: var(--accent); }
.border-app  { border-color: var(--border-base); }
.border-soft { border-color: var(--border-soft); }

/* Cards: a small, gradient-free, theme-aware card primitive. */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.card-hover { transition: border-color .15s ease, box-shadow .2s ease, transform .2s ease; }
.card-hover:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }

/* Buttons */
.btn-primary {
  background-color: var(--accent);
  color: var(--accent-on);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  font-size: 0.875rem;
  transition: background-color .15s ease, transform .1s ease;
}
.btn-primary:hover { background-color: var(--accent-strong); border-color: var(--accent-strong); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-base);
  border: 1px solid var(--border-base);
  border-radius: 10px;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
}
.btn-secondary:hover { background-color: var(--bg-hover); border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.875rem;
}
.btn-ghost:hover { background-color: var(--bg-hover); color: var(--text-base); }

/* Inputs */
.input {
  background-color: var(--bg-surface);
  color: var(--text-base);
  border: 1px solid var(--border-base);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--text-subtle); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }

/* Pills / chips */
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background-color: var(--bg-muted); color: var(--text-muted);
  border: 1px solid var(--border-base);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.02em;
}
.chip-accent { background-color: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Flash bubbles */
.flash { border: 1px solid var(--border-base); border-radius: 10px; padding: 0.55rem 0.85rem; font-size: 0.875rem; }
.flash-success { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
.flash-warn    { background: var(--warn-bg);    color: var(--warn-text);    border-color: transparent; }
.flash-danger  { background: var(--danger-bg);  color: var(--danger-text);  border-color: transparent; }
.flash-info    { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Typography helpers */
.font-serif-news { font-family: var(--font-sans); letter-spacing: -0.015em; }
.clamp-1 { display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
.clamp-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.clamp-3 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }

/* Prose (article body) */
.prose-news { color: var(--text-base); line-height: 1.75; font-size: 1.0625rem; }
.prose-news h1, .prose-news h2, .prose-news h3, .prose-news h4 {
  font-family: var(--font-sans);
  color: var(--text-base);
}
.prose-news h2 { font-size: 1.6rem; margin: 1.8rem 0 0.6rem; font-weight: 700; }
.prose-news h3 { font-size: 1.25rem; margin: 1.4rem 0 0.5rem; font-weight: 700; }
.prose-news p { margin: 0.85rem 0; color: var(--text-base); }
.prose-news a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose-news a:hover { color: var(--accent-strong); }
.prose-news img { max-width: 100%; height: auto; border-radius: 0.6rem; margin: 1.2rem 0; }
.prose-news blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-muted);
  padding: 0.6rem 1rem; color: var(--text-muted); font-style: italic; margin: 1rem 0;
  border-radius: 0 8px 8px 0;
}
.prose-news pre, .prose-news code { background: var(--code-bg); border-radius: 0.4rem; padding: 0.15rem 0.4rem; font-size: 0.92em; }
.prose-news pre { padding: 0.9rem 1rem; overflow-x: auto; }
.prose-news ul { list-style: disc; padding-left: 1.25rem; }
.prose-news ol { list-style: decimal; padding-left: 1.25rem; }
.prose-news li { margin: 0.3rem 0; }

/* Embeds */
.embed-frame { background: var(--bg-muted); border-radius: 0.75rem; overflow: hidden; }
.embed-frame iframe { width: 100%; height: 100%; display: block; border: 0; }

/* Nav links (active underline) */
.nav-link { position: relative; color: var(--text-muted); padding: 0.25rem 0; }
.nav-link:hover { color: var(--text-base); }
.nav-link.active { color: var(--text-base); }
.nav-link.active::after {
  content:''; position:absolute; left:0; right:0; bottom:-8px; height:2px;
  background: var(--accent); border-radius: 2px;
}

/* Carousel (CSS scroll-snap, no library) */
.carousel { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > .carousel-item { scroll-snap-align: start; flex: 0 0 auto; }

.carousel-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--border-base); transition: background .15s ease, transform .15s ease; }
.carousel-dot.active { background: var(--accent); transform: scale(1.25); }

/* Theme toggle button visual */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; height: 36px; width: 36px; border-radius: 10px; border: 1px solid var(--border-base); color: var(--text-muted); background: var(--bg-surface); }
.theme-toggle:hover { color: var(--text-base); border-color: var(--accent); }

/* Details disclosure */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* Tap targets: ensure interactive things are ≥44px on small screens */
@media (max-width: 640px) {
  .btn-primary, .btn-secondary, .btn-ghost { min-height: 44px; }
}

/* Smooth focus ring for keyboard users */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ───── Quill output classes (used when articles are rendered publicly) ───── */
.ql-align-center  { text-align: center; }
.ql-align-right   { text-align: right; }
.ql-align-justify { text-align: justify; }
.ql-indent-1 { padding-left: 3em; }
.ql-indent-2 { padding-left: 6em; }
.ql-indent-3 { padding-left: 9em; }
.ql-indent-4 { padding-left: 12em; }

/* ───── Quill editor (admin form) — themed wrapper ───── */
.editor-wrap { border: 1px solid var(--border-base); border-radius: 12px; overflow: hidden; background: var(--bg-surface); }
.editor-wrap .ql-toolbar.ql-snow,
.editor-wrap .ql-container.ql-snow { border: 0; }
.editor-wrap .ql-toolbar.ql-snow {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-base) !important;
  padding: 8px 10px;
  position: sticky; top: 0; z-index: 1;
}
.editor-wrap .ql-editor {
  min-height: 340px;
  background: var(--bg-surface);
  color: var(--text-base);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-family: var(--font-sans);
  padding: 1.25rem 1.5rem;
}
.editor-wrap .ql-editor.ql-blank::before { color: var(--text-subtle); font-style: italic; font-family: var(--font-sans); }
.editor-wrap .ql-editor h2 { font-size: 1.5rem; margin: 1.2rem 0 0.5rem; font-weight: 700; }
.editor-wrap .ql-editor h3 { font-size: 1.2rem; margin: 1.1rem 0 0.4rem; font-weight: 700; }
.editor-wrap .ql-editor p  { margin: 0.7rem 0; }
.editor-wrap .ql-editor a  { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.editor-wrap .ql-editor blockquote { border-left: 3px solid var(--accent); background: var(--bg-muted); padding: 0.6rem 1rem; color: var(--text-muted); margin: 0.8rem 0; border-radius: 0 6px 6px 0; font-style: italic; }
.editor-wrap .ql-editor pre  { background: var(--code-bg); border-radius: 6px; padding: 0.7rem 0.9rem; }
.editor-wrap .ql-editor img  { max-width: 100%; height: auto; border-radius: 6px; }

/* Toolbar icons — flip in dark mode */
.editor-wrap .ql-snow .ql-stroke { stroke: var(--text-muted); }
.editor-wrap .ql-snow .ql-fill,
.editor-wrap .ql-snow .ql-stroke.ql-fill { fill: var(--text-muted); }
.editor-wrap .ql-snow .ql-picker { color: var(--text-muted); }
.editor-wrap .ql-snow .ql-picker-options { background: var(--bg-surface); border-color: var(--border-base); color: var(--text-base); }
.editor-wrap .ql-snow .ql-tooltip { background: var(--bg-surface); border-color: var(--border-base); color: var(--text-base); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.editor-wrap .ql-snow .ql-tooltip input[type=text] { background: var(--bg-page); color: var(--text-base); border: 1px solid var(--border-base); border-radius: 6px; }
.editor-wrap .ql-snow.ql-toolbar button:hover .ql-stroke,
.editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-stroke,
.editor-wrap .ql-snow.ql-toolbar button:hover .ql-fill,
.editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-fill { stroke: var(--accent); fill: var(--accent); }
.editor-wrap .ql-snow.ql-toolbar button.ql-active { color: var(--accent); }

/* Custom AI button in the toolbar */
.editor-wrap .ql-snow.ql-toolbar button.ql-ai {
  width: auto; padding: 0 8px; height: 28px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.editor-wrap .ql-snow.ql-toolbar button.ql-ai:hover { background: var(--accent); color: var(--accent-on); }

/* ───── Generic modal (used by AI assistant) ───── */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-panel { background: var(--bg-surface); color: var(--text-base); border: 1px solid var(--border-base); border-radius: 14px; max-width: 720px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-base); }
.modal-body { padding: 1rem 1.25rem; }
.modal-foot { padding: 0.85rem 1.25rem; border-top: 1px solid var(--border-base); display: flex; gap: 0.5rem; justify-content: flex-end; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───── Portrait gallery + lightbox ───── */
.gallery-main {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--bg-muted);
  border: 1px solid var(--border-base);
  display: flex; align-items: center; justify-content: center;
  /* Let the image dictate its own height up to a sensible cap so portraits,
     squares and landscapes all fit cleanly without letterbox bars. */
  min-height: 320px;
  max-height: min(78vh, 820px);
}
.gallery-main > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(78vh, 820px);
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform .15s ease;
}
.gallery-main:hover > img { transform: scale(1.01); }

/* Hover-zoom: when the user moves the mouse over the main viewer, the
   image scales up with its transform-origin tracking the cursor — like
   product zoom on e-commerce sites. JS adds .is-hover-zoom and updates
   the CSS variables --hz-x / --hz-y in real time. */
.gallery-main.is-hover-zoom > img {
  transform-origin: var(--hz-x, 50%) var(--hz-y, 50%);
  transform: scale(var(--hz-scale, 1.8));
  cursor: zoom-in;
  transition: transform .08s ease-out;
}
.gallery-main.is-hover-zoom .gallery-badge,
.gallery-main.is-hover-zoom .gallery-zoom-hint,
.gallery-main.is-hover-zoom .gallery-nav-btn {
  opacity: 0; pointer-events: none;
}
/* Disable on coarse/touch pointers — tapping shouldn't trigger zoom. */
@media (hover: none), (pointer: coarse) {
  .gallery-main.is-hover-zoom > img { transform: none; transition: none; }
}

/* Portrait cards: by default the card matches the image's own aspect
   ratio (set via inline `style="aspect-ratio: w/h"` per card), so the
   image fills the card with no letterboxing and no crop. Admins can
   override with a fixed aspect + focal point — in that case the image
   still fills the card via object-fit: cover and the focal point keeps
   the subject in view. */
.portrait-thumb {
  position: relative;
  background: var(--bg-muted);
  overflow: hidden;
}
.portrait-thumb > img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}
.gallery-badge {
  position: absolute; left: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(15, 23, 42, 0.55); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 8px; border-radius: 999px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.gallery-zoom-hint {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(15, 23, 42, 0.55); color: #fff;
  font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px;
  pointer-events: none;
  opacity: 0.9;
}
.gallery-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 38px; width: 38px; border-radius: 999px;
  background: rgba(255,255,255,0.92); color: #0f172a;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  border: 1px solid rgba(0,0,0,0.06);
}
.gallery-nav-btn:hover { background: #fff; }
.gallery-nav-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.gallery-nav-prev { left: 10px; }
.gallery-nav-next { right: 10px; }

.gallery-thumbs {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}
.gallery-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg-muted);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.gallery-thumb > img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 4px; }
.gallery-thumb:hover { transform: translateY(-1px); }
.gallery-thumb.is-active { border-color: var(--accent); }

/* Lightbox */
.lightbox-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(8, 11, 20, 0.92);
  display: flex; flex-direction: column;
  opacity: 0; transition: opacity .18s ease;
}
.lightbox-backdrop.is-open { opacity: 1; }
.lightbox-toolbar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 12px 16px;
  color: #e2e8f0;
}
.lightbox-toolbar .lb-title { font-weight: 600; font-size: 0.95rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-toolbar .lb-counter { font-size: 0.78rem; opacity: 0.7; }
.lightbox-btn {
  height: 38px; min-width: 38px; padding: 0 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06); color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.08);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.82rem;
}
.lightbox-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.lightbox-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.lightbox-stage {
  position: relative;
  flex: 1; min-height: 0;
  overflow: hidden;
  touch-action: none;
}
.lightbox-image-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  will-change: transform;
}
.lightbox-image-wrap > img {
  max-width: 100%; max-height: 100%;
  user-select: none; -webkit-user-drag: none;
  display: block;
  transition: transform .12s ease;
  transform-origin: center center;
}
.lightbox-image-wrap.is-grabbable > img { cursor: grab; }
.lightbox-image-wrap.is-dragging > img { cursor: grabbing; transition: none; }
.lightbox-side-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 44px; width: 44px; border-radius: 999px;
  background: rgba(255,255,255,0.08); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
}
.lightbox-side-btn:hover { background: rgba(255,255,255,0.18); }
.lightbox-side-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-footer {
  display: flex; gap: 8px; justify-content: center; padding: 10px 16px 16px;
  overflow-x: auto;
}
.lightbox-foot-thumb {
  flex: 0 0 auto;
  height: 56px; width: 56px;
  border-radius: 8px; overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.55;
}
.lightbox-foot-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.lightbox-foot-thumb.is-active { border-color: var(--accent); opacity: 1; }

body.lightbox-open { overflow: hidden; }

/* Image protection (paired with .no-save JS handlers in app.js) */
.no-save {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}
.no-save-zone { -webkit-touch-callout: none; }

/* Sticky mobile buy bar */
.buy-bar {
  position: sticky; bottom: 0; z-index: 30;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-base);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}
@media (min-width: 1024px) { .buy-bar { display: none; } }

/* ───── InHype-style hero slider ───── */
.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--bg-muted);
  isolation: isolate;
}

/* Break the hero out of the centered <main> container so it spans the full
   viewport width edge-to-edge, exactly like the InHype reference.
   The negative margins cancel the centering done by <main class="mx-auto">. */
.hero-fullbleed {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  /* Cancel the px-4 / sm:px-6 padding inherited from <main> so the photo
     truly reaches the viewport edges. */
  margin-top: calc(-1 * 0px); /* placeholder; overridden when present */
}
/* Pull the hero up so it kisses the header on home, and push the next
   section down for breathing room. */
main > .hero-fullbleed:first-child {
  margin-top: -1.5rem;   /* offsets the py-6 (1.5rem) on <main> */
}
@media (min-width: 640px) {
  main > .hero-fullbleed:first-child { margin-top: -2.5rem; } /* sm:py-10 */
}
.hero-stage {
  position: relative;
  min-height: 420px;
  height: 56vw;
  max-height: 620px;
}
@media (min-width: 768px) { .hero-stage { min-height: 480px; } }
@media (min-width: 1024px) { .hero-stage { min-height: 540px; } }

.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}
.hero-slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }
.hero-slide::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    100deg,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.55) 38%,
    rgba(0, 0, 0, 0.15) 70%,
    rgba(0, 0, 0, 0.05) 100%
  );
}
.hero-slide-link {
  position: absolute; inset: 0;
  z-index: 1;
}

/* Constrain the hero's inner content to the same max-width as the rest
   of the site, while the background image stays edge-to-edge. */
.hero-content {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 100%;
  max-width: 72rem; /* matches max-w-6xl (72rem) */
  top: 0; bottom: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 1.5rem 1.5rem 7.5rem;
  color: #fff;
  z-index: 2;
  pointer-events: none;
}
.hero-content > * { pointer-events: auto; }
@media (min-width: 640px) {
  .hero-content { padding: 2rem 2.25rem 8rem; }
}
@media (min-width: 1024px) {
  .hero-content {
    padding: 2.5rem 3rem 9rem;
  }
  .hero-content > * { max-width: 56%; }
}

.hero-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.hero-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: lowercase;
}
.hero-pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent);
}
.hero-pill.is-tag::before { background: #a855f7; } /* purple-500 for tags */

.hero-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.6rem, 4.2vw, 3rem);
  line-height: 1.1;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #fff;
}
.hero-title a { color: inherit; text-decoration: none; }
.hero-title a:hover,
.hero-title a:focus-visible { text-decoration: none; }

.hero-meta {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
}
.hero-meta .dot { width: 3px; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.65); display: inline-block; }

.hero-arrow {
  position: absolute; top: calc(50% - 64px);
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  display: grid; place-items: center;
  z-index: 4;
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  /* Hidden by default — only reveal when the hero is hovered or
     keyboard-focused. Touch devices (no hover capability) get them
     permanently shown via the media query below. */
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, background .15s ease, transform .15s ease;
}
.hero-slider:hover .hero-arrow,
.hero-slider:focus-within .hero-arrow {
  opacity: 1;
  pointer-events: auto;
}
@media (hover: none) {
  .hero-arrow { opacity: 1; pointer-events: auto; }
}
.hero-arrow:hover { background: rgba(15, 23, 42, 0.85); }
.hero-arrow:active { transform: translateY(-50%) scale(0.96); }
.hero-arrow-prev { left: 14px; }
.hero-arrow-next { right: 14px; }

/* Bottom card strip — previews the slides.
   Pinned to the inner-content right edge so it lines up with the rest
   of the page even though the hero is full-bleed.
   `align-items: end` keeps every card flush with the hero's bottom edge
   so the active card can grow upward without nudging its siblings. */
.hero-cards {
  position: absolute;
  bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100%;
  max-width: 72rem; /* lines up with the rest of the site */
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  z-index: 3;
  padding: 0; /* override generic padding */
}
@media (min-width: 640px) {
  .hero-cards {
    grid-template-columns: repeat(3, 1fr);
    left: auto; right: 0; transform: none;
    width: auto; max-width: 720px;
  }
}
@media (min-width: 1024px) {
  /* Sit the card strip flush with the right edge of the 72rem inner column. */
  .hero-cards {
    right: max(0px, calc((100vw - 72rem) / 2));
  }
}
.hero-card {
  text-align: left;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  padding: 1.1rem 1.1rem 1.25rem;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, padding .25s ease, box-shadow .25s ease;
  min-height: 92px;
  align-self: end;   /* sit on the bottom rail */
}
.hero-card:last-child { border-right: 0; }
.hero-card:hover { background: rgba(255, 255, 255, 1); }
.hero-card.is-active {
  background: var(--accent);
  color: var(--accent-on);
  /* Extend upward so the active tile rises above the strip (matches
     the InHype pink "02" reference). Only do this on sm+ where the
     cards sit side-by-side — on mobile they stack vertically. */
  box-shadow: 0 -8px 24px -8px rgba(0, 0, 0, 0.18);
}
.hero-card.is-active:hover { background: var(--accent-strong); }

@media (min-width: 640px) {
  .hero-card.is-active {
    padding-top: 2.25rem;
    padding-bottom: 1.6rem;
    min-height: 124px;
  }
}
@media (min-width: 1024px) {
  .hero-card.is-active {
    padding-top: 2.75rem;
    padding-bottom: 1.75rem;
    min-height: 144px;
  }
}

.hero-card-num {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.55;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.hero-card.is-active .hero-card-num { opacity: 0.9; color: var(--accent-on); }

.hero-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.32;
}

/* Hide the bottom cards strip on very small screens — they'd overlap text.
   Replace with dot indicators instead (rendered in markup, hidden ≥640px). */
.hero-dots {
  position: absolute;
  left: 1.5rem; bottom: 1.25rem;
  display: flex; gap: 7px;
  z-index: 3;
}
@media (min-width: 640px) { .hero-dots { display: none; } }
.hero-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  border: 0;
}
.hero-dot.is-active { background: #fff; }

/* On small screens, drop the cards strip (we show dots instead). */
@media (max-width: 639px) {
  .hero-cards { display: none; }
  .hero-content { padding-bottom: 4.5rem; }
  .hero-arrow { top: 50%; }
}

/* Dark mode: cards keep their light background by default to stay
   high-contrast against the dark photo, but soften the active state
   on dark mode so the accent doesn't blow out. */
[data-theme="dark"] .hero-card {
  background: rgba(255, 255, 255, 0.94);
}
[data-theme="dark"] .hero-card.is-active {
  background: var(--accent);
  color: var(--accent-on);
}

/* ───── Story shortcuts: text-only mini cards under the hero ───── */
.story-strip-wrap {
  /* Sits inside <main> but breaks out to full viewport width so it lines
     up flush with the hero above (separated by clear vertical breathing
     room rather than glued to it). */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: 2.25rem;
  background: var(--bg-page);
  border-top: 1px solid var(--border-base);
}
@media (min-width: 1024px) { .story-strip-wrap { margin-top: 3rem; } }
.story-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 72rem;     /* lines up with site content */
  margin: 0 auto;
  border-bottom: 1px solid var(--border-base);
}
@media (min-width: 640px) { .story-strip { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .story-strip { grid-template-columns: repeat(4, 1fr); } }

.story-shortcut {
  padding: 1.5rem 1.5rem 1.75rem;
  display: flex; flex-direction: column; gap: .9rem;
  background: var(--bg-page);
  border-right: 1px solid var(--border-base);
  border-bottom: 1px solid var(--border-base);
  transition: background .15s ease;
}
@media (min-width: 1024px) { .story-shortcut { border-bottom: 0; } }
@media (min-width: 640px) {
  .story-shortcut:nth-child(2n) { border-right: 0; }
}
@media (min-width: 1024px) {
  .story-shortcut { border-right: 1px solid var(--border-base); }
  .story-shortcut:nth-child(2n) { border-right: 1px solid var(--border-base); }
  .story-shortcut:nth-child(4n) { border-right: 0; }
}
.story-shortcut:hover { background: var(--bg-hover); }

.story-pills {
  display: inline-flex; flex-wrap: wrap; gap: .4rem;
}
.story-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-base);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-page);
  text-transform: lowercase;
}
.story-pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 999px;
  background: var(--dot-color, #6366f1);
}

/* Dot color palette by category slug — deterministic via inline style on the pill */
.story-pill[data-c="0"] { --dot-color: #6366f1; } /* indigo  */
.story-pill[data-c="1"] { --dot-color: #3b82f6; } /* blue    */
.story-pill[data-c="2"] { --dot-color: #ec4899; } /* pink    */
.story-pill[data-c="3"] { --dot-color: #f97316; } /* orange  */
.story-pill[data-c="4"] { --dot-color: #10b981; } /* emerald */
.story-pill[data-c="5"] { --dot-color: #a855f7; } /* purple  */
.story-pill[data-c="6"] { --dot-color: #ef4444; } /* red     */
.story-pill[data-c="7"] { --dot-color: #06b6d4; } /* cyan    */

.story-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.32;
  color: var(--text-base);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-title a { color: inherit; text-decoration: none; }
.story-shortcut:hover .story-title a { color: var(--accent-strong); }

.story-meta {
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: flex; align-items: center; gap: .55rem;
  margin-top: auto;
}
.story-meta .dot {
  width: 3px; height: 3px; border-radius: 999px;
  background: var(--text-subtle); display: inline-block;
}

/* ───── Spotlight + Recent section ─────────────────────────────────
   A magazine-style block: one large photo card with overlaid title on
   the left, a vertical "Recent" list on the right. */
.spotlight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
}
@media (min-width: 1024px) {
  .spotlight-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 3rem;
  }
}

.spotlight-media {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--bg-muted);
  isolation: isolate;
}
.spotlight-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.spotlight-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.18) 55%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 1;
  pointer-events: none;
}
.spotlight-link {
  position: absolute; inset: 0;
  z-index: 3;
}
.spotlight-icon {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  display: grid; place-items: center;
  z-index: 2;
  pointer-events: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.spotlight-content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.25rem 1.5rem 1.5rem;
  color: #fff;
  z-index: 2;
  pointer-events: none;
}
.spotlight-content > * { pointer-events: auto; }
.spotlight-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.spotlight-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  line-height: 1.18;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.spotlight-title a { color: inherit; text-decoration: none; }
.spotlight-title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.spotlight-meta {
  margin-top: .7rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.88);
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.spotlight-meta .dot {
  width: 3px; height: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}
.spotlight-excerpt {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-heading {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  padding-bottom: .85rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-base);
  color: var(--text-base);
}
.recent-list {
  display: flex; flex-direction: column;
}
.recent-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-base);
}
.recent-item:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.32;
  margin: 0;
  color: var(--text-base);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-title a { color: inherit; text-decoration: none; }
.recent-title a:hover { color: var(--accent); }
.recent-meta {
  margin-top: .4rem;
  font-size: 0.76rem;
  color: var(--text-subtle);
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.recent-meta .dot {
  width: 3px; height: 3px; border-radius: 999px;
  background: var(--text-subtle);
}

/* ───── Section header (eyebrow + big title) ───── */
.section-head {
  margin-bottom: 1.5rem;
}
.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0;
}
.section-title-xl {
  font-weight: 800;
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
  color: var(--text-base);
}

/* ───── Trending grid: 3 rich cards in a row ───── */
.trend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
}
@media (min-width: 640px)  { .trend-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; } }
@media (min-width: 1024px) { .trend-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

.trend-card {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}
.trend-media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-muted);
}
.trend-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.trend-card:hover .trend-media img { transform: scale(1.03); }
.trend-link {
  position: absolute; inset: 0;
  z-index: 2;
}
/* The small pink corner accent seen in InHype's "Top of the Week" cards */
.trend-media::after {
  content: '';
  position: absolute;
  right: 0; bottom: 0;
  width: 38px; height: 38px;
  background: var(--accent);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  z-index: 1;
}

.trend-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.trend-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0;
  color: var(--text-base);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trend-title a { color: inherit; text-decoration: none; }
.trend-card:hover .trend-title a { color: var(--accent); }
.trend-meta {
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.trend-meta .dot {
  width: 3px; height: 3px; border-radius: 999px;
  background: var(--text-subtle);
}
.trend-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ───── Today Highlights — auto-sliding 5-up row ───── */
.highlights-wrap {
  position: relative;
}
.highlights-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  overflow-y: visible;        /* let hover lift not clip */
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 8px 2px 18px;       /* room for lift + scrollbar */
  -webkit-overflow-scrolling: touch;
}
.highlights-track::-webkit-scrollbar { display: none; }
.highlight-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: calc((100% - 4 * 1.5rem) / 5);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform .25s ease;
  position: relative;
}
@media (max-width: 1023px) { .highlight-card { width: calc((100% - 2 * 1.5rem) / 3); } }
@media (max-width: 767px)  { .highlight-card { width: calc((100% - 1.5rem) / 2); } }
@media (max-width: 479px)  { .highlight-card { width: 78%; } }

.highlight-card:hover { transform: translateY(-4px); }

.highlight-media {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-muted);
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow .25s ease;
}
.highlight-card:hover .highlight-media {
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.22);
}
.highlight-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.highlight-card:hover .highlight-media img { transform: scale(1.05); }

/* Corner accent triangle — appears on hover (matches InHype's pink flag) */
.highlight-media::after {
  content: '';
  position: absolute;
  right: 0; bottom: 0;
  width: 34px; height: 34px;
  background: var(--accent);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 1;
}
.highlight-card:hover .highlight-media::after { opacity: 1; }

/* Optional play button for video cards */
.highlight-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  display: grid; place-items: center;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform .2s ease;
}
.highlight-card:hover .highlight-play { transform: translate(-50%, -50%) scale(1.05); }

.highlight-pills {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.highlight-title {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-base);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.highlight-title a { color: inherit; text-decoration: none; }
.highlight-card:hover .highlight-title a { color: var(--accent); }
.highlight-meta {
  font-size: 0.72rem;
  color: var(--text-subtle);
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
}
.highlight-meta .dot { width: 3px; height: 3px; border-radius: 999px; background: var(--text-subtle); }
.highlight-link { position: absolute; inset: 0; z-index: 3; }

/* prev/next arrow buttons hovering over the track */
.highlights-arrow {
  position: absolute;
  top: calc(50% - 36px);
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-base);
  border: 1px solid var(--border-base);
  display: grid; place-items: center;
  z-index: 5;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.25);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.highlights-arrow:hover { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.highlights-arrow-prev { left: -8px; }
.highlights-arrow-next { right: -8px; }
@media (max-width: 639px) { .highlights-arrow { display: none; } }
