/* =========================================================
   THEME TOKENS
   ========================================================= */
:root {
  --color-bg-header: #fdf6e3;
  --color-bg-main: #fffaf0;
  --color-bg-footer: #eae7dc;
  --color-text-dark: #5a4632;
  --color-accent: #d4af37;
  --color-accent-hover: #bfa533;
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Lora', serif;
}

/* =========================================================
   BASE
   ========================================================= */
body {
  margin: 0;
  font-family: var(--font-body);
  background: linear-gradient(to bottom, #fffaf0, #fdf6e3);
  color: var(--color-text-dark);
}
h1, h2, h3 {
  margin: 0;
  text-align: center;
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* =========================================================
   HEADER
   ========================================================= */
.header {
  background-color: var(--color-bg-header);
  padding: 20px;
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.header-logo,
.secondary-logo {
  height: 200px;
  width: auto;
  border-radius: 22px;
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}
.header-text h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
}
.header-text h2 {
  font-size: 1.2rem;
  margin-top: 8px;
  color: var(--color-accent);
}

/* =========================================================
   NAVIGATION (original + submenu support)
   ========================================================= */
.nav-bar {
  background-color: #f0e6d2;
  border-top: 1px solid #d4c5b2;

  /* NEW: ensure nav stacks above hero/content so dropdowns are not hidden */
  position: relative;
  z-index: 1000;
}

/* Mobile hamburger */
.hamburger {
  display: block;
  padding: 10px 20px;
  cursor: pointer;
  text-align: right;
  font-size: 1.2rem;
  color: var(--color-text-dark);
}

/* Main list container:
   On mobile we animate height; on desktop we switch to flex. */
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;

  /* Mobile slide-down behavior (kept from your original) */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;

  /* NEW: don’t clip absolutely-positioned submenus on desktop */
  overflow: visible;
}
.nav-list.open {
  max-height: 80vh;
  overflow-y: auto;
}
.nav-list li a {
  display: block;
  padding: 12px 20px;
  font-weight: 600;
  border-bottom: 1px solid #e0d4c0;
}
.nav-list li a.active {
  color: var(--color-accent);
  font-weight: bold;
}

/* ---------- SUBMENU: structure (NEW) ---------- */

/* NEW: Make sure each top-level <li> can anchor its dropdown */
.nav-list > li {
  position: relative;
  overflow: visible; /* prevent clipping */
}

/* NEW: Parent control for dropdown (looks like your links) */
.nav-parent {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 12px 20px;            /* matches your mobile link padding */
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* NEW: Keyboard focus ring for accessibility */
.nav-parent:focus-visible,
.nav-list a:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

/* NEW: Chevron indicator rotation when parent is .open (mobile) */
.has-submenu.open > .nav-parent .chev {
  transform: rotate(180deg);
  transition: transform 150ms ease;
}

/* NEW: The submenu dropdown */
.submenu {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  min-width: 220px;

  /* hidden by default; shown via hover (desktop) or .open (mobile) */
  display: none;

  /* desktop dropdown positioning */
  position: absolute;
  left: 0;
  top: calc(100% + 0.25rem);
  background: #fff;
  border: 1px solid #e0d4c0;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  z-index: 2000; /* on top of the page content */
}

/* NEW: submenu items styling */
.submenu li a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-bottom: 0; /* avoid top-level underline rule inside dropdown */
  color: var(--color-text-dark);
  white-space: nowrap;
  border-radius: 6px;
}
.submenu li a:hover,
.submenu li a:focus {
  background: #f5f0e6; /* subtle hover matching palette */
  text-decoration: none;
}

/* NEW: Optional “hover bridge” to prevent flicker when moving cursor down */
.has-submenu:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  height: 10px;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  background: linear-gradient(to right, #fdf6e3, #fffaf0);
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  /* Keep hero under nav layer */
  position: relative;
  z-index: 1;
}
.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 auto;
  max-width: 700px;
  width: 100%;
}
.hero-text h1 {
  font-size: 2.5rem;
  margin: 0 auto 15px auto;
  text-align: center;
  width: 100%;
}
.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-style: italic;
  text-align: center;
}
.hero-button {
  background-color: var(--color-accent);
  color: var(--color-text-dark);
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}
.hero-button:hover {
  background-color: var(--color-accent-hover);
}

