/* ============================================================
   TESTER FIXES — Mobile Overlap & Z-index Corrections
   ============================================================ */

/* ── Z-INDEX LAYER SYSTEM (clean, no conflicts) ── */
:root {
  --z-base:        0;
  --z-content:     1;
  --z-canvas:     -2;
  --z-sticky:    100;
  --z-nav:       900;
  --z-nav-strip: 998;
  --z-overlay:   999;
  --z-drawer:   1000;
  --z-lang:     1001;
  --z-toast:    9000;
}

#galaxy-canvas       { z-index: var(--z-canvas) !important; }
#mobile-bottom-nav   { z-index: var(--z-nav) !important; }
#whatsapp-float      { z-index: 851 !important; }
#audio-toggle        { z-index: 852 !important; }
.back-to-top         { z-index: 853 !important; }
#pwa-banner          { z-index: 854 !important; }
.nav-menu            { z-index: var(--z-nav-strip) !important; }
.nav-overlay         { z-index: var(--z-overlay) !important; }
#site-header         { z-index: var(--z-drawer) !important; }
.nav-lang-pill       { z-index: var(--z-lang) !important; }
#mob-toast           { z-index: var(--z-toast) !important; }
.cursor-sparkle      { z-index: 9999 !important; }

/* ── HERO — correct offset for sticky nav + strip ── */
.hero {
  min-height: 100dvh;
  padding-top: 0 !important;
  display: flex;
  align-items: center;
}

/* Hero content padding handled in coder-polish.css */

/* ── MAIN — push down for nav + strip ── */
@media (max-width: 768px) {
  main {
    padding-top: calc(var(--mob-nav-h) + 44px) !important;
  }
  /* Hero doesn't need extra main padding — it's first section */
  main > .hero:first-child {
    margin-top: 0;
  }
}

/* ── NAV STRIP — correct height & no content bleed ── */
@media (max-width: 768px) {
  .nav-menu {
    top: var(--mob-nav-h) !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    align-items: center !important;
  }
  .nav-link {
    line-height: 1 !important;
  }
}

/* ── BOTTOM NAV — safe area + no overlap ── */
@media (max-width: 768px) {
  #mobile-bottom-nav {
    height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* All floating buttons above bottom nav */
  #whatsapp-float {
    bottom: calc(60px + env(safe-area-inset-bottom,0px) + 12px) !important;
  }
  #audio-toggle {
    bottom: calc(60px + env(safe-area-inset-bottom,0px) + 70px) !important;
  }
  .back-to-top {
    bottom: calc(60px + env(safe-area-inset-bottom,0px) + 12px) !important;
    right: 4.5rem !important; /* beside whatsapp, not above it */
  }
  #pwa-banner {
    bottom: calc(60px + env(safe-area-inset-bottom,0px) + 8px) !important;
  }
  main {
    padding-bottom: calc(60px + env(safe-area-inset-bottom,0px) + 8px) !important;
  }
  .site-footer {
    padding-bottom: calc(60px + env(safe-area-inset-bottom,0px) + 8px) !important;
  }
}

/* ── SECTIONS — no bleed into each other ── */
.section {
  position: relative;
  overflow: hidden; /* contain internal floats/absolutes */
}

/* Annadhanam + Kulam wrapper — no overflow */
.annadhanam-kulam-wrapper {
  overflow: hidden;
  width: 100%;
}

/* ── LIVE SECTION — card minimum height fix ── */
@media (max-width: 540px) {
  .live-card {
    min-height: auto !important;
    padding: 1rem 0.9rem;
  }
  .live-grid {
    grid-template-columns: 1fr !important;
  }
  .live-grid-bottom {
    grid-template-columns: 1fr !important;
  }
}

