/* ==========================================================================
   Min Buri District Office PR News Portal — BMA CI & DGA 3.0 Stylesheet
   ========================================================================== */

:root {
  --bma-green: #00744B;
  --bma-green-dark: #005A3A;
  --bma-green-soft: #E8F5F0;
  --bma-gold: #C89B3C;
  --bma-gold-soft: #FDF6E3;
  --bma-gold-text: #7A580F;
  --bma-fb: #156CE0;
  --bma-fb-dark: #125DC2;
  --bma-danger: #B91C1C;
  --bma-danger-soft: #FEE2E2;
  --bma-bg: #F5F7F6;
  --bma-surface: #FFFFFF;
  --bma-surface-alt: #EEF3F0;
  --bma-surface-inset: #F9FCFA;
  --bma-surface-hover: #D6EBE1;
  --bma-input-bg: #FFFFFF;
  --bma-text: #111827;
  --bma-text-muted: #4B5563;
  --bma-border: #D2DDD7;
  --bma-header-bg: #00744B;
  --bma-header-border: 4px solid #C89B3C;
  --bma-footer-bg: #005A3A;
  --bma-footer-border: 4px solid #C89B3C;
  --bma-footer-text: #FFFFFF;
  --bma-nav-active-bg: #005A3A;
  --bma-nav-active-underline: #C89B3C;
  --bma-nav-toggle-bg: #005A3A;
  --bma-accent: #00744B;
  --bma-accent-hover: #005A3A;
  --bma-accent-soft: #E8F5F0;
  --bma-accent-border: #C2DED2;
  --bma-accent-text: #005A3A;
  --bma-link: #005A3A;
  --bma-link-hover: #00744B;
  --bma-hashtag-text: #005A3A;
  --bma-badge-dept-bg: #E8F5F0;
  --bma-badge-dept-text: #005A3A;
  --bma-badge-dept-border: #C2DED2;
  --bma-badge-pinned-bg: #FDF6E3;
  --bma-badge-pinned-text: #7A580F;
  --bma-badge-pinned-border: #C89B3C;
  --bma-banner-bg: linear-gradient(135deg, #005A3A 0%, #00744B 100%);
  --bma-banner-border: #C89B3C;
  --bma-banner-sub: #E8F5F0;
  --bma-hero-media-bg: #005A3A;
  --bma-btn-sec-bg: #E8F5F0;
  --bma-btn-sec-text: #005A3A;
  --bma-btn-sec-hover: #D6EBE1;
  --bma-shadow-sm: 0 1px 3px rgba(0, 48, 32, 0.08);
  --bma-shadow-md: 0 6px 20px rgba(0, 48, 32, 0.10);
  --bma-radius-sm: 6px;
  --bma-radius-md: 12px;
  --bma-radius-lg: 16px;
  --bma-font: "IBM Plex Sans Thai", "Noto Sans Thai", "Sarabun", "Sukhumvit Set", "Thonburi", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bma-max-width: 1220px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bma-bg: #141A22;
  --bma-surface: #212936;
  --bma-surface-alt: #2A3444;
  --bma-surface-inset: #18202B;
  --bma-surface-hover: #2E3A4C;
  --bma-input-bg: #18202B;
  --bma-text: #E6EDF5;
  --bma-text-muted: #9AA7B8;
  --bma-border: #323E50;
  --bma-header-bg: #18202B;
  --bma-header-border: 1px solid #2E3A4A;
  --bma-footer-bg: #0E131A;
  --bma-footer-border: 1px solid #263140;
  --bma-footer-text: #CBD5E1;
  --bma-nav-active-bg: #232D3B;
  --bma-nav-active-underline: #34D399;
  --bma-nav-toggle-bg: #232D3B;
  --bma-accent: #047857;
  --bma-accent-hover: #059669;
  --bma-accent-soft: #1C312B;
  --bma-accent-border: #2F5449;
  --bma-accent-text: #6EE7B7;
  --bma-link: #6EE7B7;
  --bma-link-hover: #A7F3D0;
  --bma-hashtag-text: #7DD3FC;
  --bma-badge-dept-bg: #1C312B;
  --bma-badge-dept-text: #6EE7B7;
  --bma-badge-dept-border: #2F5449;
  --bma-badge-pinned-bg: #3A2E14;
  --bma-badge-pinned-text: #FCD34D;
  --bma-badge-pinned-border: #B48428;
  --bma-banner-bg: linear-gradient(135deg, #18202B 0%, #212936 100%);
  --bma-banner-border: #34D399;
  --bma-banner-sub: #CBD5E1;
  --bma-hero-media-bg: #0E131A;
  --bma-btn-sec-bg: #2A3444;
  --bma-btn-sec-text: #E6EDF5;
  --bma-btn-sec-hover: #364357;
  --bma-danger: #F87171;
  --bma-danger-soft: #3B1A1F;
  --bma-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --bma-shadow-md: 0 10px 28px rgba(0, 0, 0, 0.48);
}

/* DGA Font Scaling */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

html[data-font-scale="sm"] {
  font-size: 14px;
}

html[data-font-scale="md"] {
  font-size: 16px;
}

html[data-font-scale="lg"] {
  font-size: 19px;
}

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

body {
  margin: 0;
  font-family: var(--bma-font);
  background-color: var(--bma-bg);
  color: var(--bma-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

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

a {
  color: var(--bma-link);
}

a:hover {
  color: var(--bma-link-hover);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

:focus-visible {
  outline: 3px solid var(--bma-gold);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background-color: var(--bma-green-dark);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--bma-gold);
  border-radius: 0 0 var(--bma-radius-sm) 0;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.5rem;
}

.container {
  width: 100%;
  max-width: var(--bma-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Main Header, Navigation & Unified Menu Popover
   ========================================================================== */
.site-header {
  background-color: var(--bma-header-bg);
  color: #FFFFFF;
  border-bottom: var(--bma-header-border);
  box-shadow: var(--bma-shadow-sm);
  position: relative;
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  position: relative;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: #FFFFFF;
  flex: 0 1 auto;
  min-width: 0;
}

.site-brand:hover {
  color: #FFFFFF;
}

.site-brand__logo-img {
  height: 36px;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}

.site-brand__logo-print {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__item--auth-desktop {
  display: block;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--bma-radius-sm);
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.site-nav__link:hover {
  background-color: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.site-nav__link[aria-current="page"],
.site-nav__link.is-active {
  background-color: var(--bma-nav-active-bg);
  box-shadow: inset 0 -2px 0 var(--bma-nav-active-underline);
}

.site-nav__link--staff {
  background-color: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.site-nav__link--staff:hover {
  background-color: var(--bma-gold);
  color: #111827;
  border-color: var(--bma-gold);
}

.site-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.site-header__auth-mobile {
  width: auto;
  min-height: 44px;
  min-width: 44px;
  padding: 0.42rem 0.72rem;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  min-width: 44px;
  flex-shrink: 0;
  appearance: none;
  background-color: var(--bma-nav-toggle-bg);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--bma-radius-sm);
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.header-menu-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.header-menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.header-menu-btn[aria-expanded="true"] {
  background-color: rgba(255, 255, 255, 0.24);
  border-color: var(--bma-gold);
}

.header-menu-popover {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 1.25rem;
  z-index: 120;
  width: min(300px, calc(100vw - 1.5rem));
  background-color: #FFFFFF;
  color: #1E293B;
  border: 1px solid #D1DDD7;
  border-radius: var(--bma-radius-md);
  box-shadow: var(--bma-shadow-md);
  padding: 0.85rem;
}

.header-menu-popover[hidden] {
  display: none !important;
}

.header-menu-popover.is-open {
  display: block;
}

.header-menu-nav {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0 0 0.65rem;
  border-bottom: 1px solid #E2EBE6;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.header-menu-nav .site-nav__link {
  width: 100%;
  color: #1E293B;
  background-color: transparent;
}

.header-menu-nav .site-nav__link:hover {
  background-color: #E8F5F0;
  color: #005A3A;
}

.header-menu-nav .site-nav__link[aria-current="page"],
.header-menu-nav .site-nav__link.is-active {
  background-color: #E8F5F0;
  color: #005A3A;
  box-shadow: inset 3px 0 0 #00744B;
}

.header-menu-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0;
}

.header-menu-section + .header-menu-section {
  margin-top: 0.35rem;
}

.header-menu-section__label {
  color: #1E293B;
  font-size: 0.875rem;
  font-weight: 600;
}

.header-menu-font-btns {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.a11y-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background-color: #F3F8F5;
  color: #1E293B;
  border: 1px solid #C7D7CE;
  border-radius: var(--bma-radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.a11y-btn:hover {
  background-color: #E5EFEA;
  border-color: #00744B;
}

.a11y-btn[aria-pressed="true"] {
  background-color: #00744B;
  color: #FFFFFF;
  border-color: #00744B;
}

.theme-switch {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background-color: #F3F8F5;
  border: 1px solid #C7D7CE;
  color: #1E293B;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.theme-switch:hover {
  background-color: #E5EFEA;
  border-color: #00744B;
}

.theme-switch__label {
  white-space: nowrap;
}

.theme-switch__track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background-color: #CBD5E1;
  border: 1.5px solid #475569;
  transition: background-color 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}

.theme-switch__thumb {
  position: absolute;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background-color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}

.theme-switch[aria-checked="true"] .theme-switch__track,
html[data-theme="dark"] .theme-switch .theme-switch__track {
  background-color: #059669;
  border-color: #34D399;
}

.theme-switch[aria-checked="true"] .theme-switch__thumb,
html[data-theme="dark"] .theme-switch .theme-switch__thumb {
  transform: translateX(17px);
}

/* ==========================================================================
   Main Content Layout & Common UI Components
   ========================================================================== */
.main-content {
  flex: 1 0 auto;
  padding: 1.75rem 0 3rem;
}

.section {
  margin-bottom: 2.25rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--bma-border);
}

.section-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bma-accent-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1.3em;
  background-color: var(--bma-gold);
  border-radius: 3px;
}

.section-more-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--bma-link);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
}

.section-more-link:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  border-radius: var(--bma-radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  line-height: 1.4;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--bma-accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--bma-accent-hover);
  color: #FFFFFF;
}

.btn-secondary {
  background-color: var(--bma-btn-sec-bg);
  color: var(--bma-btn-sec-text);
  border-color: var(--bma-border);
}

.btn-secondary:hover {
  background-color: var(--bma-btn-sec-hover);
  color: var(--bma-btn-sec-text);
}

.btn-outline {
  background-color: var(--bma-surface);
  color: var(--bma-accent-text);
  border-color: var(--bma-accent);
}

.btn-outline:hover {
  background-color: var(--bma-accent-soft);
}

.btn-facebook {
  background-color: var(--bma-fb);
  color: #FFFFFF;
  border-color: var(--bma-fb);
}

.btn-facebook:hover {
  background-color: var(--bma-fb-dark);
  border-color: var(--bma-fb-dark);
  color: #FFFFFF;
}

.btn-sm {
  padding: 0.36rem 0.7rem;
  font-size: 0.85rem;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

.badge-dept {
  background-color: var(--bma-badge-dept-bg);
  color: var(--bma-badge-dept-text);
  border: 1px solid var(--bma-badge-dept-border);
}

.badge-pinned {
  background-color: var(--bma-badge-pinned-bg);
  color: var(--bma-badge-pinned-text);
  border: 1px solid var(--bma-badge-pinned-border);
}

/* ==========================================================================
   Hero Carousel (Full-Bleed Clickable Banner)
   ========================================================================== */
.hero-carousel {
  position: relative;
  border-radius: var(--bma-radius-lg);
  overflow: hidden;
  background-color: var(--bma-hero-media-bg);
  box-shadow: var(--bma-shadow-md);
  border: 1px solid var(--bma-border);
}

.hero-slide {
  position: relative;
  width: 100%;
}

.hero-slide__link {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  max-height: 460px;
  overflow: hidden;
  color: #FFFFFF;
  text-decoration: none;
}

.hero-slide__link:focus-visible {
  outline: 3px solid var(--bma-gold);
  outline-offset: -3px;
}

.hero-slide__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.hero-slide__link:hover .hero-slide__img {
  transform: scale(1.015);
}

.hero-slide__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04) 25%, rgba(15, 23, 42, 0.45) 65%, rgba(15, 23, 42, 0.88) 100%);
  pointer-events: none;
}

.hero-slide__overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 1.5rem calc(0.75rem + 44px + 0.75rem) calc(0.55rem + 28px + 0.5rem);
  pointer-events: none;
}

.hero-slide__title {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  line-height: 1.35;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(15, 23, 42, 0.35);
  color: #FFFFFF;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.hero-arrow[hidden] {
  display: none;
}

.hero-arrow--prev {
  left: 0.75rem;
}

.hero-arrow--next {
  right: 0.75rem;
}

.hero-carousel:hover .hero-arrow {
  opacity: 0.85;
}

.hero-arrow:hover,
.hero-arrow:focus-visible {
  opacity: 1;
  background-color: rgba(15, 23, 42, 0.8);
  border-color: rgba(255, 255, 255, 0.65);
}

.hero-arrow:focus-visible {
  outline: 3px solid var(--bma-gold);
  outline-offset: 2px;
}

.hero-dots {
  position: absolute;
  bottom: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.hero-dots[hidden] {
  display: none;
}

.hero-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border: 0;
  background-color: transparent;
  padding: 0;
  cursor: pointer;
}

.hero-dot:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
  border-radius: 999px;
}