/* Optional: Fade-in animation */
.fade-in {
  opacity: 0;
  animation: fadeIn 4.2s ease forwards;
}
@keyframes fadeIn {
  to { opacity: 1; }
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.content-wrapper {
  max-width: 900px;
  width: 100%;
  background: #fffef9;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(90, 70, 50, 0.1);
  padding: 50px;
  line-height: 1.8;
}
.page-title {
  font-size: 2.2rem;
  font-family: var(--font-display);
  margin-bottom: 30px;
  text-align: center;
  color: var(--color-text-dark);
}

/* =========================================================
   CARD GRID
   ========================================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}
.info-card {
  background: #fffef9;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 6px 18px rgba(90, 70, 50, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(90, 70, 50, 0.15);
}
.info-card h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  font-family: var(--font-display);
}
.info-card a {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
}

/* =========================================================
   QUOTE BANNER
   ========================================================= */
.quote-banner {
  background-color: #f0e6d2;
  text-align: center;
  padding: 15px;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-text-dark);
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background-color: var(--color-bg-footer);
  color: var(--color-text-dark);
  text-align: center;
  padding: 30px 20px;
  font-size: 0.95rem;
  border-top: 1px solid #d4c5b2;

  /* Keep footer below nav layer */
  position: relative;
  z-index: 1;
}
.footer img {
  margin-top: 10px;
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
}

/* =========================================================
   RESPONSIVE LAYOUT
   ========================================================= */

/* Desktop & tablets >= 768px */
@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
  .nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    /* desktop: height is natural; ensure no clipping */
    max-height: none !important;
    overflow: visible;
  }
  .nav-list li a {
    padding: 12px 25px;
    border-bottom: none;
  }

  /* DESKTOP submenu behavior: show on hover/focus */
  .has-submenu:hover > .submenu,
  .has-submenu:focus-within > .submenu {
    display: block;
  }

  /* Make .nav-parent feel like a top-level item on desktop */
  .nav-parent {
    padding: 12px 25px;
    width: auto;
    text-align: left;
  }

  /* Optional polish: hover color consistent with links */
  .nav-list > li > a:hover,
  .nav-parent:hover {
    color: var(--color-accent-hover);
    text-decoration: none;
  }
}

/* Phones < 768px */
@media (max-width: 767px) {
  .header-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 10px;
  }
  .header-logo,
  .secondary-logo {
    height: 80px;
    margin-bottom: 10px;
  }
  .header-text h1 {
    font-size: 1.8rem;
  }
  .header-text h2 {
    font-size: 1rem;
  }
  .nav-list li a {
    padding: 14px 20px;
    font-size: 1rem;
  }
  .hero {
    padding: 30px 15px;
  }
  .hero-text h1 {
    font-size: 2rem;
    margin-bottom: 10px;
  }
  .hero-text p {
    font-size: 1rem;
    margin-bottom: 15px;
  }
  .hero-button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  .content-wrapper {
    padding: 30px 15px;
  }
  .card-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .info-card {
    padding: 20px;
    font-size: 1rem;
  }
  .footer {
    padding: 20px 10px;
    font-size: 0.9rem;
  }
  .footer h2,
  .footer h4 {
    font-size: 1rem;
  }
  .footer img {
    height: 30px;
  }

  /* MOBILE submenu behavior: render inline when parent is .open (JS toggles) */
  .submenu {
    position: static;
    display: none;   /* default closed */
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin-left: 0.75rem; /* indent to show hierarchy */
  }
  .has-submenu.open > .submenu {
    display: block;
  }
}