/* ============================================
   Bethel Presbyterian Church Global Stylesheet
   ============================================ */

/* -------------------------------
   Root Variables: Colors & Fonts
   ------------------------------- */
:root {

  /* Color Palette */

  --primary-green: #3A6B35;
  --primary-green-dark: #2A4F27;
  --primary-complement:#66356B;
  --primary-dark-complement:#4C274F;
  --secondary-complement:#6B353A;
  --secondary-dark-complement:#4F272A;
  --black: #000000;
  --white: #FFFFFF;
  --light-gray: #F5F5F5; 
 

  /* Serif Fonts */
  --font-serif-primary: 'Goudos', serif; /* make Goudos the preferred serif */
  --font-serif-secondary: 'Lora', serif;

  /* Sans-Serif Fonts */
  --font-sans-primary: 'Montserrat', sans-serif;
  --font-sans-secondary: 'Open Sans', sans-serif;

  /* Display / Decorative Fonts */
  --font-display: 'Raleway', sans-serif;
  --font-script: 'Exodus', cursive;

  /* System Fallback */
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font Sizes & Line Heights */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --line-height-tight: 1.3;
  --line-height-normal: 1.6;
  --line-height-loose: 1.8;
}

/* ================================
   Custom Fonts
   ================================ */
@font-face {
  font-family: 'Goudos';
  src: url('/font/goudos.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Italiana';
  src: url('/font/Italiana-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Wonton';
  src: url('/font/Wonton.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'MexicanTequila';
  src: url('/font/MexicanTequila.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ---------------------
   Base Reset & Defaults
   --------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: var(--line-height-normal);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif-primary); /* Goudos preferred globally */
  color: var(--black);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* ---------------------
   Global Paragraph Styling
   --------------------- */
p {
  text-align: left;          /* left-align all lines */
  /*text-indent: 1.25rem;  */    /* indent first line */ /*This was causing issues with certain elements*/
  margin: 0 0 1rem 0;        /* spacing between paragraphs */
  line-height: 1.6;          /* comfortable reading rhythm */
  font-size: 1rem;           /* consistent size */
  color: #333;               /* readable text color */
}


/* ---------------------
   Layout Containers
   --------------------- */
.container {
  margin: 0 auto;
  padding: 0 2rem;
}

.section-wrapper {
  margin: 1.5rem 5rem;
  padding: 1.5rem;
}

section {
  font-family: var(--font-serif-primary); /* unified with Goudos */
  margin-bottom: 2rem;
  padding: 1.25rem;
  border-radius: 8px; /* sleeker curve */
  text-align: center;
  background-color: var(--light-gray);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); /* restrained depth */
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
section:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px); /* subtle dimensional lift */
}

/* DEBUGGING AIDS */
#menuaim-debug {
  pointer-events: none;
}

/* ---------------------
   Typography & Headings
   --------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif-primary); /* Goudos preferred */
  color: var(--primary-green);
  margin-bottom: 0.75rem;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.08); /* restrained dimensional polish */
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
h1:hover, h2:hover, h3:hover, h4:hover {
  color: #007a4d;
  text-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

/* ---------------------
   Utility Classes
   --------------------- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.px-1 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 1rem; padding-bottom: 1rem; }
.px-2 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 2rem; padding-bottom: 2rem; }

.text-center { text-align: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }

.full-width {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/*-----SUPERSECTION-----*/
.supersection.left-right {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1000px;
}

.supersection.left-right .left-half,
.supersection.left-right .right-half {
  flex: 1 1 48%;
  min-width: 300px;
}


/* ============================================================
   UNIFIED SITE HEADER (LOGO INSIDE NAVBAR + CONTACT ABOVE)
   ============================================================ */
/* ------------------------------------------------------------
   Site Header Container
   ------------------------------------------------------------ */
.site-header {
  background-color: var(--white);
  border-bottom: 1px solid #e5e7eb; /* crisp, restrained divider */
  display: flex;
  flex-direction: column;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06); /* dimensional depth */
  position: relative;
  z-index: 10; /* ensures header sits above content */
}

