/* assets/css/style.css — 4AiTimes Premium News Design */

/* =========================================================
   FONTS & CUSTOM PROPERTIES
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  /* Brand colors */
  --c-red:        #e8202b;
  --c-red-dark:   #b51018;
  --c-ink:        #0d0d0d;
  --c-ink-mid:    #1f1f1f;
  --c-ink-soft:   #333333;
  --c-grey-dark:  #555555;
  --c-grey:       #888888;
  --c-grey-light: #bbbbbb;
  --c-border:     #e5e5e5;
  --c-bg:         #fafaf8;
  --c-bg-warm:    #f5f4f0;
  --c-white:      #ffffff;

  /* Dark mode */
  --c-dm-bg:      #0f0f0f;
  --c-dm-surface: #1a1a1a;
  --c-dm-border:  #2a2a2a;
  --c-dm-text:    #e8e8e8;
  --c-dm-muted:   #888;

  /* Typography */
  --f-display: 'Playfair Display', Georgia, serif;
  --f-body:    'Source Serif 4', Georgia, serif;
  --f-ui:      'DM Sans', system-ui, sans-serif;

  /* Spacing scale */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;

  /* Layout */
  --max-width:    1280px;
  --gutter:       24px;
  --nav-height:   60px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  200ms;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-ui);
  background: var(--c-bg);
  color: var(--c-ink);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

body.dark-mode {
  --c-bg:         var(--c-dm-bg);
  --c-bg-warm:    var(--c-dm-surface);
  --c-ink:        var(--c-dm-text);
  --c-ink-soft:   #c8c8c8;
  --c-border:     var(--c-dm-border);
  --c-white:      #1a1a1a;
  --c-grey:       var(--c-dm-muted);
}

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

/* =========================================================
   UTILITY CLASSES
   ========================================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.cat-badge {
  display: inline-block;
  font-family: var(--f-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--c-red);
  color: var(--c-white);
  white-space: nowrap;
}
.cat-badge.world    { background: #1a3a6b; }
.cat-badge.tech     { background: #0f766e; }
.cat-badge.business { background: #b45309; }
.cat-badge.sports   { background: #15803d; }
.cat-badge.science  { background: #7c3aed; }
.cat-badge.health   { background: #be185d; }

/* =========================================================
   BREAKING NEWS TICKER
   ========================================================= */
.breaking-bar {
  background: var(--c-red);
  color: #fff;
  height: 36px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  z-index: 100;
}
.breaking-label {
  flex-shrink: 0;
  background: #9b0e14;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  gap: 6px;
}
.breaking-label .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.ticker-inner {
  display: flex;
  gap: 0;
  animation: ticker-scroll 45s linear infinite;
  white-space: nowrap;
}
.ticker-inner:hover { animation-play-state: paused; }
.ticker-item {
  padding: 0 32px;
  font-family: var(--f-ui);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  transition: opacity var(--dur);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ticker-item::after { content: '·'; opacity: .4; }
.ticker-item:hover  { opacity: .85; }

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

/* =========================================================
   NAVIGATION
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--c-white);
  border-bottom: 2px solid var(--c-red);
  height: var(--nav-height);
}
body.dark-mode .navbar { background: var(--c-dm-surface); }

.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--c-red);
  letter-spacing: -.02em;
  white-space: nowrap;
  margin-right: auto;
  text-decoration: none;
}
.nav-logo .dot { color: var(--c-ink); }

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  height: 100%;
}
.nav-links li a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  font-family: var(--f-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color var(--dur), border-color var(--dur);
}
.nav-links li a:hover,
.nav-links li a.active { color: var(--c-red); border-color: var(--c-red); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--c-bg-warm);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 5px 12px;
  gap: 6px;
  transition: border-color var(--dur);
}
.search-box:focus-within { border-color: var(--c-red); }
.search-box input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--f-ui);
  font-size: 12.5px;
  color: var(--c-ink);
  width: 150px;
}
body.dark-mode .search-box { background: var(--c-dm-surface); }
body.dark-mode .search-box input { color: var(--c-dm-text); }

.btn-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: var(--c-bg-warm);
  border: 1px solid var(--c-border);
  transition: background var(--dur);
}
.btn-icon:hover { background: var(--c-border); }

.nav-hamburger { display: none; }

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero-section {
  position: relative;
  overflow: hidden;
  background: var(--c-ink-mid);
  margin-bottom: var(--space-2xl);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 400px;
  min-height: 500px;
}

.hero-image-wrap {
  position: relative;
  overflow: hidden;
}
.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 6s ease;
}
.hero-section:hover .hero-image-wrap img { transform: scale(1.03); }

.hero-image-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 40%, rgba(13,13,13,.95) 100%);
}

.hero-content {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--c-ink-mid);
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.hero-eyebrow .cat-badge { font-size: 10px; }
.hero-eyebrow .time {
  font-family: var(--f-ui);
  font-size: 11px;
  color: var(--c-grey-light);
  letter-spacing: .04em;
}

.hero-headline {
  font-family: var(--f-display);
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -.01em;
}
.hero-headline:hover { color: #e8c8c8; }

.hero-summary {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,.75);
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-ui);
  font-size: 11.5px;
  color: rgba(255,255,255,.5);
}
.hero-meta .source {
  font-weight: 600;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hero-meta .sep { opacity: .4; }

.hero-short-url {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.hero-short-url a {
  font-family: var(--f-ui);
  font-size: 11px;
  color: rgba(255,255,255,.5);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-short-url a:hover { color: rgba(255,255,255,.8); }

/* =========================================================
   SECTION DIVIDERS & HEADERS
   ========================================================= */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--c-border);
}
.section-title {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--c-ink);
}
.section-line {
  flex: 1;
  height: 1px;
  background: var(--c-border);
}
.section-more {
  font-family: var(--f-ui);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-red);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--dur);
}
.section-more:hover { gap: 8px; }

