/* ==========================================================================
   InMastermind — Government Portal Design System
   Palette : Deep Navy / Royal Blue · Gold & Saffron accents · White · Subtle Gray
   Author  : Redesign v2
   --------------------------------------------------------------------------
   1.  Design tokens
   2.  Accessibility layer (font scale + high contrast)
   3.  Reset & base
   4.  Layout primitives
   5.  Accessibility / utility widgets
   6.  Top utility bar
   7.  Masthead (emblem + wordmark + search)
   8.  Flash-news ticker
   9.  Primary navigation + mobile drawer
   10. Section furniture (headings, rules, breadcrumbs)
   11. Cards & article lists
   12. Sidebar widgets
   13. Announcements / quick links
   14. Pagination & buttons
   15. Forms
   16. Article page
   17. Footer
   18. Responsive: tablet landscape → wide desktop
   19. Motion & print preferences
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand — navy scale */
  --navy-900: #04173a;
  --navy-800: #07204a;
  --navy-700: #0a2a5e;
  --navy-600: #103a7a;
  --royal:    #17499b;
  --royal-500:#2563b8;

  /* Accents */
  --gold-700: #8a6413;
  --gold-600: #b8891f;
  --gold-500: #c9a227;
  --gold-400: #e0b83c;
  --gold-100: #fdf6e0;
  --saffron:  #e07b1f;
  --saffron-600:#c26513;

  /* Neutrals */
  --white:  #ffffff;
  --gray-50:  #f6f8fb;
  --gray-75:  #eef2f7;
  --gray-100: #e3e9f0;
  --gray-200: #d2dae4;
  --gray-300: #b4c0cf;
  --gray-400: #8b99ab;
  --gray-500: #6b7a8d;
  --gray-600: #4f5d6e;
  --gray-700: #3a4757;
  --gray-800: #26313f;
  --gray-900: #16202b;

  /* Semantic */
  --success: #1a7f45;
  --danger:  #b3261e;
  --info:    #1a5f9e;

  /* Type */
  --font-body: 'Segoe UI', 'Noto Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-head: 'Segoe UI', 'Noto Sans', Roboto, Arial, sans-serif;
  --font-serif: 'Noto Serif', Georgia, 'Times New Roman', serif;

  --fs-base: 16px;
  --lh-base: 1.62;
  --lh-tight: 1.28;

  /* Space */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Shape */
  --radius-sm: 3px;
  --radius:    6px;
  --radius-lg: 10px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(6, 33, 74, .07);
  --shadow-sm: 0 2px 6px rgba(6, 33, 74, .09);
  --shadow-md: 0 6px 18px rgba(6, 33, 74, .11);
  --shadow-lg: 0 14px 40px rgba(4, 23, 58, .18);

  /* Structure */
  --container: 1280px;
  --container-narrow: 900px;
  --header-h: 76px;

  --z-header: 500;
  --z-drawer: 900;
  --z-overlay: 850;
  --z-skip: 1000;
}

/* --------------------------------------------------------------------------
   2. ACCESSIBILITY LAYER
   Font-size adjuster drives the root font size; every type scale below is rem,
   so the whole portal scales together.
   -------------------------------------------------------------------------- */
html[data-font="default"] { font-size: var(--fs-base); }
html[data-font="large"]   { font-size: 18px; }
html[data-font="xlarge"]  { font-size: 20.5px; }

