/* ============================================================
   THE HIDDEN REPORTER — Design System v2
   Modern · Minimal · Bloomberg × Verge × FT inspired
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --white: #ffffff;
  --black: #0a0a0a;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d1d1d6;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-900: #18181b;
  --accent: #dc2626;
  --accent-dark: #b91c1c;
  --blue: #2563eb;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --gap: 24px;
  --radius: 6px;
  --radius-lg: 12px;
  --max-w: 1280px;
  --article-w: 740px;

  --header-h: 64px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.10), 0 8px 10px rgba(0, 0, 0, 0.04);

  --transition: 0.18s ease;
  --transition-slow: 0.32s ease;
}

/* ── Reset ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  /* prevent horizontal scroll globally */
}

body {
  font-family: var(--sans);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-width: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

input,
textarea,
select {
  font-family: inherit;
}

/* ── Container ────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow var(--transition), padding var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: var(--gap);
  overflow: hidden;
  /* never wider than viewport */
  box-sizing: border-box;
  width: 100%;
}

/* Logo */
.logo-link {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  flex-shrink: 1;
  /* allow logo to compress rather than overflow */
  min-width: 0;
  overflow: hidden;
}

.logo-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--black);
  letter-spacing: -0.01em;
}

.logo-tagline {
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-top: 1px;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.main-nav a {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-600);
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--black);
  background: var(--gray-100);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--gray-600);
  transition: color var(--transition), background var(--transition);
}

.header-btn:hover {
  color: var(--black);
  background: var(--gray-100);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.nav-toggle:hover {
  background: var(--gray-100);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--gray-600);
  margin: 0 auto;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Search bar */
.header-search-bar {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px var(--gap);
  box-shadow: var(--shadow-md);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.header-search-bar.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.search-form {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--black);
  background: var(--gray-50);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.search-input:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
  background: var(--white);
}

.search-btn {
  height: 44px;
  padding: 0 20px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: opacity var(--transition);
}

.search-btn:hover {
  opacity: 0.85;
}

/* ── Breaking news bar ────────────────────────────────────── */
.breaking-bar {
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  height: 36px;
  width: 100%;
  max-width: 100vw;
}

.breaking-label {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--white);
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}

.breaking-scroll {
  flex: 1;
  overflow: hidden;
  padding: 0 16px;
}

.breaking-scroll a {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  transition: opacity var(--transition);
}

.breaking-scroll a:hover {
  opacity: 0.8;
}

/* ── Trending bar ─────────────────────────────────────────── */
.trending-bar {
  border-bottom: 1px solid var(--gray-200);
  padding: 10px var(--gap);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: var(--max-w);
  margin: 0 auto;
}

.trending-bar::-webkit-scrollbar {
  display: none;
}

.trending-label {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
  white-space: nowrap;
  flex-shrink: 0;
}

.trending-tag {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-700);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.trending-tag:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.site-main {
  padding-top: 0;
  min-width: 0;
  overflow-x: hidden;
}

/* Two-column home layout */
.layout-home {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: var(--gap) var(--gap) calc(var(--gap)*3);
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: calc(var(--gap)*2);
  align-items: start;
  box-sizing: border-box;
}

/* Direct children of grid layouts need min-width:0 to prevent overflow */
.home-main,
.article-main {
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}

/* Two-column article layout */
.layout-article {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--gap)*2) var(--gap) calc(var(--gap)*3);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: calc(var(--gap)*2);
  align-items: start;
  box-sizing: border-box;
}

/* Single column default layout */
.layout-default {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--gap)*2) var(--gap) calc(var(--gap)*3);
  box-sizing: border-box;
}

/* Static pages */
.static-page {
  max-width: var(--article-w);
  margin: 0 auto;
  padding: calc(var(--gap)*2) var(--gap) calc(var(--gap)*3);
}

.static-page h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  margin-bottom: calc(var(--gap)*1.5);
  line-height: 1.2;
}

.static-page h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: calc(var(--gap)*1.5) 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.static-page p,
.static-page ul,
.static-page ol {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--gray-700);
  margin-bottom: 14px;
}

.static-page li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 6px;
}

.static-page li::before {
  content: '·';
  position: absolute;
  left: 6px;
  color: var(--gray-400);
}

