/* Daily Darshan Temples — mobile full-width, desktop padded */
:root {
  --dd-saffron: #e67e22;
  --dd-saffron-deep: #c45d0a;
  --dd-gold: #c9a227;
  --dd-gold-light: #f0d78c;
  --dd-maroon: #6b1e2a;
  --dd-maroon-deep: #4a1219;
  --dd-cream: #fbf6eb;
  --dd-border: #e0c9a0;
  --dd-ink: #2c1810;
  --dd-muted: #6b5344;
  --dd-shadow-md: 0 4px 18px rgba(107, 30, 42, 0.1);
  --dd-shadow-lg: 0 8px 28px rgba(107, 30, 42, 0.16);
  --dd-radius: 14px;
  --dd-title-size: clamp(1.05rem, 2.8vw, 1.35rem);
  --dd-caption-size: clamp(0.95rem, 2.4vw, 1.15rem);
}

#daily-darshan-wrapper {
  width: 100%;
  max-width: 960px;
  margin: 1rem auto 2rem;
  padding: 1.5rem 1.15rem 2rem;
  box-sizing: border-box;
  text-align: center;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, "Noto Serif", serif;
  color: var(--dd-ink);
  background:
    radial-gradient(ellipse at top, rgba(240, 215, 140, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, #fffaf0 0%, var(--dd-cream) 40%, #f7efdc 100%);
  border-radius: 20px;
  border: 1px solid var(--dd-border);
  box-shadow: var(--dd-shadow-md);
  position: relative;
  overflow: hidden;
}
#daily-darshan-wrapper::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--dd-maroon), var(--dd-gold), var(--dd-saffron), var(--dd-gold), var(--dd-maroon));
}

.dd-gallery-intro {
  margin: 0.75rem 0 1rem;
  padding: 0 0.5rem;
}
.dd-gallery-title {
  margin: 0 0 0.65rem;
  padding: 0 0.25rem;
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  color: var(--dd-maroon);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.dd-gallery-title::before,
.dd-gallery-title::after {
  content: " ✦ ";
  color: var(--dd-gold);
  font-size: 0.75em;
  opacity: 0.9;
}
.dd-gallery-date {
  margin: 0.5rem 0 0.35rem;
  padding: 0 0.25rem;
  font-size: clamp(1.2rem, 4vw, 1.75rem);
  font-weight: 700;
  color: var(--dd-saffron-deep);
  letter-spacing: 0.03em;
  line-height: 1.4;
}
.dd-gallery-date::before { content: "🕉 "; }
.dd-gallery-tagline {
  margin: 0.45rem 0 0;
  color: var(--dd-muted);
  font-style: italic;
  font-size: 1rem;
}

.dd-date-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin: 0.85rem 0 1.15rem;
  padding: 0 0.25rem;
  font-family: system-ui, sans-serif;
}
.dd-date-bar input[type=date] {
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--dd-border);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dd-maroon);
  background: #fff;
  max-width: 100%;
  box-sizing: border-box;
}
.dd-btn-today {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--dd-gold);
  background: #fff;
  color: var(--dd-maroon);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
}
.dd-btn-today:disabled { opacity: 0.45; cursor: not-allowed; }

