/*
 * Burning Bush Global Theme - Primary Stylesheet
 * -----------------------------------------------
 * This file controls the global look and feel of the theme.
 * It is written using a mobile-first approach.
 *
 * TABLE OF CONTENTS
 * -----------------
 * 1.  CSS VARIABLES & CUSTOM PROPERTIES
 * 2.  CSS RESET & BASE STYLES
 * 3.  TYPOGRAPHY SYSTEM
 * 4.  LAYOUT & CONTAINER CLASSES
 * 5.  UTILITY CLASSES
 * 6.  BUTTON & FORM STYLES
 * 7.  HEADER STYLES (MOBILE)
 * 8.  MOBILE MENU PANEL
 * 9.  FOOTER STYLES (MOBILE)
 * 10. MEDIA QUERY: TABLET (>= 768px)
 * 11. MEDIA QUERY: DESKTOP (>= 1024px)
 * 12. NAVIGATION & MEGA MENUS (DESKTOP)
 * 13. PRINT STYLES
 */

/* ==========================================================================
   1. CSS VARIABLES & CUSTOM PROPERTIES
   ========================================================================== */
:root {
  /* Fiery Faith Color Palette */
  --color-primary: #b52122; /* Dark Red - Main brand, links, primary buttons */
  --color-secondary: #f87f27; /* Orange - Secondary buttons, accents */
  --color-accent: #f7dc06; /* Yellow - CTAs, Donate button */
  --color-support: #ee3922; /* Bright Red - Hover states, alerts */
  --color-text: #2d3748;
  --color-text-light: #5a677d;
  --color-bg-light: #f8f9fa;
  --color-border: #e2e8f0;
  --color-white: #ffffff;
  --color-dark: #1a202c;
  --color-footer-bg: #1a202c;
  --color-footer-text: #a0aec0;

  /* Typography */
  --font-primary: "Figtree", sans-serif;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;

  /* Layout */
  --header-height-mobile: 60px;
  --header-height-desktop: 100px;
  --top-bar-height: 40px;
  --container-width: 1200px;
  --container-padding: 1.5rem;
}

/* ==========================================================================
   2. CSS RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background-color: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--color-support);
}

/* ==========================================================================
   3. TYPOGRAPHY SYSTEM
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  color: var(--color-dark);
  margin: 1.5em 0 0.5em;
}
h1 {
  font-size: 2.25rem;
}
h2 {
  font-size: 1.875rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}
p {
  margin-bottom: 1rem;
}

/* ==========================================================================
   4. LAYOUT & CONTAINER CLASSES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}
/* ========================================================================
   REFACTORED CONTENT PADDING & STICKY HEADER PLACEHOLDER
   ======================================================================== */

.site-content {
  /* Default padding for non-page templates (like blog posts, archives, etc.) */
  padding-top: 2rem;
  padding-bottom: 4rem;
  min-height: 50vh; /* Ensures footer isn't awkward on very short pages */
}

/*
 * GIVES YOU FULL CONTROL ON PAGES
 * This specifically targets pages (not posts) and removes all vertical padding.
 */
body.page .site-content {
  padding-top: 0;
  padding-bottom: 0;
}

/*
 * STICKY HEADER PLACEHOLDER (Now with higher specificity)
 * This rule will ALWAYS run when the header is sticky, overriding the zero-padding on pages.
 */
body.site-header-sticky-active #content.site-content {
  padding-top: var(--header-height-mobile); /* Placeholder on mobile */
}

@media (min-width: 1024px) {
  body.site-header-sticky-active #content.site-content {
    padding-top: var(
      --header-height-desktop
    ); /* Taller placeholder on desktop */
  }
}

/* ==========================================================================
   5. UTILITY CLASSES
   ========================================================================== */
.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ==========================================================================
   6. BUTTON & FORM STYLES
   ========================================================================== */
.btn {
  display: inline-block;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75em 1.5em;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}
.btn-primary:hover {
  background-color: var(--color-support);
  color: var(--color-white);
}
.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}
.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-dark);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.btn-accent:hover {
  background-color: #e0c405; /* Darker yellow */
  color: var(--color-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}
.btn-small {
  font-size: 0.8rem;
  padding: 0.5em 1em;
}

input[type="text"],
input[type="email"],
input[type="search"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-primary);
}
input:focus,
textarea:focus {
  outline: 2px solid var(--color-secondary);
  border-color: var(--color-secondary);
}

/* ==========================================================================
   7. HEADER STYLES (MOBILE)
   ========================================================================== */
