/* ============================================================
   DVKSM — modern responsive theme
   Font: Anek Gujarati (Google Fonts) for Gujarati + Latin text
   Colors: matched to the shared design-system palette
   ============================================================ */

:root {
  --bg-page: #ebebeb;
  --bg-subtle: #f5f5f5;
  --surface: #ffffff;
  --surface-border: #e2e8f0;
  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-soft: #64748b;
  --accent: #ff5500;
  --accent-hover: #cc4400;
  --accent-soft: #ff9662;
  --accent-soft-bg: #fff1e6;
  --focus: #ff5500;
  --font: 'Anek Gujarati', Roboto, 'Noto Sans Gujarati', system-ui, 'Segoe UI', Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 40px rgba(15, 23, 42, 0.16);
  --radius: 0.875rem;
  --radius-sm: 0.5rem;
  --container-w: 1140px;
  --header-h: 84px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.site-header__bar {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.brand__logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.brand__title {
  font-size: clamp(15px, 2.6vw, 21px);
  font-weight: 700;
  color: var(--accent-hover);
  line-height: 1.3;
  white-space: normal;
}

.brand__subtitle {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.nav-toggle {
  display: none;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------------- Nav ---------------- */

.site-nav {
  background: var(--accent);
}

.site-nav__list {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 12px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

.site-nav__list > li {
  position: relative;
}

.site-nav__list > li > a {
  display: block;
  padding: 13px 18px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

.site-nav__list > li > a:hover,
.site-nav__list > li.is-active > a {
  background: var(--accent-hover);
  color: #ffffff;
}

.site-nav__list .has-sub > a::after {
  content: '▾';
  font-size: 11px;
  margin-left: 6px;
  opacity: 0.8;
}

.site-nav__sub {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 240px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 50;
}

.site-nav__list .has-sub:hover > .site-nav__sub,
.site-nav__list .has-sub.is-open > .site-nav__sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-nav__sub a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 500;
  font-size: 14.5px;
}

.site-nav__sub a:hover { background: var(--accent-soft-bg); color: var(--accent); }

/* ---------------- Hero / Carousel (home) ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  height: min(56vw, 460px);
  min-height: 220px;
  background: var(--ink);
}

.hero__track { position: absolute; inset: 0; }

.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero__slide.is-active { opacity: 1; }

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.15) 0%, rgba(15,23,42,.6) 100%);
}

.hero__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.85);
  color: var(--accent-hover);
  font-size: 18px;
  cursor: pointer;
  z-index: 5;
}
.hero__nav--prev { left: 14px; }
.hero__nav--next { right: 14px; }
.hero__nav:hover { background: #fff; }

/* ---------------- Page hero (non-home) ---------------- */

.page-title {
  background: #e5e5e5;
  color: var(--accent);
  padding: 34px 0;
  text-align: center;
}

.page-title h1 {
  margin: 0;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
}

/* ---------------- Main content ---------------- */

main { display: block; }

.section { padding: 44px 0; }
.section--alt { background: var(--bg-subtle); }

.prose {
  max-width: 880px;
  margin: 0 auto;
  text-align: justify;
}

.prose p { margin: 0 0 20px; }
.prose p:last-child { margin-bottom: 0; }

/* Feature rows: image + paragraph pairs, alternating */

.feature {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 36px;
}

.feature:last-child { margin-bottom: 0; }

.feature--reverse { flex-direction: row-reverse; }

.feature__media {
  flex: 0 0 200px;
  width: 200px;
}

.feature__media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.feature__text { flex: 1; text-align: justify; }
.feature__text p { margin: 0; }

/* Document image pages (samajhistory / foundermember) */

.doc-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.doc-card img { border-radius: var(--radius-sm); width: 100%; height: auto; }

/* Table (marriage lists) */

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  padding: 4px;
}

table.list-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
}

table.list-table th,
table.list-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-border);
  text-align: left;
  vertical-align: top;
  font-size: 15.5px;
}

table.list-table thead th {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  position: sticky;
  top: 0;
}

table.list-table tbody tr:nth-child(even) { background: var(--bg-subtle); }
table.list-table tbody tr:hover { background: var(--accent-soft-bg); }
table.list-table td:first-child { font-weight: 700; color: var(--accent); width: 56px; }

/* Gallery grid */

.gallery-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.gallery-menu a {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
}

.gallery-menu a.is-active,
.gallery-menu a:hover {
  background: var(--accent);
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.gallery-grid a {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 1 / 1;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.gallery-grid a:hover img { transform: scale(1.08); }

/* Contact page */

.contact-grid {
  display: flex;
  gap: 32px;
  align-items: stretch;
  flex-wrap: wrap;
}

.contact-card {
  flex: 1 1 320px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px 30px;
}

.contact-card h2 { margin-top: 0; color: var(--accent-hover); font-size: 20px; }
.contact-card p { margin: 0 0 6px; }

.social-card h2 { margin-bottom: 18px; }

.social-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  transition: background .15s ease, transform .15s ease;
}

.social-links a:hover {
  background: var(--accent-soft-bg);
  transform: translateY(-2px);
}

.social-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icon svg { width: 20px; height: 20px; }

.social-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--ink);
}

.social-text strong { font-size: 14.5px; font-weight: 700; }
.social-text small {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 50%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 28px;
}

.map-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Motto list */

.motto-list { list-style: none; margin: 0 auto; padding: 0; max-width: 780px; }

.motto-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 22px;
  margin-bottom: 14px;
  font-weight: 500;
}

.motto-list li img { width: 30px; height: 30px; flex-shrink: 0; margin-top: 2px; }

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--accent-hover);
  color: rgba(255, 255, 255, 0.85);
  padding: 38px 0 28px;
  margin-top: 20px;
  text-align: center;
}

.site-footer p { margin: 0 0 6px; font-size: 14px; line-height: 1.7; }
.site-footer .footer-copy { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: #fff; }
.site-footer .footer-legal { opacity: 0.85; font-size: 13px; }

/* ---------------- Responsive ---------------- */

@media (max-width: 860px) {
  .feature, .feature--reverse { flex-direction: column; align-items: center; }
  .feature__media { flex: none; width: 220px; }
  .feature__text { text-align: justify; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  .site-nav.is-open { display: block; }

  .site-nav__list { flex-direction: column; padding: 8px; }
  .site-nav__list > li > a { padding: 14px 12px; }

  .site-nav__sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(0,0,0,0.15);
    display: none;
    min-width: 0;
    border-radius: 0;
  }

  .site-nav__list .has-sub.is-open > .site-nav__sub { display: block; }
  .site-nav__list .has-sub > a::after { float: right; }

  .contact-grid { flex-direction: column; }
}

@media (max-width: 480px) {
  .brand__logo { width: 44px; height: 44px; }
  .section { padding: 30px 0; }
}
