
/* ============================================================
   St. James Croquet Association – Amended Stylesheet
   Fix: Resolved mobile menu overlapping by enforcing block
   layout and static positioning for dropdowns.
   ============================================================ */

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  margin: 0;
  color: #333;
  background-color: #f9f9f9;
  line-height: 1.6;
  font-size: 1rem;
}

/* ===============================
   ACCESSIBILITY TOGGLE
   =============================== */
.accessibility-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 6px;
}

.accessibility-toggle {
  background: #ffd700;
  color: #000;
  border: 2px solid #fff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.9rem 0.8rem;
  min-height: 60px;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1.2;
  white-space: normal;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: background 0.3s;
}

.accessibility-toggle:hover {
  background: #fff;
  color: #000;
}

.dismiss-accessibility {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #222;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  line-height: 0.9;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  transition: background 0.3s, color 0.3s;
}

.dismiss-accessibility:hover {
  background: #ffdd00;
  color: #000;
}

.accessibility-controls.hidden {
  display: none !important;
}

/* Move accessibility toggle up a bit on small screens */
@media (max-width: 768px) {
  .accessibility-controls {
    bottom: 80px;
    right: 14px;
  }
}

/* High contrast toggle pulse */
body.high-contrast .accessibility-toggle {
  background: #ffdd00;
  color: #000;
  border: 2px solid #fff;
  font-size: 1.1rem;
  box-shadow: 0 0 0 3px #ffdd00;
  border-radius: 10px;
  animation: pulseOutline 2s ease-in-out 2;
}