.site-header {
  background-color: var(--color-white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 999;
}

/* AFTER - Add the new rule for the admin bar */
.site-header.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  animation: slideDown 0.3s ease-out;
}
/* START NEW CODE - FIXES ADMIN SCROLL BUG */
body.admin-bar .site-header.is-sticky {
  top: 32px; /* Adjusts for the default admin bar height */
}
@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.header-top-bar {
  display: none; /* Hidden on mobile by default */
}
.main-header {
  height: var(--header-height-mobile);
}
.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.site-branding {
  display: flex;
  align-items: center;
}
.custom-logo-link {
  display: block;
  max-height: 40px;
}
.custom-logo {
  max-height: 40px;
  width: auto;
}
.site-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark);
  margin-left: 0.75rem;
}
.site-title-link {
  color: inherit;
}
.site-title-link:hover {
  color: inherit;
}
.site-title-link .site-title:hover {
  color: var(--color-primary);
}

.primary-navigation {
  display: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.search-toggle,
.mobile-menu-toggle,
.mobile-menu-close {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--color-text);
}
.search-toggle:hover,
.mobile-menu-toggle:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   8. MOBILE MENU PANEL
   ========================================================================== */
.site-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85%;
  height: 100%;
  background-color: var(--color-dark);
  color: var(--color-white);
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}
body.mobile-menu-open .site-overlay {
  opacity: 1;
  visibility: visible;
}
body.mobile-menu-open .mobile-menu-panel {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem var(--container-padding);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.mobile-menu-logo .custom-logo {
  filter: brightness(0) invert(1);
  max-height: 30px;
}
.mobile-menu-close {
  color: var(--color-white);
  font-size: 1.5rem;
}

.mobile-menu-content {
  padding: 1.5rem 0;
  overflow-y: auto;
  flex-grow: 1;
}
.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 var(--container-padding) 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}
.mobile-helpline {
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  text-align: center;
  padding: 0.5rem;
}
.mobile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-menu a {
  display: block;
  padding: 0.75rem var(--container-padding);
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
  position: relative;
}
.mobile-menu a:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Accordion */
.mobile-menu .menu-item-has-children {
  position: relative;
}
.mobile-menu .menu-item-has-children > a {
  padding-right: 50px;
}
.mobile-menu .sub-menu {
  list-style: none;
  padding-left: 0;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.2);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}
.mobile-menu .sub-menu a {
  padding-left: 2.5rem;
  font-weight: var(--font-weight-regular);
  font-size: 0.9em;
}
.submenu-toggle {
  position: absolute;
  right: 0;
  top: 0;
  width: 50px;
  height: 48px;
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  z-index: 1;
}
.submenu-toggle svg {
  transition: transform 0.3s ease;
}
.menu-item-has-children.is-open > .submenu-toggle svg {
  transform: rotate(180deg);
}