/* High-contrast mode: flatten the greys, harden borders, boost text. */
html[data-contrast="high"] {
  --navy-700: #001233;
  --navy-600: #001c4d;
  --royal:    #002a73;
  --royal-500:#003a99;
  --gold-500: #f5d53c;
  --gold-600: #e0b83c;
  --saffron:  #ffab2e;
  --gray-50:  #ffffff;
  --gray-75:  #ffffff;
  --gray-100: #ffffff;
  --gray-200: #1a1a1a;
  --gray-300: #000000;
  --gray-400: #1a1a1a;
  --gray-500: #000000;
  --gray-600: #000000;
  --gray-700: #000000;
  --gray-800: #000000;
  --gray-900: #000000;
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}
html[data-contrast="high"] body { background: #fff; color: #000; }
html[data-contrast="high"] .card,
html[data-contrast="high"] .widget,
html[data-contrast="high"] .panel,
html[data-contrast="high"] .post-card,
html[data-contrast="high"] .ann-list li,
html[data-contrast="high"] .quick-link {
  border: 2px solid #000 !important;
  box-shadow: none !important;
}
html[data-contrast="high"] a { text-decoration: underline; }
html[data-contrast="high"] .btn-primary { background: #001233; border-color: #f5d53c; color: #fff; }

/* --------------------------------------------------------------------------
   3. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--lh-base);
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--navy-800);
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-3);
  font-weight: 700;
}
h1 { font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.85rem); }
h3 { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); }

p { margin: 0 0 var(--sp-4); }

a { color: var(--royal); text-decoration: none; }
a:hover { color: var(--royal-500); text-decoration: underline; }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--saffron);
  outline-offset: 2px;
  border-radius: 2px;
}
html[data-contrast="high"] :focus-visible { outline: 3px solid #ffab2e; }

/* Screen-reader-only utility */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -100px;
  z-index: var(--z-skip);
  background: var(--navy-800);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 700;
  transition: top .18s ease;
}
.skip-link:focus { top: 0; color: #fff; text-decoration: none; }

/* --------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(14px, 3.5vw, 32px);
}
.container-narrow { max-width: var(--container-narrow); }

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  padding: var(--sp-5) 0 var(--sp-7);
  align-items: start;
}
.layout-main  { min-width: 0; }
.layout-aside { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }

.stack > * + * { margin-top: var(--sp-4); }

/* --------------------------------------------------------------------------
   5. ACCESSIBILITY / UTILITY WIDGETS
   -------------------------------------------------------------------------- */
.a11y-panel {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.a11y-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--gray-300);
  font-weight: 700;
  margin-right: 2px;
}

.a11y-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 34px;
  min-height: 32px;
  padding: 4px 9px;
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  color: var(--gray-200);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.a11y-btn:hover { background: rgba(255,255,255,.12); color: #fff; border-color: var(--gold-500); }
.a11y-btn[aria-pressed="true"] {
  background: var(--gold-500);
  border-color: var(--gold-400);
  color: var(--navy-900);
}

/* Larger targets on touch devices */
@media (pointer: coarse) {
  .a11y-btn { min-width: 40px; min-height: 40px; }
}

/* --------------------------------------------------------------------------
   6. TOP UTILITY BAR
   -------------------------------------------------------------------------- */
.topbar {
  background: var(--navy-900);
  color: var(--gray-300);
  font-size: .78rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 40px;
  padding-top: 5px;
  padding-bottom: 5px;
  flex-wrap: wrap;
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.topbar-meta span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.topbar-meta i { color: var(--gold-400); font-size: .8rem; }

.gov-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-500));
  color: var(--navy-900);
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 2px;
}

@media (max-width: 719px) {
  .topbar-meta-hide { display: none; }
}

/* --------------------------------------------------------------------------
   7. MASTHEAD
   -------------------------------------------------------------------------- */
.masthead {
  background: var(--white);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--saffron) 0 33.33%, #fff 33.33% 66.66%, var(--navy-700) 66.66% 100%) 1;
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none !important;
  min-width: 0;
}
.brand:hover { text-decoration: none !important; }

.brand-emblem {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 2px 4px rgba(6,33,74,.18));
}
.brand-emblem .chakra { transform-origin: 50% 50%; }

.brand-text { min-width: 0; }

.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: .015em;
  line-height: 1;
  margin: 0;
  font-size: clamp(1.35rem, 1.05rem + 1.5vw, 2.15rem);
  color: var(--navy-800);
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 1px;
  flex-wrap: wrap;
}
.brand-name .accent { color: var(--gold-600); }