/* ------------------------------------------------------------
   Contact Bar
   ------------------------------------------------------------ */
.site-header__contact {
  background: linear-gradient(to bottom, #fcfcfc 0%, #f7f7f7 70%, #ededed 100%); /* subtle dimensional gradient */
  padding: 0.85rem 2rem; /* slightly taller for presence */
  text-align: center;
  font-family: var(--font-sans-primary);
  font-size: 0.95rem;
  letter-spacing: 0.6px; /* refined spacing */
  text-transform: uppercase;
  color: #2d2d2d; /* restrained dark tone */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem; /* balanced spacing */
  border-bottom: 1px solid #e5e7eb;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,0.05); /* dimensional inset line */
}

.site-header__contact .contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* slightly more spacing for clarity */
}

.site-header__contact a {
  color: var(--primary-green);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.site-header__contact a:hover {
  color: #005f3a;
  text-shadow: 0 1px 3px rgba(0,0,0,0.12); /* restrained dimensional accent */
}

.site-header__contact .divider {
  color: #888; /* softer gray */
  font-size: 1.1rem; /* slightly larger for eye-catching separation */
}

/* ------------------------------------------------------------
   Navigation Bar
   ------------------------------------------------------------ */
.navbar {
  background-color: #f9f9f9; /* clean neutral */
  padding: 1.1rem 2.75rem; /* balanced spacing */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: none;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
  transition: top 0.3s ease-in-out, opacity 0.3s ease-in-out, box-shadow 0.3s ease;
  opacity: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06); /* restrained dimensional depth */
}

.navbar.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12); /* dimensional shadow */
  background-color: #ffffffee; /* translucent modern effect */
  backdrop-filter: blur(8px); /* restrained glassy look */
}

.navbar.hidden {
  top: -120px;
  opacity: 0;
}

.navbar.visible {
  top: 0;
}

.site-header__logo {
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.site-header__logo img {
  max-width: 170px; /* slightly larger for eye-catching balance */
  height: auto;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.site-header__logo img:hover {
  transform: scale(1.06); /* restrained dimensional hover */
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12)); /* subtle depth */
}

.nav-list {
  display: flex;
  gap: clamp(0.2rem, calc(16vw - 182.4px), 2rem); /* fluid between 1160px→1340px */
  list-style: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans-primary);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  transition: gap 0.25s ease;
}

/* Nav links */
.nav-list a {
  color: #2d2d2d;
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease, transform 0.25s ease;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: var(--primary-green);
  transition: width 0.3s ease;
}
.nav-list a:hover {
  color: var(--primary-green);
  transform: translateY(-1px); /* restrained dimensional lift */
}
.nav-list a:hover::after {
  width: 100%; /* sleek underline animation */
}

/* Active link */
.nav-list a.active {
  color: var(--primary-green);
  font-weight: 600;
}
.nav-list a.active::after {
  width: 100%;
}

/* Accessibility focus */
.nav-list a:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(0,122,77,0.25); /* dimensional focus ring */
}

/* ------------------------------------------------------------
   Responsive Header Adjustments (Mobile)
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .site-header__contact {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.75rem 1rem;
  }

  .site-header__contact .divider {
    display: none;
  }

  .navbar {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.5rem;
  }

  .site-header__logo {
    margin-bottom: 1rem;
    position: static;
    transform: none;
  }
}

/* ------------------------------------------------------------
   Navigation Items & Dropdowns (Menu-Aim Ready)
   ------------------------------------------------------------ */
.nav-item {
  position: relative;
}

