/* Custom styling and utilities for WRC (Welfare & Relief Committee) Website */
/* Only CSS that Tailwind cannot replicate is kept here. */
/* Animations (pulse-glow, progress) are now in Tailwind config. */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'Inter', sans-serif;
  --color-primary: #ca0000;
  --color-primary-hover: #a30000;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Outfit', sans-serif;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar (no Tailwind equivalent) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: #ca0000;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a30000;
}

/* Reveal animation for timeline section (state-based, requires CSS) */
.reveal,
.fade-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.is-visible,
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

#spine-fill {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .15s linear;
}

.timeline-track {
  position: relative;
}

.node-dot {
  box-shadow: 0 0 0 6px #f8fafc;
}

/* --- Clean White Mega Menu & Dropdown Styling (complex selectors) --- */

.nav-item-dropdown {
  position: relative;
}

.nav-link-item {
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.nav-link-item:hover,
.nav-item-dropdown:hover > .nav-link-item,
.nav-item-dropdown:focus-within > .nav-link-item {
  background-color: transparent !important;
  color: var(--color-primary) !important;
}

.nav-item-dropdown:hover > .nav-link-item i,
.nav-item-dropdown:focus-within > .nav-link-item i {
  color: var(--color-primary) !important;
}

.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  left: 0;
  right: auto;
  max-width: min(100vw, 360px);
  box-sizing: border-box;
  /* The news ticker is the next sibling inside the sticky <header> and paints at
     z-index 10; without a z-index of its own the menu was drawn *behind* it, so a
     hovering dropdown disappeared into the ticker band. .nav-item-dropdown is
     position: relative with z-index auto, so this value is resolved against the
     header's stacking context and 60 clears the ticker. */
  z-index: 60;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-item-dropdown[data-align="right"] .dropdown-menu,
.nav-item-dropdown.right-align .dropdown-menu {
  left: auto;
  right: 0;
}

/* Mega Menu Alignment for Desktop Viewports */
@media (min-width: 1280px) {
  .mega-menu-full {
    width: min(1100px, calc(100vw - 3rem));
    max-width: 700px;
    left: 0;
    right: auto;
    transform: translateX(0) translateY(8px);
  }
  .nav-item-dropdown:hover .mega-menu-full {
    transform: translateX(0) translateY(0);
  }
}

.dropdown-menu a,
.mega-menu a {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid transparent;
  color: #334155;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.dropdown-menu a i,
.mega-menu a i {
  color: #ca0000;
}

.dropdown-menu a:hover,
.mega-menu a:hover {
  background: rgba(254, 226, 226, 0.95);
  color: #0f172a;
  border-color: rgba(202, 0, 0, 0.24);
  transform: translateX(1px);
}

.dropdown-menu a:hover i,
.mega-menu a:hover i {
  color: #a30000;
}

.dropdown-menu a + a,
.mega-menu a + a {
  margin-top: 0.35rem;
}

/* Mobile submenu items match the desktop dropdown tone */
.mobile-submenu a {
  border-radius: 0.75rem;
}
.mobile-submenu a:hover {
  background: rgba(254, 226, 226, 0.95);
  color: #0f172a;
}

/* Mobile Accordion Smooth Collapse */
.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-submenu.open {
  max-height: 800px;
}

/* Hamburger to X animation */
.hamburger-line {
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.25s ease;
  transform-origin: center;
}
.mobile-menu-btn.menu-open .hamburger-line:first-child {
  transform: translateY(8px) rotate(45deg);
}
.mobile-menu-btn.menu-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-menu-btn.menu-open .hamburger-line:last-child {
  transform: translateY(-8px) rotate(-45deg);
}

/* === MOBILE SIDE TRAY === */
/* Hidden by default on all screens */
.mobile-tray-overlay,
.mobile-tray {
  display: none;
}

@media (max-width: 1023px) {
  .mobile-tray-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 70;
    pointer-events: none;
    transition: background 0.45s cubic-bezier(0.4, 0, 0.2, 1), backdrop-filter 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: background, backdrop-filter;
  }
  .mobile-tray-overlay.active {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    pointer-events: auto;
  }

  .mobile-tray {
    position: fixed;
    top: 0;
    right: 0;
    width: min(380px, 88vw);
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 80;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    will-change: transform;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  }
  .mobile-tray.active {
    transform: translateX(0);
  }

  .mobile-tray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
  }

  .mobile-tray-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    background: none;
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .mobile-tray-close:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: rotate(90deg);
  }

  .mobile-tray-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.75rem 1rem 2rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .mobile-tray-body::-webkit-scrollbar {
    display: none;
  }

  .mobile-tray-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .mobile-tray-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0.875rem;
    border-radius: 0.625rem;
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.25s ease, color 0.25s ease, opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
  }
  .mobile-tray-link:hover,
  .mobile-tray-link:active {
    background: #f8fafc;
    color: #0f172a;
  }

  .mobile-tray-link.active-link,
  .mobile-tray-submenu a.active-link {
    color: #ca0000;
    background: rgba(202, 0, 0, 0.06);
  }

  .mobile-tray-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.8rem 0.875rem;
    border-radius: 0.625rem;
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.25s ease, color 0.25s ease, opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mobile-tray-accordion-btn:hover {
    background: #f8fafc;
  }

  .mobile-tray-accordion-btn .acc-icon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.6rem;
    color: #94a3b8;
  }
  .mobile-tray-accordion-btn.open .acc-icon {
    transform: rotate(180deg);
    color: #475569;
  }

  .mobile-tray-submenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 0.5rem;
    overflow: hidden;
  }
  .mobile-tray-submenu > div {
    overflow: hidden;
  }
  .mobile-tray-submenu.open {
    grid-template-rows: 1fr;
  }

  .mobile-tray-submenu a {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    text-decoration: none;
  }
  .mobile-tray-submenu a:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateX(3px);
  }

  .mobile-tray-footer {
    padding: 0.875rem 1rem;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
  }

  .mobile-tray-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem 1.5rem;
    border-radius: 0.625rem;
    background: #ca0000;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  }
  .mobile-tray-cta:hover {
    background: #a30000;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(202, 0, 0, 0.3);
  }

  body.tray-open {
    overflow: hidden;
  }
}

