/* =========================
   HEADER & FOOTER STYLES
   ========================= */

/* ---- Topbar ---- */
.topbar {
  background: var(--brand-navy);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.7rem;
  padding: 0.25rem 0;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Left side: languages inline */
.language-switcher {
  display: flex;
  gap: 1rem;
}
.language-switcher a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s ease;
}
.language-switcher a:hover {
  opacity: 0.7;
}

/* Right side: socials + menu inline */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Social icons inline */
.topbar-social {
  display: flex;
  gap: 0.75rem;
  border-right: 1px solid rgba(255,255,255,0.3);
  padding-right: 1rem;
  margin-right: 1rem;
}
.topbar-social a {
  color: var(--white);
  font-size: 1.1rem;
  transition: color 0.3s ease;
}
.topbar-social a:hover {
  color: var(--brand-orange);
}

/* Topbar menu inline */
.topbar-menu {
  display: flex;
  gap: 1rem;
}
.topbar-menu a {
  color: var(--white);
  text-decoration: none;
  transition: opacity 0.3s ease;
}
.topbar-menu a:hover {
  opacity: 0.7;
}
@media (max-width: 768px) {
  .topbar-menu__list {
    display: none;
  }
}


/* ---- Main Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  transition: background 0.4s ease;
}

/* Default background */
.site-header.default-bg {
  background: #ffffff;
}

/* Example section-based colors */
.site-header.pillars-bg {
  background: #590c05; /* same as your Pillars section */
}

.site-header.donate-bg {
  background: #00273f; /* brand navy for donate section */
}

/* --- Logo Swap Logic --- */

.site-branding .logo {
  position: absolute;
  top: 0;
  left: 0;
  height: auto;
  width: auto;
  max-height: 60px;
  transition: opacity 0.3s ease;
}

.site-branding .logo-white {
  opacity: 0;
  z-index: 2;
}
.site-header.on-dark .logo-normal {
  opacity: 0;
}
.site-header.on-dark .logo-white {
  opacity: 1;
}


.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
}

.main-navigation {
  position: relative;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}

.main-navigation a {
  text-decoration: none;
  color: var(--brand-navy);
  font-weight: 500;
  transition: color 0.3s ease;
}
.main-navigation a:hover {
  color: var(--brand-orange);
}

/* ---- Mega Menu ---- */
.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--white);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 2rem;
  z-index: 1000;
}

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

.mega-menu h4 {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  color: var(--brand-navy);
}

.mega-menu a {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--brand-navy);
  font-size: 0.95rem;
}
.mega-menu a:hover {
  color: var(--brand-orange);
}

/* ---- Mobile Navigation ---- */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-navy);
}

@media (max-width: 992px) {
  .main-navigation ul {
    display: none;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    position: absolute;
    top: 100%;
    right: 0;
    width: 80%;
    border: 1px solid #eee;
  }

  .main-navigation ul.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

/* ---- Footer ---- */
/* -------------------------
   Footer responsive fixes
-------------------------- */

/* Grid collapses properly */
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
  }
}

@media (max-width: 767px) {
  .footer-widgets {
    grid-template-columns: 1fr; /* stack all in one column on mobile */
    text-align: center; /* optional: center text on mobile */
  }
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-form input[type="email"] {
    border-radius: 3px;
    margin-bottom: 0.5rem;
  }
  .newsletter-form button {
    border-radius: 3px;
    width: 100%;
  }
}

/* -------------------------
   Fix list bullets in footer menus
-------------------------- */
.footer-menu-list,
.footer-menu-list li,
.footer-menu-list li::marker,
.footer-resources ul,
.footer-resources li,
.footer-resources li::marker,
.footer-legal,
.footer-legal li,
.footer-legal li::marker {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Container for language switcher */
.language-box {
  position: relative;
  display: inline-block;
}

/* Force style the Google Translate dropdown */
.goog-te-combo {
  background: #00273f !important; /* solid brand bg */
  background-image: none !important; /* kill google bg */
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
  border-radius: 10px !important;
  padding: 0.4rem 1rem !important;
  font-size: 0.9rem !important;
  font-family: Poppins, sans-serif !important;
  min-width: 180px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}

/* Add custom arrow ▾ */
.language-box::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #ffffff;
  font-size: 0.9rem;
  pointer-events: none;
}

/* Remove Google logos & branding */
.goog-logo-link,
.goog-te-gadget span,
.goog-te-banner-frame,
.goog-te-gadget-simple img {
  display: none !important;
}
body { top: 0 !important; }

