/* =============================================
   BinTV Sports News — Global Styles
   Google AdSense Ready | Poppins
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --accent: #f4a261;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface2: #f1f3f5;
  --text: #212529;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, .08);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, .14);
  --font: 'Poppins', sans-serif;
  --header-h: 64px;
  --max-w: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ─── HEADER ─────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #111;
  color: #fff;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}

.header-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
}

.logo-text span {
  color: var(--primary);
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  color: #ccc;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background .2s, color .2s;
}

.site-nav a:hover,
.site-nav a.active {
  background: var(--primary);
  color: #fff;
}

/* Search */
.header-search {
  display: flex;
  align-items: center;
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  max-width: 240px;
  flex: 1;
}

.header-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
}

.header-search input::placeholder {
  color: #666;
}

.header-search button {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background .2s;
}

.header-search button:hover {
  background: var(--primary-dark);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* ─── AD BANNER (top) ─────────────────────── */
.ad-banner-top {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── BREAKING TICKER ─────────────────────── */
.breaking-bar {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 36px;
  font-size: 13px;
  font-weight: 500;
}

.breaking-label {
  background: #111;
  color: var(--primary);
  padding: 0 14px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ticker-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes ticker {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(-100%);
  }
}

/* ─── LAYOUT ──────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  padding: 30px 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ─── HERO / FEATURED ─────────────────────── */
.featured-section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
}

.hero-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 360px;
  transition: box-shadow .25s;
  cursor: pointer;
}

.hero-card:hover {
  box-shadow: var(--shadow-hover);
}

.hero-img-wrap {
  position: relative;
  overflow: hidden;
  background: #222;
}

.hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.hero-card:hover .hero-img-wrap img {
  transform: scale(1.04);
}

.hero-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
}

.hero-body {
  padding: 28px 28px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
}

.hero-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.hero-meta .source {
  font-weight: 600;
  color: var(--text);
}

.btn-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
  margin-top: 16px;
  width: fit-content;
  text-decoration: none;
}

.btn-read:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ─── NEWS GRID ───────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.news-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .25s, transform .2s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #eee;
  aspect-ratio: 16/9;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.news-card:hover .card-img-wrap img {
  transform: scale(1.06);
}

.card-cat {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-meta .src {
  font-weight: 600;
  color: #444;
}

/* ─── LIST CARD (sidebar, latest) ────────── */
.list-card {
  display: flex;
  gap: 12px;
  cursor: pointer;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity .2s;
}

.list-card:last-child {
  border-bottom: none;
}

.list-card:hover {
  opacity: .78;
}

.list-card-img {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #eee;
}

.list-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-card-body {
  flex: 1;
}

.list-card-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.list-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── SIDEBAR ─────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--surface2);
}

/* Category pills */
.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--surface2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all .2s;
  color: var(--text);
}

.cat-pill:hover,
.cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Ad placeholder */
.ad-box {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  gap: 6px;
}

.ad-box-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .7;
}

/* In-content ad */
.ad-inline {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 24px 0;
}

/* ─── PAGINATION ──────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 0 16px;
}

.page-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: .4;
  cursor: default;
}

/* ─── CATEGORIES PAGE ─────────────────────── */
.categories-header {
  background: linear-gradient(135deg, #111 0%, #1a1a2e 100%);
  color: #fff;
  padding: 48px 20px;
  text-align: center;
}

.category-hero-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
}

.category-hero-sub {
  font-size: 14px;
  color: #aaa;
}

/* ─── ARTICLE PAGE ────────────────────────── */
.article-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 30px 20px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
}

.article-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow);
}

.article-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-breadcrumb a {
  color: var(--primary);
}

.article-breadcrumb span {
  color: var(--text-muted);
}

.article-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.article-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 18px;
  color: var(--text);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.article-meta .author {
  font-weight: 600;
  color: var(--text);
}

.article-meta .dot {
  opacity: .4;
}

.article-hero-img {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  aspect-ratio: 16/8;
  background: #eee;
}

.article-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  font-size: 16px;
  line-height: 1.85;
  color: #333;
}

.article-body p {
  margin-bottom: 18px;
}

.source-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  transition: background .2s;
  text-decoration: none;
}

.source-link-btn:hover {
  background: var(--primary);
}

/* Share icons */
.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.share-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.share-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: #fff;
  transition: opacity .2s;
  font-family: var(--font);
}

.share-btn:hover {
  opacity: .85;
}

.share-fb {
  background: #1877f2;
}

.share-tw {
  background: #1da1f2;
}

.share-wa {
  background: #25d366;
}

.share-link {
  background: #444;
}

/* Related */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

/* ─── SEARCH PAGE ─────────────────────────── */
.search-bar-large {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
}

.search-bar-large input {
  flex: 1;
  font-family: var(--font);
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  outline: none;
  transition: border .2s;
}