/* Gallery Items */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  cursor: pointer;
}
.gallery-item::after {
  content: '\f00e';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(202, 0, 0, 0.7);
  color: white;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover::after {
  opacity: 1;
}

/* Lightbox transitions */
#gallery-lightbox {
  transition: opacity 0.3s ease;
}
#gallery-lightbox img {
  transition: transform 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .fade-up {
    transition: none !important;
    transform: none !important;
  }
  .mobile-tray,
  .mobile-tray-overlay {
    transition: none !important;
  }
  .mobile-tray-link,
  .mobile-tray-accordion-btn {
    transition: none !important;
  }
  .hamburger-line {
    transition: none !important;
  }
  .mobile-tray-submenu {
    transition: none !important;
  }
  .mobile-tray-close {
    transition: none !important;
  }
}

/* --- WRC "Our Work" Enhancement CSS --- */

/* Breadcrumb Component */
.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}
.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.breadcrumb-item a {
  color: #ca0000;
  transition: color 0.2s ease;
  text-decoration: none;
}
.breadcrumb-item a:hover {
  color: #a30000;
}
.breadcrumb-separator {
  color: #cbd5e1;
}

/* Program Card Hover & Animations */
.program-card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.program-card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(202, 0, 0, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

/* Image overlay for program hero sections */
.hero-image-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.85) 100%);
}

/* Process Timeline (Horizontal on desktop, Vertical on mobile) */
.process-timeline {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
}
.process-step {
  flex: 1;
  position: relative;
  text-align: center;
}
.process-step::after {
  content: '';
  position: absolute;
  top: 1.75rem;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}
.process-step:last-child::after {
  display: none;
}
.process-icon-wrapper {
  position: relative;
  z-index: 10;
  background: white;
  margin: 0 auto 1rem;
}

