/* ==================================================
   TRYNEWS — shared design system
   Loaded once, cached by the browser across every page
   (homepage, ~8,700 articles, legal pages). Keep this file
   lean — every byte here is downloaded by first-time visitors
   before anything renders.
   ================================================== */

:root {
  --ink:        #0a0c10;
  --ink-soft:   #12151c;
  --paper:      #f6f4ef;
  --cream:      #ece8de;
  --surface:    #ffffff;
  --accent:     #4f46e5;
  --accent-2:   #06b6d4;
  --accent-ink: #ffffff;
  --muted:      #6b6459;
  --rule:       #ddd6c7;
  --live:       #ef4444;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 8px 24px -12px rgba(10,12,16,0.25);
  --shadow-lg:  0 20px 48px -16px rgba(10,12,16,0.35);
  --maxw:       1280px;
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Source Sans 3', Georgia, serif;
  --font-mono:    'Space Grotesk', ui-monospace, monospace;
}

/* Category accent hues — used for tag chips, card borders, hover glow */
.cat-technology { --cat: #4f46e5; }
.cat-science    { --cat: #0f9d6e; }
.cat-business   { --cat: #b45309; }
.cat-health     { --cat: #be185d; }
.cat-world      { --cat: #0891b2; }
.cat-culture    { --cat: #7c3aed; }
.cat-general, .cat-sports { --cat: #475569; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #fff; }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }

/* ── LIVE PULSE DOT ── */
.pulse-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(239,68,68,0.6);
  animation: pulse 1.8s infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ==================================================
   SITE HEADER — slim, sticky, on every page
   ================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,12,16,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
}

.brand {
  font-family: 'Bebas Neue', var(--font-display);
  font-size: 26px;
  letter-spacing: 0.08em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.brand .accent { color: var(--accent-2); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  justify-content: flex-end;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a, .site-nav button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  color: rgba(255,255,255,0.62);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color .15s ease, background .15s ease;
}
.site-nav a:hover, .site-nav button:hover { color: #fff; background: rgba(255,255,255,0.06); }
.site-nav a.active, .site-nav button.active { color: #fff; background: rgba(79,70,229,0.35); }

/* ── HOMEPAGE MASTHEAD (index only) ── */
.masthead {
  background:
    radial-gradient(ellipse 900px 300px at 15% -20%, rgba(79,70,229,0.35), transparent),
    radial-gradient(ellipse 700px 260px at 100% 0%, rgba(6,182,212,0.25), transparent),
    var(--ink);
  color: var(--paper);
  padding: 56px 24px 40px;
  text-align: center;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}

.masthead-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246,244,239,0.55);
  margin-bottom: 20px;
}
.masthead-eyebrow .sep { color: rgba(246,244,239,0.25); }

.masthead-logo {
  font-family: 'Bebas Neue', var(--font-display);
  font-size: clamp(56px, 9vw, 104px);
  letter-spacing: 0.06em;
  line-height: 1;
}
.masthead-logo .accent {
  background: linear-gradient(100deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.masthead-tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  color: rgba(246,244,239,0.6);
  margin-top: 10px;
  letter-spacing: 0.02em;
}

/* ── TICKER ── */
.ticker {
  background: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 38px;
}
.ticker-label {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: var(--live);
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 16px;
  height: 100%;
  box-shadow: 6px 0 10px -4px rgba(0,0,0,0.35);
}
.ticker-label .pulse-dot { background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,0.6); }
.ticker-track {
  display: flex;
  gap: 56px;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  padding-left: 24px;
  color: rgba(246,244,239,0.85);
  font-size: 13px;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { color: rgba(246,244,239,0.85); }
.ticker-item:hover { color: var(--accent-2); text-decoration: underline; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ==================================================
   AD SLOTS — fixed footprints reserved now so turning
   real ad units on later causes ZERO layout shift (CLS-safe).
   Sizes match the Adsterra units already wired into the
   publishing pipeline: 728x90 leaderboard, 300x250 sidebar,
   native banner, social bar.
   ================================================== */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border: 1px dashed var(--rule);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  overflow: hidden;
}
.ad-slot--leaderboard { min-height: 90px; margin: 24px 0; }
.ad-slot--rect         { min-height: 250px; width: 100%; max-width: 300px; margin: 0 auto 24px; }
.ad-slot--native        { min-height: 180px; margin: 32px 0; }
@media (max-width: 640px) {
  .ad-slot--leaderboard { min-height: 50px; }
}

/* ==================================================
   HERO (homepage top story) — grid-template-areas so the
   breakpoints redefine layout safely without leftover
   grid-column placements dragging in phantom columns.
   ================================================== */
.hero {
  padding: 32px 0 0;
}
.hero-grid {
  display: grid;
  gap: 0;
  grid-template-columns: 1.15fr 1fr 300px;
  grid-template-areas: "main secondary sidebar";
  border-bottom: 2px solid var(--ink);
  padding-bottom: 40px;
  margin-bottom: 40px;
}
.hero-main      { grid-area: main;      padding-right: 32px; border-right: 1px solid var(--rule); }
.hero-secondary { grid-area: secondary; padding: 0 32px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 24px; }
.hero-sidebar   { grid-area: sidebar;   padding-left: 32px; }

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "main secondary"; }
  .hero-sidebar { display: none; }
  .hero-secondary { border-right: none; }
}
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; grid-template-areas: "main" "secondary"; gap: 0; }
  .hero-main { padding-right: 0; border-right: none; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
  .hero-secondary { padding: 24px 0 0; border-right: none; }
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--cat, var(--accent));
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.hero-headline a:hover { color: var(--accent); }

.hero-excerpt { font-size: 17px; color: #3a3a3a; line-height: 1.55; margin-bottom: 16px; }

.article-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.article-meta .dot { color: var(--rule); }

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  transition: gap .15s ease;
}
.read-more:hover { gap: 10px; color: var(--accent); }

.sec-article + .sec-article { padding-top: 24px; border-top: 1px solid var(--rule); }
.sec-headline { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
.sec-headline a:hover { color: var(--accent); }

.sidebar-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.sidebar-article { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.sidebar-article:first-child { padding-top: 0; }
.sidebar-num { font-family: 'Bebas Neue', var(--font-display); font-size: 26px; color: var(--rule); line-height: 1; width: 28px; flex-shrink: 0; }
.sidebar-headline { font-family: var(--font-display); font-size: 14px; font-weight: 600; line-height: 1.3; }
.sidebar-headline a:hover { color: var(--accent); }

/* ==================================================
   SECTIONS + ARTICLE CARDS (reused: homepage grids AND
   article-page "related" widgets share this card look)
   ================================================== */
.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.section-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.section-rule { flex: 1; height: 1px; background: var(--rule); }
.section-viewall { font-family: var(--font-display); font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.section-viewall:hover { color: var(--accent); text-decoration: underline; }

section + section, .ad-slot { margin-top: 48px; }
section:first-of-type { margin-top: 0; }

.article-grid   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.article-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.article-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--cat, var(--accent));
}
.card-headline { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
.card-headline a:hover { color: var(--accent); }
.card-excerpt {
  font-size: 14px;
  color: #55524a;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Feature strip — dark accent band, 3-up */
.feature-strip {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 36px;
  position: relative;
  overflow: hidden;
}
.feature-strip::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 500px 220px at 100% 0%, rgba(6,182,212,0.18), transparent);
  pointer-events: none;
}
.feature-article { position: relative; padding: 0 28px; }
.feature-article:first-child { padding-left: 0; }
.feature-article:last-child { padding-right: 0; }
.feature-divider { width: 1px; background: rgba(255,255,255,0.14); }
.feature-headline { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.3; margin-bottom: 10px; }
.feature-headline a:hover { color: var(--accent-2); }
.feature-excerpt { font-size: 14px; color: rgba(246,244,239,0.7); line-height: 1.5; }

/* Loading skeletons */
.loading-pulse {
  background: linear-gradient(90deg, var(--cream) 25%, #f5f2ea 37%, var(--cream) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==================================================
   ARTICLE PAGE
   ================================================== */
.article-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 0;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: start;
}
@media (max-width: 900px) {
  .article-wrap { grid-template-columns: 1fr; gap: 40px; }
}

.article-header { padding-bottom: 28px; border-bottom: 2px solid var(--ink); margin-bottom: 28px; }
.article-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.article-excerpt {
  font-size: 19px;
  color: #3a3a3a;
  line-height: 1.55;
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  margin-bottom: 18px;
}
.article-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.article-body { font-size: 18px; line-height: 1.8; color: #171613; }
.article-body p { margin-bottom: 22px; }
.article-body h2 {
  font-family: var(--font-display);
  font-size: 25px; font-weight: 700;
  margin: 38px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.article-body h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 28px 0 10px; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 28px 0; padding: 14px 22px;
  background: var(--cream);
  font-style: italic; font-size: 19px; color: #333;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body ul, .article-body ol { margin: 0 0 22px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { font-weight: 700; }

.article-tags { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tags-label { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tag { background: var(--cream); border: 1px solid var(--rule); font-size: 12px; padding: 5px 12px; border-radius: 999px; font-weight: 600; }
.tag:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.related-articles { margin-top: 40px; padding: 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); border-left: 3px solid var(--accent); }
.related-articles h3 { font-family: var(--font-display); font-size: 15px; margin-bottom: 12px; }
.related-articles ul { list-style: none; margin: 0; padding: 0; }
.related-articles li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.related-articles li:last-child { border-bottom: none; }
.related-articles a { color: var(--accent); font-weight: 600; font-size: 14px; }
.related-articles a:hover { text-decoration: underline; }

/* Sidebar (article page) */
.article-sidebar { display: flex; flex-direction: column; gap: 32px; }
.sidebar-widget-title {
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 14px;
}
.fb-like-box-wrap { padding: 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); }

/* ==================================================
   LEGAL / STATIC PAGES
   ================================================== */
.page-hero {
  background: var(--ink); color: var(--paper);
  padding: 56px 24px;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}
.page-hero-inner { max-width: 820px; margin: 0 auto; }
.page-eyebrow { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 10px; }
.page-title { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); font-weight: 700; letter-spacing: -0.01em; }
.page-subtitle { margin-top: 12px; color: rgba(246,244,239,0.7); font-size: 16px; max-width: 640px; }

.page-body { max-width: 820px; margin: 0 auto; padding: 48px 24px 64px; }
.page-body h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 36px 0 12px; }
.page-body h2:first-child { margin-top: 0; }
.page-body p { margin-bottom: 16px; line-height: 1.7; color: #26241f; }
.page-body ul { margin: 0 0 16px 22px; line-height: 1.7; color: #26241f; }
.page-body li { margin-bottom: 6px; }
.page-body a { color: var(--accent); font-weight: 600; }
.page-body a:hover { text-decoration: underline; }
.page-note {
  background: var(--cream); border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px; margin: 20px 0; font-size: 15px; color: #3a3a3a;
}
.contact-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.contact-card h3 { font-family: var(--font-display); font-size: 15px; margin-bottom: 6px; }
.contact-card a { color: var(--accent); }

/* ==================================================
   FOOTER — shared across all pages
   ================================================== */
footer.site-footer { background: var(--ink); color: rgba(246,244,239,0.6); margin-top: 64px; }
.footer-grid { max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 24px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand { font-family: 'Bebas Neue', var(--font-display); font-size: 26px; color: #fff; letter-spacing: 0.08em; margin-bottom: 12px; }
.footer-brand .accent { color: var(--accent-2); }
.footer-about { font-size: 14px; line-height: 1.6; max-width: 320px; }
.footer-col-title { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(246,244,239,0.4); margin-bottom: 14px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto; padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; flex-wrap: wrap; gap: 12px;
}
.footer-legal { display: flex; gap: 20px; }
.footer-legal a:hover { color: #fff; }

/* ==================================================
   RESPONSIVE
   ================================================== */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .article-grid, .article-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .feature-strip { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
  .feature-article { padding: 0 !important; }
  .feature-divider { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .article-grid, .article-grid-3 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .site-header-inner { padding: 0 16px; }
  .site-nav { font-size: 11px; }
  .masthead { padding: 40px 20px 32px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .article-grid, .article-grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .article-wrap { padding: 28px 16px 0; }
}

@media (max-width: 480px) {
  .masthead-logo { font-size: 52px; }
  .hero-headline { font-size: 26px; }
}