.search-bar-large input:focus {
  border-color: var(--primary);
}

.search-bar-large button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
}

.search-bar-large button:hover {
  background: var(--primary-dark);
}

/* ─── FOOTER ──────────────────────────────── */
.site-footer {
  background: #111;
  color: #aaa;
  margin-top: 48px;
}

.footer-top {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 20px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-brand .logo-text {
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
  display: block;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.social-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #222;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  color: #aaa;
  transition: all .2s;
  text-decoration: none;
}

.social-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 13px;
  color: #aaa;
  transition: color .2s;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid #222;
  padding: 16px 20px;
  text-align: center;
  font-size: 12px;
  background: #0a0a0a;
}

.footer-bottom a {
  color: var(--primary);
}

/* ─── STATES ──────────────────────────────── */
.spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  font-size: 14px;
}

.error-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13px;
  color: #856404;
  margin-bottom: 20px;
}

/* ─── SCROLL TO TOP ───────────────────────── */
#scrollTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(230, 57, 70, .4);
  display: none;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
  z-index: 999;
}

#scrollTop.visible {
  display: flex;
}

#scrollTop:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ─── DARK NO-IMAGE FALLBACK ──────────────── */
.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Complete Mobile-First Overhaul
   ═══════════════════════════════════════════ */

/* ─── Tablet: 960px ──────────────────────── */
@media (max-width: 960px) {

  /* Layout: drop sidebar into column on tablet */
  .page-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }

  /* Sidebar: show as horizontal strip on tablet */
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  /* Hero: stack image on top */
  .hero-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-img-wrap {
    aspect-ratio: 16 / 8;
    height: auto;
    min-height: 200px;
  }

  .hero-body {
    padding: 22px;
  }

  .hero-title {
    font-size: 20px;
  }

  /* News grid: 2 cols */
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Article */
  .article-wrapper {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }

  .article-content {
    padding: 28px 30px;
  }

  .article-title {
    font-size: 24px;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 36px 20px 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  /* Related */
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Categories page header */
  .category-hero-title {
    font-size: 28px;
  }
}

