* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%; /* prevent iOS auto-resizing on orientation change */
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Cormorant", Georgia, "Times New Roman", serif;
  font-weight: 500;
  color: var(--color-ink);
  background:
    radial-gradient(ellipse at top,    rgba(255, 153, 51, 0.18), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(122,  31, 31, 0.12), transparent 55%),
    linear-gradient(180deg, var(--color-cream) 0%, var(--color-cream-soft) 100%);
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport — accounts for mobile address bars */
  display: flex;
  align-items: safe center; /* keep centered, but never clip when content > viewport */
  justify-content: center;
  padding: 32px 20px;
  padding-top: max(32px, env(safe-area-inset-top, 0));
  padding-bottom: max(32px, env(safe-area-inset-bottom, 0));
  font-size: var(--text-base);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent; /* remove iOS blue tap flash */
}

/* Keyboard focus indicator for interactive elements */
a:focus-visible {
  outline: 2px solid var(--color-saffron-deep);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Decorative mandala-style border on viewport edges */
body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 6px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--color-saffron) 0 12px,
      var(--color-gold) 12px 24px,
      var(--color-maroon) 24px 36px
    );
  z-index: 10;
}
body::before { top: 0; }
body::after  { bottom: 0; }

.page {
  width: 100%;
  max-width: 720px;
  text-align: center;
  padding: 56px 32px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: var(--radius-md);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 30px 60px -30px rgba(74, 15, 15, 0.35);
  position: relative;
}

/* Corner ornaments */
.page::before,
.page::after {
  content: "❁";
  position: absolute;
  color: var(--color-gold);
  font-size: var(--text-lg);
  line-height: 1;
  opacity: 0.7;
}
.page::before { top: 14px; left: 18px; }
.page::after  { bottom: 14px; right: 18px; }

.om {
  font-family: "Tiro Devanagari Sanskrit", "Cormorant", serif;
  font-size: var(--text-2xl);
  color: var(--color-maroon);
  line-height: 1;
  margin: 0 0 8px;
  text-shadow: 0 2px 0 rgba(201, 162, 39, 0.35);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-gold);
  margin: 18px auto 24px;
}
.divider .line {
  flex: 0 1 90px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}
.divider .dot {
  width: 6px;
  height: 6px;
  background: var(--color-saffron);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.18);
}

h1.title {
  font-family: "Cormorant Garamond", "Cormorant", serif;
  font-weight: 500;
  letter-spacing: 0.10em;
  color: var(--color-maroon-deep);
  font-size: var(--text-lg);
  line-height: 1.3;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.title-telugu {
  font-family: "Tiro Telugu", "Cormorant", serif;
  font-weight: 400;
  color: var(--color-maroon);
  font-size: var(--text-md);
  line-height: 1.5;
  margin: 0 0 12px;
}

.abbr {
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.42em;
  color: var(--color-gold);
  font-size: var(--text-sm);
  margin: 0 0 14px;
  padding-left: 0.42em; /* visually compensate for trailing letter-spacing */
}

.subtitle {
  font-style: italic;
  color: var(--color-saffron-deep);
  font-size: var(--text-md);
  margin: 0 0 28px;
}

.coming-soon {
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-cream);
  background: linear-gradient(135deg, var(--color-maroon) 0%, var(--color-saffron-deep) 100%);
  padding: 12px 28px;
  border-radius: 999px;
  font-size: var(--text-sm);
  box-shadow: 0 8px 24px -8px rgba(122, 31, 31, 0.45);
  margin-bottom: 28px;
}

.message {
  max-width: 520px;
  margin: 0 auto 28px;
  color: var(--color-ink);
  font-size: var(--text-base);
}

.address {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid rgba(201, 162, 39, 0.55);
  border-radius: var(--radius-sm);
  background: rgba(255, 247, 230, 0.7);
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--color-maroon);
  font-size: var(--text-base);
  text-decoration: none;
}
.address::before {
  content: "🕉";
  font-size: var(--text-md);
}

.location {
  margin: 14px 0 0;
  color: var(--color-saffron-deep);
  font-size: var(--text-sm);
  font-style: italic;
  letter-spacing: 0.06em;
}

/* --- Construction section ----------------------------------------------- */
.construction {
  margin: 8px 0 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(201, 162, 39, 0.3);
}

.section-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: 0.06em;
  color: var(--color-maroon-deep);
  text-transform: uppercase;
  margin: 0 0 6px;
}

.section-lead {
  font-style: italic;
  color: var(--color-saffron-deep);
  font-size: var(--text-base);
  margin: 0 0 20px;
}