@keyframes pulseOutline {
  0%, 100% { box-shadow: 0 0 0 3px #ffdd00; }
  50% { box-shadow: 0 0 8px 6px #ffdd00; }
}

/* ===============================
   HIGH CONTRAST MODE
   =============================== */
body.high-contrast {
  background: #000;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1.8;
}

body.high-contrast a {
  color: #ffdd00;
  text-decoration: underline;
}

body.high-contrast .join-now,
body.high-contrast .hero-cta,
body.high-contrast .member-login,
body.high-contrast .reserve-now {
  background: #fff;
  color: #000 !important;
}

body.high-contrast .navbar {
  background: #111;
}

body.high-contrast .navbar .dropdown {
  background: #222;
  border: 1px solid #666;
}

body.high-contrast .navbar .dropdown a {
  color: #fff;
}

body.high-contrast .navbar .dropdown a:hover {
  background: #444;
  color: #ffdd00;
}

body.high-contrast .section,
body.high-contrast .section.alt,
body.high-contrast .content {
  background: #111;
  color: #fff;
  border: 1px solid #444;
}

body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3 {
  color: #ffdd00;
}

body.high-contrast .content.open {
  max-height: none;
}

body.high-contrast .content {
  padding-bottom: 1.5rem;
}

/* ===============================
   HERO
   =============================== */
.hero {
  background: url("images/banner.jpg") center / cover no-repeat;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: white;
  position: relative;
  padding: 3% 4%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.hero .overlay {
  position: relative;
  z-index: 1;
  max-width: 1100px;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.hero-title-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.logo {
  width: 190px;
  height: auto;
}

.hero h1 {
  font-size: 3rem;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hero-tagline {
  margin: 1rem 0 1.2rem;
  font-size: 1.15rem;
  color: #f3f3f3;
}

.hero-cta-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* ===============================
   HERO BUTTONS
   =============================== */
.hero-cta {
  display: inline-block;
  background: #ffd700;
  color: #000;
  font-weight: 700;
  padding: 0.9rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1rem;
  border: 2px solid #fff;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-cta:hover {
  background: #fff;
  color: #004d00;
  border-color: #ffd700;
}

.hero-cta.secondary {
  background: #ffcc00;
  color: #000;
  border: 2px solid #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

.hero-cta.secondary:hover {
  background: #fff;
  color: #004d00;
  border-color: #ffd700;
}

/* ===============================
   NAVBAR
   =============================== */
.navbar {
  background: #004d00;
  padding: 0.4rem 1rem;
  position: sticky;
  top: 0;
  z-index: 200;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.6rem;
  border-radius: 10px;
  min-height: 44px;
  min-width: 44px;
}

.navbar > ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.navbar > ul > li {
  margin: 0.25rem 0.35rem;
  position: relative;
}

.navbar a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  line-height: 1.3;
  font-size: 1.125rem;
  font-weight: 500;
}

.navbar a:hover {
  color: #d4af37;
  background: rgba(255, 255, 255, 0.08);
}

.navbar .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  padding: 0.4rem 0;
  list-style: none;
  background: #004d00;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.navbar li.has-dropdown:hover > .dropdown,
.navbar li.has-dropdown.open > .dropdown {
  display: block;
}

.navbar .dropdown a {
  display: block;
  padding: 0.6rem 0.9rem;
  min-height: 44px;
}

/* Larger CTAs */
.reserve-now a,
.join-now a {
  font-size: 1.2rem;
  font-weight: 600;
}

/* ===============================
   SECTIONS
   =============================== */
.section {
  padding: 3.5rem 10%;
  background: #fff;
}

.section.alt {
  background: #eef7ee;
}

.section h2 {
  font-size: 2rem;
  margin: 0 0 1.25rem;
  color: #004d00;
  cursor: pointer;
}

.faq-item {
  margin-top: 1.3rem;
}

.faq-item h3 {
  font-size: 1.25rem;
  margin: 0;
}

/* ===============================
   COLLAPSIBLES
   =============================== */
.content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.35s ease;
  padding: 0 1rem;
  border-left: 4px solid #b58f1b;
  border-radius: 10px;
  background: #fff;
  color: #000;
}

.content.open {
  opacity: 1;
  padding: 1.1rem;
  margin-top: 0.6rem;
}

/* ===============================
   COLLAPSIBLE HEADINGS – VISUAL CUE
   =============================== */
.collapsible {
  position: relative;
  cursor: pointer;
  padding-right: 1.8rem;
  transition: color 0.25s ease;
  user-select: none;
}

.collapsible::after {
  content: "▼";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-size: 1.2rem;
  color: #004d00;
  transition: transform 0.25s ease, color 0.25s ease;
}

.collapsible:hover {
  color: #b58f1b;
}

.collapsible.active::after {
  transform: translateY(-50%) rotate(180deg);
  color: #b58f1b;
}

/* High-contrast arrow adjustment */
body.high-contrast .collapsible::after {
  color: #ffdd00;
}

body.high-contrast .collapsible.active::after {
  color: #fff;
}

/* ===============================
   FOUR-PANEL CYCLING GALLERY
   =============================== */
.landing-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.gallery-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.gallery-cell img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 10px;
  opacity: 0;
  animation: cellFade 16s linear infinite;
}

.gallery-cell img:nth-child(1) { animation-delay: var(--start); }
.gallery-cell img:nth-child(2) { animation-delay: calc(var(--start) + 4s); }
.gallery-cell img:nth-child(3) { animation-delay: calc(var(--start) + 8s); }
.gallery-cell img:nth-child(4) { animation-delay: calc(var(--start) + 12s); }

@keyframes cellFade {
  0% { opacity: 0; }
  5% { opacity: 1; }
  25% { opacity: 1; }
  30% { opacity: 0; }
  100% { opacity: 0; }
}

.landing-gallery-grid:hover img {
  animation-play-state: paused;
}

/* ===============================
   FOOTER
   =============================== */
footer {
  padding: 1.6rem;
  background: #003000;
  color: white;
  text-align: center;
  position: relative;
  z-index: 1;
  padding-bottom: 3rem;
}

/* ===============================
   NAVBAR CUSTOM UPDATES
   =============================== */
.nav-home a {
  font-weight: 700;
  color: #ffd700;
}

.nav-home a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.reserve-now .note {
  font-size: 0.8em;
  display: block;
  margin-top: 0.15em;
  opacity: 0.85;
  line-height: 1.2;
}

/* ===============================================
   ACCESSIBILITY REOPEN BUTTON (Eye Icon)
   =============================================== */
#reopen-accessibility {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: #ffd700;
  color: #004d00;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

#reopen-accessibility svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

#reopen-accessibility:hover {
  background: #fff;
  color: #004d00;
  border-color: #ffd700;
}

body.high-contrast #reopen-accessibility {
  background: #fff;
  color: #000;
  border-color: #ffdd00;
}

/* ===============================
   RESPONSIVE & MOBILE FIXES
   =============================== */
@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
  }

  /* Main Navigation Container */
  .navbar > ul {
    display: none; /* Hidden until 'active' */
    flex-direction: column;
    background: #004d00;
    padding: 1rem 0;
    width: 100%;
    position: relative;
    height: auto;
  }

  .navbar > ul.active {
    display: flex;
  }

  /* Force each menu item to be its own row */
  .navbar > ul > li {
    text-align: left; /* Better readability on mobile */
    margin: 0;
    width: 100%;
    display: block;
    position: relative;
  }

  /* Expand link area for touch targets */
  .navbar a {
    display: flex;
    width: 100%;
    padding: 0.8rem 1.5rem;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Mobile Dropdown Logic */
  .navbar .dropdown {
    display: none;
    position: static !important; /* Forces dropdown to take up space in the flow */
    background: rgba(0, 0, 0, 0.2); 
    box-shadow: none;
    padding: 0;
    margin: 0;
    width: 100%;
    border-radius: 0;
  }

  .navbar .has-dropdown.open > .dropdown {
    display: block; /* Stacks sub-links vertically */
  }

  .navbar .dropdown a {
    padding: 0.7rem 2.5rem; /* Indent sub-links */
    font-size: 1rem;
    color: #eee;
  }

  /* Gallery adjustments */
  .landing-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 2.1rem;
  }

  .logo {
    width: 140px;
  }

  .landing-gallery-grid {
    grid-template-columns: 1fr;
  }
}