/* =========================================================
   NEWS GRID
   ========================================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}
.news-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.news-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* =========================================================
   ARTICLE CARD
   ========================================================= */
.card {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  cursor: pointer;
}
body.dark-mode .card { background: var(--c-dm-surface); border-color: var(--c-dm-border); }

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
body.dark-mode .card:hover { box-shadow: 0 12px 32px rgba(0,0,0,.5); }

.card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--c-bg-warm);
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.card:hover .card-image img { transform: scale(1.06); }
.card-image .cat-badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-headline {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--c-ink);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--dur);
}
.card:hover .card-headline { color: var(--c-red); }

.card-summary {
  font-family: var(--f-body);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--c-grey-dark);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
body.dark-mode .card-summary { color: var(--c-dm-muted); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-ui);
  font-size: 11px;
  color: var(--c-grey);
  flex-wrap: wrap;
}
.card-meta .source {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--c-grey-dark);
}
body.dark-mode .card-meta .source { color: var(--c-dm-muted); }
.card-meta .sep { opacity: .4; }
.card-short-url {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
  font-family: var(--f-ui);
  font-size: 10.5px;
  color: var(--c-grey);
  display: flex;
  align-items: center;
  gap: 5px;
}
.card-short-url a { color: var(--c-red); font-weight: 600; }
.card-short-url a:hover { text-decoration: underline; }

/* Card: Featured (large) */
.card.card-featured {
  grid-column: span 2;
}
.card.card-featured .card-headline { font-size: 20px; -webkit-line-clamp: 4; }

/* Card: List style */
.card-list {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--c-border);
  border-radius: 0;
  padding: 14px 0;
}
.card-list:hover { transform: none; box-shadow: none; }
.card-list .card-image {
  flex-shrink: 0;
  width: 90px;
  height: 66px;
  aspect-ratio: unset;
  border-radius: 2px;
}
.card-list .card-body { padding: 0; }
.card-list .card-headline { font-size: 14px; -webkit-line-clamp: 2; }
.card-list .card-summary { display: none; }

/* =========================================================
   HOMEPAGE LAYOUT
   ========================================================= */
.homepage-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  margin-bottom: var(--space-2xl);
}

.sidebar {
  border-left: 1px solid var(--c-border);
  padding-left: 32px;
}
body.dark-mode .sidebar { border-color: var(--c-dm-border); }

.sidebar-section { margin-bottom: 36px; }
.sidebar-title {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c-red);
  display: inline-block;
  letter-spacing: -.01em;
}

/* Trending list */
.trending-list { list-style: none; }
.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
}
body.dark-mode .trending-item { border-color: var(--c-dm-border); }
.trending-item:hover .trending-title { color: var(--c-red); }
.trending-num {
  flex-shrink: 0;
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--c-border);
  line-height: 1;
  width: 28px;
  text-align: right;
}
.trending-title {
  font-family: var(--f-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--c-ink);
  transition: color var(--dur);
}
.trending-time {
  font-family: var(--f-ui);
  font-size: 10.5px;
  color: var(--c-grey);
  margin-top: 3px;
}

/* =========================================================
   CATEGORY SECTIONS
   ========================================================= */
.category-section { margin-bottom: var(--space-2xl); }

/* =========================================================
   ARTICLE PAGE
   ========================================================= */
.article-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  max-width: var(--max-width);
  margin: 48px auto;
  padding: 0 var(--gutter);
}

.article-main {}

.article-header { margin-bottom: 32px; }

.article-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.article-headline {
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--c-ink);
  margin-bottom: 20px;
}