.brand-motto {
  margin: 5px 0 0;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gray-500);
  font-weight: 600;
}
@media (max-width: 519px) {
  .brand-motto { font-size: .75rem; letter-spacing: .06em; }
  .brand-emblem { width: 44px; height: 44px; }
}

/* Header search */
.header-search { flex: 1 1 300px; max-width: 420px; min-width: 240px; }
@media (max-width: 899px) { .header-search { max-width: none; order: 3; flex-basis: 100%; } }

.search-form { display: flex; border: 2px solid var(--navy-700); border-radius: var(--radius); overflow: hidden; background: #fff; }
.search-form:focus-within { border-color: var(--gold-600); box-shadow: 0 0 0 3px rgba(201,162,39,.22); }
.search-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 11px 14px;
  font-size: .95rem;
  background: transparent;
}
.search-form input:focus { outline: none; }
.search-form input::placeholder { color: var(--gray-400); }
.search-form button {
  flex: 0 0 auto;
  border: 0;
  background: var(--navy-700);
  color: var(--gold-400);
  padding: 0 18px;
  font-size: 1rem;
  cursor: pointer;
  transition: background .16s ease;
}
.search-form button:hover { background: var(--royal); }

.header-actions { display: flex; align-items: center; gap: var(--sp-2); }
@media (max-width: 1023px) { .header-actions .desktop-only { display: none; } }

/* --------------------------------------------------------------------------
   8. FLASH NEWS TICKER
   -------------------------------------------------------------------------- */
.ticker {
  background: var(--navy-800);
  color: #fff;
  border-top: 1px solid rgba(255,255,255,.07);
  border-bottom: 1px solid rgba(0,0,0,.2);
}
.ticker-inner {
  display: flex;
  align-items: stretch;
  min-height: 44px;
}

.ticker-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .12em;
  padding: 0 16px;
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
}
.ticker-tag::after {
  content: "";
  position: absolute;
  top: 0; right: -9px;
  border-top: 22px solid transparent;
  border-bottom: 22px solid transparent;
  border-left: 9px solid var(--danger);
}
.ticker-tag .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.ticker-viewport {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 44px;
  white-space: nowrap;
  padding-left: 28px;
  will-change: transform;
  animation: ticker-scroll 58s linear infinite;
}
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item {
  color: rgba(255,255,255,.94);
  font-size: .86rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.ticker-item:hover { color: var(--gold-400); text-decoration: none; }
.ticker-item .sep { color: var(--gold-500); margin-right: 12px; }
.ticker-item .ts { color: var(--gray-400); font-size: .78rem; margin-left: 8px; }

@media (max-width: 599px) {
  .ticker-tag { padding: 0 12px; font-size: .75rem; letter-spacing: .08em; }
  .ticker-tag .ticker-tag-text { display: none; }
  .ticker-item { font-size: .8rem; }
}

/* --------------------------------------------------------------------------
   9. PRIMARY NAVIGATION + MOBILE DRAWER
   -------------------------------------------------------------------------- */
.nav-bar {
  background: var(--navy-700);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  box-shadow: var(--shadow-md);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 52px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  color: rgba(255,255,255,.94);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.nav-list > li > a:hover {
  background: rgba(255,255,255,.09);
  color: #fff;
  text-decoration: none;
  border-bottom-color: var(--gold-500);
}
.nav-list > li > a[aria-current="page"] {
  background: rgba(255,255,255,.13);
  color: #fff;
  border-bottom-color: var(--gold-500);
}
.nav-list > li > a .chev { font-size: .62rem; opacity: .75; }

/* Dropdown */
.nav-list .has-drop > .subnav {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 250px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--gold-500);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  display: none;
  z-index: 20;
}
.nav-list .has-drop:hover > .subnav,
.nav-list .has-drop:focus-within > .subnav { display: block; }
.subnav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  color: var(--navy-800);
  font-size: .87rem;
  font-weight: 600;
  border-left: 3px solid transparent;
}
.subnav a:hover {
  background: var(--gray-75);
  color: var(--royal);
  text-decoration: none;
  border-left-color: var(--gold-500);
}
.subnav .count { font-size: .78rem; color: var(--gray-400); font-weight: 700; }