.hero-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.52);
  transition: width 0.18s ease, background-color 0.18s ease;
}

.hero-dot[aria-selected="true"]::after {
  width: 24px;
  background-color: #FFFFFF;
}

.muted-note {
  font-size: 0.875rem;
  color: var(--bma-text-muted);
}

/* ==========================================================================
   Quick Search & Filter Panel
   ========================================================================== */
.search-banner {
  background-color: var(--bma-surface);
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-md);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--bma-shadow-sm);
}

.quick-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
}

.quick-search-form__input {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-sm);
  background-color: var(--bma-input-bg);
  color: var(--bma-text);
}

.quick-search-form__input:focus {
  border-color: var(--bma-accent);
}

/* Department Tabs */
.dept-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dept-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
  appearance: none;
  background-color: var(--bma-surface);
  color: var(--bma-text);
  border: 1px solid var(--bma-border);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dept-tab:hover {
  border-color: var(--bma-accent-border);
  background-color: var(--bma-accent-soft);
  color: var(--bma-accent-text);
}

.dept-tab[aria-selected="true"],
.dept-tab.is-active {
  background-color: var(--bma-accent);
  color: #FFFFFF;
  border-color: var(--bma-accent);
}

/* Hashtag Chips */
.hashtag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hashtag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background-color: var(--bma-surface);
  border: 1px solid var(--bma-border);
  color: var(--bma-hashtag-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.hashtag-chip:hover,
.hashtag-chip.is-active {
  background-color: var(--bma-accent);
  color: #FFFFFF;
  border-color: var(--bma-accent);
}

.hashtag-chip__count {
  font-size: 0.78rem;
  opacity: 0.8;
}

/* ==========================================================================
   News Grid & Cards
   ========================================================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.news-card {
  min-width: 0;
  background-color: var(--bma-surface);
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-md);
  box-shadow: var(--bma-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--bma-shadow-md);
  border-color: var(--bma-accent-border);
}

.news-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background-color: var(--bma-surface-inset);
  overflow: hidden;
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.news-card:hover .news-card__media img {
  transform: scale(1.03);
}

.news-card__pin {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  font-size: 0.72rem;
  padding: 0.14rem 0.48rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.news-card__img-count {
  position: absolute;
  bottom: 0.45rem;
  right: 0.45rem;
  background-color: rgba(17, 24, 39, 0.78);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  line-height: 1.3;
}

.news-card__body {
  padding: 0.65rem 0.7rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.4rem;
}

.news-card__dept-row {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.news-card__dept {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.74rem;
  padding: 0.14rem 0.5rem;
  text-decoration: none;
}

.news-card__dept:hover {
  text-decoration: underline;
}

.news-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
  font-size: 0.76rem;
  color: var(--bma-text-muted);
  line-height: 1.35;
}

.news-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.news-card__icon {
  flex-shrink: 0;
  opacity: 0.82;
}

.news-card__views {
  font-size: inherit;
  color: var(--bma-text-muted);
  font-weight: 500;
}

.news-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.news-card__title a {
  color: var(--bma-text);
  text-decoration: none;
}

.news-card__title a:hover {
  color: var(--bma-link);
  text-decoration: underline;
}

/* ==========================================================================
   News Archive Filter Form & Pagination (news.html)
   ========================================================================== */
.page-banner {
  background: var(--bma-banner-bg);
  color: #FFFFFF;
  padding: 1.5rem 1.75rem;
  border-radius: var(--bma-radius-md);
  margin-bottom: 1.5rem;
  border-left: 6px solid var(--bma-banner-border);
}

.page-banner h1 {
  margin: 0 0 0.3rem;
  font-size: 1.6rem;
}

.page-banner p {
  margin: 0;
  color: var(--bma-banner-sub);
}

.filter-panel {
  background-color: var(--bma-surface);
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-md);
  padding: 1.25rem;
  box-shadow: var(--bma-shadow-sm);
  margin-bottom: 1.5rem;
}

