:root {
  --gov-red: #0284c7;
  --gov-red-dark: #0c4a6e;
  --gov-yellow: #38bdf8;
  --gov-blue: #075985;
  --gov-bg: #f0f9ff;
}

html, body {
  height: 100%;
}

body {
  font-family: Roboto, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--gov-bg);
}

.font-serif-header {
  font-family: Merriweather, serif;
}

/* Article content helpers (for future “news detail” pages) */
.news-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
  text-align: justify;
}

.news-content img {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
  border-radius: 6px;
}

.news-content figure {
  text-align: center;
  margin-bottom: 1.5rem;
}

.news-content figcaption {
  font-style: italic;
  color: #666;
  font-size: 0.9em;
  margin-top: 0.5rem;
  background: #e9ecef;
  padding: 4px 8px;
  display: inline-block;
  border-radius: 4px;
}

/* ========== LIVE PULSE INDICATOR ========== */
.live-pulse-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.live-pulse-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #2563eb;
  border-radius: 9999px;
  animation: pulse-dot 1.5s ease-in-out infinite;
  z-index: 2;
}

.live-pulse-ring-1,
.live-pulse-ring-2 {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #3b82f6;
  border-radius: 9999px;
  animation: pulse-ring 1.5s ease-out infinite;
  opacity: 0;
}

.live-pulse-ring-2 {
  animation-delay: 0.5s;
}

@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.8;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  50% {
    opacity: 0.35;
  }
  100% {
    transform: scale(2.7);
    opacity: 0;
  }
}

/* ========== MARQUEE (seamless) ========== */
@keyframes seamless-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: seamless-scroll 50s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

/* ========== SUBTLE ORNAMENT (header/footer) ========== */
.gov-ornament {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: var(--ornament-opacity, 0.06);
  background-repeat: repeat;
  background-image:
    radial-gradient(circle at 14px 14px, rgba(2, 132, 199, 0.30) 0 1px, transparent 1.4px),
    radial-gradient(circle at 74px 62px, rgba(14, 165, 233, 0.22) 0 1px, transparent 1.4px),
    radial-gradient(circle at 110px 26px, rgba(125, 211, 252, 0.22) 0 1px, transparent 1.4px),
    linear-gradient(135deg, rgba(2, 132, 199, 0.14) 0 1px, transparent 1px 16px),
    linear-gradient(45deg, rgba(14, 165, 233, 0.10) 0 1px, transparent 1px 18px);
  background-size: 140px 140px, 180px 180px, 220px 220px, 18px 18px, 20px 20px;
}

.gov-ornament--header {
  --ornament-opacity: 0.085;
  background-repeat: repeat, repeat, repeat, repeat, no-repeat;
  background-image:
    radial-gradient(circle at 14px 14px, rgba(2, 132, 199, 0.26) 0 1px, transparent 1.6px),
    radial-gradient(circle at 90px 58px, rgba(14, 165, 233, 0.18) 0 1px, transparent 1.6px),
    linear-gradient(90deg, rgba(2, 132, 199, 0.10) 0 1px, transparent 1px 24px),
    linear-gradient(0deg, rgba(2, 132, 199, 0.08) 0 1px, transparent 1px 24px),
    radial-gradient(circle at 60% 40%, rgba(125, 211, 252, 0.16) 0, transparent 55%);
  background-size: 160px 160px, 210px 210px, 24px 24px, 24px 24px, 100% 100%;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
  filter: saturate(1.02);
}

.gov-ornament--nav {
  --ornament-opacity: 0.11;
  background-repeat: no-repeat, repeat, repeat, repeat;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 240'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2' opacity='0.22'%3E%3Cpath d='M40 180 C120 120, 220 220, 320 160 C420 100, 520 200, 600 120'/%3E%3Cpath d='M40 70 C140 20, 240 120, 340 80 C440 40, 520 140, 600 90'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='0.18'%3E%3Ccircle cx='120' cy='130' r='3'/%3E%3Ccircle cx='220' cy='90' r='3'/%3E%3Ccircle cx='320' cy='150' r='3'/%3E%3Ccircle cx='420' cy='110' r='3'/%3E%3Ccircle cx='520' cy='140' r='3'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(255,255,255,0.10) 0 1px, transparent 1px 16px),
    radial-gradient(circle at 12px 12px, rgba(255,255,255,0.18) 0 1px, transparent 1.6px),
    linear-gradient(to bottom, rgba(255,255,255,0.18), transparent 60%);
  background-size: 680px 260px, 18px 18px, 140px 140px, 100% 100%;
  background-position: 50% 55%, 0 0, 0 0, 0 0;
}