/* Clickable nav links */
.nav-item a,
.nav-label.clickable-true {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: var(--primary-green);
  background-color: var(--white);
  border: 1px solid var(--primary-green);
  border-radius: 6px;
  font-family: var(--font-sans-primary);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-item a:hover,
.nav-label.clickable-true:hover {
  background-color: var(--primary-green);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Non-clickable nav labels */
.nav-label.clickable-false {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: var(--primary-green);
  background-color: var(--white);
  border: 1px solid var(--primary-green);
  border-radius: 6px;
  font-family: var(--font-sans-primary);
  font-weight: bold;
  cursor: default;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-label.clickable-false:hover {
  background-color: var(--light-gray);
  color: var(--black);
}
.nav-item.dead-zone-active {
  position: relative;
}

/* Create a dead zone overlay on the right 2/3 */
.nav-item.dead-zone-active::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 66.66%;
  height: 100%;
  pointer-events: none; /* default: allow hover */
  z-index: 2;
}

/* When sibling is active, block pointer events */
.nav-item.dead-zone-active.sibling-open::before {
  pointer-events: auto; /* block hover */
  background-color: transparent; /* optional debug */
}

/* ------------------------------------------------------------
   Dropdown Menu Styling (Hidden by default)
   ------------------------------------------------------------ */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  list-style: none;
  background-color: var(--white);
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 1000;

  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 160ms ease;
}

/* JS-controlled visibility (menu-aim) */
.nav-item.active > .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* CSS fallback (only if JS not active) */
.nav-item:hover > .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Dropdown item content */
.dropdown li {
  margin: 0;
  padding: 0;
}

.dropdown a,
.dropdown .nav-label {
  display: block;
  min-width: 180px;
  padding: 0.5rem 1rem;
  font-family: var(--font-sans-primary);
  white-space: nowrap;
  color: var(--primary-green);
  background-color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid #eee;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown li:last-child a,
.dropdown li:last-child .nav-label {
  border-bottom: none;
}

.dropdown a:hover {
  background-color: var(--light-gray);
  color: var(--black);
}

/* ------------------------------------------------------------
   Recursive Dropdowns (flyout to the right)
   ------------------------------------------------------------ */
.nav-item .dropdown .nav-item {
  position: relative;
}

.nav-item .dropdown .dropdown {
  top: 0;
  left: 100%;
  margin-left: 0;
  min-width: 180px;
  border: 1px solid #ccc;
  z-index: 1001;

  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 160ms ease;
}

/* JS-controlled visibility for nested levels */
.nav-item .dropdown .nav-item.active > .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* CSS fallback hover for nested levels */
.nav-item .dropdown .nav-item:hover > .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ------------------------------------------------------------
   Dropdown Indicators & Motion
   ------------------------------------------------------------ */
.nav-item.has-children > .nav-label::after,
.nav-item.has-children > a::after {
  content: " ▼";
  font-size: 0.75rem;
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.nav-item .dropdown .nav-item.has-children > .nav-label::after,
.nav-item .dropdown .nav-item.has-children > a::after {
  content: " ▶";
  transition: transform 0.2s ease;
}

.nav-item.active > .nav-label::after,
.nav-item.active > a::after {
  transform: translateY(3px);
}

.nav-item .dropdown .nav-item.active > .nav-label::after,
.nav-item .dropdown .nav-item.active > a::after {
  transform: translateX(3px);
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn,
button {
  font-family: var(--font-sans-primary);
  font-size: 1rem;
  font-weight: bold;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  background-color: var(--primary-green);
  color: var(--white);
  border: 1px solid #004c2e;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:hover,
button:hover {
  background-color: #007a4d;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ------------------------------------------------------------
   Responsive Grid Utility
   ------------------------------------------------------------ */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ------------------------------------------------------------
   Responsive Tweaks
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .container { padding: 0 1rem; }

  .navbar {
    flex-direction: column;
    align-items: center;
    max-width: 100%;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.5rem;
  }
  .box {
    padding: 1rem;
  }

  section {
    padding: 1rem;
  }

  .contact-bar {
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
  }

  .contact-bar .divider {
    display: none;
  }
  
  .wide-header {
    font-size: 1.8rem;
  }

  .underline-accent::after {
    width: 40px;
    height: 3px;
  }
  
  .grid-2 .card {
    flex-direction: column;
    text-align: center;
  }

  .grid-2 .card-icon {
    margin-right: 0;
    margin-bottom: 0.75rem;
  }

}
