/* Maryland Society SAR - Main Stylesheet */
/* styles.css */

/* Prevent FOUC by hiding body until styles load */
html {
  visibility: visible;
}

body {
  visibility: visible;
  opacity: 1;
  transition: none;
}

/* Apply default text size immediately */
body:not(.text-normal):not(.text-plusplus):not(.text-plusplusx2) {
  --font-size-base: 18px;
  --font-size-large: 20px;
  --font-size-xl: 22px;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-blue: #002868;
  --primary-red: #BF0A30;
  --gold: #FFD700;
  --text-dark: #333;
  --text-light: #666;
  --bg-light: #F8F9FA;
  --border-light: #E0E0E0;
  --font-size-base: 16px;
  --font-size-large: 18px;
  --font-size-xl: 20px;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: #fff;
  font-size: var(--font-size-base);
}

/* Text Size Variations */
body.text-normal {
  --font-size-base: 18px;
  --font-size-large: 20px;
  --font-size-xl: 22px;
}

body.text-plusplus {
  --font-size-base: 22px;
  --font-size-large: 24px;
  --font-size-xl: 26px;
}

body.text-plusplusx2 {
  --font-size-base: 28px;
  --font-size-large: 32px;
  --font-size-xl: 36px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Accessibility Controls */
.accessibility-controls {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: #fff;
  border: 2px solid var(--primary-blue);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

.accessibility-controls span {
  font-size: 12px;
  margin-right: 6px;
  color: var(--text-dark);
}

.accessibility-controls button {
  background: var(--primary-blue);
  color: #fff;
  border: 0;
  padding: 8px 12px;
  margin: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

.accessibility-controls button:hover {
  background: #001845;
}

.accessibility-controls button.active {
  background: var(--primary-red);
}

/* Header */
header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  width: 100px;
  height: auto;
}

.site-title h1 {
  color: var(--primary-blue);
  font-size: calc(var(--font-size-xl) + 8px);
  font-weight: 700;
  margin-bottom: 5px;
}

.site-title p {
  color: var(--text-light);
  font-size: var(--font-size-base);
  font-style: italic;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.social-links-header {
  display: flex;
  gap: 10px;
}

.social-links-header a {
  width: 36px;
  height: 36px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s;
  text-decoration: none;
}

.social-links-header a:hover {
  background: var(--primary-red);
}

.flag-logo {
  width: 120px;
  height: auto;
}

/* Navigation */
nav {
  background: var(--primary-blue);
  padding: 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, .6);
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 16px;
  cursor: pointer;
}

.nav-toggle:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-menu li {
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 18px 20px;
  color: #fff;
  text-decoration: none;
  font-size: var(--font-size-base);
  transition: background .3s;
  white-space: nowrap;
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, .1);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .1);
  display: none;
  min-width: 250px;
  z-index: 1000;
}

.nav-menu li:hover .dropdown {
  display: block;
}

.dropdown a {
  color: var(--text-dark);
  padding: 12px 20px;
  display: block;
  border-bottom: 1px solid var(--border-light);
  font-size: calc(var(--font-size-base) - 1px);
  text-decoration: none;
}

.dropdown a:hover {
  background: var(--bg-light);
  color: var(--primary-blue);
}

/* Mobile submenu toggles (hidden on desktop) */
.submenu-toggle {
  display: none;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.submenu-toggle:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #004080 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}

.hero h2 {
  font-size: calc(var(--font-size-xl) * 2);
  margin-bottom: 20px;
}

.tagline {
  font-size: calc(var(--font-size-large) + 6px);
  font-style: italic;
  opacity: .95;
}

/* Main Content */
.main-content {
  padding: 60px 0;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 10px 0 40px;
}

.btn-primary,
.btn-secondary {
  color: #fff;
  padding: 20px 30px;
  text-align: center;
  text-decoration: none;
  font-size: var(--font-size-large);
  font-weight: 600;
  border-radius: 8px;
  transition: all .3s;
  display: block;
}

.btn-primary {
  background: var(--primary-blue);
}

.btn-primary:hover {
  background: #001845;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
}

.btn-secondary {
  background: var(--primary-red);
}

.btn-secondary:hover {
  background: #9B0826;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.content-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 30px;
  transition: transform .3s, box-shadow .3s;
  cursor: pointer;
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, .1);
}