/* Hamburger + drawer (mobile / tablet) */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 42px;
}
.nav-toggle:hover { background: rgba(255,255,255,.12); }
.nav-toggle .bars { width: 20px; display: grid; gap: 4px; }
.nav-toggle .bars span {
  display: block; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 23, 58, .55);
  backdrop-filter: blur(2px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.drawer-overlay.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(86vw, 360px);
  background: var(--navy-800);
  color: #fff;
  z-index: var(--z-drawer);
  transform: translateX(-102%);
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.drawer.is-open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: var(--navy-900);
}
.drawer-head .brand-name { font-size: 1.05rem; color: #fff; }
.drawer-head .brand-name .accent { color: var(--gold-400); }
.drawer-close {
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  flex: 0 0 auto;
}
.drawer-close:hover { background: rgba(255,255,255,.12); }

.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 0 24px; -webkit-overflow-scrolling: touch; }

.drawer-section {
  padding: 14px 18px 6px;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-400);
  font-weight: 800;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  color: rgba(255,255,255,.95);
  font-size: .92rem;
  font-weight: 600;
  border-left: 3px solid transparent;
  min-height: 48px;
}
.drawer-link:hover,
.drawer-link:focus-visible { background: rgba(255,255,255,.1); text-decoration: none; border-left-color: var(--gold-500); }
.drawer-link i { width: 18px; text-align: center; color: var(--gold-400); font-size: .9rem; }
.drawer-link .chev { margin-left: auto; font-size: .68rem; opacity: .7; }

.drawer-sub { background: rgba(0,0,0,.22); }
.drawer-sub .drawer-link {
  padding-left: 46px;
  font-size: .87rem;
  font-weight: 500;
  color: rgba(255,255,255,.82);
}
.drawer-foot {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: .78rem;
  color: var(--gray-300);
}
.drawer-foot a { color: var(--gold-400); }

/* Switch to drawer mode below the desktop breakpoint */
@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  .nav-desktop { display: none !important; }
}
@media (min-width: 1024px) {
  .drawer, .drawer-overlay { display: none !important; }
}

/* --------------------------------------------------------------------------
   10. SECTION FURNITURE
   -------------------------------------------------------------------------- */
.page-head {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--sp-5) 0 var(--sp-4);
}
.page-head h1 { margin: 0 0 6px; }
.page-head .lede { color: var(--gray-600); margin: 0; max-width: 68ch; font-size: .95rem; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--gray-500);
  list-style: none;
  padding: var(--sp-3) 0 0;
}
.breadcrumb li { display: flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: "\f105"; font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro"; font-weight: 900; color: var(--gray-300); font-size: .7rem; }
.breadcrumb a { color: var(--royal); font-weight: 600; }
.breadcrumb [aria-current] { color: var(--gray-600); font-weight: 600; }

/* Standard section title with gold rule */
.sec-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 var(--sp-4);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-100);
  position: relative;
}
.sec-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 84px; height: 2px;
  background: var(--gold-500);
}
.sec-title h2, .sec-title h3 {
  margin: 0;
  font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem);
  letter-spacing: .01em;
  color: var(--navy-800);
}
.sec-title .count-pill {
  margin-left: auto;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-75);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 3px 11px;
}
.sec-title .all-link {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 700;
  color: var(--royal);
}
.sec-title .all-link i { font-size: .68rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--saffron-600);
  margin-bottom: 6px;
}
.eyebrow.navy { color: var(--royal); }
.eyebrow.invert { color: var(--gold-400); }