.article-summary {
  font-family: var(--f-body);
  font-size: 19px;
  line-height: 1.65;
  color: var(--c-grey-dark);
  margin-bottom: 24px;
  font-style: italic;
  font-weight: 300;
  padding-left: 16px;
  border-left: 3px solid var(--c-red);
}
body.dark-mode .article-summary { color: var(--c-dm-muted); }

.article-byline {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 28px;
}
body.dark-mode .article-byline { border-color: var(--c-dm-border); }

.byline-source {
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-grey-dark);
}
.byline-date {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--c-grey);
}
.byline-sep { color: var(--c-border); }

.share-bar {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.share-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: var(--c-bg-warm);
  border: 1px solid var(--c-border);
  transition: background var(--dur), color var(--dur);
  color: var(--c-grey-dark);
}
.share-btn:hover { background: var(--c-ink); color: #fff; }

.article-hero-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 10px;
}
.article-image-credit {
  font-family: var(--f-ui);
  font-size: 10.5px;
  color: var(--c-grey);
  margin-bottom: 32px;
  text-align: right;
}

/* Article body typography */
.article-body {
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.8;
  color: var(--c-ink-soft);
}
body.dark-mode .article-body { color: #c8c8c8; }

.article-body p {
  margin-bottom: 1.5em;
}
.article-body p:first-child::first-letter {
  float: left;
  font-family: var(--f-display);
  font-size: 4.5em;
  line-height: 0.75;
  margin: 0.05em 0.08em 0 0;
  color: var(--c-red);
  font-weight: 700;
}
.article-body h2 {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 700;
  margin: 2em 0 .8em;
  color: var(--c-ink);
}
.article-body h3 {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 700;
  margin: 1.6em 0 .6em;
}
.article-body blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  border-left: 4px solid var(--c-red);
  background: var(--c-bg-warm);
  font-style: italic;
  font-size: 19px;
  line-height: 1.65;
  color: var(--c-ink-soft);
  border-radius: 0 4px 4px 0;
}
body.dark-mode .article-body blockquote { background: var(--c-dm-surface); }

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 1.5em;
}
.article-body li { margin-bottom: .5em; }
.article-body strong { font-weight: 600; color: var(--c-ink); }

/* AI badge */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #7dd3fc;
  font-family: var(--f-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 24px;
}
.ai-badge svg { width: 12px; height: 12px; }

/* Short URL display */
.article-short-url {
  background: var(--c-bg-warm);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 14px 16px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
body.dark-mode .article-short-url { background: var(--c-dm-surface); border-color: var(--c-dm-border); }
.article-short-url .label {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--c-grey);
  flex-shrink: 0;
}
.article-short-url .url {
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--c-red);
  font-weight: 600;
  flex: 1;
}
.copy-btn {
  padding: 5px 12px;
  background: var(--c-red);
  color: #fff;
  border-radius: 2px;
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background var(--dur);
}
.copy-btn:hover { background: var(--c-red-dark); }
.copy-btn.copied { background: #15803d; }

/* Related articles */
.related-articles { margin-top: 48px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 16px;
}

/* Article sidebar */
.article-sidebar {}

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 32px 0;
}
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--c-border);
  border-radius: 2px;
  color: var(--c-grey-dark);
  background: var(--c-white);
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.page-btn:hover, .page-btn.active {
  background: var(--c-red);
  color: #fff;
  border-color: var(--c-red);
}
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* =========================================================
   LOAD MORE BUTTON
   ========================================================= */
.load-more-wrap {
  text-align: center;
  padding: 24px 0 48px;
}
.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: transparent;
  border: 2px solid var(--c-ink);
  color: var(--c-ink);
  font-family: var(--f-ui);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background var(--dur), color var(--dur);
}
.btn-load-more:hover { background: var(--c-ink); color: #fff; }
.btn-load-more.loading { opacity: .6; pointer-events: none; }
body.dark-mode .btn-load-more { border-color: var(--c-dm-text); color: var(--c-dm-text); }

/* =========================================================
   SEARCH RESULTS PAGE
   ========================================================= */
.search-header {
  padding: 32px 0 24px;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 32px;
}
.search-header h1 {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 700;
}
.search-count {
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--c-grey);
  margin-top: 6px;
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  background: var(--c-ink-mid);
  color: rgba(255,255,255,.6);
  padding: 48px 0 24px;
  margin-top: var(--space-2xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand .logo {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
}
.footer-brand p {
  font-family: var(--f-body);
  font-size: 13.5px;
  line-height: 1.65;
  max-width: 280px;
}
.footer-col h4 {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a {
  font-family: var(--f-ui);
  font-size: 13px;
  color: rgba(255,255,255,.6);
  transition: color var(--dur);
}
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--f-ui);
  font-size: 11.5px;
  color: rgba(255,255,255,.3);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: var(--c-red); }

/* =========================================================
   TOAST / COPY FEEDBACK
   ========================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--c-ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* =========================================================
   LOADING SPINNER
   ========================================================= */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--c-border);
  border-top-color: var(--c-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   404 PAGE
   ========================================================= */
.page-404 {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px var(--gutter);
}
.page-404 .num {
  font-family: var(--f-display);
  font-size: 120px;
  font-weight: 900;
  color: var(--c-red);
  line-height: 1;
}
.page-404 h1 {
  font-family: var(--f-display);
  font-size: 32px;
  margin: 16px 0 8px;
}
.page-404 p {
  font-family: var(--f-body);
  font-size: 16px;
  color: var(--c-grey);
  max-width: 400px;
}

/* =========================================================
   DARK MODE TOGGLE
   ========================================================= */
.dark-toggle {
  position: relative;
  width: 44px; height: 24px;
  background: var(--c-border);
  border-radius: 12px;
  transition: background var(--dur);
  cursor: pointer;
  flex-shrink: 0;
}
.dark-toggle.active { background: var(--c-ink-mid); }
.dark-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--dur) var(--ease);
}
.dark-toggle.active::after { transform: translateX(20px); }