.content-card h3 {
  color: var(--primary-blue);
  font-size: calc(var(--font-size-xl) + 4px);
  margin-bottom: 12px;
}

.content-card p {
  color: var(--text-light);
  margin-bottom: 18px;
  font-size: var(--font-size-base);
  line-height: 1.7;
}

.learn-more {
  color: var(--primary-red);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-base);
}

.learn-more:hover {
  text-decoration: underline;
}

/* Wider cards on very large text */
body.text-plusplus .content-grid {
  grid-template-columns: repeat(2, minmax(460px, 1fr));
  gap: 28px;
}

body.text-plusplusx2 .content-grid {
  grid-template-columns: repeat(2, minmax(520px, 1fr));
  gap: 32px;
}

/* Keep nav centered & single-line on desktop at all sizes */
@media (min-width: 901px) {
  nav .nav-menu {
    flex-wrap: nowrap;
    justify-content: center;
    white-space: nowrap;
    gap: 0;
  }
  
  .nav-menu > li > a {
    padding: 16px 14px;
  }
  
  body.text-plusplus nav .nav-menu > li > a {
    font-size: 20px;
    padding: 16px 12px;
  }
  
  body.text-plusplusx2 nav .nav-menu > li > a {
    font-size: 22px;
    padding: 16px 10px;
  }
}

/* Store Section */
.store-section {
  background: linear-gradient(135deg, var(--primary-red) 0%, #8B0020 100%);
  color: #fff;
  padding: 50px 0;
  margin: 40px 0;
  border-radius: 10px;
}

.store-content {
  text-align: center;
}

.store-content h2 {
  font-size: calc(var(--font-size-xl) * 1.8);
  margin-bottom: 20px;
}

.store-content p {
  font-size: var(--font-size-large);
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.store-button {
  background: #fff;
  color: var(--primary-red);
  padding: 15px 40px;
  text-decoration: none;
  font-size: var(--font-size-large);
  font-weight: 600;
  border-radius: 8px;
  display: inline-block;
  transition: all .3s;
}

.store-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
}

/* Podcast Section */
.podcast-section {
  background: var(--bg-light);
  padding: 60px 0;
  margin: 40px 0;
}

.podcast-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: center;
}

.podcast-icon {
  text-align: center;
}

.podcast-icon svg {
  width: 150px;
  height: 150px;
}

.podcast-content h2 {
  color: var(--primary-blue);
  font-size: calc(var(--font-size-xl) * 1.6);
  margin-bottom: 20px;
}

.podcast-content p {
  font-size: var(--font-size-large);
  color: var(--text-dark);
  margin-bottom: 20px;
  line-height: 1.8;
}

.podcast-link {
  color: var(--primary-red);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--font-size-large);
}

.podcast-link:hover {
  text-decoration: underline;
}

