/* =============================================================================
   UNIFIED THEME CSS - Navigation & Footer
   Modern design system for Drupal 10 & Bootstrap 5 - GitHub Style Mobile Menu
   ============================================================================= */

/* =============================================================================
   SHARED VARIABLES & BASE STYLES
   ============================================================================= */
:root {
  /* ── THG colour tokens (redesign 2a) ──────────────────────────────── */
  --thg-green-deep: #24402a;
  --thg-green-forest: #2e6a35;
  --thg-green-sage: #6b9b4a;
  --thg-green-mint: #a8d5aa;
  --thg-leaf-tint: #eef4e9;
  --thg-orange: #e8720c;
  --thg-orange-hover: #c9630a;
  --thg-body-bg: #fcfbf8;
  --thg-ink: #2c352c;
  --thg-muted: #66755f;
  --thg-border: #e6eae2;
  --thg-cat-urgent: #e8720c;
  --thg-cat-info: #6b9b4a;
  --thg-cat-event: #3d7ea6;
  --thg-cat-notice: #c9862a;

  /* ── Derived / composite tokens ────────────────────────────────────── */
  --primary-gradient: linear-gradient(135deg, var(--thg-green-forest) 0%, var(--thg-green-deep) 100%);
  --accent-gradient: linear-gradient(90deg, var(--thg-orange), var(--thg-green-forest), var(--thg-green-sage));
  --hover-gradient: linear-gradient(90deg, rgba(240, 124, 0, 0.08) 0%, rgba(240, 124, 0, 0.03) 100%);
  --text-primary: #1a1a1a;
  --text-secondary: var(--thg-green-forest);
  --text-muted: var(--thg-green-sage);
  --accent-color: var(--thg-orange);
  --border-color: rgba(45, 90, 48, 0.15);
  --shadow-light: 0 2px 10px rgba(28, 46, 30, 0.08);
  --shadow-medium: 0 4px 20px rgba(28, 46, 30, 0.12);
  --shadow-hover: 0 8px 30px rgba(232, 114, 12, 0.18);
  --transition-smooth: all 0.3s ease;
  --transition-quick: all 0.2s ease;
  --border-radius: 8px;
  --border-radius-lg: 12px;
}

/* ── Light colour scheme — pinned to the redesign 2a palette ─────────────
   The alternate lighter-green scheme predates the redesign; its values are
   pinned to the :root tokens so flipping the admin setting cannot regress
   the site to the old palette. Re-derive here if a real alternate scheme
   is wanted again. ── */
[data-color-scheme="light"] {
  --thg-green-deep: #24402a;
  --thg-green-forest: #2e6a35;
  --thg-green-sage: #6b9b4a;
  --thg-orange: #e8720c;
  --thg-orange-hover: #c9630a;
  --thg-body-bg: #fcfbf8;
}

/* =============================================================================
   FOOTER STYLES
   ============================================================================= */
.footer {
  background: var(--thg-green-deep);
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.footer h4 {
  color: #ffffff;
  font-weight: 600;
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.footer h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent-color);
  border-radius: 1px;
}

.footer .btn-link {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none;
  padding: 8px 0;
  display: block;
  transition: var(--transition-smooth);
  border: none;
  text-align: left;
}

footer .btn-link:hover {
  color: var(--thg-orange) !important;
  padding-left: 10px;
  transform: translateX(5px);
}

.social-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: var(--transition-smooth);
  margin-right: 10px;
  font-size: 15px;
}

.social-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.social-btn.facebook:hover {
  background: #0b5fcc;
  border-color: #0b5fcc;
  color: white;
}

.social-btn.instagram:hover {
  background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
  border-color: #dc2743;
  color: white;
}

.social-btn.tiktok:hover {
  background: #000000;
  border-color: #000000;
  color: white;
}

.social-btn.telegram:hover {
  background: #26A5E4;
  border-color: #26A5E4;
  color: white;
}

.social-btn.youtube:hover {
  background: #FF0000;
  border-color: #FF0000;
  color: white;
}

