/* FTMQ News - BBC-Style Design */
:root {
  --red: #b80000;
  --red-dark: #8b0000;
  --red-live: #d32f2f;
  --black: #1a1a1a;
  --gray-dark: #3a3a3a;
  --gray: #5a5a5a;
  --gray-light: #8a8a8a;
  --gray-border: #e0e0e0;
  --gray-bg: #f4f4f4;
  --white: #ffffff;
  --blue-link: #0066cc;
}

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

body {
  font-family: 'Libre Franklin', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--white);
  color: var(--black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== TOP HEADER ===== */
.top-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--black);
  border-radius: 4px;
}

.menu-btn:hover {
  background: var(--gray-bg);
}

.logo-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.logo {
  display: flex;
  gap: 3px;
}

.logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--black);
  color: var(--white);
  font-weight: 800;
  font-size: 22px;
}

.logo-box.small {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

.bitcoin-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--gray-bg);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-dark);
  white-space: nowrap;
}

.ticker-label {
  font-weight: 700;
  color: var(--black);
}

.ticker-price {
  font-family: 'Monaco', 'Courier New', monospace;
  font-weight: 600;
  color: var(--black);
}

.ticker-price.positive {
  color: #2d7d2d;
}

.ticker-price.negative {
  color: var(--red);
}

@media (max-width: 768px) {
  .bitcoin-ticker {
    font-size: 12px;
    padding: 6px 10px;
    gap: 6px;
  }
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--black);
  border-radius: 4px;
}

.header-btn:hover {
  background: var(--gray-bg);
}

/* ===== MAIN NAVIGATION ===== */
.main-nav {
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-primary {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 4px;
}

.nav-primary li a {
  display: block;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--black);
  transition: background 0.15s;
}

.nav-primary li a:hover {
  background: var(--gray-bg);
}

.nav-primary li a.active {
  border-bottom: 3px solid var(--red);
}

/* ===== SECTION NAVIGATION ===== */
.section-nav {
  background: var(--gray-bg);
  border-bottom: 1px solid var(--gray-border);
}

.nav-secondary {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-secondary li a {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--gray-dark);
  white-space: nowrap;
  transition: background 0.15s;
}

.nav-secondary li a:hover,
.nav-secondary li a.active {
  background: var(--white);
  color: var(--black);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  background: var(--white);
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.page-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--red);
  padding: 24px 0;
  letter-spacing: 2px;
}

/* ===== HERO SECTION ===== */
.hero-section {
  margin-bottom: 30px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 24px;
  min-height: 400px;
}

/* Left Column - Lead Story */
.hero-lead {
  display: flex;
  flex-direction: column;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red-live);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.live-badge::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  background: var(--red-live);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

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

.hero-lead .lead-headline {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
}

.hero-lead .lead-headline a:hover {
  text-decoration: underline;
}

.hero-lead .lead-summary {
  font-size: 15px;
  color: var(--gray);
  line-height: 1.6;
}