/* Chips / category pills */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--navy-700);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
}
.chip.gold  { background: var(--gold-500); color: var(--navy-900); }
.chip.ghost { background: var(--gray-75); color: var(--navy-700); border: 1px solid var(--gray-200); }
.chip.saffron { background: var(--saffron); color: #fff; }

.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: .78rem;
  color: var(--gray-500);
}
.meta-line span { display: inline-flex; align-items: center; gap: 6px; }
.meta-line i { color: var(--gray-400); }

/* --------------------------------------------------------------------------
   11. CARDS & ARTICLE LISTS
   -------------------------------------------------------------------------- */
.card, .panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.panel { padding: var(--sp-5); }
@media (max-width: 599px) { .panel { padding: var(--sp-4); } }

.lead-story {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-top: 4px solid var(--navy-700);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-5);
}
.lead-media { position: relative; background: var(--gray-75); }
.lead-media img { width: 100%; height: 100%; min-height: 240px; object-fit: cover; }
.lead-media .flag {
  position: absolute;
  left: 0; top: 0;
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 14px;
}
.lead-body { padding: var(--sp-5); display: flex; flex-direction: column; }
.lead-body h2 { margin: 8px 0 10px; }
.lead-body h2 a { color: var(--navy-800); }
.lead-body h2 a:hover { color: var(--royal); text-decoration: none; }
.lead-body p { color: var(--gray-600); font-size: .96rem; }
.lead-body .meta-line { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--gray-100); }

@media (min-width: 900px) {
  .lead-story { grid-template-columns: 1.15fr 1fr; }
  .lead-body { padding: var(--sp-6); justify-content: center; }
}

.post-list { display: flex; flex-direction: column; gap: var(--sp-4); }

.post-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.post-card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); transform: translateY(-1px); }

.post-thumb {
  position: relative;
  background: var(--gray-75);
  overflow: hidden;
}
.post-thumb img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  transition: transform .3s ease;
}
.post-card:hover .post-thumb img { transform: scale(1.035); }
.post-thumb .cat-overlay {
  position: absolute;
  left: 0; bottom: 0;
}

.post-body { padding: var(--sp-4) var(--sp-4) var(--sp-4); display: flex; flex-direction: column; }
.post-body h3 { margin: 9px 0 8px; font-size: 1.06rem; line-height: 1.34; }
.post-body h3 a { color: var(--navy-800); }
.post-body h3 a:hover { color: var(--royal); text-decoration: none; }
.post-body p { font-size: .9rem; color: var(--gray-600); margin-bottom: 12px; }
.post-body .meta-line { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--gray-100); }

@media (min-width: 640px) {
  .post-card { grid-template-columns: 260px 1fr; }
}
@media (min-width: 1280px) {
  .post-card { grid-template-columns: 300px 1fr; }
}

/* Compact row (used in related / most-read) */
.post-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px dashed var(--gray-200);
}
.post-row:last-child { border-bottom: 0; padding-bottom: 0; }
.post-row .thumb { border-radius: var(--radius-sm); overflow: hidden; background: var(--gray-75); aspect-ratio: 4 / 3; }
.post-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-row h4 { margin: 0 0 5px; font-size: .9rem; line-height: 1.36; font-weight: 700; }
.post-row h4 a { color: var(--navy-800); }
.post-row h4 a:hover { color: var(--royal); text-decoration: none; }
.post-row .meta-line { font-size: .78rem; }

.empty-state {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  background: var(--white);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  color: var(--gray-500);
}
.empty-state i { font-size: 2rem; color: var(--gray-300); margin-bottom: 12px; }

/* --------------------------------------------------------------------------
   12. SIDEBAR WIDGETS
   -------------------------------------------------------------------------- */
.widget {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.widget-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px var(--sp-4);
  background: var(--navy-700);
  color: #fff;
}
.widget-head h3, .widget-head h2 {
  margin: 0;
  font-size: .88rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  font-weight: 700;
}
.widget-head i.dash { color: var(--gold-400); font-size: .8rem; }
.widget-head .more { margin-left: auto; font-size: .78rem; color: var(--gold-400); font-weight: 700; }
.widget-body { padding: var(--sp-4); }
.widget-body.flush { padding: 0 var(--sp-4); }

