/*
Theme Name: DW Pulse Light
Theme URI: https://dwpulse.com
Author: DW Pulse Engineering
Author URI: https://dwpulse.com
Description: Production-ready, ultra-fast light news theme optimized for Google News, Core Web Vitals, and high-traffic loads.
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: dwpulse
*/

:root {
  --red: #C8102E;
  --dark: #FFFFFF;
  --darker: #F5F6F8;
  --card: #FFFFFF;
  --border: #E2E5EA;
  --gold: #A9740A;
  --text: #1B1F27;
  --muted: #6B7280; /* Meets WCAG AA 4.5:1 contrast on white */
  --white: #14171C;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

/* Touch targets & accessibility */
button, .icon-btn, .ctag, .share-btn, .cat-item, .drawer-item {
  min-height: 44px;
  min-width: 44px;
}

/* FOCUS STYLES */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* TICKER */
.ticker-wrap {
  background: var(--red);
  padding: 7px 0;
  overflow: hidden;
  position: relative;
  z-index: 200;
}
.ticker-inner {
  display: flex;
  align-items: center;
}
.ticker-label {
  background: var(--white);
  color: #FFFFFF;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  padding: 4px 12px;
  letter-spacing: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-track {
  overflow: hidden;
  flex: 1;
}
.ticker-scroll {
  display: flex;
  white-space: nowrap;
  will-change: transform;
  animation: ticker 30s linear infinite;
}
.ticker-scroll:hover {
  animation-play-state: paused;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  padding: 0 20px;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* HEADER */
header {
  background: var(--darker);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 150;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}
.logo-main {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  color: var(--white);
  letter-spacing: 3px;
  line-height: 1;
}
.logo-main span {
  color: var(--red);
}
.logo-sub {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 2px;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* DRAWER */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.menu-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 290px;
  height: 100vh;
  background: var(--card);
  z-index: 400;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  border-right: 2px solid var(--red);
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}
.menu-drawer.open {
  transform: translateX(0);
}
.drawer-head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 3px;
}
.drawer-logo span {
  color: var(--red);
}
.drawer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}
.drawer-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.drawer-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted);
  padding: 0 20px 10px;
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.drawer-item:hover, .drawer-item.active {
  background: rgba(200, 16, 46, 0.06);
  border-left-color: var(--red);
  color: var(--white);
}

/* SEARCH BAR */
.search-bar {
  background: var(--darker);
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.search-bar.open {
  max-height: 60px;
  padding: 10px 16px;
}
.search-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}
.search-input:focus {
  border-color: var(--red);
}

/* CATEGORY NAVIGATION */
.cat-nav {
  background: var(--card);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-inner {
  display: flex;
  padding: 0 8px;
  min-width: max-content;
}
.cat-item {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 11px 18px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.cat-item:hover, .cat-item.active {
  color: var(--white);
  border-bottom-color: var(--red);
}

/* LAYOUT CONTAINER */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

/* HERO SECTION */
.hero { padding: 16px 0 12px; }
.hero-inner { display: flex; flex-direction: column; gap: 12px; }
.hero-main { position: relative; overflow: hidden; background: var(--darker); display: block; border: 1px solid var(--border); }
.hero-main img { width: 100%; height: 260px; object-fit: cover; filter: brightness(0.85); transition: transform 0.4s ease, filter 0.3s ease; }
.hero-main:hover img { transform: scale(1.02); filter: brightness(0.95); }
.hero-overlay { position: absolute; bottom: 0; inset-x: 0; background: linear-gradient(transparent, rgba(0,0,0,0.85)); padding: 32px 16px 16px; }
.hero-cat { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 2px; padding: 3px 8px; text-transform: uppercase; display: inline-block; margin-bottom: 8px; }
.hero-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 900; line-height: 1.25; color: #fff; margin-bottom: 8px; }
.hero-meta { font-size: 11px; color: rgba(255, 255, 255, 0.8); display: flex; gap: 12px; flex-wrap: wrap; }

/* HORIZONTAL SCROLL CONTAINERS */
.trending-scroll, .country-scroll, .hero-side-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.trend-card, .country-card, .hero-side-card {
  scroll-snap-align: start;
  flex-shrink: 0;
}
.hero-side-card { position: relative; width: 220px; height: 140px; background: var(--darker); overflow: hidden; display: block; border: 1px solid var(--border); }
.hero-side-card img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); transition: transform 0.3s ease; }
.hero-side-card:hover img { transform: scale(1.04); }
.side-overlay { position: absolute; bottom: 0; inset-x: 0; padding: 16px 10px 10px; background: linear-gradient(transparent, rgba(0,0,0,0.82)); }
.side-cat { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; margin-bottom: 4px; }
.side-title { font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700; line-height: 1.3; color: #fff; }

/* NEWS GRID & CARDS */
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 16px; border-bottom: 2px solid var(--border); padding-bottom: 10px; }
.section-title { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 3px; color: var(--white); display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; display: block; width: 4px; height: 22px; background: var(--red); }
.see-all { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--red); }