/* Featured/Video Section */
.featured-section {
  padding: 60px 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.featured-content h2 {
  color: var(--primary-blue);
  font-size: calc(var(--font-size-xl) * 1.8);
  margin-bottom: 20px;
}

.featured-content p {
  font-size: var(--font-size-large);
  color: var(--text-dark);
  margin-bottom: 30px;
  line-height: 1.8;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .15);
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Quick Links */
.quick-links {
  background: #fff;
  padding: 40px 0;
  border-top: 3px solid var(--primary-blue);
  margin-top: 60px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.link-item {
  text-align: center;
  padding: 20px;
  background: var(--bg-light);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dark);
  transition: all .3s;
  font-size: var(--font-size-base);
}

.link-item:hover {
  background: var(--primary-blue);
  color: #fff;
}

/* Events Calendar Section */
.events-section {
  background: var(--bg-light);
  padding: 60px 0;
  margin-top: 40px;
}

.events-section h2 {
  color: var(--primary-blue);
  font-size: calc(var(--font-size-xl) * 1.6);
  margin-bottom: 16px;
  text-align: center;
}

/* Filter Control Buttons */
.filter-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-control-btn {
  flex: 1;
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: calc(var(--font-size-base) - 1px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.filter-control-btn:hover {
  background: #001845;
  transform: translateY(-2px);
}

.filter-control-btn:active {
  transform: translateY(0);
}

.events-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.calendar-wrap {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-title {
  font-size: var(--font-size-large);
  color: var(--primary-blue);
  font-weight: 700;
}

.cal-nav button {
  background: var(--primary-blue);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  margin-left: 8px;
}

.cal-nav button:hover {
  background: #001845;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-name {
  text-align: center;
  font-weight: 700;
  color: var(--text-light);
  font-size: calc(var(--font-size-base) - 1px);
  padding: 6px 0;
}

.day {
  min-height: 90px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px;
  position: relative;
  background: #fff;
}

.day .dnum {
  font-weight: 700;
  color: var(--primary-blue);
  font-size: calc(var(--font-size-base) - 1px);
}

.event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-red);
  display: inline-block;
  margin-right: 6px;
}

.event-item {
  font-size: 12px;
  color: var(--text-dark);
  margin-top: 4px;
  display: flex;
  align-items: center;
}

.events-filter.side {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px;
  position: sticky;
  top: 90px;
  overflow: auto;
  max-height: 70vh;
}

.events-filter .filter-group {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.events-filter .filter-group h4 {
  font-size: var(--font-size-large);
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.events-filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: calc(var(--font-size-base) - 1px);
  margin: 6px 0;
}

.no-events {
  text-align: center;
  color: var(--text-light);
  font-size: var(--font-size-large);
  padding: 12px;
  margin-top: 10px;
}

/* Footer */
footer {
  background: var(--text-dark);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.footer-section h4 {
  color: var(--gold);
  margin-bottom: 15px;
  font-size: var(--font-size-large);
}

.footer-section p,
.footer-section a {
  color: #CCC;
  text-decoration: none;
  line-height: 1.8;
  font-size: calc(var(--font-size-base) - 1px);
}

.footer-section a:hover {
  color: #fff;
  text-decoration: underline;
}

.interserver-button {
  display: inline-block;
  background: #4A90E2;
  color: #fff;
  padding: 8px 14px;
  border-radius: 5px;
  text-decoration: none;
  margin-left: 10px;
  transition: all .3s;
  font-weight: 600;
  font-size: 14px;
}

.interserver-button:hover {
  background: #3A7BC8;
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid #555;
  padding-top: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s;
  text-decoration: none;
}

.social-links a:hover {
  background: var(--primary-blue);
}

/* Accessibility Enhancements */
@media (prefers-contrast: high) {
  .content-card {
    border: 2px solid var(--text-dark);
  }
  
  .btn-primary,
  .btn-secondary {
    border: 2px solid #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Anniversary Hero */
.anniversary-hero {
  background: radial-gradient(60% 100% at 50% 0%, rgba(255, 255, 255, 0.15), transparent 60%),
              linear-gradient(135deg, var(--primary-blue) 0%, #0a3a86 50%, #001845 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.anniv-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: nowrap;
}

.anniv-badge {
  width: 300px;
  max-width: 30vw;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35));
}

.anniv-center {
  max-width: 720px;
}

.anniv-title {
  font-size: calc(var(--font-size-xl) * 1.8);
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.anniv-rotator {
  position: relative;
  height: 1.9em;
  line-height: 1.9em;
  margin: 12px auto 20px;
  font-size: calc(var(--font-size-large) + 2px);
  font-style: italic;
  overflow: hidden;
  mask-image: linear-gradient(transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(transparent, black 10%, black 90%, transparent);
}

.anniv-rotator .phrase {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  transform: translateY(20%) scale(0.98);
  filter: blur(2px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .8, .2, 1), filter .6s ease;
  will-change: opacity, transform, filter;
}

.anniv-rotator .phrase.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.anniv-button {
  display: inline-block;
  background: #fff;
  color: var(--primary-blue);
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid #fff;
  transition: transform .2s, box-shadow .2s;
}

.anniv-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
}

.anniv-button:focus {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.anniv-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 215, 0, .12), transparent 65%);
  pointer-events: none;
}

/* Footer contact divider */
.contact-sep {
  height: 1px;
  background: #777;
  opacity: .7;
  margin: 10px 0;
  width: 60%;
}

/* Mobile Responsive Styles */
@media (max-width: 900px) {
  /* Hide accessibility text size controls on mobile */
  .accessibility-controls {
    display: none !important;
  }

  /* Mobile Header with Inline Logos */
  .header-top {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    gap: 8px;
  }
  
  /* Main row with logos and title inline */
  .logo-section {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
  }
  
  /* Left logo */
  .logo {
    width: 48px;
    height: auto;
    flex-shrink: 0;
  }
  
  /* Center title */
  .site-title {
    text-align: center;
    flex: 1 1 auto;
  }
  
  .site-title h1 {
    line-height: 1.1;
    font-size: clamp(20px, 5.5vw, 26px);
    margin-bottom: 3px;
  }
  
  .site-title p {
    font-size: clamp(10px, 2.8vw, 13px);
  }
  
  /* Flag logo - will be inline */
  .flag-logo {
    width: 48px;
    height: auto;
    flex-shrink: 0;
  }
  
  /* Header right container */
  .header-right {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  /* Social links appear below */
  .social-links-header {
    display: flex;
    justify-content: center;
    gap: 10px;
  }
  
  .social-links-header a {
    width: 30px;
    height: 30px;
  }

  /* Navigation */
  .nav-inner {
    justify-content: center;
  }
  
  .nav-toggle {
    display: block;
    margin: 10px auto 8px;
  }
  
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
  }
  
  body.nav-open .nav-menu {
    display: flex;
  }
  
  /* Mobile nav grid layout */
  nav .nav-menu {
    width: 100% !important;
    align-items: stretch !important;
  }
  
  nav .nav-menu > li {
    display: grid !important;
    grid-template-columns: 1fr 48px !important;
    align-items: center !important;
    width: 100% !important;
  }
  
  nav .nav-menu > li > a {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    padding: 14px 16px !important;
    border-top: 1px solid rgba(255, 255, 255, .15);
    text-align: center;
  }
  
  nav .nav-menu > li > .submenu-toggle {
    grid-column: 2 !important;
    grid-row: 1 !important;
    position: static !important;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    display: grid !important;
    place-items: center !important;
    background: transparent !important;
    border: 0 !important;
    color: #fff !important;
    font-size: 18px !important;
    transform: translateY(3px);
    transition: transform 0.2s ease;
  }
  
  nav .nav-menu > li.open > .submenu-toggle {
    transform: translateY(0) rotate(180deg);
  }
  
  nav .nav-menu > li > .dropdown {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    position: static;
    display: none;
    box-shadow: none;
  }
  
  .nav-menu li.open > .dropdown {
    display: block;
  }
  
  .nav-menu li:hover .dropdown {
    display: none;
  }
  
  .dropdown a {
    text-align: center;
  }

  /* Anniversary adjustments */
  .anniv-inner {
    gap: 14px;
  }
  
  .anniv-badge {
    width: 130px;
    max-width: 34vw;
  }
  
  .anniv-badge.right {
    display: none !important;
  }
  
  .anniv-title {
    font-size: calc(var(--font-size-xl) * 1.4);
  }
  
  .anniv-rotator {
    font-size: var(--font-size-large);
  }

  /* Other mobile adjustments */
  .hero h2 {
    font-size: calc(var(--font-size-xl) * 1.6);
  }
  
  .tagline {
    font-size: calc(var(--font-size-large) + 2px);
  }
  
  .featured-grid,
  .podcast-grid {
    grid-template-columns: 1fr;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
  }
  
  .events-layout {
    grid-template-columns: 1fr;
  }
  
  .events-filter.side {
    position: static;
    max-height: none;
  }

  /* Center footer on mobile */
  .footer-content {
    justify-items: center;
  }
  
  .footer-section,
  .footer-section p,
  .footer-section a,
  .footer-bottom p {
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .contact-sep {
    margin: 10px auto;
  }
}

@media (max-width: 640px) {
  .anniv-badge {
    width: 100px;
    max-width: 36vw;
  }
  
  .anniv-title {
    font-size: calc(var(--font-size-xl) * 1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .anniv-rotator .phrase {
    transition: none;
  }
}

/* Improve focus visibility */
.nav-toggle:focus,
.submenu-toggle:focus,
.nav-menu a:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}


/* Add/modify these CSS rules in new_styles.css */

/* Update the header structure */
.header-top {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Remove social links from logo section on desktop */
.logo-section .social-links-header {
  display: none; /* This removes the duplicate if it exists */
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Social links next to flag on desktop */
.header-right .social-links-header {
  display: flex;
  gap: 10px;
}

.social-links-header a {
  width: 36px;
  height: 36px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s;
  text-decoration: none;
}

.social-links-header a:hover {
  background: var(--primary-red);
}

/* Mobile Responsive - Keep existing mobile behavior */
@media (max-width: 900px) {
  .header-top {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    gap: 8px;
  }
  
  /* Main row with logos and title inline */
  .logo-section {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
  }
  
  /* Left logo */
  .logo {
    width: 48px;
    height: auto;
    flex-shrink: 0;
  }
  
  /* Center title */
  .site-title {
    text-align: center;
    flex: 1 1 auto;
  }
  
  .site-title h1 {
    line-height: 1.1;
    font-size: clamp(20px, 5.5vw, 26px);
    margin-bottom: 3px;
  }
  
  .site-title p {
    font-size: clamp(10px, 2.8vw, 13px);
  }
  
  /* On mobile, move flag into logo-section */
  .flag-logo {
    width: 48px;
    height: auto;
    flex-shrink: 0;
  }
  
  /* Header right container for social links on mobile */
  .header-right {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0;
  }
  
  /* Social links appear below on mobile */
  .header-right .social-links-header {
    display: flex;
    justify-content: center;
    gap: 10px;
  }
  
  .social-links-header a {
    width: 30px;
    height: 30px;
  }
}

/* Minimal Accessibility Controls with S/M/L */
.accessibility-controls {
  position: fixed;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary-blue);
  border-radius: 20px;
  padding: 10px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hidden state */
.accessibility-controls.hidden {
  opacity: 0;
  transform: translateX(-60px) translateY(-50%);
  pointer-events: none;
}

/* Text label */
.accessibility-controls span {
  font-size: 10px;
  margin-bottom: 6px;
  color: var(--text-dark);
  font-weight: 600;
  text-align: center;
}

/* S/M/L buttons */
.accessibility-controls button.size-btn {
  background: transparent;
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
  padding: 0;
  margin: 3px 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  width: 36px;
  height: 36px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accessibility-controls button.size-btn:hover {
  background: var(--primary-blue);
  color: white;
}

.accessibility-controls button.size-btn.active {
  background: var(--primary-red);
  color: white;
  border-color: var(--primary-red);
}

/* Help/Close button */
.accessibility-controls .help-btn {
  background: transparent;
  border: 1px solid #999;
  color: #666;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  margin-top: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s;
}

.accessibility-controls .help-btn:hover {
  background: #f0f0f0;
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Tooltip */
.help-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1001;
}

.help-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: rgba(0, 0, 0, 0.9);
}

.help-btn:hover .help-tooltip {
  opacity: 1;
}

/* Show button when controls are hidden */
.accessibility-show-btn {
  position: fixed;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  z-index: 999;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary-blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  transition: all 0.3s;
  color: var(--primary-blue);
  font-size: 16px;
  font-weight: bold;
}

.accessibility-show-btn:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

/* When controls are hidden, show the show button */
body.controls-hidden .accessibility-controls {
  opacity: 0;
  transform: translateX(-60px) translateY(-50%);
  pointer-events: none;
}

body.controls-hidden .accessibility-show-btn {
  display: flex;
}

/* Animation for showing controls */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-60px) translateY(-50%);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(-50%);
  }
}

.accessibility-controls.showing {
  animation: slideIn 0.3s ease forwards;
}

/* Hide on mobile devices */
@media (max-width: 900px) {
  .accessibility-controls,
  .accessibility-show-btn {
    display: none !important;
  }
}


/* Replace the existing accessibility controls CSS in new_styles.css with this: */

/* Minimal Accessibility Controls with S/M/L */
.accessibility-controls {
  position: fixed;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary-blue);
  border-radius: 20px;
  padding: 10px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Text label */
.accessibility-controls span {
  font-size: 10px;
  margin-bottom: 6px;
  color: var(--text-dark);
  font-weight: 600;
  text-align: center;
}

/* S/M/L buttons */
.accessibility-controls button.size-btn {
  background: transparent;
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
  padding: 0;
  margin: 3px 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  width: 36px;
  height: 36px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accessibility-controls button.size-btn:hover {
  background: var(--primary-blue);
  color: white;
}

.accessibility-controls button.size-btn.active {
  background: var(--primary-red);
  color: white;
  border-color: var(--primary-red);
}

/* Help/Close button */
.accessibility-controls .help-btn {
  background: transparent;
  border: 1px solid #999;
  color: #666;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  margin-top: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s;
}

.accessibility-controls .help-btn:hover {
  background: #f0f0f0;
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Tooltip */
.help-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1001;
}

.help-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: rgba(0, 0, 0, 0.9);
}

.help-btn:hover .help-tooltip {
  opacity: 1;
}

/* Show button - now positioned at bottom left */
.accessibility-show-btn {
  position: fixed;
  left: 10px;
  bottom: 20px;  /* Default position at bottom */
  z-index: 999;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary-blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  color: var(--primary-blue);
  font-size: 16px;
  font-weight: bold;
}

/* Sliding animation states */
.accessibility-show-btn.sliding-down {
  animation: slideToBottom 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.accessibility-show-btn.at-bottom {
  bottom: 20px;
  top: auto;
  transform: none;
}

.accessibility-show-btn.sliding-up {
  animation: slideToCenter 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes slideToBottom {
  0% {
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
  }
  100% {
    top: auto;
    bottom: 20px;
    transform: none;
  }
}

@keyframes slideToCenter {
  0% {
    top: auto;
    bottom: 20px;
    transform: none;
  }
  100% {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
  }
}

.accessibility-show-btn:hover {
  background: var(--primary-blue);
  color: white;
  transform: scale(1.1);
}

.accessibility-show-btn.at-bottom:hover {
  transform: translateY(-3px) scale(1.1);
}

/* Pulse animation to draw attention when at bottom */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  }
  50% {
    box-shadow: 0 2px 15px rgba(0, 40, 104, .3);
  }
}

.accessibility-show-btn.at-bottom {
  animation: pulse 2s infinite;
}

.accessibility-show-btn.at-bottom:hover {
  animation: none;
}

/* When controls are hidden */
body.controls-hidden .accessibility-controls {
  opacity: 0;
  transform: translateX(-60px) translateY(-50%);
  pointer-events: none;
}

body.controls-hidden .accessibility-show-btn {
  display: flex;
}

/* Animation for showing controls */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-60px) translateY(-50%);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(-50%);
  }
}

.accessibility-controls.showing {
  animation: slideIn 0.3s ease forwards;
}

/* Hide on mobile devices */
@media (max-width: 900px) {
  .accessibility-controls,
  .accessibility-show-btn {
    display: none !important;
  }
}

/* Add/update these styles in your new_styles.css file for mobile navigation scrolling */

/* Mobile navigation scrolling fix */
@media (max-width: 900px) {
  /* Make the nav menu scrollable when open */
  body.nav-open {
    overflow: hidden; /* Prevent body scroll when menu is open */
  }
  
  nav {
    position: relative;
  }
  
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - 150px); /* Adjust based on header height */
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding-bottom: 20px; /* Add some bottom padding */
  }
  
  body.nav-open .nav-menu {
    display: flex;
  }
  
  /* Style the scrollbar for better visibility (optional) */
  .nav-menu::-webkit-scrollbar {
    width: 6px;
  }
  
  .nav-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
  }
  
  .nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
  }
  
  /* Ensure dropdown content is visible within scroll */
  .nav-menu li.open > .dropdown {
    display: block;
    position: static; /* Important: make dropdown part of the flow */
    box-shadow: none;
    background: rgba(0, 40, 104, 0.95); /* Slightly different bg to show it's a submenu */
    margin: 0;
  }
  
  .dropdown a {
    padding: 12px 24px; /* Indent submenu items */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
  }
  
  /* Visual indicator when menu is scrollable */
  body.nav-open nav {
    position: relative;
  }
  
  /* Optional: Add a subtle shadow at bottom when scrollable */
  body.nav-open nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(0, 40, 104, 0.8), transparent);
    pointer-events: none;
    z-index: 10;
  }
  
  /* Ensure the last item is fully visible when scrolling */
  .nav-menu > li:last-child {
    margin-bottom: 10px;
  }
}

