:root {
  --red: #b70f14;
  --deep-red: #85090c;
  --maroon: #66130e;
  --saffron: #f28c00;
  --yellow: #ffd15c;
  --cream: #fff8ec;
  --card: #fffdf8;
  --gold: #d9a43a;
  --line: #ecd4a1;
  --ink: #261d1a;
  --muted: #6d5c52;
  --shadow: 0 16px 42px rgba(118, 42, 12, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 5%, rgba(242, 140, 0, 0.16), transparent 22rem),
    radial-gradient(circle at 90% 28%, rgba(217, 164, 58, 0.16), transparent 25rem),
    #fffdfa;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
span,
small,
strong {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  letter-spacing: 0;
}

.wrap {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
}

.main-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(217, 164, 58, 0.35);
  box-shadow: 0 10px 30px rgba(91, 34, 13, 0.08);
  backdrop-filter: blur(12px);
}

.nav-inner {
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

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

.brand-mark {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 3px solid #ffcc52;
  border-radius: 50%;
  color: var(--red);
  background:
    radial-gradient(circle at center, #fff 0 42%, transparent 43%),
    conic-gradient(from 10deg, #ffcf4f, #f36f0a, #e11d22, #ffcf4f, #f36f0a, #ffcf4f);
  box-shadow: 0 9px 20px rgba(183, 15, 20, 0.2);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.brand-name {
  display: grid;
  gap: 3px;
  text-transform: uppercase;
}

.brand-name strong {
  color: var(--red);
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(1.15rem, 2.05vw, 1.68rem);
  line-height: 1.05;
}

.brand-name small {
  color: var(--maroon);
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(0.94rem, 1.55vw, 1.22rem);
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.93rem;
  font-weight: 800;
  color: #302726;
}

.nav-links a {
  position: relative;
  padding: 14px 0;
}

.nav-links a::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: transparent;
}

.nav-links a:hover,
.nav-links a:first-child {
  color: var(--red);
}

.nav-links a:hover::after,
.nav-links a:first-child::after {
  background: var(--red);
}

.nav-toggle {
  display: none;
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8e6;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--red);
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.97), rgba(255, 243, 218, 0.96)),
    repeating-radial-gradient(circle at 6% 20%, transparent 0 18px, rgba(217, 164, 58, 0.22) 19px 20px);
}

.hero::after {
  position: absolute;
  right: -110px;
  bottom: -80px;
  width: 470px;
  height: 190px;
  content: "";
  border-top: 14px solid var(--yellow);
  border-radius: 70% 0 0 0;
  background: linear-gradient(135deg, rgba(183, 15, 20, 0.95), rgba(133, 9, 12, 0.98));
}

.hero-inner {
  position: relative;
  z-index: 1;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 36px;
  padding: 44px 0;
}

.hero-copy {
  max-width: 820px;
}

.blessing {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  color: var(--saffron);
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(1.35rem, 2.5vw, 2.1rem);
  font-weight: 800;
}

.blessing::before,
.blessing::after {
  width: 74px;
  height: 1px;
  content: "";
  background: var(--gold);
}

h1 {
  max-width: 830px;
  color: #2b2727;
  font-size: clamp(2.35rem, 5vw, 4.1rem);
  line-height: 1.08;
}

.subtitle {
  max-width: 660px;
  margin: 18px 0 0;
  color: #514842;
  font-size: 1.04rem;
  line-height: 1.75;
}

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

.hero-actions {
  margin-top: 28px;
}

.btn,
.ghost-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.btn {
  border: 1px solid transparent;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--deep-red));
  box-shadow: 0 13px 24px rgba(183, 15, 20, 0.22);
}

.btn.secondary,
.ghost-btn {
  color: var(--maroon);
  background: #fffdf8;
  border: 1px solid var(--gold);
}