/* ─── Small tablet / large phone: 768px ─────── */
@media (max-width: 768px) {
  :root {
    --header-h: 58px;
  }

  /* Header */
  .header-search {
    max-width: 180px;
  }

  .header-search input {
    font-size: 12px;
  }

  /* Ticker slightly smaller */
  .breaking-bar {
    font-size: 12px;
    height: 32px;
  }

  .breaking-label {
    font-size: 11px;
    padding: 0 10px;
  }

  /* Sidebar: single column on small tablet */
  .sidebar {
    grid-template-columns: 1fr;
  }

  /* Ad boxes: reduce min-height */
  .ad-box {
    min-height: 150px;
  }

  .ad-box[style*="min-height:600px"],
  .ad-box[style*="min-height: 600px"] {
    min-height: 300px !important;
  }

  /* Article */
  .article-content {
    padding: 22px 24px;
  }

  .article-title {
    font-size: 22px;
  }

  .article-body {
    font-size: 15px;
  }

  /* Share buttons: smaller */
  .share-btn {
    padding: 7px 12px;
    font-size: 11px;
  }

  .source-link-btn {
    font-size: 13px;
    padding: 10px 18px;
  }

  /* Search page */
  .search-bar-large {
    padding: 14px;
    gap: 10px;
  }

  .search-bar-large input {
    font-size: 14px;
  }

  .search-bar-large button {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* About page stats grid inside */
  .category-hero-title {
    font-size: 26px;
  }

  .category-hero-sub {
    font-size: 13px;
  }

  /* Pagination */
  .page-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .pagination {
    gap: 5px;
  }
}

/* ─── Phone: 640px ───────────────────────── */
@media (max-width: 640px) {
  :root {
    --header-h: 56px;
  }

  /* Hide nav & search — use hamburger */
  .site-nav {
    display: none;
  }

  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #111;
    padding: 12px 16px 20px;
    z-index: 999;
    border-top: 1px solid #222;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  }

  .site-nav.open a {
    padding: 11px 14px;
    font-size: 14px;
    border-radius: 8px;
    border-bottom: none;
  }

  .hamburger {
    display: block;
  }

  .header-search {
    display: none;
  }

  /* Header: tighter */
  .header-inner {
    padding: 0 14px;
    gap: 10px;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .logo-text {
    font-size: 20px;
  }

  /* Layout padding */
  .page-layout {
    padding: 16px 12px;
    gap: 16px;
  }

  .featured-section {
    margin-bottom: 20px;
  }

  /* Hero full-stack */
  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-img-wrap {
    aspect-ratio: 16 / 9;
    min-height: 180px;
  }

  .hero-body {
    padding: 18px;
  }

  .hero-title {
    font-size: 18px;
  }

  .hero-desc {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .hero-meta {
    font-size: 11px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .btn-read {
    font-size: 12px;
    padding: 9px 16px;
    margin-top: 12px;
  }

  /* News: 1 column */
  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Cards */
  .card-title {
    font-size: 13.5px;
  }

  .card-desc {
    font-size: 12px;
  }

  /* Hide sidebar completely on phone */
  .sidebar {
    display: none;
  }

  /* Article */
  .article-wrapper {
    padding: 14px 12px;
    grid-template-columns: 1fr;
  }

  .article-content {
    padding: 18px 16px;
    border-radius: 8px;
  }

  .article-title {
    font-size: 20px;
    line-height: 1.3;
  }

  .article-body {
    font-size: 15px;
    line-height: 1.75;
  }

  .article-meta {
    font-size: 12px;
    gap: 8px;
  }

  .article-meta .dot {
    display: none;
  }

  .article-hero-img {
    aspect-ratio: 16 / 9;
    margin-bottom: 20px;
  }

  .article-breadcrumb {
    font-size: 11px;
  }

  .source-link-btn {
    width: 100%;
    justify-content: center;
    font-size: 13px;
  }

  /* Share row: wrap and fill */
  .share-row {
    gap: 8px;
  }

  .share-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 11px;
    padding: 8px 6px;
  }

  /* Related: 1 col */
  .related-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 16px 20px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-desc {
    font-size: 12px;
  }

  /* Search page */
  .search-bar-large {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .search-bar-large input {
    width: 100%;
  }

  .search-bar-large button {
    width: 100%;
    padding: 12px;
  }

  /* Categories header */
  .categories-header {
    padding: 32px 16px;
  }

  .category-hero-title {
    font-size: 22px;
  }

  /* Ad inline */
  .ad-inline {
    min-height: 60px;
    font-size: 10px;
    margin: 16px 0;
  }

  /* Pagination: show fewer numbers */
  .pagination {
    flex-wrap: wrap;
    padding: 20px 0 10px;
    gap: 6px;
  }

  .page-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
    border-radius: 6px;
  }

  /* Error/spinner */
  .spinner-wrap {
    padding: 48px 20px;
  }

  .empty-state {
    padding: 48px 16px;
  }

  .empty-state h3 {
    font-size: 17px;
  }

  /* Section titles */
  .section-title {
    font-size: 12px;
    letter-spacing: 1px;
  }

  /* Cat pills */
  .cat-pill {
    font-size: 11px;
    padding: 5px 12px;
  }

  /* Scroll to top button */
  #scrollTop {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ─── Small phone: 480px ────────────────── */
@media (max-width: 480px) {
  .logo-text {
    font-size: 18px;
  }

  .hero-title {
    font-size: 17px;
  }

  .hero-body {
    padding: 14px;
  }

  .hero-img-wrap {
    min-height: 160px;
  }

  /* Card body tighter */
  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 13px;
  }

  /* Article */
  .article-title {
    font-size: 18px;
  }

  .article-content {
    padding: 14px 13px;
  }

  .article-body {
    font-size: 14.5px;
  }

  /* Share row: stack on very small */
  .share-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .share-btn {
    width: 100%;
    text-align: center;
  }

  /* Footer cols compact */
  .footer-col h4 {
    margin-bottom: 10px;
  }

  .footer-col li {
    margin-bottom: 6px;
  }

  /* Breaking bar */
  .breaking-label {
    font-size: 10px;
    padding: 0 8px;
    letter-spacing: 0;
  }

  .breaking-bar {
    font-size: 11px;
  }

  /* Source link */
  .source-link-btn {
    padding: 10px 14px;
    font-size: 12px;
  }

  /* Spinner */
  .spinner {
    width: 32px;
    height: 32px;
  }
}

/* ─── Very small / iPhone SE: 375px ────── */
@media (max-width: 375px) {
  :root {
    --header-h: 52px;
  }

  .header-inner {
    padding: 0 10px;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
    border-radius: 6px;
  }

  .logo-text {
    font-size: 16px;
  }

  .page-layout {
    padding: 12px 10px;
  }

  .hero-title {
    font-size: 15px;
  }

  .hero-body {
    padding: 12px;
  }

  .hero-img-wrap {
    min-height: 140px;
  }

  .btn-read {
    font-size: 11px;
    padding: 8px 13px;
  }

  .article-content {
    padding: 12px 10px;
    border-radius: 6px;
  }

  .article-title {
    font-size: 16px;
  }

  .article-body {
    font-size: 14px;
    line-height: 1.7;
  }

  .section-title {
    font-size: 11px;
  }

  .card-body {
    padding: 10px;
  }

  .card-title {
    font-size: 12.5px;
  }

  .category-hero-title {
    font-size: 19px;
  }

  .page-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}