/* ==========================================================================
   9. FOOTER STYLES (MOBILE)
   ========================================================================== */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  font-size: 0.9rem;
}
.footer-main {
  padding: 3rem 0;
}
.footer-main .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
.footer-widget {
  text-align: center;
}
.footer-widget .widget-title {
  color: var(--color-white);
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-logo {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}
.footer-logo img {
  max-height: 100px;
  filter: brightness(0) invert(1);
}
.footer-logo .text-logo {
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
  font-size: 1.5rem;
}
.tagline,
.mission-statement {
  color: var(--color-footer-text);
  margin-bottom: 1rem;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.social-icons a {
  color: var(--color-footer-text);
}
.social-icons a:hover {
  color: var(--color-white);
}
.social-icons svg {
  width: 22px;
  height: 22px;
}

.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-links a {
  color: var(--color-footer-text);
}
.footer-links a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

.footer-contact li {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.footer-contact a {
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
}
.newsletter-title {
  color: var(--color-white);
  margin-top: 2rem;
}
.newsletter-form {
  position: relative;
  max-width: 300px;
  margin: 0 auto;
}
.newsletter-form input {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  padding-right: 50px;
}
.newsletter-form input::placeholder {
  color: var(--color-footer-text);
}
.newsletter-form button {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-bottom {
  background-color: #111;
  padding: 1.5rem 0;
  font-size: 0.8rem;
}
/* .footer-bottom .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
} */
.footer-legal-links .separator {
  margin: 0 0.5rem;
}

.footer-bottom .container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center; /* Vertically align all items */
}

/* Give the copyright a flexible width but don't let it grow */
.copyright {
  flex: 0 1 auto;
}

/* Make the legal links grow to fill space and center their text */
.footer-legal-links {
  flex-grow: 1;
  text-align: center;
}

/* .back-to-top {
  width: 40px;
  height: 40px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  visibility: hidden;
} */
/* .back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background-color: var(--color-support);
  transform: translateY(-3px);
} */

.back-to-top {
  width: 40px;
  height: 40px;
  background-color: var(--color-primary);
  color: var(--color-white); /* Ensures icon is white */
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s, transform 0.3s, background-color 0.3s;
  opacity: 0;
  visibility: hidden;
  position: relative; /* Add position for z-index */
  z-index: 10; /* Ensure it's on top */
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--color-support);
  color: var(
    --color-white
  ); /* THIS IS THE FIX: Keep icon color white on hover */
  transform: translateY(-3px);
}

/* ==========================================================================
   10. MEDIA QUERY: TABLET (>= 768px)
   ========================================================================== */
@media (min-width: 768px) {
  .header-top-bar {
    display: block;
    background-color: var(--color-bg-light);
    height: var(--top-bar-height);
  }
  .header-top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
  }
  .top-bar-left,
  .top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.85rem;
  }
  .top-bar-item {
    display: flex;
    align-items: center;
    color: var(--color-text-light);
    gap: 0.5rem;
  }
  .top-bar-item:hover {
    color: var(--color-primary);
  }
  .volunteer-link {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
  }
  .volunteer-link:hover {
    color: var(--color-primary);
  }

  .site-header.is-sticky .header-top-bar {
    display: none;
  }
  .site-header {
    top: 0;
  }
  body.admin-bar .site-header.is-sticky {
    top: 32px;
  }

  /* Footer */
  .footer-main .container {
    grid-template-columns: 1fr 1fr;
  }
  .footer-widget {
    text-align: left;
  }
  .footer-logo {
    justify-content: flex-start;
  }
  .social-icons {
    justify-content: flex-start;
  }
  .footer-contact li {
    justify-content: flex-start;
  }
  .newsletter-form {
    margin-left: 0;
  }
  .footer-bottom .container {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ==========================================================================
   11. MEDIA QUERY: DESKTOP (>= 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
  .main-header {
    height: var(--header-height-desktop);
  }
  .mobile-menu-toggle {
    display: none;
  }
  .primary-navigation {
    display: block;
  }

  .main-header .site-branding .custom-logo {
    max-height: 70px;
    width: auto;
  }

  .main-header .site-branding .custom-logo-link {
    display: flex;
    align-items: center;
    height: 100%; /* This makes the link as tall as the header's flex space allows */
  }

  /* Footer */
  .footer-main .container {
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 3rem;
  }

  /* Header menu submenu */
  .hide-submenu-on-desktop .sub-menu {
    display: none !important;
  }

  .hide-submenu-on-desktop.menu-item-has-children > a::before {
    content: "" !important;
    font-size: 0em !important;
    position: absolute !important;
    display: none !important;
  }
}

@media (max-width: 768px) {
  .footer-bottom .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .footer-legal-links .separator {
    margin: 0 0.5rem;
  }
}

/* ==========================================================================
   12. NAVIGATION & MEGA MENUS (DESKTOP)
   ========================================================================== */
.primary-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  height: var(--header-height-desktop);
}
.primary-menu > .menu-item {
  position: relative;
  height: 100%;
}
.primary-menu > .menu-item > a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.25rem;
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  position: relative;
}
.primary-menu > .menu-item > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.primary-menu > .menu-item:hover > a,
.primary-menu > .menu-item.current-menu-item > a,
.primary-menu > .menu-item.current-menu-ancestor > a {
  color: var(--color-primary);
}
.primary-menu > .menu-item:hover > a::after,
.primary-menu > .menu-item.current-menu-item > a::after,
.primary-menu > .menu-item.current-menu-ancestor > a::after {
  transform: scaleX(1);
}
.primary-menu .menu-item-has-children > a {
  padding-right: 2.25rem;
}
.primary-menu .menu-item-has-children > a::before {
  content: "▼";
  font-size: 0.6em;
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Standard Dropdown Menu */
.primary-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 4px 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 10;
}
.primary-menu .menu-item:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.primary-menu .sub-menu .menu-item a {
  display: block;
  padding: 0.75rem 1.25rem;
  font-weight: var(--font-weight-regular);
  color: var(--color-text);
}
.primary-menu .sub-menu .menu-item a:hover {
  background-color: var(--color-bg-light);
  color: var(--color-primary);
}