.hero-panel {
  min-height: 190px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 26px;
  border: 1px solid #e8c983;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 225, 0.96)),
    repeating-radial-gradient(circle at top right, transparent 0 13px, rgba(217, 164, 58, 0.18) 14px 15px);
  box-shadow: var(--shadow);
}

.panel-label {
  margin: 0;
  color: var(--saffron);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-panel strong {
  color: var(--red);
  font-size: 2.25rem;
}

.welcome-section,
.events-section,
.members-section,
.media-section,
.contact-section,
.admin-section {
  padding: 34px 0;
}

.welcome-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 30px;
  padding: 18px;
  border: 1px solid #e6c98f;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 16px 36px rgba(79, 34, 8, 0.09);
}

.welcome-image {
  min-height: 238px;
  border-radius: 9px;
  background:
    linear-gradient(0deg, rgba(55, 16, 8, 0.12), rgba(55, 16, 8, 0.04)),
    url("assets/sabha-hero-bg.png") center / cover;
}

.welcome-image.empty {
  display: none;
}

.welcome-card:has(.welcome-image.empty) {
  grid-template-columns: 1fr;
}

.welcome-copy {
  align-self: center;
}

.welcome-copy h2,
.section-title h2,
.admin-lock h2 {
  color: var(--red);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.12;
}

.welcome-copy h2::after,
.section-title span {
  display: block;
  width: 96px;
  height: 2px;
  margin-top: 9px;
  content: "";
  background: linear-gradient(90deg, var(--gold), transparent);
}

.welcome-copy p,
.admin-lock p {
  color: #493f3a;
  font-size: 1rem;
  line-height: 1.78;
}

.section-title {
  margin-bottom: 22px;
}

.section-title.centered {
  text-align: center;
}

.section-title.centered span {
  margin-inline: auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.events-grid,
.member-grid,
.media-grid {
  display: grid;
  gap: 22px;
}

.events-grid {
  grid-template-columns: repeat(3, 1fr);
}

.event-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  border: 1px solid #ead8b5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(87, 45, 12, 0.1);
}

.event-date {
  min-height: 100px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 10px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, var(--red), var(--saffron));
  text-align: center;
}

.event-date strong {
  display: block;
  font-size: 2.15rem;
  line-height: 1;
}

.event-date span {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 900;
  text-transform: uppercase;
}

.event-card h3 {
  color: var(--red);
  font-size: 1.22rem;
}

.event-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.event-card time {
  display: inline-flex;
  margin-top: 12px;
  padding: 7px 10px;
  border: 1px solid #ecc77d;
  border-radius: 6px;
  color: #594327;
  background: #fff1c7;
  font-size: 0.88rem;
  font-weight: 800;
}

.member-grid {
  grid-template-columns: repeat(4, 1fr);
}

.media-grid {
  grid-template-columns: repeat(3, 1fr);
}

.media-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid #ead8b5;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #fff, #fffaf0),
    repeating-radial-gradient(circle at top right, transparent 0 13px, rgba(217, 164, 58, 0.16) 14px 15px);
  box-shadow: 0 14px 34px rgba(87, 45, 12, 0.1);
}

.media-card h3 {
  color: var(--red);
  font-size: 1.2rem;
}

.media-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.media-card time {
  color: #5c4939;
  font-weight: 900;
}

.pdf-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 9px 12px;
  border: 1px solid #ecc77d;
  border-radius: 8px;
  color: var(--maroon);
  background: #fff1c7;
  font-weight: 900;
}

.member-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e9d4ab;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 13px 30px rgba(92, 42, 11, 0.09);
}

.member-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #ddd0b8;
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 35%, #c7c7c7 0 15%, transparent 16%),
    radial-gradient(circle at 50% 86%, #cfcfcf 0 40%, transparent 41%),
    #f4f4f4;
}

.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-card h3 {
  margin-top: 14px;
  color: var(--red);
  font-size: 1.08rem;
}

