:root {
  --ink: #221814;
  --muted: #6b625f;
  --paper: #fffaf3;
  --surface: #ffffff;
  --marigold: #f4a51c;
  --vermilion: #b93d2b;
  --leaf: #1f6f55;
  --teal: #236b73;
  --line: #eadcc8;
  --shadow: 0 18px 45px rgba(72, 44, 24, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans Kannada", "Plus Jakarta Sans", system-ui, sans-serif;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(255, 250, 243, 0.92);
  border-bottom: 1px solid rgba(185, 61, 43, 0.15);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  color: #fff;
  background: var(--vermilion);
  border: 3px solid var(--marigold);
  border-radius: 50%;
  font-family: "Noto Sans Kannada", sans-serif;
  font-weight: 800;
}

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

.brand strong {
  font-family: "Noto Sans Kannada", sans-serif;
  font-size: clamp(0.92rem, 1.8vw, 1.12rem);
  line-height: 1.25;
}

.brand small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  color: #463632;
  font-size: 0.92rem;
  font-weight: 700;
}

.nav a {
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: var(--vermilion);
}

.hero {
  position: relative;
  min-height: clamp(610px, 88vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-slides,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 1200ms ease;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(34, 24, 20, 0.04) 0%, rgba(34, 24, 20, 0.04) 48%, rgba(34, 24, 20, 0.72) 100%);
}

.hero-content {
  position: relative;
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
  padding: 0 0 clamp(14px, 2.8vh, 24px);
  color: #fff;
}

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

.hero .eyebrow {
  color: #ffcf6b;
  font-family: "Noto Sans Kannada", sans-serif;
  text-transform: none;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 3.2vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 700px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  margin-bottom: 14px;
}

.hero-actions,
.section-heading,
.seva-layout,
.contact-grid,
.intro-grid,
.portal-shell,
footer {
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--vermilion);
  box-shadow: 0 10px 24px rgba(185, 61, 43, 0.24);
}

.button.secondary,
.button.compact {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.45);
}

.button.compact {
  min-height: 40px;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

section {
  padding: clamp(64px, 10vw, 112px) 0;
}

.band {
  background:
    linear-gradient(180deg, rgba(244, 165, 28, 0.08), rgba(31, 111, 85, 0.06)),
    #fffdf8;
  border-block: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 32px;
}

.section-heading h2 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
}

.intro-grid,
.seva-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  gap: clamp(24px, 5vw, 62px);
  align-items: start;
}

.intro-grid > p,
.seva-layout p {
  color: #4f4440;
  font-size: 1.08rem;
}

.intro-grid {
  display: block;
}

.intro-grid > p {
  max-width: 780px;
}

.login-panel,
.dashboard,
.contact-grid > div,
.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.events {
  background: #fffaf3;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.event-card {
  min-height: 220px;
  padding: 24px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.event-card:hover,
.event-card:focus-visible {
  border-color: rgba(185, 61, 43, 0.45);
  box-shadow: 0 22px 50px rgba(72, 44, 24, 0.18);
  outline: none;
  transform: translateY(-3px);
}

.event-card span {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--teal);
  font-weight: 900;
}

.event-card h3 {
  margin-bottom: 10px;
  font-size: 1.24rem;
}

.event-card p,
.contact-grid p {
  color: var(--muted);
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
}

.gallery-modal.is-open {
  display: grid;
}

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 24, 20, 0.72);
  backdrop-filter: blur(10px);
}

.gallery-dialog {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(86vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto;
  overflow: hidden;
  background: #fffaf3;
  border: 1px solid rgba(234, 220, 200, 0.75);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.gallery-header,
.gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.gallery-header {
  border-bottom: 1px solid var(--line);
}

.gallery-header h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  line-height: 1.15;
}

.gallery-icon-button,
.gallery-nav {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.gallery-icon-button {
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
}

.gallery-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  background: #1d1512;
}

.gallery-stage img {
  width: 100%;
  height: min(66vh, 640px);
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 56px;
  color: #fff;
  background: rgba(34, 24, 20, 0.58);
  border-color: rgba(255, 255, 255, 0.28);
  font-size: 2.2rem;
  transform: translateY(-50%);
}

.gallery-nav.previous {
  left: 14px;
}

.gallery-nav.next {
  right: 14px;
}

.gallery-nav:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.gallery-empty {
  display: grid;
  gap: 8px;
  width: min(520px, calc(100% - 36px));
  padding: 26px;
  color: #fff;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.gallery-empty strong {
  font-size: 1.2rem;
}

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

.gallery-footer {
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 800;
}

.donation-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  place-items: center;
  padding: 18px;
}

.donation-modal.is-open {
  display: grid;
}