/* Additional fix to ensure header stays in place */
@media (max-width: 900px) {
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
  }
  
  /* Make navigation container have a fixed max height */
  nav {
    max-height: calc(100vh - 120px); /* Adjust based on your header height */
    display: flex;
    flex-direction: column;
  }
  
  .nav-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }
  
  /* Ensure menu takes remaining height */
  body.nav-open .nav-inner {
    overflow: visible;
  }
  
  .filter-controls {
    flex-direction: column;
  }
}

.mdssar-size-btn.active {
  background: #BF0A30;
  color: white;
  border-color: #BF0A30;
}

/* Offset anchored sections for sticky header */
:target {
  scroll-margin-top: 90px;
}


/* President Carousel (pc-*) */
.president-carousel { position: relative; overflow: hidden; border-radius: 12px; }
.pc-viewport { position: relative; width: 100%; height: clamp(220px, 38vw, 420px); }
.pc-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; height: 100%; translate: 0 0; transition: transform .45s ease; }
.pc-slide { position: relative; width: 100%; height: 100%; display: grid; grid-template-columns: minmax(220px, 36%) 1fr; gap: clamp(12px, 2vw, 24px); background: linear-gradient(90deg, #0f4c81 0%, #163a5f 100%); color: #fff; }
.pc-media { height: 100%; overflow: hidden; }
.pc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-caption { padding: clamp(12px, 2vw, 20px) clamp(12px, 2vw, 22px); align-self: center; }
.pc-name { margin: 0 0 4px; font-size: clamp(1.1rem, 2.2vw, 1.6rem); line-height: 1.2; }
.pc-title { margin: 0 0 10px; opacity: .9; font-weight: 600; }
.pc-blurb { margin: 0; font-size: clamp(.9rem, 1.6vw, 1rem); line-height: 1.6; max-width: 60ch; }

.pc-controls { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.pc-nav { pointer-events: auto; border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.25); color: #fff; width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.pc-nav:hover { background: rgba(0,0,0,.4); }

.pc-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; gap: 8px; justify-content: center; }
.pc-dot { width: 8px; height: 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.2); cursor: pointer; }
.pc-dot[aria-selected="true"] { background: #fff; }

@media (max-width: 851px) {
  .pc-slide { grid-template-columns: 1fr; }
  .pc-viewport { height: clamp(260px, 56vw, 420px); }
}

/* Simpler today highlight - just a colored border and bold number */
.day.today {
  border: 2px solid var(--primary-blue);
  background: rgba(0, 40, 104, 0.05);
}

.day.today .dnum {
  color: var(--primary-blue);
  font-weight: 900;
}