.filter-mobile-bar {
  display: none;
}

.filter-toggle-btn {
  width: 100%;
  justify-content: space-between;
  min-height: 44px;
}

.filter-toggle-btn[aria-expanded="true"] {
  background-color: var(--bma-accent-soft);
  border-color: var(--bma-accent);
}

.filter-panel__body {
  display: block;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  align-items: end;
}

.form-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bma-text);
}

.form-control {
  width: 100%;
  min-height: 44px;
  padding: 0.52rem 0.75rem;
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-sm);
  background-color: var(--bma-input-bg);
  color: var(--bma-text);
}

.form-control::placeholder,
.quick-search-form__input::placeholder {
  color: var(--bma-text-muted);
}

.form-control:focus {
  border-color: var(--bma-accent);
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
  align-items: center;
  justify-content: space-between;
}

.filter-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--bma-text-muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-sm);
  background-color: var(--bma-surface);
  color: var(--bma-text);
  font-weight: 600;
  cursor: pointer;
}

.page-btn:hover:not([disabled]) {
  background-color: var(--bma-accent-soft);
  border-color: var(--bma-accent);
}

.page-btn[aria-current="page"] {
  background-color: var(--bma-accent);
  color: #FFFFFF;
  border-color: var(--bma-accent);
}

.page-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   Article Reader & 30-Image Gallery & Lightbox (article.html)
   ========================================================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--bma-text-muted);
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}

