:root {
  --ink: #201814;
  --muted: #6b625d;
  --line: #e8ded2;
  --paper: #fffaf2;
  --soft: #f6efe4;
  --saffron: #c96f24;
  --ruby: #9d2836;
  --leaf: #2d6a4f;
  --shadow: 0 18px 50px rgba(72, 42, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: #fff;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(32, 24, 20, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  opacity: 0.78;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 700;
}

.site-nav a {
  text-decoration: none;
}

.nav-admin {
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  padding: 9px 14px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: #fff;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: end;
  padding: 130px clamp(22px, 6vw, 88px) 82px;
  color: #fff;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(29, 18, 12, 0.82), rgba(29, 18, 12, 0.32)),
    url("https://images.unsplash.com/photo-1606298855672-3efb63017be8?auto=format&fit=crop&w=1800&q=82") center/cover;
  transform: scale(1.02);
}

.hero-content {
  position: relative;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--saffron);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffcf88;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-family: "Noto Serif Malayalam", Georgia, serif;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

h3 {
  margin-bottom: 10px;
}

.hero p {
  max-width: 620px;
  font-size: 1.2rem;
  line-height: 1.7;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--saffron);
  color: #fff;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.button.secondary {
  background: #efe3d4;
  color: var(--ink);
}

.button.danger {
  background: #b4232f;
  color: #fff;
}

.section {
  padding: 82px clamp(22px, 6vw, 88px);
}

.section.muted {
  background: var(--soft);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 34px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 48px;
  align-items: center;
}

.about-grid p,
.contact-section p,
.history-section .section-heading p,
.schedule-section .section-heading p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.info-panel,
.contact-card {
  display: grid;
  gap: 18px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.info-panel div {
  display: grid;
  gap: 5px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.info-panel div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-panel span {
  color: var(--muted);
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 34px;
  align-items: start;
}

.timeline {
  display: grid;
  gap: 18px;
  position: relative;
}

.timeline article {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 24px 24px 24px 88px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.timeline article::before {
  content: "";
  position: absolute;
  left: 42px;
  top: 32px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ruby);
  box-shadow: 0 0 0 7px #f5d6c4;
}

.timeline span {
  position: absolute;
  left: 18px;
  top: 60px;
  color: var(--saffron);
  font-weight: 800;
}

.timeline h3,
.timeline p,
.legacy-panel h3 {
  margin: 0;
}

.timeline p,
.legacy-panel li {
  color: var(--muted);
  line-height: 1.65;
}

.legacy-panel {
  position: sticky;
  top: 96px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.legacy-panel ul {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding-left: 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-item {
  position: relative;
  min-height: 310px;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #ddd;
}

.gallery-item img {
  height: 100%;
  min-height: 310px;
  object-fit: cover;
  transition: transform 250ms ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 4px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.74));
}

.gallery-item span,
.video-card p,
.pooja-card p,
.event-card p {
  color: var(--muted);
  line-height: 1.65;
}

.gallery-item span {
  color: rgba(255, 255, 255, 0.78);
}

.video-grid,
.pooja-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.video-card,
.pooja-card,
.event-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-card {
  padding-bottom: 22px;
}

.video-card h3,
.video-card p {
  padding: 0 22px;
}

.video-frame {
  aspect-ratio: 16 / 9;
  margin-bottom: 20px;
  background: #111;
}

.video-frame iframe,
.video-placeholder {
  width: 100%;
  height: 100%;
}

.video-frame iframe {
  border: 0;
}

.video-placeholder {
  display: grid;
  place-items: center;
  padding: 24px;
  color: #f9e8ce;
  text-align: center;
  font-weight: 800;
  background: linear-gradient(135deg, #321e17, #8d2633);
}

.pooja-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.pooja-card span {
  align-self: flex-start;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f3dbc2;
  color: #783e14;
  font-size: 0.78rem;
  font-weight: 800;
}

.pooja-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pooja-card a {
  color: var(--ruby);
  font-weight: 800;
  text-decoration: none;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.schedule-card {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.schedule-card h3 {
  margin-bottom: 18px;
}

.schedule-card dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.schedule-card dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.schedule-card dl div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.schedule-card dt {
  color: var(--muted);
  font-weight: 700;
}

.schedule-card dd {
  margin: 0;
  color: var(--ruby);
  font-weight: 800;
  white-space: nowrap;
}

.event-list {
  display: grid;
  gap: 18px;
}

.event-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 26px;
  padding: 18px;
  align-items: center;
}

.event-card img {
  height: 170px;
  object-fit: cover;
  border-radius: 6px;
}

.event-date {
  margin-bottom: 8px;
  color: var(--ruby);
  font-weight: 800;
}

.event-card span {
  color: var(--leaf);
  font-weight: 800;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 46px;
  align-items: center;
}

.contact-card a,
.contact-card span {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(22px, 6vw, 88px);
  color: #fff;
  background: #201814;
}

.site-footer a {
  color: #ffcf88;
  text-decoration: none;
}

.admin-body {
  min-height: 100vh;
  background: #f5efe6;
}

.login-panel,
.admin-shell,
.admin-topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.login-panel {
  display: grid;
  gap: 18px;
  max-width: 460px;
  padding: 54px 0;
}

.back-link {
  color: var(--ruby);
  font-weight: 800;
  text-decoration: none;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 34px 0 22px;
}

.admin-topbar h1 {
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
}

.admin-topbar nav {
  display: flex;
  gap: 12px;
}

.admin-topbar a {
  padding: 10px 13px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.admin-shell {
  padding-bottom: 60px;
}

.alert {
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 800;
}

.alert.success {
  background: #dff3e8;
  color: #165f3b;
}

.alert.error {
  background: #ffe1e5;
  color: #8e1723;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.admin-tabs button.is-active {
  background: var(--ruby);
  color: #fff;
}

.admin-section {
  display: none;
}

.admin-section.is-active {
  display: grid;
  gap: 20px;
}

.admin-section-heading,
.admin-form,
.admin-list {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.admin-form textarea,
.admin-form input {
  width: 100%;
  border: 1px solid #d9c9b8;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
}

.admin-form textarea,
.form-actions {
  grid-column: 1 / -1;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.admin-record div:first-child {
  display: grid;
  gap: 4px;
}

.admin-record span {
  color: var(--muted);
}

.record-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.record-actions form {
  margin: 0;
}

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

  .site-nav {
    position: absolute;
    top: 74px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    background: rgba(32, 24, 20, 0.98);
    border-radius: 8px;
  }

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

  .about-grid,
  .contact-section,
  .history-layout,
  .event-card {
    grid-template-columns: 1fr;
  }

  .gallery-grid,
  .video-grid,
  .pooja-grid,
  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legacy-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 86vh;
    padding-bottom: 54px;
  }

  .section {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .gallery-grid,
  .video-grid,
  .pooja-grid,
  .schedule-grid,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .timeline article {
    padding-left: 24px;
  }

  .timeline article::before,
  .timeline span {
    position: static;
  }

  .admin-topbar,
  .admin-record,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