.social-btn.flickr:hover {
  background: #ff0084;
  border-color: #ff0084;
  color: white;
}

/* Flickr icon polyfill — Bootstrap Icons has no bi-flickr glyph.
   Uses CSS mask so the icon inherits currentColor in all states. */
.bi.bi-flickr::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='4.5' cy='8' r='3.5'/%3E%3Ccircle cx='11.5' cy='8' r='3.5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='4.5' cy='8' r='3.5'/%3E%3Ccircle cx='11.5' cy='8' r='3.5'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.social-icons-grid {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 8px;
  justify-content: start;
}

.social-icons-grid .social-btn {
  margin-right: 0;
}

/* =============================================================================
   REDESIGN 2A — FOOTER (brand block + restyled DB link columns)
   ============================================================================= */
.thg-footer {
  background: var(--thg-green-deep);
  color: rgba(255, 255, 255, 0.85);
}

.thg-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 3.6fr;
  gap: 48px;
  padding: 48px 0 8px;
}

@media (max-width: 991.98px) {
  .thg-footer__grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0 8px;
  }
}

/* ── Brand block ── */
.thg-footer__brand-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.thg-footer__logo-chip {
  width: 64px;
  height: 64px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.thg-footer__logo-chip img {
  max-width: 100%;
  max-height: 100%;
}

.thg-footer__school-name {
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  max-width: 220px;
  margin: 0;
}

.thg-footer__contacts {
  margin-bottom: 18px;
}

.thg-footer__contacts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.thg-footer__contacts i {
  color: var(--thg-orange);
  flex-shrink: 0;
}

.thg-footer__contacts a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.thg-footer__contacts a:hover {
  color: var(--thg-orange);
}

.thg-footer__social {
  display: flex;
  gap: 8px;
}

.thg-footer__social .social-btn {
  margin-right: 0;
}

/* ── DB footer block neutralization + restyle (zero DB edits) ── */
.thg-footer__links .footer {
  background: transparent;
  margin-top: 0 !important;
  overflow: visible;
}

.thg-footer__links .footer::before {
  display: none;
}

.thg-footer__links .footer > .container {
  padding: 0 !important;
  max-width: none;
}

/* Brand block replaces the DB contacts column and copyright bar */
.thg-footer__links .footer .contacts-mobile-top,
.thg-footer__links .footer .copyright {
  display: none !important;
}

/* Links zone spans full width once contacts column is hidden */
.thg-footer__links .footer .col-lg-9 {
  flex: 0 0 100%;
  max-width: 100%;
  width: 100%;
}

.thg-footer__links .footer h4 {
  color: var(--thg-green-mint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 0;
  margin-bottom: 14px;
}

.thg-footer__links .footer h4::after {
  display: none;
}

.thg-footer__links .footer .btn-link {
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 13.5px;
  padding: 5px 0;
}

/* Mobile footer accordion — match desktop mint headings, whiten chevron.
   The Bootstrap .accordion-button toggles are otherwise unstyled → default
   dark text + blue chevron on the green footer. Accordion is only shown
   <992px via .mobile-accordion, so no media query needed. */
.thg-footer__links .mobile-accordion .accordion,
.thg-footer__links .mobile-accordion .accordion-item,
.thg-footer__links .mobile-accordion .accordion-button,
.thg-footer__links .mobile-accordion .accordion-collapse {
  background: transparent !important;
  border: 0 !important;
}
.thg-footer__links .mobile-accordion .accordion-item + .accordion-item {
  border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
}
.thg-footer__links .mobile-accordion .accordion-button {
  color: var(--thg-green-mint) !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 0;
  box-shadow: none !important;
}
.thg-footer__links .mobile-accordion .accordion-button::after {
  filter: brightness(0) invert(1); /* recolor the dark/blue chevron to white */
  opacity: 0.85;
}
.thg-footer__links .mobile-accordion .accordion-body {
  padding: 0 0 10px 0;
}

/* ── Bottom bar ── */
.thg-footer__bottom {
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 16px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 32px;
}

/* Zero out Drupal wrapper margins inside header region */
.region-header .block,
.region-header .field,
.region-header .field__item,
.region-header .content {
  margin-bottom: 0 !important;
}

/* =============================================================================
   REDESIGN 2A — TOPBAR (deep green strip above white navbar)
   ============================================================================= */
.thg-topbar {
  background: var(--thg-green-deep);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

/* !important + underline reset needed: compiled style.css link rules
   (.field__item a:not(...), base a) otherwise win over this selector and paint
   spamspan email + inactive language links forest green on the deep-green bar */
.thg-topbar a:not(.header-social-icon) {
  color: rgba(255, 255, 255, 0.92) !important;
  background-image: none !important;
  padding-bottom: 0 !important;
}

.thg-topbar a:not(.header-social-icon):hover,
.thg-topbar a:not(.header-social-icon):focus {
  color: var(--thg-orange) !important;
}

/* Contacts block uses Bootstrap .text-muted (!important) — force white on deep green */
.thg-topbar .text-muted,
.thg-topbar .contact-info {
  color: rgba(255, 255, 255, 0.92) !important;
}

.thg-topbar .header-social-icon {
  color: rgba(255, 255, 255, 0.7);
}

.thg-topbar .header-social-icon:hover,
.thg-topbar .header-social-icon:focus {
  color: var(--thg-orange);
}

/* Language switcher — active language as orange chip */
.thg-topbar .language-link.is-active,
.thg-topbar a.is-active {
  background: var(--thg-orange);
  color: #fff !important;
  border-radius: 10px;
  padding: 1px 8px;
}

.thg-topbar .language-link.is-active:hover,
.thg-topbar a.is-active:hover {
  color: #fff !important;
  background: var(--thg-orange-hover);
}

/* =============================================================================
   REDESIGN 2A — ORANGE CTA BUTTON (desktop navbar)
   ============================================================================= */
.thg-btn-cta {
  background: var(--thg-orange);
  color: #fff !important;
  border: none;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 18px;
  white-space: nowrap;
}

.thg-btn-cta:hover,
.thg-btn-cta:focus {
  background: var(--thg-orange-hover);
  color: #fff !important;
}

/* =============================================================================
   REDESIGN 2A — MEGA MENU PANEL (top-level parents with >6 children)
   ============================================================================= */
.unified-nav .desktop-nav .nav-item--mega {
  position: static;
}

.unified-nav .desktop-nav .thg-mega {
  position: absolute;
  left: 0 !important;
  right: 0 !important;
  top: 100%;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--thg-border);
  box-shadow: 0 24px 40px -20px rgba(28, 46, 30, 0.25);
  padding: 32px 40px;
  column-count: 3;
  column-gap: 32px;
}

.unified-nav .desktop-nav .thg-mega > li {
  break-inside: avoid;
}

/* =============================================================================
   HEADER SOCIAL ICONS — subtle, sketch-like on light background
   ============================================================================= */
.header-social-icons-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  color: rgba(45, 90, 48, 0.4);
  text-decoration: none !important;
  background: none;
  border: none;
  border-radius: 50%;
  transition: color 0.25s ease, transform 0.2s ease;
  background-image: none !important;
  background-size: 0 !important;
  padding-bottom: 0;
}

.header-social-icon:hover,
.header-social-icon:focus {
  color: var(--thg-orange, #e8720c);
  text-decoration: none !important;
  transform: scale(1.15);
  background-image: none !important;
}

.header-social-icon:focus-visible {
  outline: 2px solid var(--thg-orange);
  outline-offset: 2px;
}

[data-bs-theme="dark"] .header-social-icon {
  color: rgba(255, 255, 255, 0.4);
}

[data-bs-theme="dark"] .header-social-icon:hover,
[data-bs-theme="dark"] .header-social-icon:focus {
  color: rgba(255, 255, 255, 0.95);
}

.contact-info {
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.contact-info i {
  width: 20px;
  margin-right: 15px;
  margin-top: 2px;
  color: var(--thg-orange);
  flex-shrink: 0;
}

.copyright {
  background-color: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 20px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

/* Footer Accordion Styles */
.footer .accordion-button {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 15px 0;
  box-shadow: none;
}

.footer .accordion-button:not(.collapsed) {
  background: transparent;
  color: var(--accent-color);
  box-shadow: none;
}

.footer .accordion-button:focus {
  box-shadow: none;
  border: none;
}

.footer .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%233498db'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.footer .accordion-body {
  padding: 0;
  background: transparent;
}

.footer .accordion-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
}

/* =============================================================================
   NAVIGATION STYLES - GitHub Style Mobile Menu
   ============================================================================= */

/* Desktop Navigation */

/* White navbar since redesign 2a — title must be forest green, not the old
   dark-navbar white; 16px + nowrap keeps the brand block narrow enough for
   six pills + CTA on one row */
.navbar-brand a.site-title {
  color: var(--thg-green-forest) !important;
  font-size: 16px;
  white-space: nowrap;
}

[data-bs-theme="dark"] .navbar-brand a.site-title {
  color: #a8d5aa !important;
}

.nav-link {
  color: white;
}
.nav-brand .nav-link:hover {
  font-weight: bold !important;
  color: white !important;
}

/* Pill-style nav links — white navbar, forest pills (redesign 2a).
   Tight padding/size: six pills + brand + CTA must fit one row at 992px */
.unified-nav .desktop-nav .nav-link {
  color: var(--thg-green-forest);
  padding: 8px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Never let the last pill wrap to a second row */
.unified-nav .desktop-nav .navbar-nav {
  flex-wrap: nowrap !important;
}

/* At lg widths the brand goes logo-only — the title doesn't fit */
@media (max-width: 1199.98px) {
  .unified-nav .desktop-nav .site-title {
    display: none;
  }
}

.unified-nav .desktop-nav .nav-link:hover,
.unified-nav .desktop-nav .nav-link:focus {
  color: var(--thg-green-forest) !important;
  background: var(--thg-leaf-tint);
}

/* Active page link — solid forest pill */
.unified-nav .desktop-nav .nav-link.is-active,
.unified-nav .desktop-nav .nav-link.active,
.unified-nav .desktop-nav .menu-item--active-trail > a,
.unified-nav .desktop-nav .menu-item--active-trail > .nav-link {
  color: white !important;
  background: var(--thg-green-forest);
  font-weight: 600;
}

/* Keep hover visible on active pill */
.unified-nav .desktop-nav .nav-link.is-active:hover,
.unified-nav .desktop-nav .nav-link.active:hover,
.unified-nav .desktop-nav .menu-item--active-trail > a:hover,
.unified-nav .desktop-nav .menu-item--active-trail > .nav-link:hover {
  background: var(--thg-green-deep);
}

/* Dropdown toggle open state */
.unified-nav .desktop-nav .nav-link.show,
.unified-nav .desktop-nav .nav-link.show:focus {
  color: white !important;
  background: var(--thg-green-forest);
}

/* Last two nav item dropdowns — align to right edge to prevent off-screen overflow */
.unified-nav .desktop-nav li:nth-last-child(-n+2) .dropdown-menu:not(.thg-mega),
.unified-nav .desktop-nav li:nth-last-child(-n+2) .dropdown-menu[data-bs-popper]:not(.thg-mega) {
  right: 0 !important;
  left: auto !important;
}

.unified-nav .desktop-nav {
  background: #fff;
  border-bottom: 1px solid var(--thg-border);
  transition: var(--transition-smooth);
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  position: relative;
}

.unified-nav .container-fluid {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Mobile Header - Fixed at top — white bg, green accents (redesign 2a) */
.mobile-header {
  background: #fff;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--thg-border);
  box-shadow: var(--shadow-light);
  z-index: 1050;
  height: 70px;
}

/* Hamburger Menu Button - GitHub Style */
.mobile-menu-btn {
  color: var(--thg-green-forest);
  background: transparent;
  border: none;
  padding: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
  cursor: pointer;
  border-radius: 6px;
}

.mobile-menu-btn:hover {
  background: var(--thg-leaf-tint);
}

.mobile-menu-btn:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Hamburger Lines - GitHub Style Animation */

.hamburger-line {
  width: 18px;
  height: 2px;
  background: var(--thg-green-forest);
  border-radius: 1px;
  transition: all 0.3s ease;
  display: block;
  transform-origin: center;
}

/* Hamburger to X Animation */

.mobile-menu-btn.menu-open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.mobile-menu-btn.menu-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.mobile-menu-btn.menu-open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

.brand-section {
  text-align: center;
}

.brand-logo {
  height: 32px;
  width: auto;
  transition: var(--transition-smooth);
}

.brand-link {
  color: var(--thg-green-forest);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.brand-link:hover {
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Mobile Off-canvas - Full Screen Coverage */
.offcanvas .nav-link,
.mobile-offcanvas .nav-link {
  color: #1a1a1a;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 14px;
}

.mobile-offcanvas {
  --bs-offcanvas-bg: #f8f9fa;
  --bs-offcanvas-width: 100vw;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important; /* dynamic viewport height — excludes mobile browser chrome */
  max-width: none !important;
  top: 0 !important;
  left: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

.mobile-offcanvas-body {
  padding: 62px 10px 0 10px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex;
  flex-direction: column;
  height: 100vh !important;
  height: 100dvh !important;
  /* dvh keeps the sticky search footer within the visible viewport on mobile */
  min-height: 100vh !important;
  min-height: 100dvh !important;
}

.mobile-menu-content {
  flex: 1 1 auto;
  /* Allow it to grow and shrink */
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  /* Important for flex items */
  padding-bottom: 20px;
  /* Add some spacing */
}

/* Mobile Menu Items */
.mobile-offcanvas ul.menu,
.mobile-offcanvas .menu,
.mobile-offcanvas .navbar-nav {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.mobile-offcanvas .menu-item,
.mobile-offcanvas .nav-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin: 0;
}

.mobile-offcanvas .menu-item:last-child,
.mobile-offcanvas .nav-item:last-child {
  border-bottom: none;
}

.mobile-offcanvas .menu-item a,
.mobile-offcanvas .nav-item > a,
.mobile-offcanvas .nav-item > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  text-decoration: none;
  color: #1a1a1a !important;
  transition: var(--transition-quick);
  font-weight: 600;
  font-size: 17px;
  background: transparent;
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.mobile-offcanvas .menu-item a:hover,
.mobile-offcanvas .menu-item a:focus,
.mobile-offcanvas .nav-item > a:hover,
.mobile-offcanvas .nav-item > span:hover {
  background-color: #f0f4f0;
  color: var(--accent-color) !important;
  border-left-color: var(--accent-color);
}

.mobile-offcanvas .menu-item a.is-active,
.mobile-offcanvas .menu-item--active-trail > a,
.mobile-offcanvas .nav-item > a.is-active {
  background-color: rgba(45, 90, 48, 0.08);
  color: var(--accent-color) !important;
  border-left-color: var(--accent-color);
  font-weight: 700;
}

/* Dropdown Arrows */
.mobile-offcanvas .menu-item--expanded > a::after,
.mobile-offcanvas .menu-item.dropdown > a::after,
.mobile-offcanvas .dropdown-toggle::after,
.mobile-offcanvas .nav-item.dropdown > span::after {
  content: "\F285" !important;
  font-family: "bootstrap-icons" !important;
  font-size: 14px !important;
  font-weight: normal !important;
  color: #999 !important;
  border: none !important;
  vertical-align: middle !important;
  margin-left: auto !important;
  margin-right: 4px;
  transform: rotate(0deg) !important;
  transition: transform 0.25s ease, color 0.25s ease !important;
  flex-shrink: 0 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mobile-offcanvas .menu-item--expanded.show > a::after,
.mobile-offcanvas .menu-item.dropdown.show > a::after,
.mobile-offcanvas .nav-item.dropdown.show > span::after,
.mobile-offcanvas .dropdown.show .dropdown-toggle::after {
  transform: rotate(90deg) !important;
  color: var(--accent-color) !important;
}

/* Submenus - GitHub Style */
.mobile-offcanvas .dropdown-menu,
.mobile-offcanvas .menu-item .menu {
  position: static !important;
  transform: none !important;
  float: none !important;
  width: 100% !important;
  min-width: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #f6f8fa;
  display: none;
  overflow: hidden;
}

.mobile-offcanvas .dropdown-menu.show,
.mobile-offcanvas .menu-item .menu.show {
  display: block;
}

.mobile-offcanvas .menu-item .menu {
  background: #f6f8fa;
  border-left: none;
  margin: 0;
  overflow: hidden;
}

.mobile-offcanvas .menu-item .menu .menu-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-offcanvas .menu-item .menu .menu-item:last-child {
  border-bottom: none;
}

.mobile-offcanvas .menu-item .menu .menu-item a {
  padding: 9px 14px 9px 32px;
  font-size: 16px;
  font-weight: 400;
  color: #24292f !important;
  border-left: none;
}

.mobile-offcanvas .menu-item .menu .menu-item a:hover {
  color: var(--accent-color) !important;
  background-color: #e7f3ff;
}

/* Bootstrap dropdown items inside mobile menu */
.mobile-offcanvas .dropdown-menu .nav-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-offcanvas .dropdown-menu .nav-item:last-child {
  border-bottom: none;
}

.mobile-offcanvas .dropdown-menu .dropdown-item {
  padding: 9px 14px 9px 32px;
  font-size: 16px;
  font-weight: 400;
  color: #24292f !important;
  white-space: normal;
  border-left: none;
  transition: var(--transition-quick);
}

.mobile-offcanvas .dropdown-menu .dropdown-item:hover,
.mobile-offcanvas .dropdown-menu .dropdown-item:focus {
  color: var(--accent-color) !important;
  background-color: #f0f4f0;
}

.mobile-offcanvas .dropdown-menu .dropdown-item.is-active {
  color: var(--accent-color) !important;
  background-color: rgba(45, 90, 48, 0.08);
  font-weight: 600;
}

/* Search Footer - GitHub Style */
.mobile-search-footer {
  background: #f6f8fa;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-top: 0;
  /* Remove auto margin */
  flex-shrink: 0;
  /* Prevent it from shrinking */
  position: sticky;
  /* Make it stick to bottom */
  bottom: 0;
}

.search-container {
  position: relative;
}

.search-input {
  background: #ffffff !important;
  border: 1px solid #d1d9e0 !important;
  color: #24292f !important;
  padding: 12px 12px 12px 40px !important;
  border-radius: 6px !important;
  font-size: 14px;
  transition: var(--transition-smooth);
  width: 100%;
}

.search-input::placeholder {
  color: #656d76;
}

.search-input:focus {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
  outline: none !important;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #656d76;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.search-input:focus + .search-icon {
  color: var(--accent-color);
}

/* Menu search filtering */
.mobile-menu-content.menu-search-active .nav-item.menu-search-hidden {
  display: none;
}

.mobile-menu-content.menu-search-active .menu-search-match {
  background-color: rgba(232, 114, 12, 0.08);
  font-weight: 600;
}

.search-message {
  padding: 20px 16px;
  text-align: center;
  color: #656d76;
  font-style: italic;
  font-size: 14px;
}

[data-bs-theme="dark"] .search-message {
  color: #6b8a6c;
}

[data-bs-theme="dark"] .mobile-menu-content.menu-search-active .menu-search-match {
  background-color: rgba(232, 114, 12, 0.12);
}

/* Body Spacer */
.mobile-body-spacer {
  padding-top: 70px;
}

/* =============================================================================
   SHARED RESPONSIVE STYLES
   ============================================================================= */
@media (max-width: 991.98px) {
  /* Hide contacts block on mobile/tablet */
  #block-hvgb5subtheme-contacts {
    display: none !important;
  }

  body {
    padding-top: 70px;
  }
  
.mobile-header {
  background: #fff;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--thg-border);
  box-shadow: var(--shadow-light);
  z-index: 1050;
  height: 70px;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.mobile-header .container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}

.mobile-header .container-fluid>.d-flex {
  padding-left: 15px;
  padding-right: 15px;
}

  .contacts-mobile-top {
    order: -1;
    margin-bottom: 30px;
  }
  
  .mobile-accordion {
    display: block !important;
  }
  
  .desktop-links {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .mobile-accordion {
    display: none !important;
  }
  
  .desktop-links {
    display: block !important;
  }
}

/* =============================================================================
   ACCESSIBILITY & PERFORMANCE
   ============================================================================= */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for better accessibility */
.mobile-menu-btn:focus-visible,
.brand-link:focus-visible,
.search-input:focus-visible,
.mobile-offcanvas .menu-item a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Hide elements properly from screen readers when needed */
.mobile-offcanvas .block-system-branding-block {
  display: none;
}

/* Ensure proper overflow handling */
#modernMobileMenu {
  overflow-x: hidden !important;
}

mobile-offcanvas .menu-item a {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
}

/* Block spacing */
.mobile-offcanvas .block {
  margin-bottom: 0;
}

/* Override Bootstrap offcanvas backdrop */
.offcanvas-backdrop {
  background-color: rgba(0, 0, 0, 0.5) !important;
}
/* =============================================================================
   REDESIGN 2A — DARK MODE (Phase 8): topbar, navbar, mega panel, mobile header
   ============================================================================= */

/* Topbar — darker green surface */
[data-bs-theme="dark"] .thg-topbar {
  background: #141d16;
}

/* White navbar → dark surface, mint pills */
[data-bs-theme="dark"] .unified-nav .desktop-nav {
  background: #16211a;
  border-bottom-color: #243024;
}

[data-bs-theme="dark"] .unified-nav .desktop-nav .nav-link {
  color: #a8d5aa;
}

[data-bs-theme="dark"] .unified-nav .desktop-nav .nav-link:hover,
[data-bs-theme="dark"] .unified-nav .desktop-nav .nav-link:focus {
  color: #a8d5aa !important;
  background: rgba(168, 213, 170, 0.12);
}

[data-bs-theme="dark"] .unified-nav .desktop-nav .nav-link.is-active,
[data-bs-theme="dark"] .unified-nav .desktop-nav .nav-link.active,
[data-bs-theme="dark"] .unified-nav .desktop-nav .menu-item--active-trail > a,
[data-bs-theme="dark"] .unified-nav .desktop-nav .menu-item--active-trail > .nav-link,
[data-bs-theme="dark"] .unified-nav .desktop-nav .nav-link.show,
[data-bs-theme="dark"] .unified-nav .desktop-nav .nav-link.show:focus {
  color: #111814 !important;
  background: #a8d5aa;
}

/* Mega panel + regular dropdowns — dark surface */
[data-bs-theme="dark"] .unified-nav .desktop-nav .dropdown-menu {
  background: #1c2b1e;
  border-color: #243024;
}

[data-bs-theme="dark"] .unified-nav .desktop-nav .dropdown-menu .dropdown-item {
  color: #d4e6d5;
}

[data-bs-theme="dark"] .unified-nav .desktop-nav .dropdown-menu .dropdown-item:hover {
  background: #243024;
  color: #a8d5aa;
}

[data-bs-theme="dark"] .unified-nav .desktop-nav .thg-mega {
  border-bottom-color: #243024;
  box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.65);
}

/* Mobile fixed header */
[data-bs-theme="dark"] .mobile-header {
  background: #16211a;
  border-bottom-color: #243024;
}

[data-bs-theme="dark"] .mobile-menu-btn {
  color: #a8d5aa;
}

[data-bs-theme="dark"] .mobile-menu-btn:hover {
  background: rgba(168, 213, 170, 0.12);
}

[data-bs-theme="dark"] .hamburger-line {
  background: #a8d5aa;
}

[data-bs-theme="dark"] .brand-link {
  color: #a8d5aa;
}

/* Footer — deep green band; keep, just soften the bottom strip */
[data-bs-theme="dark"] .thg-footer {
  background: #16211a;
}
