/* Tokens ----------------------------------------------------------------- */
:root {
  --ink: #16181D;
  --paper: #FFFFFF;
  --wash: #F2F3F5;
  --brand: #C4122F;        /* news red */
  --brand-dark: #9B0C23;
  --navy: #0F2340;
  --muted: #5D6573;
  --rule: #DADDE2;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1200px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; padding-top: 32px; padding-bottom: 48px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.meta { color: var(--muted); font-size: 13px; }

/* Masthead ---------------------------------------------------------------- */
.topstrip { background: var(--navy); color: #C9D2E0; font-size: 13px; }
.topstrip-inner { display: flex; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; }
.topstrip a:hover { color: #fff; }
.brandrow { padding-top: 18px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 30px; height: 30px; background: var(--brand); border-radius: 4px; position: relative; }
.logo-mark::after { content: ""; position: absolute; inset: 8px 7px; border-top: 3px solid #fff; border-bottom: 3px solid #fff; }
.logo-word { font: 800 30px/1 var(--serif); letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }

.catnav { background: var(--brand); }
.catnav-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.catnav-inner::-webkit-scrollbar { display: none; }
.catnav a { color: #fff; font-weight: 600; font-size: 15px; padding: 11px 14px; white-space: nowrap; }
.catnav a:hover, .catnav a.on { background: var(--brand-dark); color: #fff; }

/* The one moving element on the page */
.ticker { border-bottom: 1px solid var(--rule); background: var(--wash); }
.ticker-inner { display: flex; align-items: center; gap: 14px; height: 42px; }
.ticker-tag { flex: none; font-weight: 700; font-size: 13px; color: var(--brand); display: inline-flex; align-items: center; gap: 7px; }
.ticker-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: pulse 1.6s ease-in-out infinite; }
.ticker-viewport { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-track { display: flex; gap: 40px; list-style: none; margin: 0; padding: 0; width: max-content; animation: scroll 60s linear infinite; }
.ticker-track li { white-space: nowrap; font-size: 14px; font-weight: 500; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .ticker-tag::before { animation: none; }
  .ticker-viewport { overflow-x: auto; }
}

/* Layout ------------------------------------------------------------------ */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding-top: 28px; padding-bottom: 56px; }
@media (max-width: 960px) { .page-grid { grid-template-columns: 1fr; gap: 32px; } }

.kicker { display: inline-block; color: var(--brand); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.standfirst { font: 400 19px/1.5 var(--serif); color: #3A3F4A; margin: 10px 0 12px; max-width: 64ch; }
.page-title { font: 800 34px/1.15 var(--serif); letter-spacing: -0.015em; margin: 0 0 20px; }

/* Placeholder art (used when an article has no hero_image) */
.hero-ph { position: relative; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; display: flex; align-items: flex-end;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: rgba(255,255,255,.9); }
.hero-ph::before { content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.07) 0 2px, transparent 2px 22px); }
.hero-ph span { position: relative; font: 700 15px/1 var(--sans); padding: 14px 16px; }
.hero-lg span { font-size: 18px; }
.hero-xs span { display: none; }
.hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.hero-india-news { --c1: #C4122F; --c2: #6E0A1B; }
.hero-world-news { --c1: #1D4E89; --c2: #0F2340; }
.hero-business   { --c1: #146356; --c2: #0A342E; }
.hero-cities     { --c1: #8A4B08; --c2: #4A2804; }
.hero-science    { --c1: #4B3F9E; --c2: #231C52; }
.hero-sports     { --c1: #2F7A1F; --c2: #163C0E; }

/* Home -------------------------------------------------------------------- */
.lead { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.lead-title { font: 800 clamp(28px, 3.4vw, 40px)/1.12 var(--serif); letter-spacing: -0.02em; margin: 0; }
@media (max-width: 720px) { .lead { grid-template-columns: 1fr; gap: 16px; } }

.secondary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 24px 0 8px; }
.card-title { font: 700 18px/1.3 var(--serif); margin: 0; }
.card .hero-ph, .card .hero-img { margin-bottom: 12px; }
@media (max-width: 720px) { .secondary { grid-template-columns: 1fr; } }

.section { margin-top: 36px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 3px solid var(--ink); padding-top: 10px; margin-bottom: 6px; }
.section-head h2 { font: 800 22px/1.2 var(--serif); margin: 0; }
.section-head a { font-size: 14px; font-weight: 600; color: var(--brand); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.list > li > a { font: 700 18px/1.3 var(--serif); }
.list > li p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.list-rich > li { display: grid; grid-template-columns: 180px 1fr; gap: 18px; }
.list-rich h2 { font: 700 20px/1.3 var(--serif); margin: 0 0 4px; }
@media (max-width: 560px) { .list-rich > li { grid-template-columns: 110px 1fr; gap: 12px; } .list-rich h2 { font-size: 17px; } .list-rich p { display: none; } }

/* Trending rail: genuinely ranked, so numbers are meaningful */
.rail { align-self: start; position: sticky; top: 16px; }
.rail-h { font: 800 20px/1.2 var(--serif); margin: 0 0 4px; padding-bottom: 8px; border-bottom: 3px solid var(--brand); }
.trending { list-style: none; counter-reset: t; margin: 0; padding: 0; }
.trending li { counter-increment: t; display: grid; grid-template-columns: 34px 1fr; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.trending li::before { content: counter(t); font: 800 26px/1 var(--serif); color: var(--brand); grid-row: span 2; }
.trending a { font-weight: 600; line-height: 1.35; }
@media (max-width: 960px) { .rail { position: static; } }

/* Article ----------------------------------------------------------------- */
.story { max-width: 760px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--brand); font-weight: 600; }
.story-title { font: 800 clamp(28px, 4vw, 42px)/1.14 var(--serif); letter-spacing: -0.02em; margin: 0; }
.byline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 14px 0; margin: 8px 0 20px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.byline strong { display: block; font-size: 15px; }
.share { display: flex; gap: 8px; }
.share a, .share button { font: 600 13px var(--sans); padding: 7px 12px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--brand); color: var(--brand); }
.quickread { background: var(--wash); border-left: 4px solid var(--brand); padding: 16px 20px; margin: 24px 0; }
.quickread h2 { font: 700 16px/1.2 var(--sans); margin: 0 0 8px; }
.quickread ul { margin: 0; padding-left: 20px; }
.quickread li { margin: 4px 0; }
.story-body p { font: 400 19px/1.7 var(--serif); margin: 0 0 1.1em; max-width: 68ch; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 28px 0; }
.tags li { font-size: 13px; font-weight: 600; background: var(--wash); padding: 6px 12px; border-radius: 999px; }
.related h2 { font: 800 20px/1.2 var(--serif); border-top: 3px solid var(--ink); padding-top: 10px; margin: 36px 0 0; }
.empty { color: var(--muted); }

/* Footer ------------------------------------------------------------------ */
.sitefoot { background: var(--navy); color: #C9D2E0; margin-top: 24px; }
.foot-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-top: 36px; padding-bottom: 24px; }
.logo-small .logo-word { font-size: 22px; color: #fff; }
.logo-small .logo-mark { width: 24px; height: 24px; }
.logo-small .logo-mark::after { inset: 6px 5px; border-width: 2px; }
.foot-note { max-width: 46ch; font-size: 14px; }
.foot-note a { color: #fff; text-decoration: underline; }
.foot-links { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 28px; font-size: 14px; align-content: start; }
.foot-links a:hover { color: #fff; }
.foot-legal { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; padding-bottom: 20px; font-size: 13px; }

.story-body h2 { font: 800 24px/1.25 var(--serif); margin: 1.6em 0 .6em; }
.preview-bar { background: #FFF1D6; color: #5C3D00; font-weight: 600; font-size: 14px; padding: 10px 0; border-bottom: 1px solid #EBC57A; }
.preview-bar a { color: var(--brand); text-decoration: underline; }
