/* =========================================================
   SPD shared responsive fixes (2026-11-02)
   Loaded LAST on every page so it overrides page CSS files.
   ========================================================= */

/* ---------- Global safety ---------- */
html, body { max-width: 100%; overflow-x: clip; }
img, video, iframe, embed, object { max-width: 100%; }
iframe { display: block; }
table { max-width: 100%; }
*, *::before, *::after { box-sizing: border-box; }

/* Mobile dropdown open state */
.nav-menu .dropdown.open > .dropdown-menu { display: block; }

/* ---------- Tablet & small laptop: switch to hamburger menu ---------- */
@media (max-width: 1100px) {
  .site-header { padding: 0.6rem 0; }
  .site-header .container { flex-wrap: nowrap; }

  .nav-toggle { display: flex !important; }

  .main-nav {
    position: absolute !important;
    top: 100%;
    left: 0;
    right: 0;
    width: 100% !important;
    display: block !important;
    background: transparent;
    transform: none !important;
    height: auto !important;
  }

  .nav-menu {
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100%;
    margin: 0;
    padding: 0.5rem 1rem 1rem !important;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .nav-menu.active,
  .main-nav.active .nav-menu { display: flex !important; }

  .nav-menu > li { width: 100%; border-bottom: 1px solid #f1f1f1; }
  .nav-menu > li:last-child { border-bottom: 0; }
  .nav-menu a { padding: 0.8rem 0.5rem !important; }
  .nav-menu a::after { display: none; }

  /* Dropdowns become tap-to-open accordions */
  .nav-menu .dropdown > a { display: flex; justify-content: space-between; align-items: center; }
  .nav-menu .dropdown > a::before {
    content: "\25BE";            /* small down arrow */
    order: 2;
    font-size: 0.9em;
    transition: transform 0.2s ease;
  }
  .nav-menu .dropdown.open > a::before { transform: rotate(180deg); }

  .dropdown-menu {
    position: static !important;
    display: none !important;
    min-width: 0 !important;
    width: 100%;
    border: 0 !important;
    box-shadow: none !important;
    background: #faf6f3 !important;
    padding-left: 0.75rem !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  .dropdown:hover .dropdown-menu { display: none !important; }
  .nav-menu .dropdown.open > .dropdown-menu { display: block !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 768px) {
  .container { width: 92%; }

  /* Page banners: keep big titles inside the banner */
  .page-hero h1, .hero h1, [class*="hero"] h1, .section-title {
    font-size: clamp(1.5rem, 6.5vw, 2.4rem) !important;
    line-height: 1.25 !important;
    word-break: break-word;
  }
  .page-hero, [class*="-hero"] { height: auto !important; min-height: 220px; padding-top: 40px !important; padding-bottom: 40px !important; }
  .page-hero p, [class*="-hero"] p { font-size: 1rem !important; }

  h1 { overflow-wrap: anywhere; }

  /* Footer: one centred column */
  .footer-container { flex-direction: column !important; align-items: center; text-align: center; gap: 30px !important; }
  .footer-left, .footer-right, .footer-links { width: 100%; min-width: 0 !important; flex: none !important; }
  .footer-links { flex-direction: column !important; align-items: center; gap: 25px !important; }
  .footer-links > div { min-width: 0 !important; }
  .footer-logo { margin-left: auto; margin-right: auto; }
  .social-icons { justify-content: center; }

  /* Gallery slider should never push the page wider */
  .gallery-slider, .swiper { overflow: hidden; max-width: 100%; }

  /* Google map on Contact page */
  iframe[src*="google.com/maps"] { width: 100% !important; height: 300px; }
}

@media (max-width: 480px) {
  .logo-img { height: 42px !important; }
  .logo-text { font-size: 1rem !important; line-height: 1.2; }
  .logo a { gap: 8px !important; }
  section { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Gallery & album headings (had a fixed 410px indent) ---------- */
@media (max-width: 1100px) {
  .section-title, .section-subtitle {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
  }
  .gallery-slider .section-title { padding-top: 30px !important; }
  .album-header { flex-wrap: wrap !important; justify-content: center; text-align: center; margin-top: 30px !important; }
  .album-header .section-title { width: 100%; }
}

/* ---------- Consistent hamburger button on every page ---------- */
@media (max-width: 1100px) {
  .nav-toggle {
    -webkit-appearance: none; appearance: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    width: 42px !important; height: 42px !important;
    padding: 9px !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    align-self: center !important;
    gap: 5px;
    margin: 0 0 0 auto !important;
    position: relative !important; top: auto !important; right: auto !important;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .nav-toggle:focus-visible { outline: 2px solid var(--brand-accent, #C6A15B); }
  .nav-toggle span {
    display: block !important;
    width: 24px !important; height: 3px !important;
    margin: 0 !important;
    background: var(--brand-primary, #5E3018) !important;
    border-radius: 3px;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }
  .nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg) !important; }
  .nav-toggle.active span:nth-child(2) { opacity: 0 !important; }
  .nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg) !important; }
}

@media (max-width: 1100px) {
  .site-header .container { justify-content: space-between !important; align-items: center !important; }
}
