/* ============================================================
   HabariFupi — Main Stylesheet
   Brand: Deep Red #C0392B, Dark #0f0f14, Accent Gold #F39C12
   ============================================================ */

:root {
  --red:      #C0392B;
  --red-dark: #922b21;
  --red-light:#e74c3c;
  --dark:     #0f0f14;
  --dark2:    #1a1a24;
  --dark3:    #252533;
  --mid:      #3d3d52;
  --light:    #f4f4f8;
  --white:    #ffffff;
  --gold:     #F39C12;
  --text:     #1c1c28;
  --text-muted: #6b7280;
  --border:   #e5e7eb;
  --radius:   12px;
  --radius-sm: 6px;
  --shadow:   0 4px 24px rgba(0,0,0,.10);
  --shadow-md:0 8px 40px rgba(0,0,0,.14);
  --transition: .2s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --text:      #e8e8f0;
  --text-muted:#9ca3af;
  --border:    #2d2d3e;
  --light:     #0f0f14;
  --white:     #1a1a24;
  --shadow:    0 4px 24px rgba(0,0,0,.40);
  --shadow-md: 0 8px 40px rgba(0,0,0,.60);
}

[data-theme="dark"] .navbar {
  box-shadow: 0 1px 8px rgba(0,0,0,.4);
}
[data-theme="dark"] .btn-icon:hover {
  background: rgba(255,255,255,.1);
  color: var(--text);
}
[data-theme="dark"] .navbar__nav a:hover,
[data-theme="dark"] .navbar__nav a.active {
  background: rgba(192,57,43,.25);
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--light);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }

/* ─── Utility ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
  white-space: nowrap;
}

.navbar__logo-icon {
  width: 34px; height: 34px;
  background: var(--red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.navbar__logo span.accent { color: var(--red-light); }

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar__nav a {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.navbar__nav a:hover,
.navbar__nav a.active {
  color: var(--red);
  background: rgba(192,57,43,.08);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: background var(--transition), color var(--transition);
}

.btn-icon:hover { background: rgba(0,0,0,.06); color: var(--text); }

.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
}

.navbar__hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ─── Category bar ─────────────────────────────────────────── */
.cat-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }

.cat-bar__inner {
  display: flex;
  gap: 0;
  height: 44px;
  align-items: stretch;
  min-width: max-content;
}

.cat-bar__item {
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.cat-bar__item:hover { color: var(--red); }
.cat-bar__item.active { color: var(--red); border-bottom-color: var(--red); }

/* ─── Hero Section ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--dark);
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .55;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,15,20,.95) 0%, rgba(15,15,20,.4) 60%, transparent 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 48px 0 40px;
  width: 100%;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.hero__badge::before {
  content: '';
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.8);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.7); }
}

.hero__title {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  max-width: 680px;
  margin-bottom: 14px;
}

.hero__summary {
  font-size: .95rem;
  color: rgba(255,255,255,.8);
  max-width: 560px;
  margin-bottom: 22px;
  line-height: 1.65;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero__source {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.7);
  font-size: .82rem;
  font-weight: 600;
}

.hero__time { color: rgba(255,255,255,.5); font-size: .8rem; }

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  font-size: .88rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.2);
  transition: background var(--transition);
}

.btn-ghost:hover { background: rgba(255,255,255,.2); }

/* ─── Section headings ────────────────────────────────────── */
.section { padding: 40px 0; }

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section__title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section__title::before {
  content: '';
  display: block;
  width: 4px; height: 20px;
  background: var(--red);
  border-radius: 2px;
}

.section__more {
  font-size: .82rem;
  font-weight: 600;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section__more:hover { color: var(--red-dark); }

/* ─── News Grid ───────────────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.news-grid--4 { grid-template-columns: repeat(4, 1fr); }
.news-grid--3 { grid-template-columns: repeat(3, 1fr); }
.news-grid--2 { grid-template-columns: repeat(2, 1fr); }

/* ─── News Card ───────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card__img-wrap {
  position: relative;
  padding-top: 56%;
  overflow: hidden;
  background: var(--dark3);
  flex-shrink: 0;
}

.card__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.card:hover .card__img { transform: scale(1.04); }

.card__img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--dark2), var(--dark3));
  color: rgba(255,255,255,.2);
}

.card__cat-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 4px;
}

.card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card__title {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__summary {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card__source {
  font-size: .75rem;
  font-weight: 600;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card__time {
  font-size: .72rem;
  color: var(--text-muted);
}

/* ─── Latest list (big card + side list) ──────────────────── */
.latest-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}

.latest-big .card__img-wrap { padding-top: 60%; }
.latest-big .card__title    { font-size: 1.1rem; -webkit-line-clamp: 3; }
.latest-big .card__summary  { -webkit-line-clamp: 4; }

.latest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Compact card (text-only) ────────────────────────────── */
.card-compact {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card-compact:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-compact__img {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--dark3);
}

.card-compact__img-placeholder {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--dark2), var(--dark3));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: rgba(255,255,255,.2);
}