/* ── GALLERY — prevent card overflow ── */
.gallery-photo-card {
  overflow: hidden;
  width: 100%;
}
.gallery-real-photo {
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── LOCATION SECTION — static map card ── */
.map-static-card {
  background: linear-gradient(135deg, rgba(26,10,0,0.95), rgba(10,20,40,0.95));
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.map-static-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid rgba(255,215,0,0.1);
  background: url('images/hanging-lamps-corridor.jpg') center/cover no-repeat;
  position: relative;
  min-height: 160px;
}
.map-static-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(10,20,40,0.8));
}
.map-static-pin {
  font-size: 3rem;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(255,100,100,0.8));
  animation: pin-bounce 2s ease-in-out infinite;
}
@keyframes pin-bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.map-static-info {
  position: relative;
  z-index: 1;
}
.map-static-name {
  font-family: 'Noto Serif Malayalam', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.map-static-addr {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.2rem;
}
.map-static-dist {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
}
.map-static-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  flex-wrap: wrap;
}
.map-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 50px;
  background: linear-gradient(135deg, #c8860a, #ffd700);
  color: #1a0800;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(255,180,0,0.3);
  font-family: 'Noto Serif Malayalam', serif;
}
.map-open-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,180,0,0.4); }
.map-open-btn:active { transform: scale(0.97); }
.map-open-apple {
  background: linear-gradient(135deg, #1c1c1e, #3a3a3c);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
  .map-static-preview { min-height: 130px; padding: 1rem; }
  .map-static-name { font-size: 0.95rem; }
  .map-open-btn { font-size: 0.8rem; padding: 0.65rem 1rem; }
  .map-static-actions { gap: 0.5rem; padding: 0.8rem 1rem; }
}

/* ── CONTACT FORM — prevent iOS zoom on select ── */
.contact-form select {
  font-size: 1rem !important; /* iOS won't zoom above 16px */
}

/* ── TIMING NOTE with link — readable ── */
.timing-note a {
  color: var(--color-gold);
  font-weight: 600;
  text-decoration: underline;
}

/* ── SCROLLING ISSUES FIX ── */
/* Prevent text from going under sticky nav on anchor scroll */
section[id] {
  scroll-margin-top: 115px;
}
@media (min-width: 769px) {
  section[id] { scroll-margin-top: 80px; }
}

/* ══════════════════════════════════════════════
   HERO LAYOUT — COMPLETE REALIGNMENT
   Tester-identified fixes: image added 280px height,
   triple padding conflicts resolved
══════════════════════════════════════════════ */

/* ── Hero section: full viewport, flex column ── */
.hero {
  min-height: 100dvh;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible !important; /* don't clip content */
  padding: 0 !important;
  position: relative;
}

/* ── Hero content: single source of truth ── */
.hero-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem !important;
  /* Top padding = nav height + nav strip + breathing room */
  padding-top: calc(var(--mob-nav-h, 64px) + 44px + 1rem) !important;
  gap: 0.4rem;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* Desktop: less top padding (no nav strip) */
@media (min-width: 769px) {
  .hero-content {
    padding-top: calc(var(--mob-nav-h, 64px) + 2rem) !important;
    gap: 0.6rem;
    padding-bottom: 3rem !important;
  }
}

/* ── Krishna image: correct sizing per screen ── */
.hero-krishna-img-wrap {
  flex-shrink: 0 !important;
  margin-bottom: 0.2rem !important; /* small gap before tagline */
  width: 100%;
  display: flex;
  justify-content: center;
}

.hero-krishna-img {
  width: clamp(150px, 42vw, 260px) !important;
  height: auto !important;
  display: block;
}

@media (max-width: 380px) {
  .hero-krishna-img { width: 140px !important; }
}
@media (min-width: 769px) {
  .hero-krishna-img { width: 280px !important; }
}

/* ── Text elements: tight but readable ── */
.hero-tagline {
  margin: 0 !important;
  line-height: 1.3;
  font-size: clamp(0.85rem, 3.5vw, 1.1rem) !important;
}
.hero-title {
  margin: 0.2rem 0 0 !important;
  font-size: clamp(1.7rem, 7.5vw, 3.5rem) !important;
  line-height: 1.2 !important;
}
.hero-subtitle {
  margin: 0 !important;
  font-size: clamp(0.78rem, 3vw, 1rem) !important;
  opacity: 0.88;
}
.hero-location {
  margin: 0.1rem 0 0.4rem !important;
  font-size: clamp(0.75rem, 2.8vw, 0.9rem) !important;
}

/* ── Buttons: stack on very small screens ── */
.hero-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.6rem !important;
  margin-top: 0.5rem !important;
  width: 100%;
  max-width: 340px;
}
.hero-actions .btn {
  flex: 1 1 140px;
  min-width: 130px;
  max-width: 200px;
  font-size: clamp(0.8rem, 3vw, 0.9rem) !important;
  padding: 0.75rem 1rem !important;
}

@media (max-width: 360px) {
  .hero-actions .btn { flex: 1 1 100%; max-width: 100%; }
}
