/* ============================================================
   Memorial Website for Gopal Krishna Saxena
   ============================================================ */

:root {
  --color-bg: #faf8f4;
  --color-surface: #ffffff;
  --color-primary: #5c3d2e;
  --color-primary-dark: #3a2418;
  --color-accent: #b8860b;
  --color-accent-light: #d4a843;
  --color-text: #2d2a26;
  --color-text-muted: #7a7068;
  --color-border: #e6ddd4;
  --color-border-light: #f0ebe5;
  --color-hero-start: #2a1810;
  --color-hero-end: #5c3d2e;
  --color-section-alt: #f5f0ea;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --max-width: 960px;
  --transition: 0.3s ease;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--color-hero-start) 0%, var(--color-hero-end) 100%);
  color: #fff;
  text-align: center;
  padding: 6rem 1.5rem 5rem;
}

.hero h1 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.hero-dates {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 300;
  opacity: 0.85;
  letter-spacing: 0.04em;
}

.hero-ornament {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
  letter-spacing: 0.5em;
}

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-light);
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-link {
  display: flex;
  align-items: center;
  text-align: center;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-back {
  color: var(--color-accent);
  font-weight: 600;
  border-right: 1px solid var(--color-border);
  margin-right: 0.25rem;
}

.nav-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

/* ---- Sections ---- */
.section {
  padding: 4rem 1.5rem;
}

.section-alt {
  background: var(--color-section-alt);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

/* ---- Photo Grid ---- */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
  justify-content: center;
}

.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  background: var(--color-surface);
  max-width: 420px;
}

.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
}

.photo-card .photo-caption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---- Bhajan Cards ---- */
.bhajan-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bhajan-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.bhajan-card:hover {
  box-shadow: var(--shadow-md);
}

.bhajan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  user-select: none;
  gap: 1rem;
}

.bhajan-header:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.bhajan-number {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  min-width: 2rem;
}

.bhajan-titles {
  flex: 1;
  min-width: 0;
}

.bhajan-title-hi {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-primary-dark);
}

.bhajan-title-en {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.expand-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.expand-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bhajan-card.expanded .expand-icon {
  transform: rotate(180deg);
}

/* Expand/collapse animation */
.bhajan-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}

.bhajan-card.expanded .bhajan-body {
  grid-template-rows: 1fr;
}

.bhajan-body-inner {
  overflow: hidden;
}

.bhajan-content {
  padding: 0 1.5rem 1.5rem;
}

/* Context blurb */
.bhajan-context {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-style: italic;
  padding: 0.75rem 1rem;
  background: var(--color-border-light);
  border-radius: calc(var(--radius) / 2);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Hindi lyrics */
.bhajan-hindi {
  margin-bottom: 1.5rem;
}

.bhajan-hindi h4,
.columns-header h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.hindi-lyrics {
  font-size: 1.05rem;
  line-height: 1.8;
}

.hindi-lyrics .verse {
  margin-bottom: 1rem;
}

.hindi-lyrics .verse:last-child {
  margin-bottom: 0;
}

/* Side-by-side columns */
.bhajan-columns {
  padding-top: 0;
}

.columns-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1rem;
}

.verse-pair {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}

.verse-pair:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.verse-pair p {
  margin-bottom: 0.3rem;
  line-height: 1.6;
}

.verse-pair p:last-child {
  margin-bottom: 0;
}

.verse-transliteration {
  font-size: 1rem;
}

.verse-hindi {
  font-size: 1rem;
}

.verse-translation {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.lazy-load-placeholder {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Bhajan sources */
.bhajan-sources {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.bhajan-sources a {
  color: var(--color-accent);
  text-decoration: none;
}

.bhajan-sources a:hover {
  text-decoration: underline;
}

/* ---- Family Tree ---- */
.family-tree-container {
  text-align: center;
  background: var(--color-bg);
  border-radius: var(--radius);
}

.family-tree-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ---- Album Grid ---- */
.album-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.album-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--color-text);
  transition: transform var(--transition), box-shadow var(--transition);
}

.album-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.album-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.album-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.album-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
}

.album-card .album-link-text {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 500;
  white-space: nowrap;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  cursor: pointer;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
  line-height: 1;
  padding: 0.5rem;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero {
    padding: 4rem 1.25rem 3.5rem;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .nav-link {
    padding: 0.75rem 0.6rem;
    font-size: 0.75rem;
  }

  /* Stack columns on mobile */
  .columns-header {
    display: none;
  }

  .verse-pair {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .verse-transliteration {
    margin-bottom: 0.5rem;
  }

  .verse-hindi::before {
    content: 'Hindi';
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin-bottom: 0.35rem;
  }

  .verse-hindi {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--color-border-light);
  }

  .verse-transliteration::before {
    content: 'Transliteration';
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin-bottom: 0.35rem;
  }

  .verse-translation::before {
    content: 'Translation';
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin-bottom: 0.35rem;
  }

  .verse-translation {
    padding-top: 0.5rem;
    border-top: 1px dashed var(--color-border-light);
  }

  .bhajan-header {
    padding: 1rem 1.25rem;
  }

  .bhajan-content {
    padding: 0 1.25rem 1.25rem;
  }

  .bhajan-title-hi {
    font-size: 1rem;
  }

  .photo-grid {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
}

  .bhajan-number {
    font-size: 1.2rem;
    min-width: 1.5rem;
  }
}

/* ---- Print ---- */
@media print {
  .navbar,
  .lightbox,
  .expand-icon,
  .photo-card,
  .album-card {
    display: none !important;
  }

  .hero {
    background: none;
    color: var(--color-text);
    padding: 2rem 0;
  }

  .hero::after {
    display: none;
  }

  .bhajan-body {
    grid-template-rows: 1fr !important;
  }

  .bhajan-body-inner {
    overflow: visible !important;
  }

  .bhajan-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .section {
    padding: 1.5rem 0;
  }

  .verse-pair {
    break-inside: avoid;
  }
}