.card-compact__body { flex: 1; min-width: 0; }

.card-compact__title {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-compact__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-compact__source {
  font-size: .72rem;
  font-weight: 600;
  color: var(--red);
}

.card-compact__time {
  font-size: .7rem;
  color: var(--text-muted);
}

/* ─── Breaking ticker ─────────────────────────────────────── */
.ticker {
  background: var(--red);
  color: #fff;
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}

.ticker__label {
  background: var(--red-dark);
  padding: 0 16px;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker__track {
  display: flex;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}

.ticker__track:hover { animation-play-state: paused; }

.ticker__item {
  padding: 0 40px 0 0;
  font-size: .8rem;
  font-weight: 500;
}

.ticker__item::after {
  content: '•';
  margin-left: 40px;
  opacity: .5;
}

.ticker__item:last-child::after { display: none; }

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,.6);
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer__brand .navbar__logo { margin-bottom: 14px; }

.footer__brand p {
  font-size: .85rem;
  line-height: 1.7;
  max-width: 280px;
}

.footer__heading {
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}

.footer__links { display: flex; flex-direction: column; gap: 8px; }
.footer__links a { font-size: .83rem; transition: color var(--transition); }
.footer__links a:hover { color: var(--red-light); }

.footer__bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__bottom a { color: var(--red-light); }

/* ─── News Feed (full-screen card swipe) ──────────────────── */
.feed-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 104px);
}

.feed-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  overflow-y: auto;
  position: sticky;
  top: 104px;
  height: calc(100vh - 104px);
}

.feed-sidebar__heading {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 0 20px 10px;
}

.feed-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}

.feed-sidebar__link:hover { background: var(--light); color: var(--red); }
.feed-sidebar__link.active {
  background: rgba(192,57,43,.08);
  color: var(--red);
  border-left-color: var(--red);
  font-weight: 700;
}

.feed-sidebar__icon { width: 20px; text-align: center; }

.feed-main { overflow: hidden; }

/* ─── Story cards (swipe feed) ────────────────────────────── */
.swipe-feed {
  height: calc(100vh - 104px);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.swipe-feed::-webkit-scrollbar { display: none; }

.story-card {
  height: calc(100vh - 104px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--dark);
}

.story-card__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .45;
  transition: opacity .3s;
}

.story-card__img-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.story-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,15,20,1) 0%, rgba(15,15,20,.7) 45%, rgba(15,15,20,.2) 100%);
}

.story-card__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
}

.story-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.story-card__cat {
  background: var(--red);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 4px;
}

.story-card__nav-hint {
  color: rgba(255,255,255,.4);
  font-size: .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.story-card__content {
  margin-top: auto;
}

.story-card__source-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.story-card__source {
  font-size: .78rem;
  font-weight: 700;
  color: var(--red-light);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.story-card__time {
  font-size: .75rem;
  color: rgba(255,255,255,.45);
}

.story-card__title {
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 16px;
}

.story-card__summary {
  font-size: .92rem;
  color: rgba(255,255,255,.82);
  line-height: 1.7;
  margin-bottom: 24px;
}

.story-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.story-card__read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.story-card__read:hover { background: var(--red-dark); }

.story-card__share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  font-size: .85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.2);
  transition: background var(--transition);
}

.story-card__share:hover { background: rgba(255,255,255,.2); }

.story-card__bookmark {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7);
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,.2);
  transition: background var(--transition), color var(--transition);
}