/* Mega Menu
.primary-menu .menu-item-has-mega-menu > .sub-menu {
  width: var(--container-width);
  max-width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  padding: 2rem;
  display: flex;
}
.mega-menu-content {
  display: flex;
  width: 100%;
  gap: 2rem;
}
.mega-menu-column {
  flex: 1;
}
.mega-menu-column .widget-title {
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-top: 0;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
}
.mega-menu-column .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mega-menu-column .menu li {
  line-height: 1.8;
} */
/* --- Mega Menu --- */
/* .primary-menu > .menu-item-has-mega-menu {
  position: static;
} */

/* .primary-menu .menu-item-has-mega-menu > .mega-menu-wrapper {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--color-white);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 10;
}

.primary-menu .menu-item-has-mega-menu:hover > .mega-menu-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-content {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 2rem var(--container-padding);
}

.mega-menu-columns {
  display: grid;
  gap: 2rem;
}
.mega-menu-columns-2 {
  grid-template-columns: repeat(2, 1fr);
}
.mega-menu-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.mega-menu-column .widget-title,
.mega-menu-column .menu-item a {
  font-weight: var(--font-weight-regular);
}

.mega-menu-column > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mega-menu-column > ul > li {
  line-height: 1;
}

.mega-menu-column > ul > li > a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  color: var(--color-text-light);
  border-radius: 4px;
  font-weight: var(--font-weight-semibold);
  transition: all 0.2s ease-in-out;
}
.mega-menu-column > ul > li > a:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-light);
  padding-left: 1rem;
}
.mega-menu-column > ul > li > a::before {
  content: "→";
  color: var(--color-secondary);
  font-weight: bold;
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.2s ease-in-out;
}
.mega-menu-column > ul > li > a:hover::before {
  opacity: 1;
  transform: translateX(0);
} */

/* --- Mega Menu --- */
.primary-menu .menu-item-has-mega-menu > .mega-menu-wrapper {
  position: absolute;
  top: 100%;
  left: 0;
  width: fit-content;
  background-color: var(--color-white);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 10;
}
.primary-menu .menu-item-has-mega-menu:hover > .mega-menu-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mega-menu-content {
  /* Make the content area wider by default */
  max-width: calc(var(--container-width) + 100px);
  margin: 0 auto;
  padding: 2.5rem var(--container-padding);
}
.resources-mega-menu .mega-menu-content {
  max-width: 900px; /* A more constrained width for the 2-column layout */
}

/* --- Mega Menu Columns & Grids --- */
.mega-menu-columns,
.mega-menu-grid {
  display: grid;
  gap: 2rem 3rem; /* Increased column gap for more space */
  list-style: none;
  padding: 0;
  margin: 0;
}
.mega-menu-columns-2 {
  grid-template-columns: repeat(2, 1fr);
}
.mega-menu-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* --- Styling for "Resources" Menu --- */
.mega-menu-column > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mega-menu-column > ul > li > a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text-light);
  border-radius: 4px;
  font-weight: var(--font-weight-semibold);
  transition: all 0.2s ease-in-out;
}
.mega-menu-column > ul > li > a:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-light);
  transform: translateX(5px);
}

/* --- Styling for "Global Camps" Grid with Flags --- */
.mega-menu-grid > li > a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  color: var(--color-text);
  border-radius: 6px;
  font-weight: var(--font-weight-semibold);
  transition: all 0.2s ease-in-out;
  border: 1px solid transparent; /* Prepare for hover effect */
}
.mega-menu-grid > li > a:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-light);
  border-color: var(--color-border);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}
/* .mega-menu-grid .flag-icon {
  font-size: 1.25rem; 
  border-radius: 2px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
} */

.mega-menu-grid .flag-icon {
  /* Styles for the flag itself */
  font-size: 1.25rem; /* Makes the flag icon larger */
  border-radius: 2px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

/* ...with this new corrected rule */
.mega-menu-grid .fi {
  /* Target the new 'fi' base class */
  /* The library sets the size using 'font-size', so we can adjust it here */
  font-size: 2rem;
  /* The 'fis' class makes it square, so no border-radius needed */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* A subtle shadow for depth */
  /* The library handles the background-image, we just style the container */
}

/* ==========================================================================
   13. PRINT STYLES
   ========================================================================== */
@media print {
  body {
    background-color: #fff;
    color: #000;
    font-size: 12pt;
  }
  .site-header,
  .site-footer,
  .no-print {
    display: none;
  }
  a {
    text-decoration: underline;
    color: #000;
  }
  .site-content {
    padding: 0;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
}
