
/* =========================================================
   ApexPulse News - Modern US Editorial Stylesheet (2026)
   Ultra-Fast, Mobile-First, SEO & Ad-Optimized
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Merriweather', Georgia, Cambria, serif;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --brand-blue: #2563eb;
  --brand-navy: #1e3a8a;
  --brand-teal: #0d9488;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --container-max: 1280px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ================= TOP BILLBOARD AD ================= */
.billboard-wrapper {
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.ad-placeholder {
  margin: 0.5rem auto;
  text-align: center;
  position: relative;
}

.ad-label {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.ad-box-billboard {
  min-height: 90px;
  max-width: 728px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-navy);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem;
}

/* ================= HEADER ================= */
.site-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-navy);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo span {
  color: var(--brand-blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links li {
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links a {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.35rem 0.1rem;
  transition: all 0.15s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--brand-blue);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-blue);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.82rem;
  width: 120px;
  transition: width 0.2s;
}

.search-bar input:focus {
  width: 160px;
}

/* ================= MOBILE NAVIGATION ================= */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 60;
}

.mobile-menu-btn span {
  width: 100%;
  height: 2.5px;
  background: var(--brand-navy);
  border-radius: 2px;
  transition: all 0.2s;
}

.mobile-cat-bar {
  display: none;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
}

.mobile-cat-scroll {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-cat-scroll::-webkit-scrollbar {
  display: none;
}

.mobile-cat-scroll a {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  transition: all 0.15s;
}

.mobile-cat-scroll a.active,
.mobile-cat-scroll a:hover {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
}

/* MOBILE DRAWER */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  backdrop-filter: blur(2px);
}

.mobile-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 290px;
  max-width: 85vw;
  background: #ffffff;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
  padding: 1.5rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.drawer-search {
  margin-bottom: 1.5rem;
}

.drawer-search-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--bg-secondary);
}

.drawer-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
}

.drawer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drawer-nav-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s;
}

.drawer-nav-list a:hover,
.drawer-nav-list a.active {
  background: #eff6ff;
  color: var(--brand-blue);
}

.drawer-nav-list.secondary a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.45rem 0.75rem;
}

/* ================= HERO SECTION ================= */
.hero-section {
  padding: 2rem 0 1.5rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.hero-featured-card {
  background: var(--bg-primary);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hero-image-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.hero-featured-card:hover .hero-image-wrap img {
  transform: scale(1.02);
}

.category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--brand-navy);
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-md);
}

.hero-content {
  padding: 1.5rem;
}

.hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.hero-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.meta-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ================= SIDEBAR TRENDING ================= */
.sidebar-trending {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trending-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.trending-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trending-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #cbd5e1;
  font-family: var(--font-sans);
}

.trending-text h4 {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.trending-text h4:hover {
  color: var(--brand-blue);
}

/* ================= ARTICLES GRID ================= */
.articles-section {
  padding: 2rem 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.article-card-image {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: 0.35rem;
  letter-spacing: 0.05em;
}

.article-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.article-card-title a:hover {
  color: var(--brand-blue);
}

.article-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

/* ================= ARTICLE VIEW (SINGLE) ================= */
.article-single-layout {
  display: grid;
  grid-template-columns: 2.8fr 1.2fr;
  gap: 2rem;
  padding: 2.5rem 0;
}

.article-main {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.breadcrumbs {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumbs a:hover {
  color: var(--brand-blue);
}

.article-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.article-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.75rem;
  font-size: 0.85rem;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.article-featured-img {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.article-body-content {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: #1e293b;
}

.article-body-content p {
  margin-bottom: 1.5rem;
}

.article-body-content h3 {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--brand-navy);
  margin: 2rem 0 1rem 0;
}

/* ================= IN-ARTICLE AD SLOTS ================= */
.ad-box-native {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--brand-blue);
  border-radius: 8px;
  padding: 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-navy);
  box-shadow: var(--shadow-sm);
  margin: 1.75rem 0;
}

.ad-box-moat {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  padding: 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: #14532d;
  box-shadow: var(--shadow-sm);
  margin: 2rem 0;
}

.ad-matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}

.ad-matrix-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

/* ================= FOOTER ================= */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3rem 0 1.5rem 0;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand h3 {
  color: #ffffff;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .article-single-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ad-matrix-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .mobile-cat-bar {
    display: block;
  }
  .header-inner {
    height: 56px;
    gap: 0.75rem;
  }
  .brand-logo {
    font-size: 1.2rem;
  }
  .search-bar {
    padding: 0.3rem 0.6rem;
  }
  .search-bar input {
    width: 90px;
  }
  .search-bar input:focus {
    width: 130px;
  }
}

@media (max-width: 640px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .article-main {
    padding: 1.25rem;
  }
  .article-header h1 {
    font-size: 1.6rem;
  }
  .ad-matrix-grid {
    grid-template-columns: 1fr;
  }
}