.donation-dialog {
  position: relative;
  width: min(840px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  background: #fffaf3;
  border: 1px solid rgba(234, 220, 200, 0.85);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.donation-form {
  padding: 18px;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d8c8b4;
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

.payment-prompt {
  margin-top: 16px;
  padding: 16px;
  color: #4f403a;
  background: #fff3d8;
  border: 1px solid #f1d39a;
  border-radius: 8px;
}

.payment-prompt strong {
  display: block;
  margin-bottom: 6px;
  color: var(--vermilion);
}

.payment-prompt p {
  margin-bottom: 0;
}

.donation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.button.secondary.dark {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.upload-panel {
  padding: 18px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-copy {
  margin-bottom: 18px;
}

.upload-copy h3 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.upload-copy p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.upload-preview figure {
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.upload-preview figcaption {
  padding: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-history {
  margin-top: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-history h3 {
  margin-bottom: 12px;
}

.empty-note {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.seva-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.seva-list li {
  background: #fff;
  border-left: 5px solid var(--marigold);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(72, 44, 24, 0.08);
}

.seva-list button {
  width: 100%;
  min-height: 70px;
  padding: 15px 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.seva-list li:hover,
.seva-list li:focus-within {
  box-shadow: 0 16px 34px rgba(72, 44, 24, 0.14);
}

.seva-list button:focus-visible {
  outline: 3px solid rgba(185, 61, 43, 0.28);
  outline-offset: 3px;
}

.portal-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.portal-page {
  min-height: calc(100vh - 76px);
  padding-top: clamp(52px, 8vw, 86px);
}

.portal-page h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
}

.portal-shell.is-logged-in {
  grid-template-columns: minmax(0, 1fr);
}

.login-panel,
.dashboard {
  min-width: 0;
  padding: 22px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #574b47;
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d8c8b4;
  border-radius: 6px;
  font: inherit;
}

.login-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--vermilion);
  font-weight: 700;
}

.portal-config-message {
  margin-bottom: 16px;
  padding: 14px;
  background: #fff5dc;
  border: 1px solid #e8c87c;
  border-radius: 8px;
}

.portal-config-message h2 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.portal-config-message p,
.portal-user {
  margin-bottom: 0;
  color: var(--muted);
}

.dashboard-top,
.dashboard-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-top h2,
.dashboard-top h3 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  line-height: 1.25;
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  background: #fbf5eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.portal-tab {
  min-height: 42px;
  padding: 0 16px;
  color: #5f544f;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.portal-tab.is-active {
  color: #fff;
  background: var(--vermilion);
  box-shadow: 0 8px 20px rgba(185, 61, 43, 0.2);
}

.portal-panel[hidden] {
  display: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-width: 0;
  padding: 14px;
  background: #fbf5eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--leaf);
  font-size: clamp(1.22rem, 2.2vw, 1.65rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.dashboard-tools label {
  flex: 1;
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: normal;
  overflow-wrap: anywhere;
}

th {
  color: #594b45;
  background: #fbf5eb;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-size: 0.92rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.income {
  color: #0d5d43;
  background: #dff4ea;
}

.pill.expense {
  color: #8a2d20;
  background: #ffe1da;
}

.event-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.summary-card {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

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

.contact-grid > div {
  padding: 22px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
}

footer a {
  color: var(--vermilion);
  font-weight: 800;
}

@media (min-width: 1180px) {
  .hero-content {
    width: min(1120px, calc(100% - 36px));
  }

  h1 {
    max-width: 760px;
    font-size: clamp(2.3rem, 3vw, 3.35rem);
  }
}

@media (max-width: 940px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    min-height: 720px;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(34, 24, 20, 0.05) 0%, rgba(34, 24, 20, 0.08) 42%, rgba(34, 24, 20, 0.78) 100%);
  }

  .intro-grid,
  .seva-layout,
  .portal-shell,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .brand {
    min-width: 0;
  }

  .hero {
    min-height: 660px;
  }

  .hero-content {
    width: min(100% - 36px, 580px);
    margin-inline: auto;
    padding-bottom: 18px;
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.55rem);
  }

  .event-grid,
  .metric-grid,
  .event-summary {
    grid-template-columns: 1fr;
  }

  .portal-shell,
  .portal-shell.is-logged-in {
    width: min(100% - 24px, 520px);
  }

  .dashboard {
    padding: 16px;
  }

  .metric strong {
    font-size: clamp(1.5rem, 9vw, 2rem);
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 0.82rem;
  }

  th:nth-child(3),
  td:nth-child(3),
  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(6),
  td:nth-child(6) {
    display: none;
  }

  .dashboard-top,
  .dashboard-tools,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .donation-actions .button {
    width: 100%;
  }
}
