:root {
  --aff-red: #e30613;
  --aff-red-dark: #b9050f;
  --aff-blue: #153d7a;
  --aff-blue-soft: #1e4a94;
  --aff-grey-bg: #f3f4f6;
  --aff-border: #e5e7eb;
  --aff-text: #1f2937;
  --aff-muted: #6b7280;
  --aff-topbar-h: 36px;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--aff-text);
  background: #fff;
  min-height: 100vh;
}

body.theme-dark {
  background: #0f1115;
  color: #e5e7eb;
}

body.theme-dark .bg-white-card,
body.theme-dark .site-header,
body.theme-dark .main-nav,
body.theme-dark .page-title-card,
body.theme-dark .sidebar-card {
  background: #161b22 !important;
  border-color: #2d333b !important;
}

body.theme-dark .text-muted,
body.theme-dark .nav-link-main {
  color: #9ca3af !important;
}

body.theme-dark .breaking-track {
  background: #1c2128;
}

/* Top bar */
.top-bar {
  background: var(--aff-red);
  color: #fff;
  font-size: 0.85rem;
  min-height: var(--aff-topbar-h);
}

.top-bar a {
  color: #fff;
  text-decoration: none;
  opacity: 0.95;
}

.top-bar a:hover {
  opacity: 1;
}

.top-bar .social a {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.top-bar .social a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.advertise-link {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--aff-border);
  padding: 0.75rem 0;
}

.header-tools .btn-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--aff-border);
  background: #fff;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--aff-text);
  padding: 0;
}

body.theme-dark .header-tools .btn-icon {
  background: #161b22;
  border-color: #2d333b;
  color: #e5e7eb;
}

.header-tools .btn-icon:hover {
  border-color: #d1d5db;
}

.mobile-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-circle-btn.menu-btn {
  background: var(--aff-red);
  color: #fff;
}

.mobile-circle-btn.bell-btn {
  background: var(--aff-red);
  color: #fff;
}

.brand-block {
  text-align: center;
}

.brand-block .logo-img {
  max-height: 56px;
  width: auto;
  object-fit: contain;
}

.brand-block .site-name-fallback {
  font-weight: 800;
  font-style: italic;
  font-size: 1.75rem;
  color: var(--aff-blue);
  letter-spacing: -0.02em;
}

.brand-block .tagline {
  font-size: 0.9rem;
  color: var(--aff-blue-soft);
  margin-top: 0.15rem;
}

body.theme-dark .brand-block .tagline {
  color: #93c5fd;
}

.subscribe-btn {
  background: var(--aff-red);
  color: #fff !important;
  border: none;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.subscribe-btn:hover {
  background: var(--aff-red-dark);
  color: #fff !important;
}

/* Main nav desktop */
.main-nav {
  border-bottom: 1px solid var(--aff-border);
  padding: 0.35rem 0;
}

.nav-link-main {
  color: var(--aff-muted) !important;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.65rem !important;
  position: relative;
}

.nav-link-main:hover {
  color: var(--aff-text) !important;
}

.nav-link-main.active {
  color: var(--aff-red) !important;
}

.nav-link-main.active::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.15rem;
  height: 3px;
  background: var(--aff-red);
  border-radius: 2px;
}

/* Mobile menu strip */
.mobile-menu-strip {
  background: var(--aff-red);
  color: #fff;
  text-align: center;
  padding: 0.4rem 0;
  font-weight: 600;
  display: none;
}

.mobile-menu-strip button {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 600;
}

/* Breaking news */
.breaking-wrap {
  background: var(--aff-grey-bg);
  border-top: 1px solid var(--aff-border);
  border-bottom: 1px solid var(--aff-border);
  overflow: hidden;
}

.breaking-badge {
  background: var(--aff-red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.breaking-inner {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.breaking-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 2%, #000 98%, transparent);
}

.breaking-track {
  display: inline-flex;
  gap: 2.5rem;
  align-items: center;
  white-space: nowrap;
  animation: aff-marquee 45s linear infinite;
  width: max-content;
}

.breaking-track:hover {
  animation-play-state: paused;
}

@keyframes aff-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.break-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.break-item img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 2px;
}

.break-item a {
  color: inherit;
  text-decoration: none;
}

.break-item a:hover {
  color: var(--aff-red);
}

/* Hero / cards */
.hero-card {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  min-height: 420px;
  background: #111;
}

.hero-card .ratio {
  --bs-aspect-ratio: 56%;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent 55%);
  pointer-events: none;
}

.hero-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem 1.5rem;
  z-index: 2;
}

.cat-pill {
  display: inline-block;
  background: #fff;
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.5rem;
}

