/* ═══════════════════════════════════════════════════════════════
   Rajgarhia Parivaar — Global Stylesheet
   Heritage Rajasthani Theme · Mobile-First · Production Ready
═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --saffron:    #FF9933;
  --maroon:     #8b1a1a;
  --maroon-dk:  #6a0f0f;
  --gold:       #c9a24d;
  --gold-lt:    #f3e5c8;
  --cream:      #fffaf0;
  --bg:         #f4efe6;
  --text:       #3b2b1a;
  --text-muted: #6b5040;
  --border:     #c9a24d;
  --radius:     14px;
  --shadow:     0 8px 28px rgba(120,60,0,.22);
  --font-body:  'Noto Serif Devanagari', 'Noto Serif', Georgia, serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
main { flex: 1; }

/* ── Header ─────────────────────────────────────────────────── */
header {
  background: var(--saffron);
  padding: 12px 20px;
  position: relative;
  box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
.header-inner {
  max-width: 1280px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-logo img { height: 70px; border-radius: 8px; }
.header-text { flex: 1; }
.header-title {
  font-size: clamp(16px, 3vw, 26px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  margin-right: 8px;
}

/* ── Language Toggle ─────────────────────────────────────────── */
.lang-toggle-desktop {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.6);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s;
}
.lang-toggle-desktop:hover { background: rgba(255,255,255,.35); }
.lang-toggle-mobile { display: none; }

/* ── Desktop Nav ─────────────────────────────────────────────── */
nav {
  background: #fff;
  border-bottom: 3px solid var(--saffron);
}
nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  max-width: 1280px;
  margin: auto;
  flex-wrap: wrap;
}
nav > ul > li { position: relative; }
nav > ul > li > a {
  display: block;
  padding: 13px 20px;
  font-weight: 700;
  font-size: 15px;
  transition: background .2s, color .2s;
}
nav > ul > li > a:hover,
nav > ul > li.has-dropdown:hover > a {
  background: var(--saffron);
  color: #fff;
}
nav .nav-cta {
  background: var(--maroon);
  color: #fff;
  border-radius: 6px;
  margin: 6px 8px;
  padding: 7px 18px !important;
}
nav .nav-cta:hover { background: var(--maroon-dk) !important; }

/* Dropdown */
nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 220px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  border-top: 3px solid var(--saffron);
  z-index: 100;
  list-style: none;
}
nav .dropdown li a {
  display: block;
  padding: 12px 18px;
  font-size: 14px;
  border-bottom: 1px solid #f0e6d6;
}
nav .dropdown li a:hover { background: var(--gold-lt); color: var(--maroon); }
nav .has-dropdown:hover .dropdown { display: block; }

/* ── Mobile Menu ─────────────────────────────────────────────── */
.side-menu {
  position: fixed;
  top: 0; left: -270px;
  width: 260px;
  height: 100%;
  background: #fff;
  box-shadow: 3px 0 20px rgba(0,0,0,.25);
  z-index: 1000;
  transition: left .3s ease;
  padding-top: 56px;
  overflow-y: auto;
}
.side-menu.open { left: 0; }
.side-menu-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--maroon);
}
.side-menu a {
  display: block;
  padding: 13px 22px;
  font-weight: 600;
  border-bottom: 1px solid #f0e6d6;
}
.side-menu a:hover { background: var(--gold-lt); }
.side-menu-cta {
  background: var(--maroon) !important;
  color: #fff !important;
  text-align: center;
  margin: 12px 16px !important;
  border-radius: 8px !important;
  border: none !important;
}
.mobile-expand {
  width: 100%;
  text-align: left;
  padding: 13px 22px;
  border: none; border-bottom: 1px solid #f0e6d6;
  background: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.mobile-submenu { display: none; background: #fdf7ee; }
.mobile-submenu a { padding-left: 36px; font-weight: 400; font-size: 14px; }
.lang-toggle-mobile {
  display: block;
  padding: 13px 22px;
  font-weight: 600;
  color: var(--maroon) !important;
  border-top: 2px solid var(--gold);
}

.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: none; z-index: 900;
}
.overlay.show { display: block; }

/* ── Flash Messages ──────────────────────────────────────────── */
.flash {
  padding: 14px 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.flash-success { background: #d4edda; color: #155724; border-bottom: 2px solid #28a745; }
.flash-error   { background: #f8d7da; color: #721c24; border-bottom: 2px solid #dc3545; }
.flash-info    { background: #d1ecf1; color: #0c5460; border-bottom: 2px solid #17a2b8; }
.flash-close   { background: none; border: none; cursor: pointer; font-size: 18px; }

/* ── Heritage Card ───────────────────────────────────────────── */
.card-heritage {
  background: var(--cream);
  border: 5px double var(--maroon);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}
.card-gold {
  background: var(--cream);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 24px;
}

/* Section title with decorative divider */
.section-title {
  text-align: center;
  color: var(--maroon);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  margin-bottom: 6px;
}
.section-sub {
  text-align: center;
  font-size: 16px;
  color: var(--text-muted);
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gold);
  margin-bottom: 24px;
}
.section-sub::before, .section-sub::after { content: ' ✦ '; color: var(--gold); }

/* ── Homepage Layout ─────────────────────────────────────────── */
.home-layout {
  max-width: 1280px;
  margin: 30px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;
}
.home-intro {
  max-width: 1280px;
  margin: 28px auto 0;
  padding: 20px 16px;
  text-align: center;
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.9;
}

/* Event cards */
.event-card {
  text-align: center;
  margin-bottom: 28px;
}
.event-card h4 { color: var(--maroon); font-size: 17px; margin-bottom: 4px; }
.event-card h5 { color: var(--text-muted); font-size: 14px; margin-bottom: 10px; }
.event-card img {
  width: 100%;
  border-radius: 12px;
  border: 3px solid var(--gold);
  object-fit: cover;
}

/* Birthday / Wish Scroll */
.wish-scroll {
  height: 220px;
  overflow: hidden;
  position: relative;
}
.wish-scroll:hover .scroll-inner { animation-play-state: paused; }
.scroll-inner {
  display: flex;
  flex-direction: column;
  animation: scrollWish 20s linear infinite;
}
@keyframes scrollWish {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.wish-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 2px solid var(--gold);
}
.wish-photo {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--maroon);
  flex-shrink: 0;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--maroon);
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font-body);
  background: #fffdf6;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(139,26,26,.12);
}
.btn {
  display: inline-block;
  padding: 11px 24px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dk); }