.story-card__bookmark:hover,
.story-card__bookmark.saved { background: var(--gold); color: #fff; border-color: var(--gold); }

.story-card__progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.1);
}

.story-card__progress-bar {
  height: 100%;
  background: var(--red);
  width: 0;
  transition: width .3s linear;
}

/* ─── Share modal ─────────────────────────────────────────── */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.share-modal.open { display: flex; }

.share-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

.share-modal__panel {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 28px 24px 40px;
  width: 100%;
  max-width: 480px;
  animation: slide-up .25s ease;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.share-modal__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  text-align: center;
}

.share-modal__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.share-modal__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
}

.share-modal__option:hover { background: var(--light); }

.share-modal__option-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

.share-modal__option-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); }

.share-wa   { background: #25D366; }
.share-tg   { background: #0088CC; }
.share-x    { background: #000; }
.share-fb   { background: #1877F2; }
.share-copy { background: var(--mid); }

.share-modal__copy-row {
  display: flex;
  gap: 8px;
  background: var(--light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  align-items: center;
}

.share-modal__copy-url {
  flex: 1;
  font-size: .8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-modal__copy-btn {
  background: var(--red);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ─── Search bar ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 14px;
  height: 34px;
  transition: background var(--transition), border-color var(--transition);
}

.search-bar:focus-within {
  border-color: var(--red);
  background: var(--white);
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .83rem;
  width: 140px;
  font-family: inherit;
}

.search-bar input::placeholder { color: var(--text-muted); }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }

/* ─── Loading skeleton ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--light) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .news-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .feed-layout  { grid-template-columns: 1fr; }
  .feed-sidebar { display: none; }
}

@media (max-width: 768px) {
  .navbar__nav   { display: none; }
  .navbar__hamburger { display: flex; }
  .search-bar    { display: none; }
  .latest-grid   { grid-template-columns: 1fr; }
  .news-grid--4,
  .news-grid--3,
  .news-grid--2  { grid-template-columns: 1fr; }
  .hero          { min-height: 380px; }
  .story-card__summary { font-size: .85rem; }
  .footer__grid  { grid-template-columns: 1fr; gap: 24px; }
  .share-modal__grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero__title { font-size: 1.4rem; }
  .story-card__body { padding: 16px; }
  .story-card__title { font-size: 1.15rem; }
  .story-card__actions { gap: 8px; }
  .story-card__read,
  .story-card__share { font-size: .8rem; padding: 9px 14px; }
}

/* ─── Browse page — article tile list (mirrors app browse_screen) ── */
.browse-wrap {
  background: var(--light);
  min-height: calc(100vh - 104px);
}

.article-list {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Single article tile */
.article-tile {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.article-tile:hover { background: var(--light); }
.article-tile:last-child { border-bottom: none; }

/* Text column */
.article-tile__body {
  flex: 1;
  min-width: 0;
}

.article-tile__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}

.article-tile__source {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: .01em;
}

.article-tile__dot {
  font-size: 11px;
  color: var(--text-muted);
}

.article-tile__time {
  font-size: 11px;
  color: var(--text-muted);
}

.article-tile__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-tile__summary {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Actions row */
.article-tile__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tile-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.tile-action:hover { color: var(--red); background: rgba(192,57,43,.07); }
.tile-action.saved { color: var(--red); }

.tile-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  background: var(--red);
  padding: 5px 12px;
  border-radius: 6px;
  transition: background var(--transition);
  white-space: nowrap;
}

.tile-read-btn:hover { background: var(--red-dark); }

/* Thumbnail */
.article-tile__thumb {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.article-tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-tile__thumb-ph {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,.18);
}

/* Empty state */
.browse-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}

.browse-empty__icon  { font-size: 3rem; margin-bottom: 16px; }
.browse-empty__title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.browse-empty__sub   { font-size: .88rem; max-width: 280px; }

/* Immersive reader CTA */
.browse-reader-cta {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  justify-content: center;
}

.browse-reader-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--red);
  border: 1.5px solid var(--red);
  padding: 10px 24px;
  border-radius: 24px;
  transition: background var(--transition), color var(--transition);
}

.browse-reader-btn:hover {
  background: var(--red);
  color: #fff;
}

/* ─── Dark mode override ─────────────────────────────────── */
[data-theme="dark"] .cat-bar { background: var(--dark2); border-color: var(--border); }
[data-theme="dark"] .card    { background: var(--dark2); }
[data-theme="dark"] .card-compact { background: var(--dark2); }
[data-theme="dark"] .feed-sidebar { background: var(--dark2); border-color: var(--border); }
[data-theme="dark"] .share-modal__panel { background: var(--dark2); }
[data-theme="dark"] .share-modal__copy-row { background: var(--dark3); }

/* Browse page dark mode */
[data-theme="dark"] .article-list        { background: var(--dark2); border-color: var(--border); }
[data-theme="dark"] .article-tile        { background: var(--dark2); border-color: var(--border); }
[data-theme="dark"] .article-tile:hover  { background: var(--dark3); }
[data-theme="dark"] .article-tile__thumb-ph { color: rgba(255,255,255,.18); }

/* ─── Responsive — article tiles ────────────────────────── */
@media (max-width: 768px) {
  .article-list {
    border-left: none;
    border-right: none;
    max-width: 100%;
  }
  .article-tile { padding: 12px 14px; }
  .article-tile__thumb,
  .article-tile__thumb-ph { width: 76px; height: 76px; }
  .tile-read-btn { display: none; } /* save space on mobile */
}

@media (max-width: 480px) {
  .article-tile { gap: 10px; padding: 12px; }
  .article-tile__title   { font-size: 13.5px; }
  .article-tile__summary { font-size: 11.5px; }
  .article-tile__thumb,
  .article-tile__thumb-ph { width: 68px; height: 68px; }
}

/* ─────────────────────────────────────────────────────────────
   Article detail modal  (mirrors app ArticleDetailScreen)
───────────────────────────────────────────────────────────── */
.story-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  align-items: flex-end;
  justify-content: center;
}
.story-modal.open { display: flex; }

.story-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.story-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sm-slide-up .25s cubic-bezier(.32,1,.28,1) both;
}
@keyframes sm-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Hero */
.story-modal__hero {
  position: relative;
  height: 220px;
  background: var(--light);
  flex-shrink: 0;
  overflow: hidden;
}
.story-modal__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-modal__hero-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: .4;
}
.story-modal__close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background var(--transition);
}
.story-modal__close:hover { background: rgba(0,0,0,.65); }