.member-card p {
  margin: 6px 0 0;
  color: #5d554f;
  line-height: 1.55;
}

.member-phone {
  display: inline-flex;
  margin-top: 10px;
  color: var(--maroon);
  font-weight: 900;
}

.admin-card {
  border: 1px solid #e6c98f;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.admin-section {
  display: none;
}

.admin-section.visible {
  display: block;
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1fr);
  gap: 30px;
  align-items: start;
  padding: 24px;
  border: 1px solid #e6c98f;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #fffdf8, #fff4d8),
    repeating-radial-gradient(circle at right top, transparent 0 13px, rgba(217, 164, 58, 0.16) 14px 15px);
  box-shadow: var(--shadow);
}

.contact-card h2 {
  color: var(--red);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.contact-card p {
  color: var(--muted);
  line-height: 1.7;
}

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

.contact-form label {
  display: grid;
  gap: 7px;
  color: #4f413a;
  font-weight: 800;
}

.admin-lock,
.admin-panel {
  padding: 24px;
}

.admin-lock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.5fr);
  gap: 24px;
  align-items: center;
}

.pin-form,
.admin-form {
  display: grid;
  gap: 14px;
}

.pin-form label,
.admin-form label {
  display: grid;
  gap: 7px;
  color: #4f413a;
  font-weight: 800;
}

.pin-form div {
  display: flex;
  gap: 10px;
}

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

textarea {
  resize: vertical;
}

.admin-panel[hidden],
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 22px;
}

.tab {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #e2c58a;
  border-radius: 999px;
  color: var(--maroon);
  background: #fff8e7;
  font-weight: 900;
  cursor: pointer;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--deep-red));
  border-color: var(--red);
}

.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.full {
  grid-column: 1 / -1;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid #ead8b5;
  border-radius: 8px;
  background: #fff;
}

.admin-row strong,
.admin-row small {
  display: block;
}

.admin-row small {
  margin-top: 4px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #e0c188;
  border-radius: 7px;
  background: #fff8e7;
  color: var(--maroon);
  font-weight: 800;
  cursor: pointer;
}

.row-actions button:last-child {
  color: var(--red);
}

.site-footer {
  border-top: 1px solid #dcb976;
  background: #fff8e7;
}

.footer-compact {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--maroon);
}

.footer-compact strong {
  font-family: Cinzel, Georgia, serif;
}

.footer-compact a {
  color: var(--red);
  font-weight: 900;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed #dcb976;
  border-radius: 10px;
  color: var(--muted);
  background: #fffdf8;
  text-align: center;
}

@media (max-width: 1050px) {
  .events-grid,
  .media-grid,
  .member-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    gap: 15px;
  }
}

@media (max-width: 900px) {
  .nav-inner {
    min-height: 82px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 22px;
    right: 22px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .nav-links a {
    padding: 13px 14px;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  .hero-inner,
  .welcome-card,
  .contact-card,
  .admin-lock {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    width: min(100%, 360px);
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(100% - 24px, 1180px);
  }

  .brand {
    gap: 11px;
  }

  .brand-name strong {
    font-size: 0.98rem;
  }

  .brand-name small {
    font-size: 0.82rem;
  }

  .hero-inner {
    min-height: 0;
    padding: 34px 0;
  }

  .hero::after {
    width: 340px;
    height: 132px;
    right: -160px;
  }

  .blessing::before,
  .blessing::after {
    width: 38px;
  }

  .hero-actions,
  .btn,
  .pin-form div {
    width: 100%;
  }

  .pin-form div,
  .footer-compact,
  .section-row,
  .admin-row {
    align-items: stretch;
    flex-direction: column;
  }

  .events-grid,
  .media-grid,
  .member-grid,
  .contact-form,
  .two-col {
    grid-template-columns: 1fr;
  }

  .event-card {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .event-date strong {
    font-size: 1.8rem;
  }

  .welcome-image {
    min-height: 210px;
  }
}