/* =========================================================
   PLACEHOLDER IMAGE
   ========================================================= */
.img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #f0eeea 0%, #e8e6e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-grey-light);
  font-size: 32px;
}
body.dark-mode .img-placeholder { background: linear-gradient(135deg, #222 0%, #1a1a1a 100%); }

/* =========================================================
   LAZY-LOAD IMAGE STATES
   ========================================================= */
/* Thumbnail shimmer skeleton while loading */
.card-image img[data-src],
.card-list .card-image img[data-src] {
  opacity: 0;
  transition: opacity 0.35s ease;
  background: linear-gradient(90deg, #f0eeea 25%, #e4e2dc 50%, #f0eeea 75%);
  background-size: 200% 100%;
  animation: img-shimmer 1.4s ease-in-out infinite;
}
body.dark-mode .card-image img[data-src] {
  background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
  background-size: 200% 100%;
}
/* Fade in once loaded */
.card-image img.loaded {
  opacity: 1;
  animation: none;
  background: none;
}
@keyframes img-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Ensure placeholder covers the full card-image area */
.card-image {
  position: relative;
  background: linear-gradient(90deg, #f0eeea 25%, #e4e2dc 50%, #f0eeea 75%);
  background-size: 200% 100%;
  animation: img-shimmer 1.4s ease-in-out infinite;
}
body.dark-mode .card-image {
  background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
  background-size: 200% 100%;
}
/* Stop shimmer on card-image once child img is loaded */
.card-image:has(img.loaded),
.card-image:has(.img-placeholder) {
  animation: none;
  background: var(--c-bg-warm);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .homepage-grid { grid-template-columns: 1fr 280px; gap: 32px; }
}

@media (max-width: 900px) {
  :root { --nav-height: 54px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image-wrap { aspect-ratio: 16/8; }
  .hero-image-overlay { background: linear-gradient(180deg, transparent 50%, rgba(13,13,13,.97) 100%); }
  .hero-content { background: rgba(13,13,13,.9); padding: 28px 24px; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid.grid-3 { grid-template-columns: repeat(2, 1fr); }
  .card.card-featured { grid-column: span 1; }
  .homepage-grid { grid-template-columns: 1fr; }
  .sidebar { border-left: none; padding-left: 0; border-top: 1px solid var(--c-border); padding-top: 32px; }
  .article-page { grid-template-columns: 1fr; gap: 32px; }
  .article-sidebar { border-top: 1px solid var(--c-border); padding-top: 32px; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .nav-links, .search-box { display: none; }
  .nav-hamburger { display: flex; }
  .news-grid { grid-template-columns: 1fr; gap: 0; }
  .card { border-radius: 0; border-left: none; border-right: none; border-bottom: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .breaking-label { padding: 0 10px; font-size: 9px; }
  .article-headline { font-size: 26px; }
  .article-body { font-size: 16px; }
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeInUp 0.5s var(--ease) both;
}
.animate-in:nth-child(2) { animation-delay: 0.08s; }
.animate-in:nth-child(3) { animation-delay: 0.16s; }
.animate-in:nth-child(4) { animation-delay: 0.24s; }

/* Print */
@media print {
  .breaking-bar, .navbar, footer, .sidebar, .related-articles { display: none; }
  .article-page { grid-template-columns: 1fr; }
}

/* ── Font Awesome category icons ──────────────────────────────── */
.section-title i,
.footer-col a i { width: 1.1em; text-align: center; }
.section-title i { color: var(--c-red); margin-right: 4px; }
.footer-col a i  { color: rgba(255,255,255,.45); margin-right: 6px; }

/* sidebar-title icon */
.sidebar-title i { color: var(--c-red); margin-right: 6px; }

/* img-placeholder FA icon */
.img-placeholder i { font-size: inherit; color: inherit; }