.dd-share-box {
  background: linear-gradient(145deg, #fffef8 0%, #faf0d8 55%, #f5e6c8 100%);
  border: 1.5px solid var(--dd-gold);
  border-radius: 18px;
  box-shadow: var(--dd-shadow-md);
  padding: 1.25rem 1rem;
  margin: 0 0 1.5rem;
  box-sizing: border-box;
}
.dd-share-title {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  color: var(--dd-maroon);
  font-weight: 700;
}
.dd-share-title::before { content: "🙏 "; }
.dd-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.dd-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff !important;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 5px 14px rgba(44,24,16,0.22);
  transition: transform 0.2s ease;
}
.dd-share-btn:hover { transform: translateY(-3px) scale(1.05); }
.dd-share-btn svg { width: 22px; height: 22px; fill: currentColor; }
.dd-share-wa { background: linear-gradient(145deg, #2fe075, #1da851); }
.dd-share-x { background: linear-gradient(145deg, #333, #000); }
.dd-share-fb { background: linear-gradient(145deg, #4b8ef0, #1877f2); }
.dd-share-tg { background: linear-gradient(145deg, #4eb8ef, #229ed9); }
.dd-gen-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.35rem;
}
.dd-gen-btn {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--dd-gold);
  background: linear-gradient(135deg, var(--dd-maroon), #8b2e3c);
  color: #fff8e7;
  font-weight: 700;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
}
.dd-gen-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Temple grid */
.dd-gallery-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
.dd-album-item {
  background: linear-gradient(180deg, #fffefb 0%, #faf3e4 100%);
  border: 1.5px solid var(--dd-border);
  border-radius: var(--dd-radius);
  box-shadow: var(--dd-shadow-md);
  padding: 0.85rem 0.75rem 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.dd-album-item::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--dd-gold), transparent);
}
.dd-album-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--dd-shadow-lg);
}
.dd-album-item a.dd-thumb {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
}
.dd-album-item img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--dd-border);
  margin: 0 auto;
  display: block;
  transition: transform 0.25s ease;
}
.dd-album-item:hover img { transform: scale(1.02); }

.dd-album-item h3 {
  margin: 0.85rem 0 0.25rem;
  padding: 0 0.25rem;
  font-size: var(--dd-title-size);
  color: var(--dd-maroon);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  word-wrap: break-word;
}
.dd-album-item .dd-title-kn {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.95em;
  color: var(--dd-maroon-deep);
  font-weight: 600;
}
.dd-caption {
  margin: 0.35rem 0 0;
  padding: 0 0.25rem;
  font-size: var(--dd-caption-size);
  color: var(--dd-muted);
  line-height: 1.4;
}
.dd-empty {
  padding: 1.5rem;
  color: var(--dd-muted);
  font-style: italic;
}

.dd-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dd-lightbox.open { display: flex; }
.dd-lightbox .lb-title {
  color: #fff8e7;
  font-size: 1.1rem;
  text-align: center;
  max-width: 90vw;
  margin: 0 0 0.5rem;
  padding: 0.5rem 2.5rem 0;
  font-family: Georgia, serif;
}
.dd-lightbox img {
  max-width: 96vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 2px solid var(--dd-gold);
}
.dd-lightbox .close {
  position: absolute;
  top: 12px;
  right: 16px;
  color: #fff;
  font-size: 2rem;
  background: 0;
  border: 0;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}
.dd-lightbox .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 0;
  font-size: 1.75rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
}
.dd-lightbox .prev { left: 10px; }
.dd-lightbox .next { right: 10px; }
.dd-lightbox .lb-counter {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-family: system-ui, sans-serif;
}

/* Mobile: full screen width, one column, natural image height */
@media (max-width: 640px) {
  #daily-darshan-wrapper {
    margin: 0.5rem 0 1.25rem;
    padding: 1.25rem 0.75rem 1.5rem;
    border-radius: 14px;
    max-width: 100%;
    width: 100%;
  }
  .dd-gallery-intro {
    margin: 0.5rem 0 0.85rem;
    padding: 0 0.15rem;
  }
  .dd-gallery-title {
    margin-top: 0.25rem;
  }
  .dd-gallery-items {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
  }
  .dd-album-item {
    padding: 0.65rem 0.5rem 0.9rem;
    width: 100%;
  }
  .dd-album-item img {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    max-height: none;
    object-fit: contain;
    background: #fff;
  }
  .dd-share-box {
    margin-left: 0;
    margin-right: 0;
    padding: 1rem 0.65rem;
  }
}

/* Desktop: comfortable side margins so title is not edge-stuck */
@media (min-width: 641px) {
  #daily-darshan-wrapper {
    margin: 1.5rem auto 2.5rem;
    padding: 2rem 1.75rem 2.25rem;
  }
  .dd-gallery-intro {
    margin-bottom: 1.25rem;
  }
  .dd-gallery-items {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  .dd-album-item img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    max-height: 320px;
  }
}

/* Site section wrap padding so content not flush to viewport */
section#darshan.section.wrap {
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  padding-top: 0.5rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