/* Ranked most-read list */
.rank-list { counter-reset: rank; }
.rank-list li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px dashed var(--gray-200);
}
.rank-list li:last-child { border-bottom: 0; }
.rank-list li::before {
  content: counter(rank, decimal-leading-zero);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-300);
  line-height: 1.1;
  border-right: 2px solid var(--gold-500);
  padding-right: 10px;
  text-align: right;
}
.rank-list li:nth-child(-n+3)::before { color: var(--saffron); }
.rank-list h4 { margin: 0 0 5px; font-size: .89rem; line-height: 1.35; font-weight: 700; }
.rank-list h4 a { color: var(--navy-800); }
.rank-list h4 a:hover { color: var(--royal); text-decoration: none; }
.rank-list .meta-line { font-size: .78rem; }

/* Category widget */
.cat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--gray-200);
}
.cat-list li:last-child { border-bottom: 0; }
.cat-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--navy-800);
  font-size: .92rem;
}
.cat-list a i { color: var(--gold-600); font-size: .78rem; }
.cat-list a:hover { color: var(--royal); text-decoration: none; }
.cat-list .total {
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-75);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* Helpline / promo card */
.promo-card {
  background: linear-gradient(150deg, var(--navy-700), var(--navy-900));
  color: #fff;
  border-radius: var(--radius);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
}
.promo-card::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(201,162,39,.14);
}
.promo-card h3 { color: #fff; font-size: 1.05rem; margin-bottom: 8px; position: relative; }
.promo-card p { color: rgba(255,255,255,.82); font-size: .88rem; margin-bottom: 16px; position: relative; }
.promo-card .helpline {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-400);
  letter-spacing: .01em;
  position: relative;
  margin-bottom: 4px;
}
.promo-card .sub { font-size: .78rem; color: rgba(255,255,255,.7); position: relative; }

/* --------------------------------------------------------------------------
   13. ANNOUNCEMENTS / QUICK LINKS
   -------------------------------------------------------------------------- */
.ann-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--gray-200);
  align-items: start;
}
.ann-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.ann-list .ico { color: var(--saffron); font-size: .82rem; padding-top: 5px; }
.ann-list h4 { margin: 0 0 5px; font-size: .93rem; line-height: 1.36; font-weight: 700; }
.ann-list h4 a { color: var(--navy-800); }
.ann-list h4 a:hover { color: var(--royal); text-decoration: none; }
.ann-list p { margin: 0; font-size: .82rem; color: var(--gray-500); }
.ann-list time { font-size: .78rem; color: var(--gray-400); }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--gold-500);
  border-radius: var(--radius-sm);
  color: var(--navy-800);
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.3;
  min-height: 56px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.quick-link i { color: var(--royal); font-size: 1rem; flex: 0 0 auto; }
.quick-link:hover {
  background: var(--gray-75);
  border-left-color: var(--saffron);
  color: var(--navy-900);
  text-decoration: none;
  transform: translateY(-1px);
}
.quick-link span { min-width: 0; }

