/* ===== UASNewsUS – Cyberpunk Theme CSS ===== */

/* --- Color Tokens --- */
:root {
  /* Design tokens from branch */
  --font-sans: 'Noto Sans', system-ui, sans-serif;
  --font-serif: 'Newsreader', serif;
  --transition: .2s ease-in-out;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  
  /* Default: navy-gold (public theme) — matches Patrick's palette */
  --bg-primary: #0a0a0a;
  --bg-secondary: #152244;
  --bg-tertiary: #1e3060;
  --bg: #0a0a0a;
  --panel: #152244;
  --panel-2: #1e3060;
  --text-primary: #ffffff;
  --text-secondary: #d0d8e8;
  --text-muted: #7a8499;
  --fg: #ffffff;
  --muted: #7a8499;
  --accent-cyan: #00d4ff;
  --accent-blue: #1a3a7a;
  --accent-gold: #c9a227;
  --accent-red: #c0392b;
  --gold: #c9a227;
  --blue: #1a3a7a;
  --red: #c0392b;
  --border: #2a3a6a;
  --ad-border: rgba(201, 162, 39, 0.3);
  --ad-background: rgba(21, 34, 68, 0.95);
  --border-glow: rgba(201, 162, 39, 0.35);
  --shadow-glow: rgba(201, 162, 39, 0.12);
  --gradient-cyber: linear-gradient(135deg, #0a0a0a 0%, #152244 100%);
  --gradient-badge: linear-gradient(45deg, #2a3a6a, #1e3060);
}

/* Light theme tokens */
[data-theme='light'] {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f8fb;
  --bg-tertiary: #edf0f7;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #e9eef9;
  --text-primary: #0b1220;
  --text-secondary: #415174;
  --text-muted: #6b7280;
  --fg: #0b1220;
  --muted: #6b7280;
  --accent-cyan: #027aff;
  --accent-blue: #0b5dbb;
  --accent-gold: #b8860b;
  --accent-red: #b91c1c;
  --gold: #b8860b;
  --blue: #0b5dbb;
  --red: #b91c1c;
  --border: #d6dae5;
  --ad-border: rgba(2, 122, 255, 0.22);
  --ad-background: rgba(255, 255, 255, 0.96);
  --border-glow: rgba(2, 122, 255, 0.25);
  --shadow-glow: rgba(2, 122, 255, 0.12);
  --gradient-cyber: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  --gradient-badge: linear-gradient(45deg, #71c6ff, #027aff);
}

/* --- Base Styles --- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 100%);
  min-height: 100vh;
}

[data-theme='light'] body {
  background: radial-gradient(ellipse at center, #ffffff 0%, #f5f7fb 100%);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-blue);
  text-shadow: 0 0 5px var(--accent-cyan);
}

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

/* --- Typography --- */
.font-mono {
  font-family: 'Courier New', monospace;
}

.font-serif {
  font-family: var(--font-serif);
}

/* --- Layout --- */
.container {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.layout-zone-header {
  padding-top: var(--space-3);
}

.editorial-container {
  display: grid;
  gap: var(--space-3);
}

.editorial-unit {
  position: relative;
  border: 1px solid var(--ad-border);
  border-radius: 10px;
  background: var(--ad-background);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.editorial-unit .editorial-link,
.editorial-unit .inline-feature-link,
.editorial-unit .media-feature-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.editorial-img,
.inline-feature-img,
.media-thumb {
  width: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.editorial-banner .editorial-img {
  aspect-ratio: 728 / 90;
}

.editorial-mobile .editorial-img {
  aspect-ratio: 320 / 100;
}

.editorial-banner .editorial-link {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 728 / 90;
}

.editorial-banner .editorial-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

.editorial-sidebar .editorial-link {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 300 / 600;
}

.editorial-sidebar .editorial-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

.content-slot-header .editorial-banner {
  width: min(730px, 100%);
  margin: 0 auto;
}

.content-slot-sidebar .editorial-sidebar {
  width: min(302px, 100%);
  margin: 0 auto;
}

.ad-space-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  background:
    linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(2, 122, 255, 0.08)),
    var(--panel);
  border: 1px dashed var(--accent-gold);
  border-radius: 8px;
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.ad-space-placeholder span {
  font-size: 0.72rem;
}

.ad-space-placeholder strong {
  color: var(--text-primary);
  font-size: 1.15rem;
}

.ad-space-placeholder-square {
  width: 300px;
  max-width: 100%;
  aspect-ratio: 1;
}

.ad-space-placeholder-tower {
  width: 300px;
  max-width: 100%;
  aspect-ratio: 300 / 600;
}

.ad-space-placeholder-footer {
  width: 728px;
  max-width: 100%;
  aspect-ratio: 728 / 90;
  margin: 0 auto;
}

.ad-mockup-placement {
  position: relative;
}

.ad-mockup-placement .ad-mockup-label {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 190px;
  padding: 0.7rem 0.9rem;
  color: #fff;
  background: rgba(8, 16, 28, 0.94);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  font-family: var(--font-sans);
  line-height: 1.15;
  text-align: left;
}

.ad-mockup-label strong {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.ad-mockup-label span {
  font-size: 1.25rem;
}

.ad-mockup-placement .ad-mockup-label::before {
  content: "";
  position: absolute;
  width: 42px;
  height: 2px;
  background: #fff;
  transform-origin: right center;
}

.ad-mockup-placement-header .ad-mockup-label {
  top: 50%;
  right: max(1rem, calc((100% - 1200px) / 2));
  transform: translateY(-50%);
}

.ad-mockup-placement-header .ad-mockup-label::before {
  top: 50%;
  right: 100%;
}

.ad-mockup-placement-sidebar .ad-mockup-label {
  top: 1.25rem;
  right: calc(100% + 1rem);
}

.ad-mockup-placement-sidebar .ad-mockup-label::before {
  top: 50%;
  left: 100%;
}

.ad-mockup-sidebar-square {
  margin-top: 1.5rem;
}

.ad-mockup-placement-footer .ad-mockup-label {
  top: 50%;
  left: calc(100% + 1rem);
  transform: translateY(-50%);
}

.ad-mockup-placement-footer .ad-mockup-label::before {
  top: 50%;
  right: 100%;
}

@media (max-width: 1100px) {
  .ad-mockup-placement .ad-mockup-label {
    position: relative;
    inset: auto;
    width: fit-content;
    margin: 0.75rem auto 0;
    transform: none;
  }

  .ad-mockup-placement .ad-mockup-label::before {
    display: none;
  }
}

.editorial-native-type .inline-feature-img {
  aspect-ratio: 300 / 250;
}

.editorial-text,
.inline-feature-content,
.media-feature-info {
  padding: 1rem;
}

.editorial-title,
.inline-feature-title,
.media-feature-title {
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.editorial-desc,
.inline-feature-desc,
.media-feature-desc,
.inline-feature-cta {
  color: var(--text-secondary);
}

.inline-feature {
  display: grid;
  gap: 0.75rem;
}

.inline-feature-header {
  padding: 0.75rem 1rem 0;
}

.sponsored-label,
.editorial-badge span {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.media-feature-thumb {
  position: relative;
}

.play-button {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 1.25rem;
}

.editorial-badge {
  padding: 0 1rem 1rem;
}

.editorial-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* --- Cyberpunk Background --- */
.cyberpunk-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 128, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.03) 0%, transparent 50%);
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.1;
  animation: grid-pulse 4s ease-in-out infinite;
}

@keyframes grid-pulse {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.2; }
}

/* --- Header --- */
header { padding: var(--space-3) 0; }

.header {
  position: relative;
  z-index: 10;
  padding: 0.75rem 0;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.drone-icon {
  display: block;
  width: 3.09rem;
  height: 2.32rem;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  color: var(--accent-cyan);
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px var(--accent-cyan));
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.footer-drone-icon {
  display: block;
  width: 2rem;
  height: 1.5rem;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
}

.footer-flag-icon {
  display: block;
  width: 1.9rem;
  height: 1.27rem;
  flex-shrink: 0;
  border-radius: 2px;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px var(--accent-cyan));
  margin: 0;
}

/* --- Navigation --- */
.nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav a {
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav a:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 10px var(--shadow-glow);
}

/* Theme Toggle (rounded neon button) */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  background: rgba(0, 0, 0, 0.35);
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  box-shadow: 0 0 10px var(--shadow-glow);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(0, 255, 255, 0.08);
  box-shadow: 0 0 16px var(--shadow-glow);
}

.theme-toggle:active {
  transform: translateY(0);
}

/* --- Search Bar --- */
.search-bar { display: flex; gap: var(--space-2); }
.search-bar input {
  flex: 1;
  padding: var(--space-2);
  border-radius: .25rem;
  border: none;
  background: var(--panel);
  color: var(--fg);
}
.search-bar button {
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: .25rem;
  background: var(--gold);
  color: #000;
  font-weight: 600;
  cursor: pointer;
}
.search-bar button:hover { background: #ffe866; }

/* --- Main Content --- */
.main-content {
  position: relative;
  z-index: 5;
  padding: 3rem 0;
}

/* --- Hero Section --- */
.hero {
  margin-top: var(--space-4);
  position: relative;
  height: 60vh;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hero .bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: -1;
  animation: heroScan 8s linear infinite;
}

@keyframes heroScan {
  0% { transform: scale(1.0) translateX(0); }
  25% { transform: scale(1.05) translateX(-2%); }
  50% { transform: scale(1.0) translateX(0); }
  75% { transform: scale(1.05) translateX(2%); }
  100% { transform: scale(1.0) translateX(0); }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--space-5);
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  max-width: 600px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  margin: 0 0 var(--space-2) 0;
  text-shadow: 0 0 20px rgba(0,255,255,0.5);
  animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { text-shadow: 0 0 20px rgba(0,255,255,0.5); }
  to { text-shadow: 0 0 30px rgba(0,255,255,0.8), 0 0 40px rgba(0,255,255,0.4); }
}

.hero-subtitle {
  font-size: 1.25rem;
  margin: 0;
  opacity: 0.9;
  font-weight: 300;
  animation: subtitleFade 3s ease-in-out infinite alternate;
}

@keyframes subtitleFade {
  from { opacity: 0.9; }
  to { opacity: 1; }
}

/* --- Carousel --- */
.carousel {
  display: flex;
  overflow-x: auto;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  scroll-snap-type: x mandatory;
  justify-content: flex-start;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-item {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: var(--panel);
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.carousel-item .thumb {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}
.carousel-item h3 {
  margin: 0;
  padding: var(--space-3);
  font-size: 1.125rem;
}

/* Desktop carousel centering and responsive adjustments */
@media (min-width: 1024px) {
  .carousel {
    justify-content: center;
    max-width: 1000px; /* 3 items * 300px + 2 gaps * 16px */
    margin: 0 auto;
    overflow-x: visible; /* Disable horizontal scroll on desktop */
  }

  .carousel-item {
    flex: 0 0 calc(33.333% - 1rem); /* Equal width for 3 items with gap */
    max-width: 300px;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  .carousel {
    justify-content: flex-start;
    max-width: none;
  }

  .carousel-item {
    flex: 0 0 280px; /* Slightly smaller on tablets */
  }
}

/* --- Grid Layout --- */
.grid { display: grid; gap: var(--space-3); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* --- News Grid --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* --- Article Cards --- */
.article-card {
  background: var(--panel);
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,.4);
  display: block;
}
.article-card .thumb {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}
.article-card h3 {
  margin: 0;
  padding: var(--space-3);
  font-size: 1.125rem;
}

/* --- News Cards --- */
.news-card {
  background: var(--gradient-cyber);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.news-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-cyan);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 20px var(--shadow-glow);
}

.news-card:hover::before {
  opacity: 1;
}

.news-card-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.news-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.news-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  line-height: 1.3;
}

.news-card-excerpt {
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.news-card-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.read-more {
  background: transparent;
  color: var(--accent-cyan);
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-cyan);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.read-more:hover {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  box-shadow: 0 0 15px var(--shadow-glow);
}

/* --- Category Badges --- */
.category-badge {
  display: inline-block;
  background: var(--gradient-badge);
  color: #000;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0.25rem;
  box-shadow: 0 2px 10px rgba(0, 255, 255, 0.3);
}

.category-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
}

/* --- Markdown & LaTeX Content Styling --- */
.article-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.article-content p {
  margin: 0 0 1.25rem 0;
  line-height: 1.7;
}

.article-content h2 {
  margin: 2.25rem 0 1rem 0;
  color: var(--accent-cyan);
  font-family: var(--font-serif);
}

.article-content h3 {
  margin: 1.75rem 0 0.75rem 0;
  color: var(--text-primary);
}

.article-content iframe {
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.article-content .math {
  font-family: 'Courier New', monospace;
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.article-content sub {
  vertical-align: sub;
  font-size: 0.8em;
}

.article-content sup {
  vertical-align: super;
  font-size: 0.8em;
}

/* Enhanced code block styling */
.article-content pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: 'Courier New', monospace;
  line-height: 1.5;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

/* Blockquote styling */
.article-content blockquote {
  border-left: 4px solid var(--accent-cyan);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
}

/* List styling enhancements */
.article-content ul, .article-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-content li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Enhanced link styling */
.article-content a {
  color: var(--accent-cyan);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
  text-decoration: none;
}

.article-content a:hover {
  border-bottom-color: var(--accent-cyan);
}

/* --- Section Titles --- */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  margin: 3rem 0 1rem 0;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-badge);
  border-radius: 2px;
}

.article-title {
  font-family: var(--font-serif);
  font-weight: 700;
}

/* --- Modern Stock Ticker --- */
.ticker-section {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.ticker-container {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  position: relative;
}

.ticker-label {
  background: var(--gradient-badge);
  color: #000;
  padding: 0.25rem 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 2rem;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 255, 255, 0.3);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.ticker-track {
  display: flex;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 3rem;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-item:hover {
  background: var(--panel);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.ticker-item strong {
  color: var(--text-primary);
  font-weight: 700;
}

.ticker-item .change {
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.ticker-item.positive .change {
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
}

.ticker-item.negative .change {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
}

/* --- Legacy Stock Ticker (keep for compatibility) --- */
.stock-ticker {
  background: rgba(0, 128, 255, 0.9);
  color: #fff;
  padding: 0.75rem 0;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--accent-blue);
  border-bottom: 1px solid var(--accent-blue);
  position: relative;
}

.stock-ticker .ticker-track {
  display: flex;
  width: calc(200% + 4rem);
  animation: ticker-scroll 31.5s linear infinite;
  /* Hardware acceleration for smooth animation */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform;
  /* Prevent animation restart on content updates */
  animation-play-state: running;
}

.ticker-content {
  display: flex;
}

@keyframes ticker-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Ensure ticker animation continues without interruption */
.stock-ticker .ticker-track {
  animation-fill-mode: forwards;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  /* Preserve animation state during DOM updates */
  contain: layout style paint;
}

/* Prevent animation restart on DOM updates */
.stock-ticker .ticker-track * {
  animation-fill-mode: inherit;
  /* Ensure child elements don't trigger parent animation restart */
  will-change: auto;
}

.ticker-item {
  display: inline-block;
  margin-right: 3rem;
  font-weight: 600;
}
.ticker-positive { color: #00ff88; }
.ticker-negative { color: #ff4444; }

/* --- Tabs --- */
.tabs { margin-top: var(--space-5); }
.tab-list {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--panel);
}
.tab {
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}
.tab.active {
  background: var(--panel);
  border-radius: .25rem .25rem 0 0;
}
.tab-content { display: none; padding: var(--space-3) 0; }
.tab-content.active { display: block; }

/* --- Aspect Ratio --- */
.aspect-video {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  width: 100%;
}

/* --- Footer --- */
.footer {
  margin-top: var(--space-5);
  padding: var(--space-4) 0;
  text-align: center;
  font-size: .875rem;
  color: var(--muted);
}

/* --- Loading States --- */
.loading-pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .site-title {
    font-size: 2rem;
  }
  
  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Focus States --- */
a:focus, button:focus {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mr-5 { margin-right: var(--space-5); }