.breadcrumb a {
  color: var(--bma-link);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.article-shell {
  background-color: var(--bma-surface);
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-lg);
  box-shadow: var(--bma-shadow-sm);
  padding: 1.75rem 2rem;
}

.article-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.article-stat {
  font-size: 0.9rem;
  color: var(--bma-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.article-title {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--bma-text);
  overflow-wrap: anywhere;
}

.article-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0;
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--bma-border);
  border-bottom: 1px solid var(--bma-border);
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--bma-text);
  overflow-wrap: anywhere;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-hashtags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--bma-border);
}

/* ==========================================================================
   Horizontal Media Slider (Shared: #article-modal & article.html)
   ========================================================================== */
.article-media-section {
  margin: 0 0 1.35rem;
}

.media-slider {
  margin-top: 1.35rem;
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-md);
  overflow: hidden;
  background-color: var(--bma-surface-alt);
}

.media-slider--modal {
  margin: 0 0 1.25rem;
}

.article-media-section .media-slider {
  margin-top: 0;
}

.media-slider__stage {
  position: relative;
  background-color: #0E131A;
  overflow: hidden;
}

.media-slider__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.media-slider__track::-webkit-scrollbar {
  display: none;
}

.media-slider__slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-slider__img-btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  background: transparent;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-slider__img-btn img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.media-slider--page .media-slider__img-btn img {
  max-height: 500px;
}