@media (min-width: 560px) { .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* --------------------------------------------------------------------------
   14. PAGINATION & BUTTONS
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--gray-200);
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy-800);
  font-weight: 700;
  font-size: .88rem;
}
.pagination a:hover { background: var(--navy-700); border-color: var(--navy-700); color: #fff; text-decoration: none; }
.pagination .active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.pagination .disabled { color: var(--gray-300); background: var(--gray-50); }
.pagination .gap { border: 0; background: none; color: var(--gray-400); min-width: 22px; padding: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 24px;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn-primary:hover { background: var(--royal); border-color: var(--royal); color: #fff; text-decoration: none; }

.btn-gold { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-400); border-color: var(--gold-400); color: var(--navy-900); text-decoration: none; }

.btn-outline { background: transparent; border-color: var(--navy-700); color: var(--navy-700); }
.btn-outline:hover { background: var(--navy-700); color: #fff; text-decoration: none; }

.btn-ghost { background: var(--white); border-color: var(--gray-200); color: var(--navy-800); }
.btn-ghost:hover { background: var(--gray-75); text-decoration: none; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1d17; color: #fff; text-decoration: none; }

.btn-sm { padding: 8px 15px; min-height: 38px; font-size: .8rem; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   15. FORMS
   -------------------------------------------------------------------------- */
.form-row { margin-bottom: var(--sp-4); }
.form-row label,
.form-label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  font-size: .84rem;
  color: var(--navy-800);
  letter-spacing: .01em;
}
.form-row .hint { display: block; margin-top: 6px; font-size: .78rem; color: var(--gray-500); }
.req { color: var(--danger); font-weight: 700; }

.input, .select, .textarea,
input[type="text"], input[type="email"], input[type="url"], input[type="tel"],
input[type="password"], input[type="search"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="file"],
select, textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: .94rem;
  color: var(--gray-800);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(23, 73, 155, .15);
}
input[type="file"] { padding: 9px 11px; background: var(--gray-50); }
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: "\f078";
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900;
  font-size: .72rem;
  color: var(--gray-500);
  pointer-events: none;
}
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 34px; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: var(--sp-3);
}

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border-left: 4px solid;
  font-size: .9rem;
  margin-bottom: var(--sp-4);
}
.alert i { margin-top: 2px; }
.alert-success { background: #e8f5ed; border-color: var(--success); color: #14532d; }
.alert-error   { background: #fdecea; border-color: var(--danger);  color: #7f1d1d; }
.alert-info    { background: var(--gray-75); border-color: var(--royal);   color: var(--navy-800); }
.alert-warn    { background: var(--gold-100); border-color: var(--gold-600); color: #5c4209; }

/* --------------------------------------------------------------------------
   16. ARTICLE PAGE
   -------------------------------------------------------------------------- */
.article { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.article-head { padding: var(--sp-5); border-bottom: 1px solid var(--gray-100); }
.article-head h1 { margin: 10px 0 14px; }
.article-head .meta-line { padding-top: 14px; border-top: 1px solid var(--gray-100); }
@media (min-width: 900px) { .article-head { padding: var(--sp-6) var(--sp-6) var(--sp-5); } }

.article-hero { background: var(--gray-75); }
.article-hero img { width: 100%; max-height: 520px; object-fit: cover; }

.article-caption {
  padding: 9px var(--sp-5) 0;
  font-size: .78rem;
  color: var(--gray-500);
  font-style: italic;
}

.article-body { padding: var(--sp-5); font-size: 1.04rem; color: var(--gray-800); line-height: 1.78; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.15em; }
.article-body h2 { margin: 1.6em 0 .6em; font-size: 1.3rem; }
.article-body h3 { margin: 1.4em 0 .5em; font-size: 1.12rem; }
.article-body ul, .article-body ol { margin: 0 0 1.15em 1.35em; }
.article-body ul li { list-style: disc; margin-bottom: .45em; }
.article-body ol li { list-style: decimal; margin-bottom: .45em; }
.article-body img { border-radius: var(--radius-sm); margin: 1.2em 0; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  background: var(--gray-50);
  border-left: 4px solid var(--gold-500);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--navy-800);
}
.article-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .9rem; }
.article-body th, .article-body td { border: 1px solid var(--gray-200); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--gray-75); font-weight: 700; }
@media (min-width: 900px) { .article-body { padding: var(--sp-6); } }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 var(--sp-5) var(--sp-5); }
@media (min-width: 900px) { .article-tags { padding: 0 var(--sp-6) var(--sp-6); } }