.hero-body h1 {
  color: #fff;
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}

.hero-body a {
  color: #fff;
  text-decoration: none;
}

.news-grid-card {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  min-height: 220px;
  background: #111;
}

.news-grid-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 220px;
}

.news-grid-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent 50%);
}

.news-grid-card .body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
}

.news-grid-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.news-grid-card a {
  color: #fff;
  text-decoration: none;
}

/* Full width featured strip */
.featured-strip-title {
  border-left: 4px solid var(--aff-red);
  padding-left: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.featured-wide {
  position: relative;
  min-height: 320px;
  background: #111;
  overflow: hidden;
}

.featured-wide img {
  width: 100%;
  height: 380px;
  object-fit: cover;
}

.featured-wide .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent);
}

.featured-wide h2 {
  color: #fff;
  font-weight: 800;
  max-width: 900px;
}

.featured-wide a {
  color: #fff;
  text-decoration: none;
}

/* Sidebar widget */
.sidebar-tabs {
  display: flex;
  border: 1px solid var(--aff-border);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}

.sidebar-tabs button {
  flex: 1;
  border: none;
  background: #fff;
  padding: 0.55rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--aff-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

body.theme-dark .sidebar-tabs button {
  background: #161b22;
  color: #9ca3af;
}

.sidebar-tabs button.active {
  background: var(--aff-red);
  color: #fff;
}

.sidebar-tabs button i {
  font-size: 1rem;
}

.sidebar-list .item {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--aff-border);
  text-decoration: none;
  color: inherit;
}

.sidebar-list .item:last-child {
  border-bottom: none;
}

.sidebar-list .thumb {
  width: 72px;
  height: 52px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 2px;
}

.sidebar-list .meta {
  font-size: 0.72rem;
  color: var(--aff-muted);
}

.sidebar-list h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

/* Breadcrumb */
.breadcrumb-bar {
  background: var(--aff-grey-bg);
  border-bottom: 1px solid var(--aff-border);
  font-size: 0.85rem;
}

.page-title-card {
  border: 1px solid var(--aff-border);
  border-radius: 4px;
  padding: 1.5rem;
  background: #fff;
}

.page-title-card h1 {
  font-weight: 800;
  font-size: 1.75rem;
}

.title-accent {
  height: 4px;
  width: 120px;
  background: var(--aff-red);
  margin-bottom: 0.5rem;
}

.title-accent-line {
  height: 1px;
  background: linear-gradient(90deg, var(--aff-red) 0 120px, var(--aff-border) 120px 100%);
  margin-top: 0.35rem;
}

.sidebar-card {
  border: 1px solid var(--aff-border);
  border-radius: 4px;
  padding: 1rem;
  background: #fff;
  margin-bottom: 1rem;
}

.sidebar-card h3 {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* Section titles */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0 1rem;
  border-bottom: 2px solid var(--aff-border);
  padding-bottom: 0.35rem;
}

.section-heading span {
  font-weight: 800;
  font-size: 1.1rem;
  border-bottom: 3px solid var(--aff-red);
  margin-bottom: -0.5rem;
  padding-bottom: 0.35rem;
}

/* Footer */
.site-footer {
  background: #0b0f14;
  color: #d1d5db;
  margin-top: 3rem;
  padding-top: 2.5rem;
  padding-bottom: 1rem;
}

.site-footer a {
  color: #e5e7eb;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer h4 {
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.footer-advert {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.footer-advert a {
  font-weight: 700;
  color: var(--aff-red);
}

.footer-copy {
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Back to top */
.back-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid var(--aff-border);
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1050;
}

.back-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-top:hover {
  border-color: var(--aff-red);
  color: var(--aff-red);
}

body.theme-dark .back-top {
  background: #161b22;
  border-color: #2d333b;
  color: #e5e7eb;
}

/* Article */
.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-body img {
  max-width: 100%;
  height: auto;
}

/* Responsive */
@media (max-width: 991.98px) {
  .desktop-nav-row {
    display: none !important;
  }

  .mobile-menu-strip {
    display: block;
  }

  .header-desktop-tools {
    display: none !important;
  }

  .header-mobile-tools {
    display: flex !important;
  }

  .brand-block .logo-img {
    max-height: 48px;
  }
}

@media (min-width: 992px) {
  .header-mobile-tools {
    display: none !important;
  }

  .mobile-menu-strip {
    display: none !important;
  }
}

/* Utilities */
.bg-white-card {
  background: #fff;
}

.text-aff-red {
  color: var(--aff-red) !important;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.object-fit-cover {
  object-fit: cover;
}