.footer-social i {
  font-size: 1.25rem;
  transition: color 0.3s ease;
}
.footer-social a:hover i {
  color: var(--brand-amber);
}

/* Ensure parent has logo height */
.site-branding {
  position: relative;
  display: inline-block;
}
.site-branding a {
  display: inline-block;
  position: relative;
}



/* Let the normal logo define container height */
.site-branding .logo-normal {
  position: relative; /* stays in flow */
  opacity: 1;
  z-index: 2;
}
.site-branding .logo-white {
  opacity: 0;
  z-index: 1;
}

/* On dark sections: fade swap */
.site-header.on-dark .logo-normal {
  opacity: 0;
}
.site-header.on-dark .logo-white {
  opacity: 1;
}

/* Menu colors */
.site-header.on-light .primary-navigation a {
  color: #000;
  transition: color 0.4s ease-in-out;
}
.site-header.on-dark .primary-navigation a {
  color: #fff;
  transition: color 0.4s ease-in-out;
}

/* Optional: smooth background transition */
.site-header {
  transition: background-color 0.4s ease-in-out;
}


/* =========================
   MAIN MENU & MEGA MENU STYLES
   ========================= */

/* ---- Main Nav (site-header line) ---- */
/* ======================================================
   OII MEGA-MENU — Clean, stable layout + aligned bullets
   Replace existing mega-menu CSS with the rules below
   ====================================================== */

/* ---------- 1) Container & show/hide animation ---------- */
/* Controls the full-width dropdown container and open state */
.oii-mega-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--brand-navy);
  color: var(--white);
  padding: 2rem 0;
  z-index: 9998;

  /* initial hidden state (toggled by JS by adding `.open`) */
  display: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  will-change: opacity, transform;
  direction: ltr; /* force LTR rendering to avoid weird bullet placement */
}

.oii-mega-menu.open {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Centered inner container with 3 columns (first column wider) */
.oii-mega-menu .oii-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* ---------- 2) Column Titles & small visual tweaks ---------- */
.oii-mega-menu h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-amber);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-family: 'Poppins', san serif;
}

/* Ensure anchor focus is visible for keyboard users */
.oii-mega-menu a:focus {
  outline: 3px solid rgba(217,90,0,0.12);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 3) First column: child pages split into two sub-columns ---------- */
/* Primary grid for children — two equal sub-columns on desktop */
.oii-child-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Each child block is a self-contained vertical block */
.child-block {
  display: block;
  padding: 0.25rem 0;
  min-width: 0; /* prevents overflow in narrow columns */
}

/* Parent (child) link */
.child-block > a {
  display: block;
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 0.35rem;
  line-height: 1.25;
}
.child-block > a:hover,
.child-block > a:focus {
  color: var(--brand-amber);
}

/* ---------- 4) Grandchildren: vertical list under each child ---------- */
/* Remove native bullets and control indentation precisely */
.grandchild-chevron-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem; /* left indent for alignment */
}

/* Each grandchild is a block stacked vertically */
.grandchild-chevron-list li {
  display: block;
  margin: 0.35rem 0;
  line-height: 1.2;
}

/* Grandchild link: keep chevron left and text aligned */
.grandchild-chevron-list li a {
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem; /* chevron + text spacing */
  font-size: 0.82rem;
  font-weight: 400;
}
.grandchild-chevron-list li a:hover,
.grandchild-chevron-list li a:focus {
  color: var(--brand-amber);
}

/* Chevron marker style (if you use <span class="chevron">»</span>) */
.grandchild-chevron-list .chevron {
  display: inline-block;
  min-width: 0.9em;
  text-align: center;
  color: rgba(255,255,255,0.95);
  font-size: 1.5rem;
  font-weight:bold;
  line-height: 1;
}

/* ---------- 5) Resources column: custom bullets & clean alignment ---------- */
/* Remove native list markers and use controlled decorative bullets */
.oii-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.oii-section li {
  position: relative;
  padding-left: 1.15rem; /* space for our custom bullet */
  margin-bottom: 0.5rem;
  display: block;
}


/* Resource links */
.oii-section a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.92rem;
}
.oii-section a:hover,
.oii-section a:focus {
  color: var(--brand-amber);
}

/* ---------- 6) Featured post column styling ---------- */
.oii-featured .featured-item {
  background: rgba(255,255,255,0.03);
  padding: 1rem;
  border-radius: 8px;
}

.featured-thumb {
  display: block;
  margin-bottom: 0.6rem;
}
.featured-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}

.oii-featured h3 {
  margin: 0.5rem 0;
  font-size: 1rem;
}
.oii-featured p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}

