@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&display=swap');

/* ─────────────────────────────────────────────
   Tokens
───────────────────────────────────────────── */
:root {
  --ink:      #0e0c0a;
  --ink-2:    #3a342c;
  --ink-3:    #7a6e60;
  --paper:    #fdf8f2;
  --paper-2:  #f5ede0;
  --paper-3:  #ecddc8;

  --gold:     #f59e0b;
  --amber:    #ea6c1e;
  --coral:    #dc4040;
  --rose:     #b5305a;

  --sunrise:  linear-gradient(105deg, #f59e0b 0%, #ea6c1e 35%, #dc4040 65%, #b5305a 100%);
  --sunrise-text: linear-gradient(105deg, #f59e0b, #ea6c1e 40%, #dc4040 70%, #b5305a);

  --c-politics:      #dc4040;
  --c-sports:        #2563eb;
  --c-business:      #d97706;
  --c-technology:    #7c3aed;
  --c-entertainment: #ea6c1e;
  --c-health:        #16a34a;
  --c-science:       #0891b2;
  --c-positive:      #d97706;

  --r:  16px;
  --rs: 10px;
  --max-w: 1200px;
  --t: 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ─────────────────────────────────────────────
   Hero header
───────────────────────────────────────────── */
.site-header {
  position: relative;
  background: var(--ink);
  overflow: hidden;
}

/* Full-bleed sunrise wash behind the header */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sunrise);
  opacity: 0.18;
  pointer-events: none;
}

/* Noise grain texture overlay */
.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
}

.header-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.site-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.site-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  background: var(--sunrise-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-date {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: flex-end;
  padding-bottom: 0.3rem;
}

/* Nav inside header */
.section-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.1rem;
}
.section-nav::-webkit-scrollbar { display: none; }

.section-nav a {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.10);
  transition: color var(--t), background var(--t), border-color var(--t);
}

.section-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
}

/* ─────────────────────────────────────────────
   Main container
───────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

/* ─────────────────────────────────────────────
   Error
───────────────────────────────────────────── */
.error-banner {
  background: #fff0f0;
  border-left: 4px solid var(--coral);
  padding: 1rem 1.25rem;
  border-radius: var(--rs);
  font-size: 0.88rem;
  color: #7a1c1c;
}

/* ─────────────────────────────────────────────
   Section
───────────────────────────────────────────── */
.news-section {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.85rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1;
}

/* Colour accent on section title per category */
.category-politics    .section-title { color: var(--c-politics); }
.category-sports      .section-title { color: var(--c-sports); }
.category-business    .section-title { color: var(--c-business); }
.category-technology  .section-title { color: var(--c-technology); }
.category-entertainment .section-title { color: var(--c-entertainment); }
.category-health      .section-title { color: var(--c-health); }
.category-science     .section-title { color: var(--c-science); }


.section-rule {
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  margin-bottom: -0.5rem;
}

.category-politics    .section-rule { background: var(--c-politics); }
.category-sports      .section-rule { background: var(--c-sports); }
.category-business    .section-rule { background: var(--c-business); }
.category-technology  .section-rule { background: var(--c-technology); }
.category-entertainment .section-rule { background: var(--c-entertainment); }
.category-health      .section-rule { background: var(--c-health); }
.category-science     .section-rule { background: var(--c-science); }
#positive             .section-rule { background: var(--c-positive); }

/* ─────────────────────────────────────────────
   Card grid — hero + supporting
───────────────────────────────────────────── */
.headline-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.5rem;
  counter-reset: headline-counter;
}

.headline-card:first-child {
  grid-column: 1;
  grid-row: 1 / 3;
}

/* ─────────────────────────────────────────────
   Card
───────────────────────────────────────────── */
.headline-card {
  background: #fff;
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  counter-increment: headline-counter;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
  transition: transform var(--t), box-shadow var(--t);
}

.headline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 12px 40px rgba(0,0,0,0.12);
}

/* Rank chip */
.headline-card::before {
  content: counter(headline-counter);
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 3;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.category-card-politics::before     { background: var(--c-politics); }
.category-card-sports::before       { background: var(--c-sports); }
.category-card-business::before     { background: var(--c-business); }
.category-card-technology::before   { background: var(--c-technology); }
.category-card-entertainment::before { background: var(--c-entertainment); }
.category-card-health::before       { background: var(--c-health); }
.category-card-science::before      { background: var(--c-science); }
.positive-card::before              { background: var(--c-positive); }

/* Image */
.card-image-link {
  display: block;
  overflow: hidden;
  background: var(--paper-3);
  aspect-ratio: 16/9;
  flex-shrink: 0;
}

.headline-card:first-child .card-image-link {
  aspect-ratio: unset;
  flex: 1;
  min-height: 220px;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--t), filter 0.45s;
  filter: brightness(0.96) saturate(0.9);
}

.headline-card:hover .card-image {
  transform: scale(1.06);
  filter: brightness(1) saturate(1);
}

/* Body */
.card-body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.headline-card:first-child .card-body {
  padding: 1.25rem 1.4rem 1.4rem;
}

.card-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1rem;
  line-height: 1.38;
  color: var(--ink);
  transition: color var(--t);
}

.headline-card:first-child .card-title {
  font-size: 1.45rem;
  line-height: 1.28;
}

.headline-card:hover .card-title { color: var(--amber); }

.card-summary {
  font-size: 0.8rem;
  color: var(--ink-2);
  line-height: 1.6;
  display: none;
}

.headline-card:first-child .card-summary { display: block; }

/* Meta */
.card-meta {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--paper-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  font-size: 0.69rem;
  color: var(--ink-3);
}

.publisher {
  font-weight: 700;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.author { font-style: italic; }

.date { margin-left: auto; color: var(--ink-3); }

.country-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--paper-3);
}

.sentiment-badge {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #fef9ec;
  color: var(--gold);
  border: 1px solid #fde68a;
}

/* ─────────────────────────────────────────────
   Empty state
───────────────────────────────────────────── */
.empty-state {
  font-size: 0.85rem;
  color: var(--ink-3);
  padding: 2rem;
  text-align: center;
  background: var(--paper-2);
  border: 1.5px dashed var(--paper-3);
  border-radius: var(--r);
}

/* ─────────────────────────────────────────────
   Footer
───────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.5);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

/* Sunrise glow at top of footer */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--sunrise);
}

.footer-inner-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-tomorrow {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  text-align: center;
  background: var(--sunrise-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.9;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-credit {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}

.footer-credit a {
  color: rgba(255,255,255,0.45);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-credit a:hover { color: rgba(255,255,255,0.75); }

.bmc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--rs);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
  white-space: nowrap;
}

.bmc-btn:hover {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.35);
  color: var(--gold);
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────────
   Responsive
───────────────────────────────────────────── */
@media (max-width: 900px) {
  .headline-list {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: unset;
  }
  .headline-card:first-child { grid-column: 1 / 3; grid-row: unset; }
  .headline-card:first-child .card-image-link { aspect-ratio: 16/7; flex: unset; }
  .headline-card:nth-child(n) { grid-column: unset; grid-row: unset; }
}

@media (max-width: 580px) {
  .headline-list { grid-template-columns: 1fr; }
  .headline-card:first-child { grid-column: 1; }
  .headline-card:first-child .card-image-link { aspect-ratio: 4/3; }
  .container { padding: 2.5rem 1.25rem 4rem; }
  .header-inner { padding: 2rem 1.25rem 1.5rem; }
  .site-title { font-size: 3rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