/* Content */
.story-modal__content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 12px;
  -webkit-overflow-scrolling: touch;
}
.story-modal__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.story-modal__source {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.story-modal__dot,
.story-modal__time { font-size: 11px; color: var(--text-muted); }

.story-modal__title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin: 0 0 14px;
}
.story-modal__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 14px;
}
.story-modal__summary {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  margin: 0;
}

/* Action bar */
.story-modal__actions {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
  gap: 0;
}
.story-modal__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.story-modal__action:hover  { color: var(--red); background: var(--light); }
.story-modal__action.sm-saved  { color: var(--red); }
.story-modal__action.sm-active { color: var(--red); }

.story-modal__read {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--red);
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition);
}
.story-modal__read:hover { background: #a93226; }

/* Dark mode */
[data-theme="dark"] .story-modal__panel   { background: var(--dark2); }
[data-theme="dark"] .story-modal__hero-ph { background: var(--dark3); }
[data-theme="dark"] .story-modal__actions { background: var(--dark2); border-color: var(--border); }
[data-theme="dark"] .story-modal__action:hover { background: var(--dark3); }

@media (max-width: 480px) {
  .story-modal__hero   { height: 180px; }
  .story-modal__title  { font-size: 17px; }
  .story-modal__action { padding: 6px 8px; font-size: 9px; }
  .story-modal__read   { padding: 9px 14px; font-size: 12px; }
}

/* ─────────────────────────────────────────────────────────────
   Legal pages (Privacy Policy / Terms & Conditions)
───────────────────────────────────────────────────────────── */
.legal-page {
  padding: 40px 20px 80px;
}
.legal-page__inner {
  max-width: 760px;
  margin: 0 auto;
}

/* Header */
.legal-page__header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--red);
}
.legal-page__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(192,57,43,.08);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.legal-page__title {
  font-size: 32px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}
.legal-page__date {
  font-size: 13px;
  color: var(--text-muted);
}