.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: var(--sp-4) var(--sp-5);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.share-bar .label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-600); }
.share-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--navy-700);
  font-size: .88rem;
  transition: background .16s ease, color .16s ease;
}
.share-bar a:hover { background: var(--navy-700); color: #fff; text-decoration: none; }
@media (max-width: 599px) { .article-tags, .share-bar { padding-left: var(--sp-4); padding-right: var(--sp-4); } }

/* --------------------------------------------------------------------------
   17. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy-900);
  color: var(--gray-300);
  margin-top: var(--sp-7);
  border-top: 4px solid var(--gold-500);
}
.footer-main { padding: var(--sp-6) 0 var(--sp-5); }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
@media (min-width: 600px)  { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: var(--sp-6); } }

.footer-about .brand-name { color: #fff; font-size: 1.5rem; }
.footer-about .brand-name .accent { color: var(--gold-400); }
.footer-about .brand-emblem { width: 46px; height: 46px; }
.footer-about p { font-size: .88rem; color: var(--gray-400); margin: var(--sp-3) 0 var(--sp-4); line-height: 1.7; }

.social-links { display: flex; gap: 10px; flex-wrap: wrap; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--gray-200);
  font-size: .95rem;
  transition: background .16s ease, color .16s ease;
}
.social-links a:hover { background: var(--gold-500); color: var(--navy-900); text-decoration: none; }

.footer-col h4 {
  color: #fff;
  font-size: .82rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  padding-bottom: 10px;
  margin-bottom: var(--sp-4);
  position: relative;
}
.footer-col h4::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 42px; height: 2px;
  background: var(--gold-500);
}
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--gray-400); font-size: .88rem; display: inline-flex; align-items: center; gap: 9px; }
.footer-col a::before { content: "\f105"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free"; font-weight: 900; font-size: .6rem; color: var(--gold-500); }
.footer-col a:hover { color: var(--gold-400); text-decoration: none; }

.footer-contact li { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 14px; font-size: .86rem; }
.footer-contact i { color: var(--gold-500); margin-top: 3px; flex: 0 0 auto; width: 15px; }
.footer-contact a { color: var(--gold-400); }

.footer-bar {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: var(--sp-4) 0;
  font-size: .8rem;
  color: var(--gray-400);
}
.footer-bar-inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  align-items: center;
  text-align: center;
}
.footer-bar nav { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; }
.footer-bar nav a { color: var(--gray-300); font-size: .8rem; }
.footer-bar nav a:hover { color: var(--gold-400); }
.footer-bar .gov-seal-text { display: flex; align-items: center; gap: 9px; }
.footer-bar .gov-seal-text i { color: var(--gold-500); }
@media (min-width: 900px) {
  .footer-bar-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* Back to top */
.to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy-700);
  color: var(--gold-400);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease, background .16s ease;
  z-index: 400;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--royal); }

/* --------------------------------------------------------------------------
   18. RESPONSIVE LAYOUT SHIFTS
   Tablet portrait keeps a single column; landscape and up get the sidebar.
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr) 330px; gap: var(--sp-6); }
  .layout-aside { position: sticky; top: calc(var(--header-h) + 12px); }
  .layout-no-aside { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (min-width: 1536px) {
  :root { --container: 1400px; }
}

/* Extra-wide desktop: three-up article grid */
@media (min-width: 1180px) {
  .grid-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-4);
  }
}
@media (min-width: 1400px) {
  .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Touch target minimums */
@media (pointer: coarse) {
  .subnav a,
  .footer-col a,
  .ann-list h4 a,
  .post-body h3 a { padding-block: 4px; }
}

/* --------------------------------------------------------------------------
   19. MOTION & PRINT
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .ticker-track { animation: none !important; transform: none !important; }
}

@media print {
  .topbar, .nav-bar, .drawer, .drawer-overlay, .ticker, .site-footer,
  .header-search, .share-bar, .to-top, .layout-aside, .pagination,
  .a11y-panel, .header-actions { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .container { max-width: 100%; padding: 0; }
  .article, .panel, .card { border: 1px solid #999; box-shadow: none; }
  .article-body { padding: 0; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