/* Uniform 4:3 grid — forgiving of any photo aspect (portrait, landscape,
   square). Tiles all get the same shape, sources are center-cropped via
   object-fit: cover. Interim layout for the under-construction phase;
   when the real site lands we'll revisit with curated assets. */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.photo {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 6px 20px -10px rgba(74, 15, 15, 0.3);
  transition: transform 0.5s ease;
  background: var(--color-cream-soft);
  cursor: zoom-in;
}
.photo:hover { transform: scale(1.02); }
/* placeholders aren't real photos — don't pretend they're clickable */
.photo:has(.photo-placeholder) { cursor: default; }
.photo:has(.photo-placeholder):hover { transform: none; }

.photo img,
.photo-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  color: var(--color-maroon);
  background:
    linear-gradient(135deg, var(--color-cream-soft) 0%, rgba(255, 153, 51, 0.2) 100%);
}

.photo figcaption {
  margin-top: 8px;
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--color-ink);
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.video-link {
  display: block;
  width: fit-content;
  margin: 0 auto 22px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-saffron-deep);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 2px;
  font-size: var(--text-sm);
}
.video-link:hover { color: var(--color-maroon); }

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 720px;
  margin: 4px auto 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 6px 20px -10px rgba(74, 15, 15, 0.3);
  background: var(--color-cream-soft);
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

footer {
  margin-top: 36px;
  color: var(--color-ink);
  opacity: 0.7;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
}

/* --- Mobile: phone-sized screens ---------------------------------------- */
@media (max-width: 540px) {
  body { padding: 24px 16px; }

  .page { padding: 36px 20px; }
  .page::before, .page::after { font-size: var(--text-base); }
  .page::before { top: 10px; left: 12px; }
  .page::after  { bottom: 10px; right: 12px; }

  .om { font-size: var(--text-xl); }
  .divider { margin: 14px auto 20px; }
  .divider .line { flex: 0 1 60px; }

  h1.title {
    font-size: var(--text-base);
    letter-spacing: 0.04em;
    line-height: 1.35;
  }
  .title-telugu { font-size: var(--text-base); line-height: 1.5; }
  .abbr {
    letter-spacing: 0.32em;
    font-size: var(--text-xs);
    padding-left: 0.32em;
  }
  .subtitle { font-size: var(--text-base); margin: 0 0 22px; }

  .coming-soon {
    letter-spacing: 0.22em;
    padding: 10px 20px;
    font-size: var(--text-xs);
  }

  .message { font-size: var(--text-sm); margin: 0 auto 22px; }

  .address {
    padding: 12px 18px;
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
  }
  .location { font-size: var(--text-xs); }

  .section-title { font-size: var(--text-md); letter-spacing: 0.04em; }
  .section-lead { font-size: var(--text-sm); margin: 0 0 16px; }
  .construction { margin: 4px 0 24px; padding-top: 22px; }

  footer { margin-top: 28px; }
}

/* --- Gallery responsive grid -------------------------------------------- */
/* Tablet: 2 columns, same uniform tile shape */
@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* Phone: 1 column. Each photo gets the full screen width — substantial
   visual weight without the thin-strip problem of 16:9 cropping. */
@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; gap: 10px; }
}

/* --- Tiny phones (iPhone SE, older Androids) ---------------------------- */
@media (max-width: 380px) {
  body { padding: 16px 12px; }

  .page { padding: 28px 14px; }
  .page::before { top: 8px; left: 10px; }
  .page::after  { bottom: 8px; right: 10px; }

  h1.title { letter-spacing: 0.02em; }
  .abbr { letter-spacing: 0.24em; padding-left: 0.24em; }
  .coming-soon { letter-spacing: 0.16em; padding: 9px 16px; }
  .divider .line { flex: 0 1 40px; }

  .address {
    padding: 10px 14px;
    letter-spacing: 0.06em;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .om { animation: glow 4.5s ease-in-out infinite; }
  @keyframes glow {
    0%, 100% { text-shadow: 0 2px 0 rgba(201, 162, 39, 0.35); }
    50%      { text-shadow: 0 0 24px rgba(255, 153, 51, 0.55), 0 2px 0 rgba(201, 162, 39, 0.35); }
  }
}

/* --- Lightbox overlay (vanilla JS in js/main.js) ------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 8, 4, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  cursor: zoom-out;
  animation: lightbox-in 0.18s ease-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  cursor: default;
  user-select: none;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
  transition: background 0.2s, transform 0.2s;
}
.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: 0;
}
.lightbox-nav:active { transform: translateY(-50%) scale(0.94); }

.lightbox-close {
  top: max(16px, env(safe-area-inset-top, 0));
  right: max(20px, env(safe-area-inset-right, 0));
  width: 44px;
  height: 44px;
  font-size: var(--text-xl);
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: var(--text-2xl);
  padding-bottom: 4px; /* visual centering for the chevron glyph */
}
.lightbox-prev { left: max(20px, env(safe-area-inset-left, 0)); }
.lightbox-next { right: max(20px, env(safe-area-inset-right, 0)); }

@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 480px) {
  .lightbox { padding: 16px; }
  .lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: var(--text-xl);
  }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}