.static-page a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--black);
}

.section-title {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
}

.section-link {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  transition: color var(--transition);
}

.section-link:hover {
  color: var(--black);
}

/* ============================================================
   ARTICLE CARDS
   ============================================================ */

/* ── Category chip ── */
.card-category {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── Card meta ── */
.card-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.card-meta-dot {
  font-size: 0.5rem;
}

/* ── Card title ── */
.card-title {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--black);
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Card summary ── */
.card-summary {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Card image ── */
.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--gray-100);
  border-radius: calc(var(--radius) - 1px);
  transition: transform 0.3s ease;
}

.card-img-wrap {
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

/* ── LARGE card (hero) ── */
.article-card--large {
  position: relative;
}

.article-card--large .card-title {
  font-size: 2rem;
  line-height: 1.22;
}

.article-card--large .card-summary {
  font-size: 0.92rem;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  margin-top: 10px;
}

.article-card--large:hover .card-img {
  transform: scale(1.02);
}

/* ── MEDIUM card ── */
.article-card--medium {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card--medium .card-title {
  font-size: 1.1rem;
}

.article-card--medium:hover .card-img {
  transform: scale(1.02);
}

/* ── SMALL card (list item) ── */
.article-card--small {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

.article-card--small:last-child {
  border-bottom: none;
}

.article-card--small .card-img-wrap {
  width: 100px;
  flex-shrink: 0;
  margin: 0;
  aspect-ratio: unset;
}

.article-card--small .card-img {
  width: 100px;
  height: 70px;
  aspect-ratio: unset;
}

.article-card--small .card-title {
  font-size: 0.95rem;
  line-height: 1.35;
}

.article-card--small .card-summary {
  display: none;
}

.article-card--small .card-category {
  margin-bottom: 5px;
}

.article-card--small:hover {
  background: transparent;
}

.article-card--small .card-title-wrap:hover .card-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Hover lift for card grids ── */
.card-lift {
  border-radius: var(--radius);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card-lift:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* ── Inline hover link ── */
a.card-link-wrap {
  display: block;
  height: 100%;
}

/* ============================================================
   HOMEPAGE — FEATURED / HERO
   ============================================================ */
.featured-section {
  margin-bottom: calc(var(--gap)*2);
}

.featured-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--gap);
}

/* Featured side cards */
.featured-side {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  border-left: 1px solid var(--gray-200);
  padding-left: var(--gap);
}

.featured-side .article-card--medium .card-title {
  font-size: 1rem;
}

.featured-side .article-card--medium .card-summary {
  display: none;
}

/* ── Category tabs ── */
.category-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
  margin-bottom: var(--gap);
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
  cursor: pointer;
}

.category-tab:hover {
  border-color: var(--gray-400);
  color: var(--black);
}

.category-tab.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ── Top stories grid ── */
.top-stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-bottom: calc(var(--gap)*2);
}

/* ── Latest + sidebar row ── */
.latest-section {
  margin-bottom: calc(var(--gap)*2);
}

.latest-list {
  display: flex;
  flex-direction: column;
}

/* ── Skeleton loaders ── */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skel-img {
  width: 100%;
  aspect-ratio: 16/9;
}

.skel-text {
  height: 14px;
  margin: 8px 0;
  width: 100%;
}

.skel-text--sm {
  width: 60%;
}

.skel-text--md {
  width: 80%;
}

.skel-title {
  height: 22px;
  margin: 10px 0 6px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.home-sidebar,
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap)*1.5);
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  scrollbar-width: none;
}

.home-sidebar::-webkit-scrollbar,
.article-sidebar::-webkit-scrollbar {
  display: none;
}

/* Widget */
.widget {
  border-top: 2px solid var(--black);
  padding-top: 14px;
}

.widget-title {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 14px;
}

/* Popular article widget */
.popular-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: opacity var(--transition);
}

.popular-item:last-child {
  border-bottom: none;
}

.popular-item:hover {
  opacity: 0.7;
}

.popular-num {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--gray-200);
  line-height: 1;
  font-weight: 400;
  flex-shrink: 0;
  width: 28px;
  text-align: right;
}

.popular-body {
  flex: 1;
  min-width: 0;
}