.media-slider__counter {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 3;
  background-color: rgba(15, 23, 42, 0.78);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.media-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.72);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.36);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.media-slider__nav:hover {
  background-color: var(--bma-accent);
  border-color: #FFFFFF;
}

.media-slider__nav--prev {
  left: 0.6rem;
}

.media-slider__nav--next {
  right: 0.6rem;
}

.media-slider__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.6rem 0.85rem;
  background-color: var(--bma-surface-alt);
  border-top: 1px solid var(--bma-border);
}

.media-slider__caption {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--bma-text-muted);
  line-height: 1.4;
}

.media-slider__dots {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.media-slider__dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.media-slider__dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: var(--bma-text-muted);
  opacity: 0.45;
  transition: width 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.media-slider__dot.is-active::after,
.media-slider__dot[aria-selected="true"]::after {
  width: 20px;
  opacity: 1;
  background-color: var(--bma-accent);
}

.media-slider__progress {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bma-text-muted);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .media-slider__track {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Pop-up Article Reader Modal (#article-modal)
   ========================================================================== */
.article-modal[hidden] {
  display: none;
}

.article-modal {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background-color: rgba(10, 18, 24, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.article-modal__dialog {
  width: 100%;
  max-width: min(740px, 100%);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bma-surface);
  color: var(--bma-text);
  border: 1px solid var(--bma-border);
  border-radius: var(--bma-radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.article-modal__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.25rem;
  background-color: var(--bma-surface);
  border-bottom: 1px solid var(--bma-border);
  flex-shrink: 0;
}

.article-modal__brand {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.article-modal__emblem {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.article-modal__brand-info {
  min-width: 0;
  flex: 1;
}

.article-modal__brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}

.article-modal__org {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--bma-text);
}

.article-modal__badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.article-modal__meta {
  margin-top: 0.2rem;
  font-size: 0.84rem;
  color: var(--bma-text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.article-modal__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--bma-border);
  background-color: var(--bma-surface-alt);
  color: var(--bma-text);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.article-modal__close:hover {
  background-color: var(--bma-danger-soft);
  border-color: var(--bma-danger);
  color: var(--bma-danger);
}

.article-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 1.35rem;
}

.article-modal__title {
  margin: 0 0 1rem;
  font-size: 1.45rem;
  line-height: 1.38;
  font-weight: 700;
  color: var(--bma-text);
  overflow-wrap: anywhere;
}

.article-modal__content {
  font-size: 1.03rem;
  line-height: 1.78;
  color: var(--bma-text);
  overflow-wrap: anywhere;
}

.article-modal__content p {
  margin: 0 0 0.95rem;
}

.article-modal__footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  background-color: var(--bma-surface);
  border-top: 1px solid var(--bma-border);
  flex-shrink: 0;
}

.article-modal__footer .btn {
  flex: 1 1 180px;
}

/* Lightbox Modal */
.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1650;
  background-color: rgba(10, 18, 14, 0.92);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  touch-action: pan-y pinch-zoom;
}

.lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lightbox__counter {
  font-weight: 700;
  font-size: 1rem;
  background-color: rgba(255, 255, 255, 0.14);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--bma-radius-sm);
  padding: 0.4rem 0.9rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.lightbox__close:hover {
  background-color: var(--bma-danger);
  border-color: var(--bma-danger);
}

.lightbox__stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.lightbox__img-wrap {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 90vw;
  max-height: 76vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img-wrap img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: var(--bma-radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.lightbox__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  width: 46px;
  height: 46px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.lightbox__nav:hover {
  background-color: var(--bma-green);
}

.lightbox__caption {
  text-align: center;
  font-size: 0.95rem;
  color: #E5E7EB;
  padding-bottom: 0.25rem;
}

/* ==========================================================================
   Empty & Loading States
   ========================================================================== */
.state-box {
  background-color: var(--bma-surface);
  border: 1px dashed var(--bma-border);
  border-radius: var(--bma-radius-md);
  padding: 2.25rem 1.25rem;
  text-align: center;
  color: var(--bma-text-muted);
}

.state-box--error {
  border-color: var(--bma-danger);
  background-color: var(--bma-danger-soft);
  color: var(--bma-danger);
}

/* ==========================================================================
   Official BMA Footer
   ========================================================================== */
.site-footer {
  background-color: var(--bma-footer-bg);
  color: var(--bma-footer-text);
  border-top: var(--bma-footer-border);
  margin-top: auto;
}

.site-footer__minimal {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.1rem 1.25rem;
  color: var(--bma-footer-text);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-region {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(380px, calc(100vw - 2rem));
}

.toast {
  background-color: var(--bma-green-dark);
  color: #FFFFFF;
  border-left: 5px solid var(--bma-gold);
  padding: 0.75rem 1rem;
  border-radius: var(--bma-radius-sm);
  box-shadow: var(--bma-shadow-md);
  font-weight: 600;
  font-size: 0.92rem;
}

.toast--error {
  background-color: var(--bma-danger);
  border-left-color: #FFFFFF;
}

/* ==========================================================================
   Dark Slate Mode (html[data-theme="dark"])
   ========================================================================== */
html[data-theme="dark"] body {
  background-color: var(--bma-bg);
  color: var(--bma-text);
}

html[data-theme="dark"] .site-header {
  background-color: #18202B;
  border-bottom: 1px solid #2E3A4A;
}

html[data-theme="dark"] .nav-toggle,
html[data-theme="dark"] .header-menu-btn {
  background-color: #232D3B;
  color: #E6EDF5;
  border-color: #3B495E;
}

html[data-theme="dark"] .header-menu-btn:hover {
  background-color: #2D394A;
}

html[data-theme="dark"] .header-menu-btn[aria-expanded="true"] {
  background-color: #2E3A4C;
  border-color: #34D399;
}

html[data-theme="dark"] .header-menu-popover {
  background-color: #18202B;
  color: #E6EDF5;
  border-color: #323E50;
}

html[data-theme="dark"] .header-menu-nav {
  border-bottom-color: #323E50;
}

html[data-theme="dark"] .header-menu-nav .site-nav__link {
  color: #E6EDF5;
  background-color: transparent;
}

html[data-theme="dark"] .header-menu-nav .site-nav__link:hover {
  background-color: #232D3B;
  color: #FFFFFF;
}

html[data-theme="dark"] .header-menu-nav .site-nav__link[aria-current="page"],
html[data-theme="dark"] .header-menu-nav .site-nav__link.is-active {
  background-color: #232D3B;
  color: #6EE7B7;
  box-shadow: inset 3px 0 0 #34D399;
}

html[data-theme="dark"] .header-menu-section__label {
  color: #CBD5E1;
}

html[data-theme="dark"] .a11y-btn {
  background-color: #232D3B;
  color: #E6EDF5;
  border-color: #3B495E;
}

html[data-theme="dark"] .a11y-btn:hover {
  background-color: #2D394A;
  border-color: #34D399;
}

html[data-theme="dark"] .a11y-btn[aria-pressed="true"] {
  background-color: #047857;
  color: #FFFFFF;
  border-color: #34D399;
}

html[data-theme="dark"] .theme-switch {
  background-color: #232D3B;
  color: #E6EDF5;
  border-color: #3B495E;
}

html[data-theme="dark"] .theme-switch:hover {
  background-color: #2D394A;
  border-color: #34D399;
}

html[data-theme="dark"] .site-nav__link {
  color: #E6EDF5;
}

html[data-theme="dark"] .site-nav__link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

html[data-theme="dark"] .site-nav__link[aria-current="page"],
html[data-theme="dark"] .site-nav__link.is-active {
  background-color: #232D3B;
  box-shadow: inset 0 -2px 0 #34D399;
}

html[data-theme="dark"] .site-nav__link--staff {
  background-color: #232D3B;
  color: #E6EDF5;
  border-color: #3B495E;
}

html[data-theme="dark"] .site-nav__link--staff:hover {
  background-color: #047857;
  color: #FFFFFF;
  border-color: #34D399;
}

html[data-theme="dark"] .site-footer {
  background-color: #0E131A;
  color: #CBD5E1;
  border-top: 1px solid #263140;
}

html[data-theme="dark"] .site-footer__minimal {
  color: #CBD5E1;
}

html[data-theme="dark"] .form-field label,
html[data-theme="dark"] .article-title,
html[data-theme="dark"] .article-body,
html[data-theme="dark"] .news-card__title a {
  color: var(--bma-text);
}

html[data-theme="dark"] .section-title,
html[data-theme="dark"] .section-more-link,
html[data-theme="dark"] .breadcrumb a {
  color: #6EE7B7;
}

html[data-theme="dark"] .article-modal__dialog {
  background-color: #212936;
  border-color: #323E50;
  color: #E6EDF5;
}

html[data-theme="dark"] .article-modal__header,
html[data-theme="dark"] .article-modal__footer {
  background-color: #212936;
  border-color: #323E50;
}

html[data-theme="dark"] .article-modal__org,
html[data-theme="dark"] .article-modal__title,
html[data-theme="dark"] .article-modal__content {
  color: #E6EDF5;
}

html[data-theme="dark"] .article-modal__close {
  background-color: #2A3444;
  border-color: #3B495E;
  color: #E6EDF5;
}

html[data-theme="dark"] .article-modal__close:hover {
  background-color: #3B1A1F;
  border-color: #F87171;
  color: #FECACA;
}

html[data-theme="dark"] .media-slider {
  background-color: #18202B;
  border-color: #323E50;
}

html[data-theme="dark"] .media-slider__footer {
  background-color: #18202B;
  border-top-color: #323E50;
}

html[data-theme="dark"] .media-slider__dot.is-active::after,
html[data-theme="dark"] .media-slider__dot[aria-selected="true"]::after {
  background-color: #34D399;
}

html[data-theme="dark"] .news-card:hover {
  border-color: #2F5449;
}

html[data-theme="dark"] .news-card__title a:hover {
  color: #6EE7B7;
}

html[data-theme="dark"] .news-card__img-count {
  background-color: rgba(14, 19, 26, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] a.btn-primary {
  background-color: #047857;
  color: #FFFFFF;
  border-color: #059669;
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] a.btn-primary:hover {
  background-color: #059669;
  color: #FFFFFF;
  border-color: #34D399;
}

html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] a.btn-outline,
html[data-theme="dark"] .filter-toggle-btn {
  background-color: #212936;
  color: #6EE7B7;
  border-color: #2F5449;
}

html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] a.btn-outline:hover,
html[data-theme="dark"] .filter-toggle-btn:hover,
html[data-theme="dark"] .filter-toggle-btn[aria-expanded="true"] {
  background-color: #1C312B;
  color: #A7F3D0;
  border-color: #34D399;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] a.btn-secondary {
  background-color: #2A3444;
  color: #E6EDF5;
  border-color: #3B495E;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] a.btn-secondary:hover {
  background-color: #364357;
  color: #FFFFFF;
  border-color: #4A5A73;
}

html[data-theme="dark"] .btn-facebook,
html[data-theme="dark"] a.btn-facebook {
  background-color: #156CE0;
  color: #FFFFFF;
  border-color: #156CE0;
}

html[data-theme="dark"] .btn-facebook:hover,
html[data-theme="dark"] a.btn-facebook:hover {
  background-color: #125DC2;
  color: #FFFFFF;
  border-color: #125DC2;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .quick-search-form__input {
  background-color: #18202B;
  color: #E6EDF5;
  border-color: #323E50;
}

html[data-theme="dark"] .hero-carousel {
  background-color: #0E131A;
  border-color: #323E50;
}

html[data-theme="dark"] .state-box--error {
  background-color: #3B1A1F;
  border-color: #F87171;
  color: #FECACA;
}

html[data-theme="dark"] .toast {
  background-color: #18202B;
  color: #E6EDF5;
  border: 1px solid #323E50;
  border-left: 5px solid #34D399;
}

html[data-theme="dark"] .toast--error {
  background-color: #7F1D1D;
  color: #FFFFFF;
  border: 1px solid #F87171;
  border-left: 5px solid #FCA5A5;
}

/* ==========================================================================
   Responsive Breakpoints & Print Styles
   ========================================================================== */
@media (min-width: 640px) {
  .news-card__body {
    padding: 0.85rem 0.95rem;
    gap: 0.45rem;
  }

  .news-card__title {
    font-size: 1rem;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.15rem;
  }

  .filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

@media (min-width: 768px) {
  .site-header__actions {
    display: inline-flex;
  }

  .site-header__auth-mobile {
    display: none;
  }

  .header-menu-nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .site-brand__logo-img {
    height: 32px;
  }
}

@media (max-width: 767px) {
  input,
  select,
  textarea,
  .form-control,
  .quick-search-form__input {
    font-size: 16px;
  }

  .site-header__inner {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .site-brand {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  .site-brand__logo-img {
    height: 30px;
  }

  .site-nav {
    display: none;
  }

  .site-nav__item--auth-desktop {
    display: none;
  }

  .site-header__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    margin-left: auto;
  }

  .site-header__auth-mobile {
    display: inline-flex;
    width: auto;
  }

  .dept-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.45rem;
    scrollbar-width: thin;
  }

  .dept-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .filter-mobile-bar {
    display: flex;
  }

  .filter-panel__body {
    margin-top: 0.9rem;
  }

  .filter-panel__body.is-collapsed {
    display: none;
  }

  .hero-slide__link {
    aspect-ratio: 16 / 10;
    min-height: 210px;
    max-height: 300px;
  }

  .hero-slide__overlay {
    padding: 1rem calc(0.75rem + 44px + 0.5rem) calc(0.55rem + 28px + 0.45rem);
  }

  .article-shell {
    padding: 1.15rem 1rem;
  }

  .article-title {
    font-size: 1.4rem;
  }

  .lightbox {
    padding: 0.75rem;
  }

  .lightbox__stage {
    gap: 0.35rem;
  }

  .lightbox__nav {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.35rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }

  .main-content {
    padding: 1.25rem 0 2.25rem;
  }

  .search-banner,
  .filter-panel {
    padding: 0.95rem;
  }

  .page-banner {
    padding: 1.1rem 1rem;
  }

  .page-banner h1 {
    font-size: 1.3rem;
  }

  .quick-search-form__input {
    flex: 1 0 100%;
    width: 100%;
  }

  .quick-search-form .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .filter-actions__btns {
    width: 100%;
  }

  .filter-actions__btns .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .article-toolbar .btn {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 135px;
  }

  .toast-region {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: none;
  }

  .article-modal {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .article-modal__dialog {
    max-height: 94dvh;
    border-radius: var(--bma-radius-md);
  }

  .article-modal__header {
    padding: 0.8rem 0.95rem;
  }

  .article-modal__body {
    padding: 1rem 0.95rem;
  }

  .article-modal__title {
    font-size: 1.25rem;
  }

  .article-modal__footer {
    padding: 0.75rem 0.95rem calc(0.75rem + env(safe-area-inset-bottom));
  }

  .media-slider__img-btn img {
    max-height: 320px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .site-header__inner {
    gap: 0.4rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .site-brand {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  .site-brand__logo-img {
    height: 26px;
    max-height: 26px;
    width: auto;
    max-width: 100%;
  }

  .site-header__actions {
    gap: 0.35rem;
  }

  .site-header__auth-mobile {
    min-height: 44px;
    min-width: 44px;
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .header-menu-popover {
    right: 0.75rem;
  }

  .section-title {
    font-size: 1.2rem;
  }
}

@media print {
  .site-nav,
  .site-header__actions,
  .header-menu-popover,
  .nav-toggle,
  .filter-mobile-bar,
  .article-toolbar,
  .breadcrumb,
  .article-modal,
  .media-slider__nav,
  .media-slider__counter,
  .media-slider__dots,
  .media-slider__progress,
  .hero-arrow,
  .hero-dots,
  .lightbox,
  .toast-region,
  .site-footer,
  .related-section {
    display: none !important;
  }

  .media-slider {
    border: none;
    background: #FFFFFF;
  }

  .media-slider__stage {
    background: #FFFFFF;
  }

  .media-slider__track {
    display: block;
    overflow: visible;
  }

  .media-slider__slide {
    display: block;
    margin-bottom: 0.75rem;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .media-slider__img-btn img {
    max-height: 320px;
    margin: 0 auto;
  }

  body {
    background: #FFFFFF;
    color: #000000;
  }

  .site-header {
    background: #FFFFFF;
    color: #000000;
    border-bottom: 2px solid #000000;
    box-shadow: none;
  }

  .site-brand__logo-screen {
    display: none !important;
  }

  .site-brand__logo-print {
    display: block !important;
  }

  .page-banner {
    background: #FFFFFF;
    color: #000000;
    border: 1px solid #999999;
    border-left: 6px solid #000000;
  }

  .page-banner p {
    color: #374151;
  }

  .article-shell {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  html[data-theme="dark"] body,
  html[data-theme="dark"] .site-header,
  html[data-theme="dark"] .site-footer,
  html[data-theme="dark"] .site-footer__minimal,
  html[data-theme="dark"] a.site-brand,
  html[data-theme="dark"] .page-banner,
  html[data-theme="dark"] .page-banner p,
  html[data-theme="dark"] .section-title,
  html[data-theme="dark"] .results-bar,
  html[data-theme="dark"] .breadcrumb,
  html[data-theme="dark"] .search-banner,
  html[data-theme="dark"] .quick-search-form__input,
  html[data-theme="dark"] .hero-carousel,
  html[data-theme="dark"] .hero-slide__title,
  html[data-theme="dark"] .btn-primary,
  html[data-theme="dark"] a.btn-primary,
  html[data-theme="dark"] .btn-outline,
  html[data-theme="dark"] a.btn-outline,
  html[data-theme="dark"] .btn-secondary,
  html[data-theme="dark"] a.btn-secondary,
  html[data-theme="dark"] .btn-facebook,
  html[data-theme="dark"] a.btn-facebook,
  html[data-theme="dark"] .dept-tab,
  html[data-theme="dark"] .dept-tab[aria-selected="true"],
  html[data-theme="dark"] .news-card,
  html[data-theme="dark"] .news-card__title a,
  html[data-theme="dark"] .news-card__dept,
  html[data-theme="dark"] .news-card__meta,
  html[data-theme="dark"] .news-card__views,
  html[data-theme="dark"] .filter-panel,
  html[data-theme="dark"] .filter-toggle-btn,
  html[data-theme="dark"] .form-field label,
  html[data-theme="dark"] .form-control,
  html[data-theme="dark"] .page-btn,
  html[data-theme="dark"] .page-btn[aria-current="page"],
  html[data-theme="dark"] .article-shell,
  html[data-theme="dark"] .article-title,
  html[data-theme="dark"] .article-body,
  html[data-theme="dark"] .media-slider,
  html[data-theme="dark"] .media-slider__stage,
  html[data-theme="dark"] .media-slider__footer,
  html[data-theme="dark"] .media-slider__caption,
  html[data-theme="dark"] .article-meta-top,
  html[data-theme="dark"] .article-meta-row,
  html[data-theme="dark"] .article-stat,
  html[data-theme="dark"] .badge,
  html[data-theme="dark"] .badge-dept,
  html[data-theme="dark"] a.badge-dept,
  html[data-theme="dark"] .badge-pinned,
  html[data-theme="dark"] .hashtag-chip,
  html[data-theme="dark"] .state-box,
  html[data-theme="dark"] a {
    background: #FFFFFF !important;
    color: #000000 !important;
    border-color: #999999 !important;
  }
}