@media (max-width: 1024px) {
  .process-timeline {
    flex-direction: column;
    gap: 1.5rem;
  }
  .process-step {
    text-align: left;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
  }
  .process-step::after {
    left: 1.75rem;
    top: 3.5rem;
    width: 2px;
    height: calc(100% + 1.5rem);
  }
  .process-step:last-child::after {
    display: none;
  }
  .process-icon-wrapper {
    margin: 0;
    flex-shrink: 0;
  }
}

/* Project snapshot grid */
.snapshot-grid-item {
  border-right: 1px solid #e2e8f0;
}
.snapshot-grid-item:last-child {
  border-right: none;
}
@media (max-width: 768px) {
  .snapshot-grid-item {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  .snapshot-grid-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
}

/* === PREMIUM PROJECT DETAIL ANIMATIONS === */

/* Hero Parallax */
.hero-parallax {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  will-change: transform;
}
@media (max-width: 768px) {
  .hero-parallax {
    background-attachment: scroll;
  }
}

/* Float Animation for Particles */
@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  25% { transform: translateY(-20px) translateX(10px); opacity: 0.6; }
  50% { transform: translateY(-10px) translateX(-5px); opacity: 0.4; }
  75% { transform: translateY(-25px) translateX(15px); opacity: 0.5; }
}
.animate-float {
  animation: float 8s ease-in-out infinite;
}
.animate-float-delayed {
  animation: float 10s ease-in-out 2s infinite;
}

/* Fade In Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.8s ease-out 0.3s both;
}
.animate-slide-up {
  animation: slideUp 0.8s ease-out 0.5s both;
}
.animate-slide-up-delay {
  animation: slideUp 0.8s ease-out 0.7s both;
}
.animate-fade-in-delay {
  animation: fadeIn 0.8s ease-out 0.9s both;
}

/* Scroll Indicator Animation */
@keyframes scrollIndicator {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}
.animate-scroll-indicator {
  animation: scrollIndicator 1.5s ease-in-out infinite;
}

