:root {
  --primary-color: #013272;
  --accent-color: #a32300;
  --bg-color: #f4f8ff;
  --text-color: #024162;
  --rug-base: #f5f0e8;
  --rug-sand: #f0e6d4;
  --rug-clay: #eadfc8;
  --rug-earth: #e4d9c2;
  --rug-accent: #ded3bc;
  --max-width: 1200px;
  --header-height: 48px;
}

/* CSS Reset for better cross-browser consistency */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Remove default list styling */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Remove default button styling */
button {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

body {
  margin: 0;
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background-color: #ffcf77;
  color: var(--text-color);
  line-height: 1.6;
  padding-top: var(--header-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

main {
  flex: 1; /* Ensure main content area expands to fill available space */
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.container1 {
  width: 100%;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 0;
  flex: 1; /* This will make the main content expand to fill available space */
}

.container2 {
  width: 80%;
  text-align: left;
  max-width: var(--max-width);
  margin: auto;
  padding: 1rem 0;
  flex: 1; /* This will make the main content expand to fill available space */
}

.banner {
  background-image: url('/images/desert-river-sky.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  text-align: center;
  padding: 1rem;
  position: relative;
}


.banner1 {
  background-image: url('/images/canyon-spider-banner.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  text-align: center;
  padding: 1rem;
  position: relative;
}


.banner2 {
  background-image: url('/images/canyon-de-chelly.jpg');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  background-attachment: scroll; /* Better mobile performance */
  width: 100vw;
  min-height: 150px;
  margin-left: calc(50% - 50vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.banner2 h1 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  color: white;
  margin-bottom: 0.5rem;
}

.banner2 h2 {
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Responsive banner adjustments */
@media (max-width: 768px) {
  .banner2 {
    min-height: 120px;
    padding: 1rem 0.5rem;
  }
  
  .banner2 h1 {
    font-size: 1.5rem;
  }
  
  .banner2 h2 {
    font-size: 1.1rem;
  }
}

/* ==== HEADER ==== */
.site-header {
  background-color: #000000;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.site-header .container {
  display: flex;
  flex: 1;
  background-color: #000000;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
}

.site-header .logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-header .logo img {
  height: var(--header-height);
  width: auto;
  display: block;
  max-width: 100%;
  object-fit: contain;
  align-items: right;
}

/* Logo responsive switching */
.site-header .logo .logo-mobile {
  display: none;
}

.site-header .logo .logo-desktop {
  display: block;
}

#header-placeholder {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}



/* Hamburger Menu Toggle */
.menu-toggle {
  display: none;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  color: #000000;
  padding: 6px 10px;
  margin-left: auto;
  z-index: 1001;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: #f0f0f0;
  -webkit-transform: scale(1.05);
  transform: scale(1.05);
}

.menu-toggle:active {
  -webkit-transform: scale(0.95);
  transform: scale(0.95);
}

/* ==== GENERAL LINK STYLES ==== */
a {
  text-decoration: none;
  color: inherit;
  -webkit-transition: color 0.3s ease;
  transition: color 0.3s ease;
}

a:hover {
  color: #3CA0E7;
}

/* ==== MOBILE NAVIGATION ==== */
@media (max-width: 768px) {
  /* Header adjustments for mobile */
  .site-header .container {
    padding: 0 1rem;
  }

  /* Switch to mobile logo */
  .site-header .logo .logo-desktop {
    display: none;
  }
  
  .site-header .logo .logo-mobile {
    display: block;
  }

  /* Show hamburger menu */
  .menu-toggle {
    display: block;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 1.2rem;
    z-index: 1002;
    position: relative;
  }

  /* Mobile navigation panel */
  .primary-navigation {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-transition: left 0.3s ease;
    transition: left 0.3s ease;
    z-index: 999;
    display: block;
    padding: 20px;
    overflow-y: auto;
    margin-left: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .primary-navigation.active {
    left: 0;
  }

  .primary-navigation ul {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    height: auto;
    display: flex;
  }

  .primary-navigation li {
    margin: 0;
    width: 100%;
    background-color: #ffffff;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
  }

  .primary-navigation li a {
    padding: 12px 15px;
    font-size: 14px;
    text-align: left;
    display: block;
    border-radius: 10px;
  }

  /* Mobile dropdown styles */
  .primary-navigation ul li ul {
    position: static;
    visibility: visible;
    opacity: 1;
    display: none;
    background: #f8f8f8;
    border: none;
    border-radius: 10px;
    margin: 10px 0 0 0;
    padding: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: auto;
  }

  .primary-navigation .has-submenu > a::after {
    content: " ▼";
    float: right;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
  }

  .primary-navigation .has-submenu.expanded > a::after {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
  }

  .primary-navigation .has-submenu.expanded ul {
    display: block;
  }

  .primary-navigation ul li ul li {
    background: transparent;
    margin: 5px 0;
    border: none;
    border-radius: 0;
  }

  .primary-navigation ul li ul li a {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 5px;
  }
}

/* Smaller mobile screens */
@media (max-width: 480px) {
  .site-header .container {
    padding: 0 0.75rem;
  }

  .primary-navigation {
    padding: 15px;
  }

  .primary-navigation li a {
    padding: 10px 12px;
    font-size: 13px;
  }

  .primary-navigation ul li ul li a {
    padding: 6px 10px;
    font-size: 11px;
  }
}

 


/* ==== FOOTER ==== */

.site-footer {
  background: #000000;
  color: white;
  padding: 20px;
  text-align: center;
  line-height: 1.6;
  font-size: 0.9rem;
  flex: 1;
}

.footer-navigation {
  margin-bottom: 15px;
  border-bottom: 1px solid #333;
  padding-bottom: 15px;
}

.footer-navigation p {
  margin: 0;
  line-height: 1.8;
}

.footer-navigation a {
  color: white;
  text-decoration: none;
  padding: 0 8px;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}

.footer-navigation a:hover {
  color: var(--accent-color);
}

/* Responsive footer navigation */
@media (max-width: 768px) {
  .footer-navigation a {
    display: inline-block;
    padding: 4px 6px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .footer-navigation p {
    line-height: 2.2;
  }
  
  .footer-navigation a {
    padding: 6px 4px;
    font-size: 0.75rem;
  }
}


.footer-info a {
  text-decoration: none;
  color: white;
  transition: color 0.2s;
}

.footer-info a:hover {
  color: var(--accent-color);
}

/* ==== RESPONSIVE LAYOUTS ==== */

/* Base mobile-first styles are already defined above */

/* TABLETS (≥ 600px) */
@media (min-width: 600px) {
  .container1, .container2 {
    padding: 1.5rem 1rem;
  }
}

/* SMALL DESKTOPS (≥ 900px) */
@media (min-width: 900px) {
  body {
    font-size: 1rem;
  }
  
  .logo {
    font-size: 2rem;
  }
  
  .container1 {
    width: 85%;
    max-width: var(--max-width);
  }
  
  .container2 {
    width: 80%;
    max-width: var(--max-width);
  }
}

/* LARGE DESKTOPS (≥ 1200px) */
@media (min-width: 1200px) {
  .container1 {
    width: 80%;
  }
  
  .container2 {
    width: 75%;
  }
}

/* ==== ACCESSIBILITY AND FOCUS STATES ==== */
/* Keyboard navigation support */
.primary-navigation a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

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

/* Show submenu on focus-within for keyboard navigation */
.primary-navigation .has-submenu:focus-within > ul {
  visibility: visible;
  opacity: 1;
  display: block;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 6px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    -webkit-transition: none !important;
    transition: none !important;
    -webkit-animation: none !important;
    animation: none !important;
  }
}

/* ==== RESPONSIVE LAYOUTS ==== */

/* Responsive styles for programs gallery */
@media screen and (max-width: 768px) {
  .gallery-row {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  
  .program-item {
    margin: 0;
    width: 100%;
    max-width: 350px;
  }
  
  .gallery-thumb {
    width: 100%;
    max-width: 350px;
  }
}

@media screen and (max-width: 480px) {
  .gallery-section {
    padding: 15px;
    margin: 20px 0;
  }
  
  .gallery-section h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
  }
  
  .gallery-row {
    gap: 25px;
  }
  
  .program-item h3 {
    font-size: 1.1em;
    margin-top: 10px;
  }
  
  .gallery-thumb {
    height: 180px;
  }
}

/* ==== IMAGE MODAL STYLES ==== */
.image-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.image-modal-content {
  position: relative;
  margin: 2% auto;
  padding: 0;
  width: 90%;
  max-width: 1200px;
  height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
  transition: all 0.3s ease;
}

.image-modal-close:hover {
  color: #ccc;
  transform: scale(1.1);
}

.image-modal-caption {
  color: #fff;
  font-size: 18px;
  text-align: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  margin-top: 20px;
  max-width: 80%;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Webkit keyframes for older Safari */
@-webkit-keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Mobile modal styles */
@media screen and (max-width: 768px) {
  .image-modal-content {
    width: 95%;
    height: 95%;
    margin: 2.5% auto;
  }
  
  .image-modal-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
  
  .image-modal-caption {
    font-size: 16px;
    padding: 15px;
  }
}

/* ==== BROWSER-SPECIFIC FIXES ==== */
/* Fix for IE11 and older browsers */
.primary-navigation {
  -ms-flex-align: center;
}

.primary-navigation ul {
  -ms-flex-pack: end;
  -ms-flex-align: center;
}

.site-header .container {
  -ms-flex-pack: justify;
  -ms-flex-align: center;
}

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
  .primary-navigation {
    -webkit-overflow-scrolling: touch;
  }
  
  .banner2 {
    background-attachment: scroll; /* Prevents iOS background-attachment issues */
  }
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
  .primary-navigation ul li ul {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    -moz-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
}


/* Donation Modal Styles */