/* ==========================================================================
   Global News Pro - Fox News Edition (Optimized & Robust Layout)
   ========================================================================== */

:root {
  --fox-navy: #003366;          /* Fox News Deep Navy */
  --fox-navy-dark: #002244;     /* Fox Header/Footer Navy */
  --fox-red: #cc0000;           /* Fox News Signature Red */
  --fox-red-hover: #b30000;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;
  
  --font-heavy: "Arial Black", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container-max: 1200px;
}

[data-theme="dark"] {
  --bg-primary: #0b0f14;
  --bg-secondary: #141b22;
  --bg-tertiary: #1f2933;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #273142;
  --border-dark: #334155;
  --fox-navy-dark: #070c12;
}

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

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

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

a:hover {
  color: var(--fox-red);
}

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

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

/* ==========================================================================
   1. Fox Top Utility Bar (Markets & LIVE)
   ========================================================================== */
.fox-top-bar {
  background-color: var(--fox-navy-dark);
  color: #cbd5e1;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 0;
}

.fox-top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.top-market-ticker {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  overflow-x: auto;
  white-space: nowrap;
}

.market-item span.up { color: #10b981; }
.market-item span.down { color: #ef4444; }

.live-badge {
  background: var(--fox-red);
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   2. Fox Header & Branding
   ========================================================================== */
.fox-header-main {
  background-color: var(--bg-primary);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.fox-logo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fox-logo-badge {
  background: var(--fox-navy);
  color: #ffffff;
  font-family: var(--font-heavy);
  font-size: 26px;
  font-weight: 900;
  padding: 5px 14px;
  border-bottom: 4px solid var(--fox-red);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.fox-logo-badge span {
  color: var(--fox-red);
}

.brand-tagline {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--fox-red);
  letter-spacing: 0.5px;
}

.brand-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

.search-input-fox {
  padding: 7px 12px;
  border: 1px solid var(--border-dark);
  font-size: 13px;
  border-radius: 3px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  width: 220px;
}

/* ==========================================================================
   3. Fox Signature Navy Navigation
   ========================================================================== */
.fox-nav-bar {
  background-color: var(--fox-navy);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}

.fox-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fox-nav-list {
  display: flex;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
}

.fox-nav-list li a {
  display: block;
  color: #ffffff;
  font-family: var(--font-heavy);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 11px 13px;
  transition: background 0.15s ease;
}

.fox-nav-list li a:hover,
.fox-nav-list li.current-menu-item a {
  background-color: var(--fox-red);
  color: #ffffff;
}

/* Legacy Topics Dropdown */
.fox-legacy-dropdown {
  position: relative;
}

.fox-legacy-toggle {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  text-transform: uppercase;
}

.fox-legacy-toggle:hover {
  background: var(--fox-red);
}

.fox-legacy-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  min-width: 200px;
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
  padding: 6px 0;
}

.fox-legacy-dropdown:hover .fox-legacy-menu {
  display: block;
}

.fox-legacy-menu a {
  display: block;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
}

.fox-legacy-menu a:hover {
  background: var(--bg-secondary);
  color: var(--fox-red);
}

/* ==========================================================================
   4. Fox Red Alert / Breaking Banner
   ========================================================================== */
.fox-breaking-bar {
  background-color: var(--fox-red);
  color: #ffffff;
  padding: 6px 0;
  font-size: 13px;
}

.fox-breaking-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.breaking-flag {
  font-family: var(--font-heavy);
  font-size: 11px;
  background: #ffffff;
  color: var(--fox-red);
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.breaking-headline-link {
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breaking-headline-link a {
  color: #ffffff;
}

.breaking-headline-link a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   5. Fox Frontpage Hero Layout (The Big Story + Rail)
   ========================================================================== */
.fox-main-layout {
  padding: 24px 0 60px;
}

.fox-frontpage-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin-bottom: 40px;
  align-items: start;
}

/* The Big Story Spotlight */
.fox-big-story {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 4px;
}

.fox-category-pill {
  display: inline-block;
  color: var(--fox-red);
  font-family: var(--font-heavy);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.fox-headline-lead {
  font-family: var(--font-heavy);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.fox-headline-lead a:hover {
  color: var(--fox-red);
}

.lead-img-box {
  display: block;
  width: 100%;
  height: 380px;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 14px;
  background: var(--bg-tertiary);
}

.lead-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lead-img-box:hover img {
  transform: scale(1.02);
}

.fox-lead-summary {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.fox-lead-bullets {
  list-style: none;
  border-left: 4px solid var(--fox-red);
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fox-lead-bullets li {
  font-size: 14px;
  font-weight: 700;
}

.fox-lead-bullets li a:hover {
  color: var(--fox-red);
  text-decoration: underline;
}

/* Side Rail (Trending Updates) */
.fox-side-rail {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--fox-navy);
  padding: 16px;
  border-radius: 4px;
}

.rail-heading {
  font-family: var(--font-heavy);
  font-size: 15px;
  text-transform: uppercase;
  color: var(--fox-navy);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rail-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

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

.rail-meta {
  font-size: 11px;
  color: var(--fox-red);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rail-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

/* ==========================================================================
   6. Fox News Section Shelves & Card Grids
   ========================================================================== */
.fox-shelf {
  margin-bottom: 44px;
}

.fox-shelf-header {
  border-bottom: 2px solid var(--fox-navy);
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 8px;
}

.fox-shelf-title {
  font-family: var(--font-heavy);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--fox-navy);
  border-left: 6px solid var(--fox-red);
  padding-left: 10px;
  line-height: 1;
}

.fox-shelf-more {
  font-size: 11px;
  font-weight: 800;
  color: var(--fox-red);
  text-transform: uppercase;
}

.fox-shelf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.fox-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fox-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.fox-card-img-wrap {
  display: block;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.fox-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.fox-card:hover .fox-card-img-wrap img {
  transform: scale(1.03);
}

.fox-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.fox-card-tag {
  color: var(--fox-red);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.fox-card-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 8px;
}

.fox-card-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
}

/* ==========================================================================
   7. Fox Article Single Page
   ========================================================================== */
.fox-article-layout {
  max-width: 820px;
  margin: 0 auto;
}

.fox-article-header {
  margin-bottom: 20px;
}

.fox-article-headline {
  font-family: var(--font-heavy);
  font-size: 34px;
  font-weight: 900;
  line-height: 1.2;
  margin: 10px 0 14px;
}

.fox-article-byline {
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.fox-article-media {
  margin-bottom: 24px;
  border-radius: 4px;
  overflow: hidden;
  max-height: 500px;
}

.fox-article-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fox-article-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-primary);
}

.fox-article-content p {
  margin-bottom: 20px;
}

.news-source-attribution {
  background: var(--bg-secondary);
  border-left: 4px solid var(--fox-navy);
  padding: 12px 16px;
  font-size: 13px;
  margin-top: 30px;
}

/* ==========================================================================
   8. Fox Navy Footer
   ========================================================================== */
.fox-footer {
  background-color: var(--fox-navy-dark);
  color: #cbd5e1;
  padding: 44px 0 24px;
  border-top: 5px solid var(--fox-red);
  font-size: 13px;
}

.fox-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.fox-footer-title {
  color: #ffffff;
  font-family: var(--font-heavy);
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.fox-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.fox-footer-archives {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fox-footer-archives a {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 11px;
  color: #94a3b8;
}

.fox-footer-archives a:hover {
  background: var(--fox-red);
  color: #fff;
}

.fox-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
}

/* ==========================================================================
   9. Responsive Design
   ========================================================================== */
@media (max-width: 992px) {
  .fox-frontpage-grid {
    grid-template-columns: 1fr;
  }
  .fox-side-rail {
    width: 100%;
  }
  .fox-shelf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .fox-footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .fox-shelf-grid {
    grid-template-columns: 1fr;
  }
  .fox-headline-lead {
    font-size: 22px;
  }
  .lead-img-box {
    height: 240px;
  }
}