.popular-title {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--black);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--gray-400);
  margin-top: 4px;
}

/* Ad placeholder */
.ad-placeholder {
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--gray-400);
  letter-spacing: 0.04em;
}

.sidebar-ad .ad-placeholder {
  padding: 16px;
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-main {
  min-width: 0;
}

/* Article header */
.article-header {
  margin-bottom: calc(var(--gap)*1.5);
}

.article-category {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.article-title {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 400;
  line-height: 1.18;
  color: var(--black);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  word-break: break-word;
  overflow-wrap: break-word;
}

.article-summary {
  font-family: var(--sans);
  font-size: 1.1rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 20px;
  font-weight: 300;
  word-break: break-word;
  overflow-wrap: break-word;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--gray-500);
  padding: 14px 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.article-meta strong {
  color: var(--black);
  font-weight: 600;
}

.article-meta-dot {
  color: var(--gray-300);
}

/* Article hero image */
.article-hero {
  margin-bottom: calc(var(--gap)*1.5);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.article-hero figcaption {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--gray-400);
  padding: 8px 0;
  line-height: 1.5;
}

/* Article body */
.article-body {
  max-width: var(--article-w);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-900);
}

.article-body p {
  margin-bottom: 1.4em;
}

.article-body p strong {
  color: var(--black);
  font-weight: 600;
}

.article-body h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 1.8em 0 0.6em;
  color: var(--black);
  line-height: 1.3;
}

.article-body h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 1.5em 0 0.4em;
  color: var(--black);
}

.article-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body blockquote {
  border-left: 3px solid var(--black);
  margin: 1.5em 0;
  padding: 0 0 0 20px;
  font-style: italic;
  color: var(--gray-600);
}

/* In-article ad */
.in-article-ad {
  margin: calc(var(--gap)*1.5) 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--gap) 0;
}

/* Source link */
.article-source {
  margin-top: calc(var(--gap)*1.5);
  padding-top: var(--gap);
  border-top: 1px solid var(--gray-200);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--gray-500);
}

.article-source a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Share bar */
.share-bar {
  margin-top: calc(var(--gap)*1.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--gray-500);
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: all var(--transition);
}

.share-btn:hover {
  border-color: var(--gray-400);
  color: var(--black);
  background: var(--gray-50);
}

/* ── Related articles ── */
.related-articles {
  margin-top: calc(var(--gap)*3);
  padding-top: calc(var(--gap)*1.5);
  border-top: 2px solid var(--black);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: var(--gap);
}

/* ============================================================
   CATEGORY / TOPIC PAGE
   ============================================================ */
.category-header {
  padding: calc(var(--gap)*2) 0 var(--gap);
  border-bottom: 2px solid var(--black);
  margin-bottom: calc(var(--gap)*2);
}

.page-title {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 8px;
}

.page-desc {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--gray-500);
  font-weight: 400;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.articles-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-page-header {
  margin-bottom: calc(var(--gap)*1.5);
}

.search-page-form {
  display: flex;
  gap: 8px;
  max-width: 600px;
  margin-bottom: var(--gap);
}

.search-page-input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
  background: var(--gray-50);
}

.search-page-input:focus {
  border-color: var(--black);
  background: var(--white);
}

.search-page-btn {
  height: 48px;
  padding: 0 24px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity var(--transition);
}

.search-page-btn:hover {
  opacity: 0.85;
}

.search-results-count {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: var(--gap);
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: var(--gap) 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--black);
}

.form-group input,
.form-group textarea {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--black);
  background: var(--gray-50);
  outline: none;
  transition: border-color var(--transition);
}

.form-group textarea {
  height: 140px;
  padding: 12px 14px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--black);
  background: var(--white);
}

.btn-submit {
  align-self: flex-start;
  height: 44px;
  padding: 0 28px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: opacity var(--transition);
}

.btn-submit:hover {
  opacity: 0.85;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--gray-50);
  border-top: 2px solid var(--black);
  margin-top: calc(var(--gap)*2);
}

.footer-ad {
  border-bottom: 1px solid var(--gray-200);
  padding: var(--gap);
  text-align: center;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap) var(--gap) calc(var(--gap)*1.5);
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  flex-wrap: wrap;
  justify-content: space-between;
}