.gov-ornament--footer {
  --ornament-opacity: 0.09;
  background-repeat: repeat, repeat, repeat, repeat;
  background-image:
    radial-gradient(circle at 14px 14px, rgba(255, 255, 255, 0.20) 0 1px, transparent 1.8px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 26px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 26px),
    radial-gradient(circle at 35% 60%, rgba(125, 211, 252, 0.10) 0, transparent 60%);
  background-size: 160px 160px, 26px 26px, 26px 26px, 100% 100%;
  background-position: 0 0, 0 0, 0 0, 0 0;
}

/* ========== NAV ACCENT LINE (under sticky toolbar) ========== */
.gov-nav-accent {
  position: relative;
}

.gov-nav-accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 6px;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(186, 230, 253, 0.95), rgba(186, 230, 253, 0.30) 55%, rgba(186, 230, 253, 0));
}

/* ========== ORNAMENTAL BORDER (meander) ========== */
.gov-border-ornament {
  position: relative;
  isolation: isolate;
}

.gov-border-ornament::before,
.gov-border-ornament::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--border-ornament-height, 16px);
  pointer-events: none;
  z-index: 2;
  opacity: var(--border-ornament-opacity, 0.95);
  background-repeat: no-repeat, repeat-x;
  background-position: 0 0, 0 4px;
  background-size: 100% 100%, 72px 12px;
  background-image:
    linear-gradient(to bottom, var(--border-ornament-accent, #16a34a) 0 3px, rgba(255,255,255,0.92) 3px 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='12' viewBox='0 0 72 12'%3E%3Cg fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='M0 2h10v8H0'/%3E%3Cpath d='M10 2h10v8H10'/%3E%3Cpath d='M20 2h10v8H20'/%3E%3Cpath d='M30 2h12v8H30'/%3E%3Cpath d='M42 2h10v8H42'/%3E%3Cpath d='M52 2h10v8H52'/%3E%3Cpath d='M62 2h10v8H62'/%3E%3C/g%3E%3C/svg%3E");
}

.gov-border-ornament--top::before {
  top: 0;
}

.gov-border-ornament--top::after {
  display: none;
}

.gov-border-ornament--bottom::after {
  bottom: 0;
  background-position: 0 0, 0 4px;
}

.gov-border-ornament--bottom::before {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .gov-border-ornament::before,
  .gov-border-ornament::after {
    opacity: var(--border-ornament-opacity, 0.95);
  }
}

/* ========== SCI-LEGAL MOTION (subtle) ========== */
@keyframes gov-ornament-drift {
  0% { background-position: 0 0; }
  100% { background-position: 140px 90px; }
}

.gov-ornament-motion {
  animation: gov-ornament-drift 38s linear infinite;
  will-change: background-position;
}

@keyframes gov-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.gov-float-slow {
  animation: gov-float 6.5s ease-in-out infinite;
  will-change: transform;
}

@keyframes gov-scan-sweep {
  0% { transform: translateX(-65%); opacity: 0; }
  10% { opacity: 0.55; }
  55% { opacity: 0.22; }
  100% { transform: translateX(165%); opacity: 0; }
}

.gov-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  overflow: hidden;
}

.gov-scanline::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.20), transparent);
  transform: translateX(-65%);
  animation: gov-scan-sweep 11s ease-in-out infinite;
  mix-blend-mode: overlay;
}

@keyframes gov-shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.gov-shimmer-bar {
  height: 0.25rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(0,84,166,0.95), rgba(186,230,253,0.95), rgba(0,84,166,0.95));
  background-size: 200% 100%;
  animation: gov-shimmer 4.8s linear infinite;
  will-change: background-position;
}

@media (prefers-reduced-motion: reduce) {
  .gov-ornament-motion,
  .gov-float-slow,
  .gov-scanline::before,
  .gov-shimmer-bar {
    animation: none !important;
  }
}

/* ========== 3D RAISED UI (footer/cards/buttons) ========== */
.gov-3d-stage {
  perspective: 900px;
}

.gov-card-3d {
  position: relative;
  transform-style: preserve-3d;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.gov-card-3d::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(1200px 340px at 18% 0%, rgba(186, 230, 253, 0.18), transparent 55%),
    radial-gradient(900px 260px at 82% 10%, rgba(125, 211, 252, 0.10), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent 35%);
  opacity: 1;
}

.gov-card-3d:hover {
  transform: translateY(-4px) rotateX(1.6deg);
  border-color: rgba(186, 230, 253, 0.34);
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.gov-btn-3d {
  position: relative;
  transform-style: preserve-3d;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}

.gov-btn-3d:hover {
  transform: translateY(-3px) translateZ(0);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  filter: saturate(1.05);
}

.gov-btn-3d:active {
  transform: translateY(-1px);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .gov-card-3d,
  .gov-card-3d:hover,
  .gov-btn-3d,
  .gov-btn-3d:hover,
  .gov-btn-3d:active {
    transition: none !important;
    transform: none !important;
  }
}