/* ---------- 7) Top-level nav alignment & donate button ---------- */
.oii-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Top-level nav links (in header row) */
.oii-nav-item > a {
  color: var(--brand-navy);
  font-weight: 600;
  text-decoration: none;
  padding: 0.6rem 0.4rem;
  display: inline-block;
}
.oii-nav-item > a:hover,
.oii-nav-item > a:focus {
  color: var(--brand-burgundy);
}

/* Donate CTA */
.header-donate-button {
  background: var(--brand-amber);
  color: var(--white) !important;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}
.header-donate-button:hover,
.header-donate-button:focus {
  background: var(--brand-burgundy);
}

/* ---------- 8) Accessibility + small-screen behaviour ---------- */
/* Keep focus visible on keyboard */
.oii-mega-menu a:focus {
  outline: 3px solid rgba(255,255,255,0.12);
  outline-offset: 3px;
}

/* Responsive: collapse to one column on smaller screens */
@media (max-width: 992px) {
  .oii-mega-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    padding: 1rem 0;
  }

  .oii-mega-menu .oii-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .oii-child-columns {
    grid-template-columns: 1fr;
  }

  /* Make top-level nav items fill width when nav is stacked */
  .oii-nav {
    flex-direction: column;
    gap: 0;
  }
  .oii-nav-item > a {
    color: var(--white);
    padding: 0.75rem 1rem;
    background: var(--brand-navy);
    display: block;
    width: 100%;
  }

  /* Mobile: hide mega menu by default, JS should add `.open` to show */
  .oii-mega-menu { display: none; }
  .oii-mega-menu.open { display: block; }
}

/* ---------- 9) Fixes for weird overflow/indent problems ---------- */
/* Make sure child-blocks don't allow their content to overflow their column */
.oii-child-columns .child-block,
.oii-section ul li {
  min-width: 0;
  word-wrap: break-word;
  hyphens: auto;
}

/* Reset: remove all borders */
.child-block {
  border-bottom: none;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Add dotted border only under the first row of each column */
.oii-child-columns .child-block:nth-child(1),
.oii-child-columns .child-block:nth-child(2) {
  border-bottom: 1px dotted rgba(255,255,255,0.25);
}

.oii-section ul li em a {
  font-size: 0.7rem;
  margin: 0.4rem 0;
  padding-bottom: 0.4rem;          /* spacing before the line */
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25); /* subtle dotted line */
}

/* Ensure consistent text wrapping for long words in menus */
.oii-mega-menu a {
  word-break: break-word;
}

/* ---------- 10) Small polish (optional) ---------- */
/* Slight shadow and separation to make the mega visually layered */
.oii-mega-menu {
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

/* =========================
   Child Pages with bullet icon
   ========================= */
.child-block > a {
  display: flex;              /* icon + text inline */
  align-items: center;        /* vertically aligned */
  gap: 0.5rem;                /* space between bullet and text */
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.child-block > a i {
  font-size: 0.95rem;         /* small circle bullet size */
  flex: 0 0 auto;             /* don’t stretch */
}

.child-block > a:hover {
  color: var(--brand-amber);
}

/* =========================
   Grandchildren with chevron
   ========================= */
.grandchild-chevron-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.2rem; /* indentation aligns under parent text */
}

.grandchild-chevron-list li {
  margin: 0.35rem 0;
}

.grandchild-chevron-list a {
  display: flex;              /* chevron + text inline */
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.95);
  text-decoration: none;
}

.grandchild-chevron-list a:hover {
  color: var(--brand-amber);
}

.grandchild-chevron-list .chevron {
  flex: 0 0 auto;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* =========================
   Resources List with Icons
   ========================= */
.oii-section ul {
  list-style: none;      /* remove default browser bullets */
  margin: 0;
  padding: 0;
}

.oii-section li {
  margin: 0.4rem 0;
}

.oii-section li a {
  display: flex;              /* icon + text inline */
  align-items: center;
  gap: 0.5rem;                /* spacing between icon and text */
  color: var(--white);
  font-size: 0.8rem;
  text-decoration: none;
}

.oii-section li a:hover {
  color: var(--brand-amber);
}

.oii-section li a i {
  font-size: 0.75rem;         /* icon small, bullet-like */
  color: var(--brand-amber);  /* icons styled as bullets */
  flex: 0 0 auto;             /* lock size, don’t stretch */
}

/* ============================================
   Header: Logo Swap for Light/Dark Backgrounds
   ============================================ */

.site-header.on-dark .logo-white {
  display: inline-block;
}

.site-header.on-dark .logo-normal {
  display: none;
}