/* Body prose */
.legal-page__body {
  color: var(--text);
  line-height: 1.8;
}
.legal-page__body p {
  font-size: 15px;
  margin-bottom: 18px;
}
.legal-page__body h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.legal-page__body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 8px;
}
.legal-page__body ul {
  margin: 0 0 18px 0;
  padding-left: 24px;
}
.legal-page__body ul li {
  font-size: 15px;
  margin-bottom: 6px;
}
.legal-page__body a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: rgba(192,57,43,.3);
  text-underline-offset: 2px;
}
.legal-page__body a:hover {
  text-decoration-color: var(--red);
}
.legal-page__body strong {
  font-weight: 700;
  color: var(--text);
}

/* Contact block */
.legal-page__contact {
  background: var(--light);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 2;
  margin-top: 4px;
}

/* Cross-link footer */
.legal-page__footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.legal-page__sibling {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  transition: opacity var(--transition);
}
.legal-page__sibling:hover { opacity: .75; }

/* Dark mode */
[data-theme="dark"] .legal-page__badge   { background: rgba(192,57,43,.18); }
[data-theme="dark"] .legal-page__contact { background: var(--dark3); }

@media (max-width: 600px) {
  .legal-page__title { font-size: 26px; }
  .legal-page__body h2 { font-size: 17px; }
}

/* ══════════════════════════════════════════════════════════════
   CONTACT PAGE
   ══════════════════════════════════════════════════════════════ */

/* Quick-contact cards */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.25rem;
  background: var(--surface-alt, #f4f4f5);
  border-radius: 12px;
  border: 1px solid var(--border, #e4e4e7);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.contact-card:hover {
  border-color: var(--primary, #C0392B);
  box-shadow: 0 0 0 3px rgba(192,57,43,.08);
}
.contact-card__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.contact-card__body {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  font-size: .875rem;
}
.contact-card__body strong {
  font-weight: 600;
  color: var(--text-primary, #18181b);
}
.contact-card__body span {
  color: var(--primary, #C0392B);
  font-size: .8rem;
}

/* Form */
.contact-form {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 600px) {
  .contact-form__row { grid-template-columns: 1fr; }
}
.contact-form__group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.contact-form__group label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary, #18181b);
}
.contact-form__group input,
.contact-form__group select,
.contact-form__group textarea {
  padding: .65rem .875rem;
  border: 1.5px solid var(--border, #e4e4e7);
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text-primary, #18181b);
  background: var(--bg, #fff);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.contact-form__group input:focus,
.contact-form__group select:focus,
.contact-form__group textarea:focus {
  border-color: var(--primary, #C0392B);
  box-shadow: 0 0 0 3px rgba(192,57,43,.1);
}
.contact-form__group textarea { resize: vertical; min-height: 130px; }
.contact-form__group select { cursor: pointer; }

.contact-form__submit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  background: var(--primary, #C0392B);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.contact-form__submit:hover { background: #a93226; transform: translateY(-1px); }
.contact-form__submit:active { transform: translateY(0); }

/* Success / error banners */
.contact-success {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: 1.25rem 1.5rem;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  color: #166534;
  margin: 1.5rem 0;
  font-size: .9rem;
  line-height: 1.5;
}
.contact-success svg { flex-shrink: 0; color: #16a34a; margin-top: 2px; }

.contact-error {
  padding: 1rem 1.25rem;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  color: #991b1b;
  font-size: .875rem;
  margin-bottom: 1rem;
}

/* Dark mode */
[data-theme="dark"] .contact-card {
  background: var(--surface-alt, #27272a);
  border-color: var(--border, #3f3f46);
}
[data-theme="dark"] .contact-card__body strong { color: #f4f4f5; }
[data-theme="dark"] .contact-form__group input,
[data-theme="dark"] .contact-form__group select,
[data-theme="dark"] .contact-form__group textarea {
  background: #27272a;
  border-color: #3f3f46;
  color: #f4f4f5;
}
[data-theme="dark"] .contact-form__group label { color: #d4d4d8; }
[data-theme="dark"] .contact-success { background: #052e16; border-color: #166534; color: #86efac; }
[data-theme="dark"] .contact-error   { background: #450a0a; border-color: #991b1b; color: #fca5a5; }