.footer-brand {
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-brand em {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-style: normal;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-nav a {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-600);
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--black);
}

.footer-copy {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--gray-400);
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

/* ============================================================
   RESPONSIVE — Tablet (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {

  .layout-home,
  .layout-article {
    grid-template-columns: 1fr;
  }

  .home-sidebar,
  .article-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    order: 2;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-side {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--gray-200);
    padding-top: var(--gap);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .top-stories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .articles-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-title {
    font-size: 2.1rem;
  }

  .article-body {
    max-width: 100%;
  }
}

/* ============================================================
   RESPONSIVE — Mobile (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --gap: 16px;
  }

  /* Hard-clamp everything to viewport width */
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  * {
    max-width: 100%;
  }

  img,
  video,
  iframe,
  table {
    max-width: 100% !important;
  }

  /* Header — keep logo + hamburger only */
  .header-inner {
    gap: 8px;
  }

  .logo-name {
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  .main-nav {
    display: none;
    flex-direction: column;
  }

  .main-nav.is-open {
    display: flex;
    position: fixed;
    /* fixed so it overlays content cleanly */
    top: var(--header-h);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px var(--gap) 20px;
    gap: 2px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  .main-nav.is-open a {
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    width: 100%;
    display: block;
  }

  .nav-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .site-header {
    position: sticky;
    width: 100%;
  }

  /* Search bar full width on mobile */
  .header-search-bar {
    left: 0;
    right: 0;
    padding: 12px var(--gap);
  }

  .search-form {
    max-width: 100%;
  }

  .search-input {
    font-size: 1rem;
  }

  /* prevents iOS zoom on focus */

  /* Layouts */
  .layout-home,
  .layout-article,
  .layout-default {
    grid-template-columns: 1fr;
    padding: var(--gap) var(--gap) calc(var(--gap)*2);
    width: 100%;
    box-sizing: border-box;
  }

  .home-sidebar,
  .article-sidebar {
    display: none;
  }

  /* Featured */
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-side {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--gray-200);
    padding-top: var(--gap);
    display: flex;
    flex-direction: column;
  }

  /* Grids */
  .top-stories-grid {
    grid-template-columns: 1fr;
  }

  .articles-row {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  /* Article */
  .article-title {
    font-size: 1.75rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .article-summary {
    font-size: 0.95rem;
  }

  .article-body {
    font-size: 0.98rem;
  }

  .article-hero img {
    max-height: 240px;
  }

  /* Cards */
  .article-card--large .card-title {
    font-size: 1.5rem;
  }

  /* Trending */
  .trending-bar {
    padding: 8px var(--gap);
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-nav {
    justify-content: center;
  }
}

/* ============================================================
   RESPONSIVE — Small Mobile (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --gap: 14px;
  }

  /* Absolute containment fallback */
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .logo-name {
    font-size: 1.05rem;
  }

  .logo-tagline {
    display: none;
  }

  .article-title {
    font-size: 1.45rem;
  }

  .article-body {
    font-size: 0.95rem;
    line-height: 1.75;
  }

  .article-hero img {
    max-height: 200px;
  }

  .article-summary {
    display: none;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .article-card--large .card-title {
    font-size: 1.3rem;
  }

  .article-card--medium .card-title {
    font-size: 0.95rem;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .trending-tag {
    font-size: 0.7rem;
    padding: 3px 10px;
  }

  .footer-inner {
    padding: var(--gap) var(--gap);
    gap: 14px;
  }

  .footer-copy {
    padding-top: 10px;
  }

  .ad-placeholder {
    padding: 16px 12px;
    font-size: 0.7rem;
  }

  .search-page-form {
    flex-direction: column;
  }

  .search-page-btn {
    width: 100%;
  }

  .share-bar {
    flex-wrap: wrap;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {

  .site-header,
  .site-footer,
  .home-sidebar,
  .article-sidebar,
  .in-article-ad,
  .related-articles,
  .breaking-bar,
  .trending-bar,
  .share-bar {
    display: none !important;
  }

  body {
    font-size: 12pt;
  }

  .article-main {
    max-width: 100%;
  }

  .article-title {
    font-size: 24pt;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.75em;
  }
}
