:root {
  color-scheme: light;
  --bg: #f4efe4;
  --bg-strong: #efe6d2;
  --ink: #17211b;
  --muted: #5f6e65;
  --line: rgba(23, 33, 27, 0.12);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --primary: #0f3d2e;
  --primary-2: #145c43;
  --accent: #d6b56d;
  --accent-soft: rgba(214, 181, 109, 0.18);
  --success: #237a56;
  --warning: #8d6424;
  --danger: #a33f3f;
  --radius: 22px;
  --radius-sm: 16px;
  --shadow: 0 18px 50px rgba(15, 61, 46, 0.12);
  --max: 1180px;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07130f;
  --bg-strong: #0b1f18;
  --ink: #f4efe4;
  --muted: #b7c4bd;
  --line: rgba(244, 239, 228, 0.12);
  --surface: rgba(15, 61, 46, 0.62);
  --surface-strong: rgba(15, 61, 46, 0.86);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top right, rgba(214, 181, 109, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(20, 92, 67, 0.06), transparent 32%),
    var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 "Manrope", "Inter", system-ui, sans-serif;
}

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

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  overflow-x: hidden;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.page-shell::before {
  background:
    radial-gradient(circle at 12% 16%, rgba(20, 92, 67, 0.08), transparent 24%),
    radial-gradient(circle at 82% 9%, rgba(214, 181, 109, 0.16), transparent 26%);
}

.page-shell::after {
  opacity: 0.07;
  background-image:
    linear-gradient(45deg, transparent 0, transparent 40%, rgba(15, 61, 46, 0.2) 40%, rgba(15, 61, 46, 0.2) 42%, transparent 42%),
    linear-gradient(-45deg, transparent 0, transparent 40%, rgba(15, 61, 46, 0.2) 40%, rgba(15, 61, 46, 0.2) 42%, transparent 42%);
  background-size: 180px 180px;
}

.container {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
}

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

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 239, 228, 0.9));
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  color: var(--primary);
  font: 700 15px/1 "Noto Serif", serif;
  overflow: hidden;
  border: 1px solid rgba(15, 61, 46, 0.08);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.brand-mark-fallback {
  font: 700 18px/1 "Noto Serif", serif;
}

.brand-copy strong,
.section-title,
.hero-title,
.card-title,
.timeline-title,
.story-title,
.detail-title {
  font-family: "Noto Serif", "Playfair Display", serif;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1.1rem;
}

.brand-copy span {
  font-size: 0.88rem;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  transition: color 160ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--primary-2);
}

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

.menu-toggle,
.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

.menu-toggle {
  display: none;
}

.hero {
  padding: 54px 0 18px;
}

.hero-panel {
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 34px;
  background:
    linear-gradient(140deg, rgba(15, 61, 46, 0.9), rgba(20, 92, 67, 0.76)),
    url("https://blog.welcomedagestan.ru/wp-content/uploads/2018/05/608_20110912.jpg") center/cover;
  background-blend-mode: soft-light;
  color: #fff;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 19, 15, 0.18), rgba(7, 19, 15, 0.44)),
    radial-gradient(circle at top left, rgba(214, 181, 109, 0.18), transparent 28%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.9rem);
  line-height: 0.96;
  max-width: 10ch;
}

.hero-subtitle {
  margin: 16px 0 18px;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: rgba(255, 255, 255, 0.84);
}

.hero-lead,
.lede {
  margin: 0;
  font-size: 1.02rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 62ch;
}

.hero-actions,
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #f1dca5);
  color: var(--primary);
  box-shadow: 0 16px 30px rgba(214, 181, 109, 0.18);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--line);
}

.hero-meta,
.meta-list,
.fact-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.hero-meta li,
.meta-list li,
.fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.hero-side {
  display: grid;
  gap: 16px;
}

.prayer-card,
.card,
.story-card,
.stat-card,
.detail-card,
.form-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.prayer-card {
  padding: 22px;
  color: var(--ink);
}

.prayer-card .eyebrow {
  color: var(--primary-2);
}

.prayer-timing {
  display: grid;
  gap: 10px;
}

.next-prayer {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary);
}

.countdown {
  font-size: 0.98rem;
  color: var(--muted);
}

.chip-row,
.status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 0.88rem;
  border: 1px solid rgba(214, 181, 109, 0.3);
}

.status-chip[data-status="needs_verification"] {
  background: rgba(141, 100, 36, 0.12);
  color: var(--warning);
}

.status-chip[data-status="confirmed"] {
  background: rgba(35, 122, 86, 0.12);
  color: var(--success);
}

.status-chip[data-status="community_submitted"] {
  background: rgba(20, 92, 67, 0.12);
  color: var(--primary-2);
}

.section {
  padding: 28px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  line-height: 1.05;
}

.section-text,
.small-note,
.source-note,
.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.cards-grid > * {
  grid-column: span 4;
}

.card {
  padding: 20px;
}

.card-media {
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--bg-strong);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.card p,
.story-card p,
.detail-card p {
  margin: 0 0 12px;
}

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

.timeline::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  padding-left: 42px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 11px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid rgba(214, 181, 109, 0.22);
}

.timeline-card {
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.timeline-period {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--primary-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-title {
  margin: 0 0 8px;
  font-size: 1.16rem;
}

.split-hero,
.story-layout,
.detail-layout,
.form-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.story-card,
.detail-card,
.form-card,
.panel {
  padding: 24px;
}

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

.stat-card {
  padding: 16px;
}

.stat-card strong {
  display: block;
  color: var(--primary);
  font-size: 1.5rem;
}

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

.gallery-grid > * {
  grid-column: span 4;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 14px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.68));
}

.table-scroll {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.field,
.textarea,
.select,
.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

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

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: start;
}

.checkbox input {
  margin-top: 4px;
}

.feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: none;
}

.feedback.is-visible {
  display: block;
}

.feedback.is-success {
  background: rgba(35, 122, 86, 0.12);
  color: var(--success);
}

.feedback.is-error {
  background: rgba(163, 63, 63, 0.12);
  color: var(--danger);
}

.site-footer {
  margin-top: 34px;
  padding: 34px 0 54px;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.2fr 1fr 1fr;
}

.footer-nav,
.footer-notes {
  display: grid;
  gap: 8px;
}

.footer-nav a,
.footer-notes a {
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-notes a:hover {
  color: var(--primary-2);
}

.page-intro {
  padding: 28px 0 4px;
}

.page-title {
  margin: 0 0 12px;
  font-family: "Noto Serif", "Playfair Display", serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.02;
}

.source-list {
  display: grid;
  gap: 16px;
}

.source-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.skeleton {
  min-height: 120px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(90deg, rgba(214, 181, 109, 0.08), rgba(214, 181, 109, 0.16), rgba(214, 181, 109, 0.08));
  background-size: 220% 100%;
  animation: pulse 1.6s linear infinite;
}

@keyframes pulse {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@media (max-width: 1040px) {
  .cards-grid > *,
  .gallery-grid > * {
    grid-column: span 6;
  }

  .hero-grid,
  .split-hero,
  .story-layout,
  .detail-layout,
  .form-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav {
    position: relative;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(88vw, 340px);
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    align-items: stretch;
  }

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

  .hero-panel {
    padding: 22px;
    border-radius: 28px;
  }

  .cards-grid > *,
  .gallery-grid > * {
    grid-column: span 12;
  }

  .form-grid,
  .grid-2,
  .grid-3,
  .stats {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: none;
  }

  .hero-meta li,
  .meta-list li,
  .fact-list li {
    flex-direction: column;
    gap: 4px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