/* Center - Hero Image */
.hero-center {
  position: relative;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.hero-image-link {
  display: block;
  height: 100%;
}

/* Right Column - Side Stories */
.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-story {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-story .story-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.sidebar-story .story-headline {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.sidebar-story .story-headline a:hover {
  text-decoration: underline;
}

.sidebar-story .story-summary {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
}

.sidebar-story .story-meta {
  font-size: 13px;
  color: var(--gray-light);
}

.sidebar-story .story-meta .category {
  color: var(--gray-dark);
}

/* ===== STORY GRID ===== */
.story-grid-section {
  margin-bottom: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-border);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.story-card {
  display: flex;
  flex-direction: column;
}

.story-card .card-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  margin-bottom: 10px;
}

.story-card .card-headline {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}

.story-card .card-headline a:hover {
  text-decoration: underline;
}

.story-card .card-summary {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== SECTION BLOCKS ===== */
.two-column-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.section-block {
  padding-top: 20px;
  border-top: 1px solid var(--gray-border);
}

.section-block.full-width {
  grid-column: span 2;
}

.section-heading {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--black);
}

.article-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-article {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-border);
}

.stack-article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stack-article .article-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.stack-article .article-content {
  display: flex;
  flex-direction: column;
}

.stack-article .article-headline {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}

.stack-article .article-headline a:hover {
  text-decoration: underline;
}

.stack-article .article-summary {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stack-article .article-meta {
  font-size: 13px;
  color: var(--gray-light);
  margin-top: 6px;
}

.stack-article .article-source {
  color: var(--gray-dark);
  font-weight: 500;
}

/* Local Block Accent */
.local-block {
  border-top-color: #1a6b1a;
}

.local-block .section-heading {
  color: #1a6b1a;
}

/* ===== TRENDING ROW ===== */
.trending-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.trending-item {
  display: flex;
  flex-direction: column;
}

.trending-item .trend-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  margin-bottom: 8px;
}

.trending-item .trend-headline {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.trending-item .trend-headline a:hover {
  text-decoration: underline;
}

/* ===== LOADING / EMPTY STATES ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--gray-light);
  font-style: italic;
}

.empty {
  text-align: center;
  padding: 30px;
  color: var(--gray-light);
}

.loading-skeleton {
  display: contents;
}

.skeleton-left,
.skeleton-center,
.skeleton-right {
  background: var(--gray-bg);
  border-radius: 4px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--black);
  color: var(--white);
  padding: 40px 20px;
  text-align: center;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-bottom: 20px;
}

.footer-logo .logo-box {
  background: var(--white);
  color: var(--black);
}

.footer-text {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--gray-light);
}

.footer-sources {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 10px;
}

.footer-update {
  font-size: 12px;
  color: var(--gray);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .hero-lead {
    grid-column: span 2;
    order: 2;
  }
  
  .hero-center {
    grid-column: span 2;
    order: 1;
    height: 300px;
  }
  
  .hero-sidebar {
    grid-column: span 2;
    order: 3;
    flex-direction: row;
    gap: 20px;
  }
  
  .sidebar-story {
    flex: 1;
  }
  
  .story-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .trending-row {
    grid-template-columns: repeat(3, 1fr);
  }
}


@media (max-width: 500px) {
  .story-grid {
    grid-template-columns: 1fr;
  }
  
  .trending-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .stack-article {
    grid-template-columns: 100px 1fr;
    gap: 10px;
  }
  
  .logo-box {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  
  .header-container {
    padding: 8px 12px;
  }
  
  .nav-primary li a {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .nav-secondary li a {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* Dark mode disabled - always use light theme like BBC */

/* Placeholder images */
.placeholder-img {
  background: linear-gradient(135deg, var(--gray-bg) 0%, var(--gray-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-light);
  font-size: 12px;
}

/* ===== SECTION PAGES ===== */
.section-header {
  text-align: center;
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--gray-border);
  margin-bottom: 30px;
}

.section-title {
  font-size: 42px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 10px;
}

.section-subtitle {
  font-size: 18px;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.4;
}

/* Articles Grid for Section Pages */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

.article-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.article-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gray-bg);
}

.article-card-content {
  padding: 20px;
}

.article-card-headline {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
}

.article-card-headline a {
  color: var(--black);
  transition: color 0.2s ease;
}

.article-card-headline a:hover {
  color: var(--red);
}

.article-card-summary {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.4;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  font-size: 12px;
  color: var(--gray-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Section Heading Improvements */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-heading a {
  color: var(--black);
  transition: color 0.2s ease;
}

.section-heading a:hover {
  color: var(--red);
}

.view-all {
  font-size: 14px;
  color: var(--blue-link);
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.view-all:hover {
  opacity: 1;
}

/* Responsive for Section Pages */


.rip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.rip-card {
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.rip-card:hover {
  transform: translateY(-2px);
}

.rip-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 15px;
  border: 3px solid var(--gray-border);
}

.rip-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--black);
}

.rip-name a {
  color: inherit;
  transition: color 0.2s ease;
}

.rip-name a:hover {
  color: var(--red);
}

.rip-message {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 10px;
  font-style: italic;
}

.rip-meta {
  font-size: 12px;
  color: var(--gray-light);
}

/* Responsive RIP */

@media (max-width: 500px) {
  .rip-row {
    grid-template-columns: 1fr 1fr;
  }
}

  .mobile-menu-overlay,
  .mobile-menu,
  .menu-btn {
    display: none !important;
  }
  
  .main-nav {
    display: block;
  }
}

/* ===== MOBILE MENU - IMPROVED ===== */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: var(--white);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  z-index: 999;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-menu.active {
  display: flex;
  flex-direction: column;
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid var(--black);
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 10;
}

.mobile-menu-header h2 {
  font-size: 16px;
  margin: 0;
  font-weight: 800;
  letter-spacing: 1px;
}

.menu-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.mobile-menu-list li {
  border-bottom: 1px solid var(--gray-border);
}

.mobile-menu-list a {
  display: block;
  padding: 14px 20px;
  color: var(--black);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s ease;
  border-left: 4px solid transparent;
}

.mobile-menu-list a:active {
  background: var(--gray-bg);
  border-left-color: var(--red);
}

/* Explicit mobile menu button visibility */
@media (max-width: 768px) {
  .menu-btn {
    display: block !important;
  }
  
  .main-nav {
    display: none !important;
  }
  
  .mobile-menu,
  .mobile-menu-overlay {
    display: block !important;
  }
}

/* Explicit desktop menu button hiding */
@media (min-width: 769px) {
  .menu-btn {
    display: none !important;
  }
  
  .mobile-menu,
  .mobile-menu-overlay {
    display: none !important;
  }
  
  .main-nav {
    display: block !important;
  }
}