.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.news-card-img { width: 100%; height: 130px; object-fit: cover; background: var(--darker); aspect-ratio: 16 / 9; border: 1px solid var(--border); }
.news-card-body { padding: 10px 0 12px; border-bottom: 1px solid var(--border); }
.news-card-cat { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--red); margin-bottom: 5px; }
.news-card-title { font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--white); margin-bottom: 6px; }
.news-card-meta { font-size: 11px; color: var(--muted); }

/* LIST LAYOUT */
.list-news { display: flex; flex-direction: column; }
.list-item { display: grid; grid-template-columns: 100px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list-item-img { width: 100px; height: 70px; object-fit: cover; background: var(--darker); aspect-ratio: 16 / 9; border: 1px solid var(--border); }

/* ARTICLE PAGE */
.article-container { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.breadcrumb { padding: 16px 0 0; font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.article-title { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 900; line-height: 1.25; color: var(--white); margin: 14px 0; }
.article-meta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; border-y: 1px solid var(--border); margin-bottom: 20px; }
.author-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--red); display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: #fff; }
.article-hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 12px; border: 1px solid var(--border); }
.article-body { font-size: 17px; line-height: 1.85; color: #3A3F47; }
.article-body p { margin-bottom: 22px; }
.article-body h2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--white); margin: 32px 0 14px; border-left: 4px solid var(--red); padding-left: 14px; }

/* AD & NEWSLETTER */
.ad-banner { background: linear-gradient(135deg, #F7F8FA, #EFF1F4); border: 1px dashed var(--border); text-align: center; padding: 22px 16px; margin: 24px 0; color: var(--muted); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.newsletter-box { background: linear-gradient(135deg, #FFF3F4, #FFFFFF); border: 1px solid var(--red); padding: 24px 18px; margin: 24px 0; }

/* FOOTER */
footer { background: var(--darker); border-top: 3px solid var(--red); margin-top: 48px; padding: 36px 0 20px; }
.footer-logo-main { font-family: 'Bebas Neue', sans-serif; font-size: 32px; letter-spacing: 3px; color: var(--white); }
.footer-logo-main span { color: var(--red); }

/* Yahan var(--muted) ki jagah dark color use karein */
.footer-desc { font-size: 13px; color: #555555; line-height: 1.6; margin: 12px 0 20px; }

/* Yahan bhi color update karein */
.social-btn { background: var(--card); border: 1px solid var(--border); color: #444444; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; font-size: 15px; transition: all 0.2s ease; }
.social-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* TOAST */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--white); border: 1px solid var(--red); color: #fff; padding: 12px 24px; font-size: 14px; font-weight: 600; z-index: 999; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.toast.show { transform: translateX(-50%) translateY(0); }

/* RESPONSIVE BREAKPOINTS */
@media (min-width: 768px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .news-card-img { height: 160px; }
  .hero-main img { height: 380px; }
  .hero-title { font-size: 28px; }
  .article-title { font-size: 36px; }
}

@media (min-width: 1024px) {
  .hero-inner { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
  .hero-main img { height: 460px; }
  .hero-side-scroll { flex-direction: column; overflow-x: visible; height: 100%; }
  .hero-side-card { width: 100%; height: 142px; flex: 1; }
  .news-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .main-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; }
}
