/* ============================================
   SportPulse — Core Styles
   Mobile-first | Dark/Light theme
   ============================================ */

:root {
  --accent: #ff4444;
  --accent-hover: #e03030;
  --accent-light: rgba(255, 68, 68, 0.12);
  --accent-gradient: linear-gradient(135deg, #ff4444, #ff6b35);
  --bg: #ffffff;
  --bg-secondary: #f4f5f7;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #8e8ea0;
  --border: #e2e4e8;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.10);
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Oswald', 'Inter', sans-serif;
  --max-width: 1280px;
  --sidebar-w: 300px;
  --header-h: 64px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --text: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --border: #2a2a3a;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

[data-theme="dark"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 10%, rgba(255,59,59,0.05), transparent),
    radial-gradient(ellipse 500px 500px at 80% 60%, rgba(59,130,246,0.03), transparent);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Utility --- */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  transition: background var(--transition), border var(--transition);
}
[data-theme="dark"] .header {
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom-color: rgba(255,255,255,0.06);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.logo__icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
}
.logo__icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.2));
}
.logo span { color: var(--accent); }

/* Nav */
.nav { display: none; gap: 4px; }
.nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.nav a:hover, .nav a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.header__controls { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background var(--transition);
}
.theme-toggle:hover { background: var(--bg-secondary); }

.burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.mobile-menu {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--bg);
  z-index: 99;
  padding: 24px 16px;
  overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 14px 0;
  font-size: 1.1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

/* ============================================
   LAYOUT
   ============================================ */
.page-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 0;
}
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 100%; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
[data-theme="dark"] .card:hover {
  border-color: rgba(255,59,59,0.3);
}
.card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-secondary);
}
.card__body { padding: 16px; }
.card__category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.card__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
}
.card__title a { color: inherit; }
.card__title a:hover { color: var(--accent); }
.card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card--hero .card__body { padding: 20px; }
.card--hero .card__title { font-size: 1.5rem; }

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ============================================
   SIDEBAR BLOCKS
   ============================================ */
.sidebar-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-block__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-block__title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.popular-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.popular-item:last-child { border-bottom: none; }
.popular-item:hover { background: var(--accent-light); border-radius: var(--radius-sm); margin: 0 -6px; padding: 10px 6px; }
.popular-item__num {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  min-width: 28px;
}
.popular-item__title {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}

.network-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.network-item__icon { font-size: 1.3rem; }
.network-item__name { font-size: 0.88rem; font-weight: 500; }
.network-item__desc { font-size: 0.75rem; color: var(--text-muted); }

.promo-banner {
  background: var(--accent-gradient);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
}
.promo-banner__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.promo-banner__text { font-size: 0.85rem; opacity: 0.9; margin-bottom: 14px; }
.promo-banner__btn {
  display: inline-block;
  background: #fff;
  color: var(--accent);
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition: opacity var(--transition);
}
.promo-banner__btn:hover { opacity: 0.85; color: var(--accent); }

/* ============================================
   AD SLOTS
   ============================================ */
.ad-slot {
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}
.ad-slot--240x400 { width: 240px; height: 400px; margin: 0 auto 20px; }
.ad-slot--728x90 { width: 100%; max-width: 728px; height: 90px; margin: 20px auto; }
.ad-slot--native {
  width: 100%;
  min-height: 120px;
  padding: 20px;
  text-align: center;
}

/* ============================================
   ARTICLE PAGE
   ============================================ */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs__sep { color: var(--text-muted); }

.article-header { margin-bottom: 24px; }
.article-header__category {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.article-header__title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}
.article-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.article-header__meta span { display: flex; align-items: center; gap: 4px; }

.article-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 24px;
  background: var(--bg-secondary);
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.75;
}
.article-content p { margin-bottom: 18px; }
.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 32px 0 14px;
  color: var(--text);
}
.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 14px 20px;
  margin: 20px 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
}
.article-content ul, .article-content ol {
  margin: 16px 0;
  padding-left: 24px;
  list-style: disc;
}
.article-content li { margin-bottom: 6px; }

.article-source {
  margin: 28px 0;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.article-source a { color: var(--text-muted); font-weight: 500; }

.related-section { margin-top: 40px; }
.related-section__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.related-section__title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}
.pagination__item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.pagination__item:hover, .pagination__item.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============================================
   CATEGORY TABS
   ============================================ */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.cat-tab:hover { color: var(--text); border-color: var(--accent); }
.cat-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 48px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 28px;
}
.footer__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: var(--text);
}
.footer__link {
  display: block;
  padding: 4px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.footer__link:hover { color: var(--accent); }
.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-in { animation: fadeUp 0.5s ease both; }
.cards-grid .card:nth-child(1) { animation-delay: 0.05s; }
.cards-grid .card:nth-child(2) { animation-delay: 0.1s; }
.cards-grid .card:nth-child(3) { animation-delay: 0.15s; }
.cards-grid .card:nth-child(4) { animation-delay: 0.2s; }
.cards-grid .card:nth-child(5) { animation-delay: 0.25s; }
.cards-grid .card:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
  .container { padding: 0 24px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .card--hero .card__title { font-size: 1.8rem; }
  .article-header__title { font-size: 2.2rem; }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
  .nav { display: flex; }
  .burger { display: none; }
}

@media (min-width: 1024px) {
  .page-layout {
    flex-direction: row;
    gap: 32px;
  }
  .sidebar { width: var(--sidebar-w); flex-shrink: 0; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .footer__grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
  .container { padding: 0 32px; }
}

@media print {
  .header, .sidebar, .footer, .ad-slot, .promo-banner { display: none !important; }
  .article-content { font-size: 12pt; }
}