.btn-gold { background: var(--gold); color: var(--maroon); }
.btn-gold:hover { background: #b8912a; }
.btn-block { width: 100%; }

/* Phone prefix */
.phone-wrapper { display: flex; }
.phone-prefix {
  padding: 11px 14px;
  background: var(--gold-lt);
  border: 2px solid var(--gold);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-weight: 700;
  color: var(--maroon);
}
.phone-wrapper .form-control { border-radius: 0 8px 8px 0; }

/* ── Thank-you Popup ─────────────────────────────────────────── */
.popup-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  align-items: center; justify-content: center;
  z-index: 9999;
}
.popup-overlay.show { display: flex; }
.popup-box {
  background: var(--cream);
  padding: 36px;
  border-radius: 16px;
  border: 4px solid var(--gold);
  text-align: center;
  max-width: 400px;
  width: 90%;
}
.popup-box h3 { color: var(--maroon); font-size: 24px; margin-bottom: 12px; }

/* ── Gallery Grid ────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.gallery-item img {
  width: 100%; height: 200px;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid var(--gold);
  cursor: zoom-in;
  transition: transform .2s, box-shadow .2s;
}
.gallery-item img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* ── Lightbox ────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 10px; }
.lightbox-close {
  position: absolute; top: 20px; right: 28px;
  font-size: 40px; color: #fff; cursor: pointer;
  line-height: 1; background: none; border: none;
}

/* ── Member / Admin Panel Sidebar ────────────────────────────── */
.panel-layout {
  display: flex;
  min-height: calc(100vh - 200px);
}
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--maroon);
  padding: 24px 0;
}
.sidebar-logo {
  text-align: center;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.2);
  margin-bottom: 12px;
}
.sidebar-logo img { height: 56px; border-radius: 8px; margin: auto; }
.sidebar-logo span { display: block; color: #fff; font-size: 13px; margin-top: 6px; }
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  color: rgba(255,255,255,.85);
  font-size: 14px;
  font-weight: 600;
  transition: background .2s;
}
.sidebar a:hover, .sidebar a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.sidebar a i { width: 18px; text-align: center; }
.panel-main { flex: 1; padding: 28px; overflow: auto; }
.panel-card {
  background: var(--cream);
  border: 4px double var(--maroon);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.panel-card-header {
  background: var(--maroon);
  color: #fff;
  padding: 14px 20px;
  font-size: 17px;
  font-weight: 700;
}
.panel-card-body { padding: 24px; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th {
  background: var(--gold-lt);
  color: var(--maroon);
  padding: 10px 14px;
  font-weight: 700;
  text-align: left;
  border-bottom: 2px solid var(--gold);
}
table.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0e6d6;
}
table.data-table tr:hover td { background: #fdf7ee; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}
.pagination a {
  padding: 9px 16px;
  background: var(--maroon);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  transition: background .2s;
}
.pagination a.active { background: var(--gold); color: var(--maroon); }
.pagination a:hover { background: var(--maroon-dk); }

/* ── Family Tree (Interactive) ───────────────────────────────── */
#family-tree-container {
  width: 100%;
  height: 70vh;
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--cream);
  overflow: hidden;
  position: relative;
}
.tree-search {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.tree-search input { flex: 1; }

/* Member tooltip card */
.tree-tooltip {
  position: absolute;
  background: var(--cream);
  border: 3px solid var(--gold);
  border-radius: 12px;
  padding: 16px;
  min-width: 220px;
  box-shadow: var(--shadow);
  z-index: 50;
  display: none;
}
.tree-tooltip.show { display: block; }
.tree-tooltip img {
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--maroon);
  margin: 0 auto 8px;
}
.tree-tooltip h4 { color: var(--maroon); text-align: center; font-size: 15px; }
.tree-tooltip p  { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 4px; }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  background: #fff;
  border-top: 3px solid var(--saffron);
  padding: 18px 20px;
}
.footer-inner {
  max-width: 1280px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links { display: flex; gap: 10px; align-items: center; }
.footer-links a:hover { color: var(--maroon); }
.footer-dev a { color: var(--maroon); }

/* ── Utilities ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-wrap { padding: 16px; max-width: 1280px; margin: auto; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.page-content { max-width: 900px; margin: 32px auto; padding: 0 16px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
  .panel-layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 12px 0; }
}
@media (max-width: 768px) {
  nav { display: none; }
  .menu-btn { display: block; }
  .lang-toggle-desktop { display: none; }
  .lang-toggle-mobile { display: block; }
  .header-title { font-size: 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media print {
  header, footer, nav, .sidebar, .pagination, .no-print { display: none !important; }
  body { background: #fff; }
  .card-heritage, .panel-card { border: 1px solid #ccc; box-shadow: none; }
}