/* Progress Bar Fill Animation */
.progress-bar-fill {
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress Ring Animation */
@keyframes progressRing {
  from { stroke-dashoffset: 339.292; }
}
.progress-ring-circle {
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reveal Section Animation */
.reveal-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-section.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-section:nth-child(2) { transition-delay: 0.1s; }
.reveal-section:nth-child(3) { transition-delay: 0.2s; }
.reveal-section:nth-child(4) { transition-delay: 0.3s; }

/* Timeline Line Animation */
@keyframes timelineLine {
  from { height: 0; }
  to { height: 100%; }
}
.timeline-line {
  animation: timelineLine 1.5s ease-out forwards;
}

/* Timeline Item Animation */
.timeline-item {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.timeline-item.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Quick Facts Bar Shadow on Scroll */
.quick-facts-bar {
  transition: box-shadow 0.3s ease;
}
.quick-facts-bar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Gallery Hover Effects */
.gallery-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

/* Button Hover Effects */
.btn-premium {
  position: relative;
  overflow: hidden;
}
.btn-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.btn-premium:hover::before {
  left: 100%;
}

/* Card Hover Lift Effect */
.card-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Sticky Sidebar Enhancement */
@media (min-width: 1024px) {
  .lg\:sticky {
    position: sticky;
    top: 8rem;
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
  }
  .lg\:sticky::-webkit-scrollbar {
    width: 4px;
  }
  .lg\:sticky::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
  }
}

/* Number Counter Animation */
.counter-number {
  font-variant-numeric: tabular-nums;
}

/* Mobile Responsive Adjustments */
@media (max-width: 1023px) {
  .quick-facts-bar {
    position: relative;
    top: auto;
    z-index: auto;
  }
}

/* Print Styles */
@media print {
  .hero-parallax {
    background-attachment: scroll !important;
  }
  .quick-facts-bar {
    position: relative;
    top: auto;
  }
  .reveal-section {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Line Clamp Utility */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dashboard Donut Chart */
.donut-segment {
  transition: all 0.5s ease;
}
.donut-segment:hover {
  filter: brightness(1.2);
}

/* Dashboard Stat Cards */
.dashboard-stat-card {
  position: relative;
  overflow: hidden;
}
.dashboard-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-color, #ca0000), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.dashboard-stat-card:hover::before {
  opacity: 1;
}

/* Sector Bar Animation */
.sector-bar-fill {
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dashboard Counter */
.dashboard-counter {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   LATEST NEWS TICKER (sticky under the main header nav)
   The track holds two identical copies of the headline list and
   slides to -50%, so the loop is seamless with no visible jump.
   ============================================================ */
/* Brand-red band, matching the theme. Solid rather than translucent so the
   headlines stay legible over any page background scrolling underneath. */
.news-ticker {
  background: linear-gradient(180deg, #d10000 0%, #ca0000 55%, #b80000 100%);
}

.news-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: news-ticker-scroll var(--ticker-duration, 60s) linear infinite;
  will-change: transform;
}

/* Soft edges so headlines fade out instead of being cut off. */
.news-ticker-viewport {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%);
}

/* Reading a headline should not make it run away. */
.news-ticker-viewport:hover .news-ticker-track,
.news-ticker-viewport:focus-within .news-ticker-track {
  animation-play-state: paused;
}

.news-ticker-item::after {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  margin-left: 0.75rem;
  flex: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .news-ticker-track {
    animation: none;
  }
  .news-ticker-viewport {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ============================================================
   NEWS ARTICLE BODY
   The Tailwind CDN build ships no typography plugin, so the old
   `prose-*` classes never matched anything, and Tailwind's
   preflight resets margin to 0 on p / h2 / ul. Between them the
   whole article painted as one unbroken block of text with an
   h2 the same size as the body copy. These rules do the
   typesetting that `prose` was supposed to do.
   ============================================================ */
.article-body {
  /* ~66 characters at 17px: long enough to avoid ragged wrapping,
     short enough that the eye does not lose its place on the return sweep. */
  max-width: 46rem;
  margin-inline: auto;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #334155;
}

/* Every top-level block after the first gets breathing room. */
.article-body > * + * {
  margin-top: 1.25rem;
}

/* Opening paragraph: larger, darker, ruled in brand red so the article
   has a visible entry point instead of fading into the page. */
.article-body > p:first-child {
  font-size: 1.1875rem;
  line-height: 1.7;
  font-weight: 500;
  color: #0e1f27;
  padding-left: 1rem;
  border-left: 4px solid #ca0000;
}

/* Section headings share the same red rule as the lead, so the page
   reads as one system rather than a heading bolted onto body text. */
.article-body > h2,
.article-body > h3 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  color: #0e1f27;
  line-height: 1.35;
  letter-spacing: -0.01em;
  padding-left: 1rem;
  border-left: 4px solid #ca0000;
}

.article-body > h2 {
  font-size: 1.4rem;
  margin-top: 2.75rem;
}

.article-body > h3 {
  font-size: 1.15rem;
  margin-top: 2.1rem;
}

/* A heading directly after another block still needs the section gap. */
.article-body > * + h2,
.article-body > * + h3 {
  margin-top: 2.75rem;
}

/* Bullet lists become a "key points" panel: tinted card, red rule down the
   left, and a check marker on every item instead of a default disc. */
.article-body > ul,
.article-body > ol {
  list-style: none;
  margin-top: 1.75rem;
  padding: 1.3rem 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #ca0000;
  border-radius: 18px;
  display: grid;
  gap: 0.7rem;
  counter-reset: wrc-item;
}

.article-body > ul > li,
.article-body > ol > li {
  position: relative;
  padding-left: 2.1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
}

.article-body > ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #ca0000
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.3 6.3l2.4 2.4 4.9-5.3' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 11px 11px no-repeat;
  box-shadow: 0 3px 8px rgba(202, 0, 0, 0.28);
}

/* Ordered lists keep real numbers, restyled to match the panel. */
.article-body > ol > li::before {
  counter-increment: wrc-item;
  content: counter(wrc-item);
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0.2rem;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #ca0000;
  font-family: 'Poppins', 'Inter', sans-serif;
}

/* In-article photograph: 16:9 crop so mixed source sizes still line up. */
.article-body > .ab-figure {
  margin-top: 2rem;
}

.article-body > .ab-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 22px 46px -30px rgba(15, 23, 42, 0.7);
}

.article-body > .ab-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  text-align: center;
}

.article-body blockquote {
  margin-top: 1.75rem;
  padding: 1.1rem 1.4rem;
  background: #f8fafc;
  border-left: 4px solid #ca0000;
  border-radius: 0 16px 16px 0;
  font-size: 1.1rem;
  font-style: italic;
  color: #1e293b;
}

.article-body a {
  color: #ca0000;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.18s ease;
}

.article-body a:hover {
  color: #a30000;
}

.article-body strong,
.article-body b {
  color: #0e1f27;
  font-weight: 600;
}

.article-body img {
  max-width: 100%;
  height: auto;
}

/* Small screens: keep the rules but tighten the measure to the viewport. */
@media (max-width: 640px) {
  .article-body {
    font-size: 1rem;
    line-height: 1.75;
  }
  .article-body > p:first-child {
    font-size: 1.0625rem;
  }
  .article-body > h2 {
    font-size: 1.2rem;
    margin-top: 2.2rem;
  }
  .article-body > ul,
  .article-body > ol {
    padding: 1.1rem 1.15rem;
    border-radius: 14px;
  }
}

/* ============================================================
   BLOG DETAIL
   The blog column already sets the reading measure, so the shared
   news typesetting must not re-centre the body. This keeps the
   cover, article text, share row and author box on one set of
   left and right edges.
   ============================================================ */
.blog-article-body.article-body {
  max-width: none;
  margin-inline: 0;
}

/* Sticky header: jumping to a section must not land underneath it. */
.blog-article-body > h2,
.blog-article-body > h3 {
  scroll-margin-top: 7.5rem;
}

.toc-link {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #64748b;
  transition: color 0.18s ease;
}

.toc-link:hover {
  color: #0e1f27;
}

.toc-link .toc-dot {
  flex-shrink: 0;
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.42rem;
  border-radius: 9999px;
  background: #cbd5e1;
  transition: background 0.18s ease, transform 0.18s ease;
}

.toc-link.toc-link-sub {
  padding-left: 1rem;
  font-size: 0.75rem;
}

.toc-link.active {
  color: #ca0000;
  font-weight: 600;
}

.toc-link.active .toc-dot {
  background: #ca0000;
  transform: scale(1.15);
}

/* ============================================================
   STICKY SOCIAL RAIL (right-hand edge, vertically centred)
   ============================================================ */
.social-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.social-rail-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: #0f172a;
  border-radius: 8px 0 0 8px;
  transition: transform 0.22s ease, background-color 0.22s ease, width 0.22s ease;
  box-shadow: -2px 2px 10px rgba(15, 23, 42, 0.18);
}

.social-rail-btn:hover,
.social-rail-btn:focus-visible {
  transform: translateX(-3px);
  background: var(--accent-color, #ca0000);
}

.social-rail-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

/* Label slides out on hover so the rail stays compact at rest. */
.social-rail-btn .social-rail-tip {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-rail-btn:hover .social-rail-tip,
.social-rail-btn:focus-visible .social-rail-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* On phones the rail would sit on top of content, so it hugs the edge. */
@media (max-width: 640px) {
  .social-rail-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
    border-radius: 6px 0 0 6px;
  }
  .social-rail-btn .social-rail-tip {
    display: none;
  }
}

/* ============================================================
   FEATURED NEWS POPUP
   ============================================================ */
.news-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.news-popup-backdrop.is-open {
  opacity: 1;
}

/* [hidden] must win over the flex display above. */
.news-popup-backdrop[hidden] {
  display: none;
}

.news-popup {
  position: relative;
  width: min(760px, 100%);
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.45);
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.26s ease;
}

.news-popup-backdrop.is-open .news-popup {
  transform: none;
  opacity: 1;
}

.news-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.news-popup-close:hover,
.news-popup-close:focus-visible {
  background: var(--accent-color, #ca0000);
  color: #fff;
  transform: rotate(90deg);
}

@media (max-width: 767px) {
  .news-popup {
    max-height: 86vh;
    overflow-y: auto;
  }
}

