html {
  scroll-behavior: smooth;
}

/* ─────────────────────────────────────────────────────────────
   Mobile bottom tab bar (app-like navigation)
   Shows only on narrow screens or when running as installed PWA.
   ───────────────────────────────────────────────────────────── */

:root {
  --parish-tab-height: 62px;
  --parish-tab-safe: env(safe-area-inset-bottom, 0px);
}

.parish-tab-bar {
  display: none; /* hidden by default; shown by media/PWA-mode below */
}

/* Base container */
@media (max-width: 767.98px) {
  .parish-tab-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 80;
    padding: 6px 4px calc(6px + var(--parish-tab-safe));
    background:
      linear-gradient(180deg,
        rgba(23, 56, 9, 0) 0%,
        rgba(23, 56, 9, 0.04) 100%),
      color-mix(in srgb, #fdfbf1 92%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid rgba(183, 138, 42, 0.25);
    box-shadow: 0 -12px 32px -18px rgba(23, 56, 9, 0.20);
  }
  /* Reserve room at bottom of every page so tab bar never overlaps content. */
  body {
    padding-bottom: calc(var(--parish-tab-height) + var(--parish-tab-safe));
  }
  /* Floating action buttons and install-banner sit above the tab bar.
     Specificity boosted with body[data-…] to win against later rules. */
  body [data-scroll-top],
  body [data-scroll-back] {
    bottom: calc(16px + var(--parish-tab-height) + var(--parish-tab-safe)) !important;
  }
  body [data-install-banner] {
    bottom: calc(76px + var(--parish-tab-height) + var(--parish-tab-safe)) !important;
  }
}

/* Dark theme adjustment */
html.theme-dark .parish-tab-bar,
html.dark .parish-tab-bar {
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.35) 100%),
    color-mix(in srgb, #171913 92%, transparent);
  border-top-color: rgba(183, 138, 42, 0.35);
}

/* Force-show tab bar when running as installed PWA even on wider screens (up to iPad) */
body.pwa-mode .parish-tab-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: fixed;
  inset: auto 0 0 0;
  z-index: 80;
  padding: 6px 4px calc(6px + var(--parish-tab-safe));
}
body.pwa-mode {
  padding-bottom: calc(var(--parish-tab-height) + var(--parish-tab-safe));
}
body.pwa-mode [data-scroll-top],
body.pwa-mode [data-scroll-back] {
  bottom: calc(16px + var(--parish-tab-height) + var(--parish-tab-safe)) !important;
}
body.pwa-mode [data-install-banner] {
  bottom: calc(76px + var(--parish-tab-height) + var(--parish-tab-safe)) !important;
}

/* Individual tab item */
.parish-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px 4px;
  color: rgb(var(--c-tertiary, 122 92 45) / 0.7);
  text-decoration: none;
  border-radius: 12px;
  transition: color 200ms ease, background 200ms ease, transform 100ms ease;
  min-height: 52px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.parish-tab:hover { background: rgba(183, 138, 42, 0.06); }
.parish-tab:active { transform: scale(0.96); }
.parish-tab-icon {
  font-size: 24px;
  line-height: 1;
  font-variation-settings: 'wght' 400, 'FILL' 0;
  transition: font-variation-settings 200ms ease, transform 200ms ease;
}
.parish-tab-label {
  font-family: "Cormorant Garamond", "PonomarUnicodeTTRegular", serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-align: center;
  color: inherit;
}
.parish-tab.is-active {
  color: #b78a2a; /* приходское золото */
}
.parish-tab.is-active .parish-tab-icon {
  font-variation-settings: 'wght' 500, 'FILL' 1;
  transform: translateY(-1px);
}
.parish-tab.is-active::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b78a2a, transparent);
  border-radius: 2px;
}
html.theme-dark .parish-tab,
html.dark .parish-tab { color: rgba(233, 193, 118, 0.55); }
html.theme-dark .parish-tab.is-active,
html.dark .parish-tab.is-active { color: #e9c176; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .parish-tab, .parish-tab-icon { transition: none; }
}

/* ─────────────────────────────────────────────────────────────
   View Transitions — smooth page-to-page fade + subtle rise.
   Works in Chrome/Edge/Safari 18+; ignored (no-op) elsewhere.
   ───────────────────────────────────────────────────────────── */
@view-transition {
  navigation: auto;
}
@keyframes parish-view-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes parish-view-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
::view-transition-old(root) {
  animation: parish-view-out 200ms ease-out forwards;
}
::view-transition-new(root) {
  animation: parish-view-in 260ms ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* ─────────────────────────────────────────────────────────────
   Pull-to-refresh (native-feeling on touch devices only)
   Enables via [data-ptr] on <body> or a scroll container.
   No overscroll conflict with existing sticky headers.
   ───────────────────────────────────────────────────────────── */
.parish-ptr {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, calc(var(--ptr-offset, 0px) - 100%));
  z-index: 200;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(253, 251, 241, 0.95);
  border: 1px solid rgba(183, 138, 42, 0.4);
  box-shadow: 0 8px 24px -6px rgba(23, 56, 9, 0.35);
  display: grid;
  place-items: center;
  opacity: var(--ptr-progress, 0);
  transition: transform 200ms ease, opacity 200ms ease;
  pointer-events: none;
  color: #b78a2a;
}
.parish-ptr .material-symbols-outlined {
  font-size: 22px;
  transform: rotate(calc(var(--ptr-angle, 0) * 1deg));
  transition: transform 100ms linear;
}
.parish-ptr.is-refreshing .material-symbols-outlined {
  animation: parish-ptr-spin 900ms linear infinite;
}
@keyframes parish-ptr-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
html.theme-dark .parish-ptr,
html.dark .parish-ptr {
  background: rgba(23, 25, 19, 0.92);
  border-color: rgba(233, 193, 118, 0.4);
  color: #e9c176;
}
/* Only enable pull-to-refresh on touch devices */
@media (hover: hover) and (pointer: fine) {
  .parish-ptr { display: none; }
}

/* Inline PDF viewer for archive documents (local file or Y.Disk via proxy).
   Renders the document via the browser's native PDF viewer inside an iframe. */
.archive-pdf-frame {
  position: relative;
  width: 100%;
  height: 78vh;
  min-height: 480px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(233, 193, 118, 0.18);
}
.archive-pdf-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}
@media (max-width: 640px) {
  .archive-pdf-frame {
    height: 72vh;
    min-height: 420px;
    border-radius: 8px;
    margin: 0 -0.25rem;
  }
}

/* Embedded videos in news/articles (YouTube / RuTube / VK Video).
   Body text is parsed by sacred_linebreaks filter — bare video URL on its own
   line becomes a responsive iframe wrapped in .video-embed. */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 880px;
  margin: 1.6rem auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(233, 193, 118, 0.18);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
@media (max-width: 640px) {
  .video-embed {
    margin: 1.2rem -0.25rem;
    border-radius: 8px;
  }
}

:root {
  --enhance-gold: #775a19;
  --enhance-gold-soft: #e9c176;
  --enhance-olive: #173809;
  --enhance-bg-dark: #171913;
  --enhance-text-dark: #ece7dd;
  --surface-cream: #f8f4eb;
  --surface-cream-strong: #f3ecdc;
  --ink-soft: #3b3a35;

  /* ══════════════════════════════════════════════════════════════
     ЕДИНЫЙ КОНТЕНТ-КОНТЕЙНЕР
     Все секции (шапка, hero, «слово часа», расписание, карточки,
     футер) выравниваются по одним левому и правому краям.

     Для отката полей к прежнему значению:
       замените строку --content-gutter ниже на:
       --content-gutter: var(--content-gutter-default);
     — правка ОДНОЙ строки.

     было: clamp(1rem, 8vw, 8rem)  ≈ 128px при 1440px
     стало: clamp(1rem, 6.4vw, 6.4rem)  (-20% = 8rem × 0.8)
     ══════════════════════════════════════════════════════════════ */
  --content-max-width: 1100px;
  --content-gutter-default: clamp(1rem, 8vw, 8rem);   /* исходное — для отката */
  --content-gutter: clamp(1rem, 6.4vw, 6.4rem);       /* 20% уже — текущее */

  /* Шапка full-bleed — своё более узкое поле, чтобы nav не сжималась
     (~10px/32px/40px → близко к оригинальному px-5/px-8/px-10) */
  --header-gutter: clamp(1rem, 2.8vw, 2.5rem);
}

/* Единый контент-контейнер:
   • max-width — потолок ширины на широких экранах (2K/4K);
   • margin-inline: auto — симметричное центрирование;
   • min() выбирает наименьшее из:
       (100% − 2×gutter) — viewport минус поля → контент не касается краёв;
       max-width — потолок.
   Фоновые полосы идут во всю ширину (<footer>, .sh-hero и др.),
   а их внутренний контент оборачивается в .site-container. */
.site-container {
  box-sizing: border-box;
  width: min(calc(100% - 2 * var(--content-gutter)), var(--content-max-width));
  margin-inline: auto;
}

/* Шапка — особый вариант: фон идёт во всю ширину экрана.
   --header-gutter меньше --content-gutter, чтобы навигация не сжималась.
   Бренд и утилиты выровнены по краям с небольшим постоянным полем. */
.site-header-inner {
  box-sizing: border-box;
  width: 100%;
  padding-inline: var(--header-gutter);
}

/* Minimal historical ornament system:
   - exactly 1 mark in header, 1 in footer (toggleable)
   - no backgrounds, no repeats */
html[data-ornament="a"] .ornament-mark--b {
  display: none !important;
}

html[data-ornament="b"] .ornament-mark--a {
  display: none !important;
}

.ornament-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  color: rgba(119, 90, 25, 0.85);
  opacity: 0.9;
}

html.theme-dark .ornament-mark,
html.dark .ornament-mark {
  color: rgba(233, 193, 118, 0.88);
  opacity: 0.88;
}

.ornament-mark__svg {
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
}

body {
  transition: opacity 220ms ease;
}

body.page-leaving {
  opacity: 0.72;
}

[data-page-progress] {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms ease;
}

[data-page-progress].is-done {
  transition: transform 220ms ease, opacity 320ms ease;
  opacity: 0;
}

.js-enhanced [data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
  will-change: auto;
}

.js-enhanced [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ── Кнопки навигации на мобильном: круглые FAB, без рамки ── */
@media (max-width: 639px) {
  [data-scroll-back],
  [data-scroll-top] {
    border-radius: 999px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.32) !important;
    bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px)) !important;
    /* убираем inset-shadow от carved-stone */
    background-image: none !important;
  }

  /* Кнопка «Домой» — только иконка, скрываем текст */
  [data-scroll-back] {
    left: 1.25rem !important;
    width: 3rem !important;
    height: 3rem !important;
    padding: 0 !important;
    max-width: 3rem !important;
    gap: 0 !important;
  }
  [data-scroll-back] .scroll-back-btn__label {
    display: none !important;
  }

  [data-scroll-top] {
    right: 1.25rem !important;
    width: 3rem !important;
    height: 3rem !important;
  }

  /* Светлая тема: кремово-белый фон */
  html:not(.theme-dark) [data-scroll-back],
  html:not(.theme-dark) [data-scroll-top] {
    background-color: rgba(255, 255, 255, 0.95) !important;
  }

  /* Тёмная тема: тёмный непрозрачный фон */
  html.theme-dark [data-scroll-back],
  html.dark [data-scroll-back],
  html.theme-dark [data-scroll-top],
  html.dark [data-scroll-top] {
    background-color: rgb(var(--c-surface-container-high)) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
  }
}

[data-scroll-top],
[data-scroll-back] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 240ms ease, transform 240ms ease;
}

[data-scroll-top].is-visible,
[data-scroll-back].is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Кнопка «На главную»: подпись по ширине левого поля (data-density задаёт JS) */
[data-scroll-back][data-density="icon"] {
  width: 3rem;
  padding-inline: 0;
  gap: 0;
}

[data-scroll-back][data-density="icon"] .scroll-back-btn__label {
  display: none;
}

[data-scroll-back][data-density="short"] .scroll-back-btn__label--full {
  display: none;
}

[data-scroll-back][data-density="full"] .scroll-back-btn__label--short {
  display: none;
}

[data-scroll-back] .scroll-back-btn__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-candle-heading] {
  animation: candle-shimmer 4s ease-in-out infinite;
}

@keyframes candle-shimmer {
  0% {
    filter: drop-shadow(0 0 0 rgba(233, 193, 118, 0));
  }
  20% {
    filter: drop-shadow(0 0 6px rgba(233, 193, 118, 0.18));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(233, 193, 118, 0.26));
  }
  80% {
    filter: drop-shadow(0 0 6px rgba(233, 193, 118, 0.18));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(233, 193, 118, 0));
  }
}

[data-service-detail-panel] {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 320ms ease, opacity 220ms ease, margin-top 220ms ease;
}

[data-service-detail-panel].is-open {
  opacity: 1;
  margin-top: 0.75rem;
}

[data-service-card].is-active-service {
  box-shadow:
    0 0 0 1px rgba(233, 193, 118, 0.45),
    0 0 18px rgba(233, 193, 118, 0.22);
  animation: active-service-pulse 1.8s ease-in-out infinite;
}

@keyframes active-service-pulse {
  0% {
    box-shadow:
      0 0 0 1px rgba(233, 193, 118, 0.38),
      0 0 14px rgba(233, 193, 118, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(233, 193, 118, 0.66),
      0 0 24px rgba(233, 193, 118, 0.32);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(233, 193, 118, 0.38),
      0 0 14px rgba(233, 193, 118, 0.18);
  }
}

img.lazy-blur {
  filter: blur(8px);
  transform: scale(1.015);
  transition: filter 260ms ease, transform 260ms ease;
}

img.lazy-blur.is-loaded {
  filter: blur(0);
  transform: scale(1);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--enhance-gold-soft);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(233, 193, 118, 0.2);
}

.ripple-host {
  position: relative;
  overflow: hidden;
}

.ripple-dot {
  position: absolute;
  border-radius: 999px;
  transform: scale(0);
  background: radial-gradient(circle, rgba(233, 193, 118, 0.45) 0%, rgba(233, 193, 118, 0) 72%);
  pointer-events: none;
  animation: ripple-burst 520ms ease-out forwards;
}

@keyframes ripple-burst {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

.icon-rotate-hover {
  transition: transform 640ms ease;
}

.icon-rotate-hover:hover {
  transform: rotate(360deg);
}

.carved-stone {
  transition: transform 240ms ease, box-shadow 240ms ease, background-color 240ms ease, border-color 240ms ease;
  border-color: rgba(119, 90, 25, 0.14);
  box-shadow:
    0 8px 24px rgba(23, 56, 9, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Light theme: green accent blocks (schedule, calendar, footer) */
html:not(.theme-dark):not(.dark) .bg-primary-container,
html:not(.theme-dark):not(.dark) footer.bg-primary-container {
  background-color: rgb(var(--c-primary-container));
  color: rgb(var(--c-on-primary));
}

html:not(.theme-dark):not(.dark) .bg-primary-container .text-secondary-fixed-dim,
html:not(.theme-dark):not(.dark) footer .text-secondary-fixed-dim {
  color: rgb(var(--c-secondary-fixed-dim));
}

html:not(.theme-dark):not(.dark) .bg-error {
  background-color: rgb(var(--c-error));
  color: rgb(var(--c-on-error));
}

@media (hover: hover) and (pointer: fine) {
  .carved-stone:hover {
    transform: translateY(-1px);
    box-shadow:
      -4px -4px 10px rgba(255, 255, 255, 0.72),
      8px 12px 26px rgba(27, 28, 25, 0.16),
      inset 2px 2px 4px rgba(255, 255, 255, 0.34),
      inset -2px -2px 4px rgba(0, 0, 0, 0.05);
  }
}

.max-messenger-icon {
  color: currentColor;
}

.site-header .max-messenger-icon {
  color: #f0ead6;
  transition: color 250ms ease-in-out;
}

.site-header .site-header-util-btn:hover .max-messenger-icon {
  color: #c9a84c;
}

.site-header .site-header-accessible-link {
  width: auto;
  min-width: 2.25rem;
  max-width: none;
  margin-left: 0.25rem;
  padding: 0.32rem 0.7rem 0.32rem 0.62rem;
  border: 1px solid rgba(195, 161, 86, 0.38);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 248, 235, 0.1) 0%,
    rgba(195, 161, 86, 0.07) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 235, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.07);
}

.site-header .site-header-accessible-link:hover,
.site-header .site-header-accessible-link:focus-visible {
  border-color: rgba(201, 168, 76, 0.62);
  background: linear-gradient(
    180deg,
    rgba(255, 248, 235, 0.14) 0%,
    rgba(195, 161, 86, 0.14) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 235, 0.2),
    0 0 14px rgba(195, 161, 86, 0.16);
}

.site-header-accessible-icon {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

.site-header-accessible-label {
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-transform: none;
  color: inherit;
  white-space: nowrap;
}

@media (min-width: 520px) {
  .site-header .site-header-accessible-link {
    margin-left: 0.4rem;
    padding: 0.38rem 0.82rem 0.38rem 0.72rem;
  }

  .site-header-accessible-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .site-header-accessible-label {
    font-size: 0.75rem;
  }
}

@media (min-width: 768px) {
  .site-header-accessible-label {
    font-size: 0.8125rem;
  }
}

.site-header-accessible-link:hover .site-header-accessible-label,
.site-header-accessible-link:focus-visible .site-header-accessible-label {
  color: inherit;
}

/* ===================================================================
   Мобильная шапка: кнопка-меню (гамбургер) обязана быть доступна на
   любой ширине.
   Архитектура flex: правый блок (тема · «для слабовидящих» · меню) —
   спасательный круг навигации, он НИКОГДА не сжимается и не уходит за
   экран. Любое переполнение поглощает бренд (сжатие + эллипсис).
   Раньше И бренд, И правый блок были shrink-0 → overflow выпихивал
   гамбургер за вьюпорт (на 360px он оказывался на x≈520).
   =================================================================== */
@media (max-width: 1023px) {
  .site-header .site-header-brand { flex-shrink: 1; min-width: 0; }
  .site-header .site-header-end   { flex-shrink: 0; }

  /* бренд усекается многоточием, а не толкает кнопки за край */
  .site-header .site-brand-line-main,
  .site-header .site-brand-line-sub {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* «Для слабовидящих» → только иконка (текст-лейбл переполнял строку) */
  .site-header .site-header-accessible-label { display: none; }
  .site-header .site-header-accessible-link {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    margin-left: 0;
    gap: 0;
  }
}

/* Телефоны поменьше: чуть мельче шрифт бренда + плотнее хром,
   чтобы полное название помещалось без усечения. */
@media (max-width: 520px) {
  .site-header .site-brand-line-main { font-size: 0.95rem; }
  .site-header .site-brand-line-sub  { font-size: 0.8rem; }
}
@media (max-width: 400px) {
  .site-header .site-header-inner { gap: 0.5rem; }
  .site-header .site-header-utilities { gap: 0.25rem; }
  .site-header .site-brand-line-main { font-size: 0.88rem; }
  .site-header .site-brand-line-sub  { font-size: 0.74rem; }
}

.site-header-logo-link {
  text-decoration: none;
  color: inherit;
}

.gold-border {
  border-image: linear-gradient(90deg, rgba(119, 90, 25, 0), rgba(233, 193, 118, 0.7), rgba(119, 90, 25, 0)) 1;
}

a,
button {
  transition: color 200ms ease, background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

img {
  border-radius: 0.1rem;
}

.group:hover .group-hover-shimmer {
  filter: drop-shadow(0 2px 10px rgba(233, 193, 118, 0.28));
}

.home-main-shell {
  display: flex;
  flex-direction: column;
  gap: clamp(2.25rem, 4.5vw, 3.25rem);
}

/*
 * Home — фотогалерея: ширина блока прежняя; золотые горизонтали шире (как midday -mx-4 / md:-mx-24).
 */
.home-gallery-section {
  --home-gallery-block-bleed: clamp(0.75rem, 2.2vw, 1.65rem);
  --home-gallery-line-bleed: 1rem;
  position: relative;
  isolation: isolate;
  z-index: 1;
  box-sizing: border-box;
  overflow-x: visible;
  overflow-y: visible;
  width: calc(100% + 2 * var(--home-gallery-block-bleed));
  max-width: calc(100% + 2 * var(--home-gallery-block-bleed));
  margin-left: calc(-1 * var(--home-gallery-block-bleed));
  margin-right: calc(-1 * var(--home-gallery-block-bleed));
  padding-inline: clamp(1rem, 2.4vw, 1.65rem);
  padding-top: clamp(1.35rem, 3vw, 1.85rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.25rem);
}

@media (min-width: 768px) {
  .home-gallery-section {
    --home-gallery-block-bleed: clamp(1.35rem, 3.2vw, 2.15rem);
    --home-gallery-line-bleed: 6rem;
    padding-inline: clamp(1.15rem, 2.6vw, 1.85rem);
  }
}

@media (min-width: 1024px) {
  .home-gallery-section {
    --home-gallery-block-bleed: clamp(1.5rem, 3.5vw, 2.35rem);
  }
}

.home-gallery-section__rule {
  --home-gallery-line-extra: max(
    0px,
    var(--home-gallery-line-bleed) - var(--home-gallery-block-bleed)
  );
  display: block;
  position: absolute;
  left: calc(-1 * var(--home-gallery-line-extra));
  right: calc(-1 * var(--home-gallery-line-extra));
  z-index: 4;
  height: 0;
  pointer-events: none;
  background: none;
  box-shadow: none;
  border-left-width: 0;
  border-right-width: 0;
  border-style: solid;
}

.home-gallery-section__rule--top {
  top: 0;
}

.home-gallery-section__rule--bottom {
  bottom: 0;
}

.home-gallery-section__content {
  width: 100%;
}

.home-gallery-carousel__heading {
  width: 100%;
  line-height: 1.1;
  margin-top: 0;
}

html.theme-dark .home-gallery-section,
html.dark .home-gallery-section {
  background-color: rgba(var(--c-surface-container-high), 0.92);
}

/* Светлая тема: боковые «шторки» — не съедают золотые вертикали рамки */
html:not(.theme-dark):not(.dark) .home-gallery-section::before,
html:not(.theme-dark):not(.dark) .home-gallery-section::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(8px, 2vw, 16px);
  z-index: 0;
  pointer-events: none;
  background: rgb(var(--c-surface-container-low) / 0.94);
}

@media (min-width: 768px) {
  html:not(.theme-dark):not(.dark) .home-gallery-section::before,
  html:not(.theme-dark):not(.dark) .home-gallery-section::after {
    width: clamp(10px, 2.4vw, 20px);
  }
}

html:not(.theme-dark):not(.dark) .home-gallery-section::before {
  left: 0;
  transform: translateX(-100%);
}

html:not(.theme-dark):not(.dark) .home-gallery-section::after {
  right: 0;
  transform: translateX(100%);
}

/* Home — карусель фотогалереи */
.home-gallery-carousel {
  --home-gallery-slide-ratio: 0.7;
  --home-gallery-gap: clamp(0.7rem, 1.6vw, 1.05rem);
}

.home-gallery-carousel__shell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.home-gallery-carousel__media {
  padding-inline: clamp(2.5rem, 6vw, 3.5rem);
}

.home-gallery-carousel__viewport {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  touch-action: pan-y pinch-zoom;
}

.home-gallery-carousel__track {
  display: flex;
  align-items: stretch;
  gap: var(--home-gallery-gap);
  will-change: transform;
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 767px) {
  .home-gallery-carousel__track {
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-gallery-carousel__track {
    transition-duration: 0.01ms;
  }

  .home-gallery-carousel__frame::after,
  .home-gallery-carousel__caption,
  .home-gallery-carousel__dot {
    transition-duration: 0.01ms;
  }
}

.home-gallery-carousel__slide {
  flex: 0 0 auto;
  min-width: 0;
}

.home-gallery-carousel__frame {
  position: relative;
  aspect-ratio: 5 / 4;
  width: 100%;
  min-height: clamp(14rem, 42vw, 22rem);
  transition: box-shadow 360ms ease;
}

.home-gallery-carousel__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(var(--c-primary) / 0.48);
  opacity: 0;
  transition: opacity 360ms ease;
  pointer-events: none;
}

.home-gallery-carousel__image {
  display: block;
  border-radius: inherit;
}

.home-gallery-carousel__slide:not(.is-active) .home-gallery-carousel__frame::after {
  opacity: 1;
}

.home-gallery-carousel__slide.is-active .home-gallery-carousel__frame {
  box-shadow: 0 16px 40px rgb(var(--c-primary) / 0.14);
}

.home-gallery-carousel__info {
  position: relative;
  min-height: clamp(5.5rem, 18vw, 8.5rem);
  margin-top: 0.25rem;
}

.home-gallery-carousel__caption {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.home-gallery-carousel__caption.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.home-gallery-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 999px;
  border: 1px solid rgb(var(--c-outline-variant) / 0.4);
  background: rgb(var(--c-surface) / 0.62);
  color: rgb(var(--c-primary));
  box-shadow: 0 6px 18px rgb(var(--c-primary) / 0.12);
  backdrop-filter: blur(6px);
  transform: translateY(-50%);
}

.home-gallery-carousel__arrow--prev {
  left: 0.15rem;
}

.home-gallery-carousel__arrow--next {
  right: 0.15rem;
}

.home-gallery-carousel__arrow .material-symbols-outlined {
  font-size: 1.65rem;
}

.home-gallery-carousel__arrow:hover,
.home-gallery-carousel__arrow:focus-visible {
  background: rgb(var(--c-surface) / 0.82);
  border-color: rgb(var(--c-secondary-fixed-dim) / 0.55);
}

.home-gallery-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.35rem;
}

.home-gallery-carousel__more {
  margin-top: 0.5rem;
}

.home-gallery-carousel__dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  border: 1.5px solid rgb(var(--c-secondary));
  background: transparent;
  padding: 0;
  transition: background-color 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.home-gallery-carousel__dot.is-active {
  background: rgb(var(--c-primary));
  border-color: rgb(var(--c-primary));
  transform: scale(1.12);
}

.home-gallery-carousel__dot:hover,
.home-gallery-carousel__dot:focus-visible {
  border-color: rgb(var(--c-secondary-fixed-dim));
}

@media (min-width: 768px) {
  .home-gallery-carousel {
    --home-gallery-slide-ratio: 0.68;
    --home-gallery-gap: clamp(0.85rem, 2vw, 1.25rem);
  }

  .home-gallery-carousel__frame {
    aspect-ratio: 4 / 3;
    min-height: clamp(18rem, 38vw, 28rem);
  }
}

@media (max-width: 767px) {
  .home-gallery-carousel {
    --home-gallery-slide-ratio: 1;
  }

  .home-gallery-carousel__media {
    padding-inline: 2.65rem;
  }

  .home-gallery-carousel__arrow {
    width: 2.45rem;
    height: 2.45rem;
    background: rgb(var(--c-surface) / 0.78);
  }

  .home-gallery-carousel__slide:not(.is-active) .home-gallery-carousel__frame::after {
    opacity: 1;
  }

  .home-gallery-carousel__caption {
    text-align: center;
  }
}

html.theme-dark .home-gallery-carousel__arrow,
html.dark .home-gallery-carousel__arrow {
  background: rgb(var(--c-surface-container-high) / 0.72);
  border-color: rgb(var(--c-outline-variant) / 0.35);
  color: rgb(var(--c-primary-fixed));
}

.news-detail-gallery {
  margin-bottom: 0.5rem;
}

.news-detail-gallery .home-gallery-carousel__info {
  min-height: clamp(4.5rem, 14vw, 7rem);
}

/* Главная: паломничества — отдельный блок после полосы фотогалереи */
.home-pilgrimage-section {
  position: relative;
  margin-top: clamp(0.5rem, 2vw, 1.25rem);
  padding-top: clamp(2.5rem, 5vw, 3.75rem);
  border-top: 1px solid rgb(var(--c-secondary) / 0.14);
}

.home-pilgrimage-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(233, 193, 118, 0.35) 18%,
    rgba(233, 193, 118, 0.72) 50%,
    rgba(233, 193, 118, 0.35) 82%,
    transparent 100%
  );
}

.home-pilgrimage-section__body {
  border: 1px solid rgb(var(--c-secondary) / 0.12);
  background: rgb(var(--c-surface) / 0.55);
  padding: clamp(1.25rem, 3vw, 2rem);
}

html.theme-dark .home-pilgrimage-section__body,
html.dark .home-pilgrimage-section__body {
  background: rgb(var(--c-surface-container-low) / 0.35);
  border-color: rgb(var(--c-secondary) / 0.18);
}

/* Золотой православный крест (PNG с прозрачным фоном) */
.site-cross-icon--header {
  width: clamp(1.65rem, 3.6vw, 2rem);
  height: clamp(2.2rem, 5vw, 2.65rem);
  flex-shrink: 0;
}

.site-cross-icon--header img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.site-cross-icon--quote {
  width: clamp(2.85rem, 6.5vw, 3.5rem);
  height: clamp(4rem, 8.5vw, 4.85rem);
  margin-inline: auto;
  opacity: 0.92;
}

.site-cross-icon--quote img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.site-cross-icon--accent {
  display: block;
  width: clamp(2.1rem, 4.2vw, 2.45rem);
  height: clamp(2.95rem, 5.8vw, 3.45rem);
  object-fit: contain;
  object-position: center;
  opacity: 0.8;
}

/* Главная — «Молитва, беседа и милосердие»: воздух вокруг креста в шапке блока */
.home-midday-section__intro {
  padding: clamp(1rem, 2.5vw, 1.65rem) clamp(1rem, 3vw, 1.75rem) clamp(0.5rem, 1.2vw, 0.85rem);
}

.home-midday-section__intro .site-cross-icon--accent {
  margin-bottom: 0.15rem;
}

/* Readable body copy: decorative face only for short headings */
.text-readable,
.home-prose,
.sacred-copy p,
.iconostasis-frame .font-headline.text-lg,
.iconostasis-frame .font-headline.text-xl,
.iconostasis-frame .font-headline.text-base {
  font-family: "Cormorant Garamond", "PonomarUnicodeTTRegular", serif;
  font-weight: 500;
  letter-spacing: 0.014em;
  line-height: 1.62;
}

.home-prose--compact {
  line-height: 1.56;
}

/* Home hero: calmer framing, subtle depth */
.home-hero-plaque {
  position: relative;
  isolation: isolate;
  margin-top: 0;
  background: linear-gradient(180deg, rgba(252, 249, 242, 0.82) 0%, rgba(248, 244, 235, 0.58) 100%);
  box-shadow:
    0 20px 44px rgba(17, 29, 14, 0.08),
    0 2px 0 rgba(195, 161, 86, 0.1);
}

@media (min-width: 768px) {
  .home-hero-plaque {
    margin-top: 0;
  }
}

.home-hero-plaque .gold-ornament {
  opacity: 0.14;
}

.home-hero-plaque [class*="border-secondary"] {
  border-color: rgba(119, 90, 25, 0.1) !important;
}

/* Home: hide frame top wave; minimal gap under site header */
.iconostasis-frame:has(.home-hero-plaque)::before {
  display: none;
}

.iconostasis-frame:has(.home-hero-plaque) {
  padding-top: clamp(0.4rem, 1vw, 0.65rem) !important;
}

@media (min-width: 768px) {
  .iconostasis-frame:has(.home-hero-plaque) {
    padding-top: clamp(0.5rem, 1.1vw, 0.75rem) !important;
  }
}

.home-hero-plaque .home-hero-title-block > .gold-ornament {
  display: none;
}

.home-hero-plaque .home-hero-title-block {
  padding-top: clamp(0.35rem, 0.95vw, 0.6rem);
  padding-bottom: clamp(0.2rem, 0.8vw, 0.55rem);
}

.home-hero-plaque .home-hero-title-block h1 {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  font-family: "PonomarUnicodeTTRegular", "Cormorant Garamond", serif;
  text-shadow: 0 1px 2px rgba(20, 27, 16, 0.06);
}

.home-hero-heading__line,
.home-hero-heading__subline {
  width: 100%;
  line-height: 1.02;
  text-wrap: balance;
}

.home-hero-heading__line {
  font-size: clamp(1.92rem, 4.5vw, 3.55rem);
  letter-spacing: 0.1em;
}

.home-hero-heading__subline {
  margin-top: 0.08rem;
  font-size: clamp(1.62rem, 3.85vw, 2.95rem);
  letter-spacing: 0.075em;
}

/* Светлая тема: заголовок героя — яркое золото (вариант 4), шрифт и размер без изменений */
html:not(.theme-dark):not(.dark) .home-hero-plaque .home-hero-heading.byzantine-shimmer {
  background-image: linear-gradient(
    96deg,
    #8a6218 0%,
    #b88924 18%,
    #dbad38 38%,
    #f0cc5c 50%,
    #ffe08a 56%,
    #f0cc5c 64%,
    #dbad38 82%,
    #8a6218 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 1px 2px rgba(138, 98, 24, 0.22));
}

.home-hero-plaque .home-hero-image-wrap {
  position: relative;
  isolation: isolate;
  width: 100%;
  line-height: 0;
  max-height: min(48vh, 25.5rem);
  overflow: hidden;
  background: #efe8d9;
}

.home-hero-plaque .home-hero-image-wrap::before,
.home-hero-plaque .home-hero-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.home-hero-plaque .home-hero-image-wrap::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(15, 23, 12, 0) 0%, rgba(15, 23, 12, 0.04) 54%, rgba(11, 17, 9, 0.22) 100%),
    linear-gradient(90deg, rgba(14, 21, 11, 0.26) 0%, rgba(14, 21, 11, 0.08) 16%, rgba(14, 21, 11, 0) 36%, rgba(14, 21, 11, 0) 64%, rgba(14, 21, 11, 0.1) 84%, rgba(14, 21, 11, 0.28) 100%);
}

.home-hero-plaque .home-hero-image-wrap::after {
  background:
    radial-gradient(circle at 52% 12%, rgba(255, 236, 196, 0.22), rgba(255, 236, 196, 0.05) 22%, rgba(255, 236, 196, 0) 46%),
    linear-gradient(180deg, rgba(250, 244, 228, 0.05) 0%, rgba(250, 244, 228, 0) 18%, rgba(10, 16, 9, 0.18) 100%);
}

.home-hero-plaque picture.home-hero-image--light {
  display: none;
}

.home-hero-plaque picture.home-hero-image--dark {
  display: block;
}

html.theme-dark .home-hero-plaque picture.home-hero-image--light,
html.dark .home-hero-plaque picture.home-hero-image--light {
  display: none;
}

html.theme-dark .home-hero-plaque picture.home-hero-image--dark,
html.dark .home-hero-plaque picture.home-hero-image--dark {
  display: block;
}

html:not(.theme-dark):not(.dark) .home-hero-plaque picture.home-hero-image--light {
  display: block;
}

html:not(.theme-dark):not(.dark) .home-hero-plaque picture.home-hero-image--dark {
  display: none;
}

.home-hero-plaque picture.home-hero-image {
  line-height: 0;
  width: 100%;
}

.home-hero-plaque picture.home-hero-image img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 12rem;
  max-height: min(48vh, 25.5rem);
  border-radius: 0;
  object-fit: cover;
  object-position: center 44%;
  filter: saturate(0.92) contrast(1.03) brightness(0.92);
  transform: scale(1.01);
}

html:not(.theme-dark):not(.dark) .home-hero-plaque .home-hero-image-wrap {
  max-height: none;
  background: #f3ecdf;
}

html:not(.theme-dark):not(.dark) .home-hero-plaque .home-hero-image-wrap::before {
  background:
    radial-gradient(circle at 50% 45%, rgba(15, 23, 12, 0) 0%, rgba(15, 23, 12, 0.02) 58%, rgba(11, 17, 9, 0.08) 100%),
    linear-gradient(90deg, rgba(14, 21, 11, 0.08) 0%, rgba(14, 21, 11, 0) 18%, rgba(14, 21, 11, 0) 82%, rgba(14, 21, 11, 0.08) 100%);
}

html:not(.theme-dark):not(.dark) .home-hero-plaque .home-hero-image-wrap::after {
  background: linear-gradient(180deg, rgba(250, 244, 228, 0.04) 0%, rgba(250, 244, 228, 0) 22%, rgba(10, 16, 9, 0.06) 100%);
}

html:not(.theme-dark):not(.dark) .home-hero-plaque picture.home-hero-image--light img {
  object-fit: contain;
  object-position: center center;
  filter: none;
  transform: none;
  max-height: min(56vh, 30rem);
}

.home-hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.7rem;
  padding: 0.85rem 1rem 1rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(119, 90, 25, 0.42);
  background: rgba(251, 249, 243, 0.92);
  color: rgba(23, 56, 9, 0.92);
  font-family: "Cormorant Garamond", "PonomarUnicodeTTRegular", serif;
  font-size: clamp(0.92rem, 1.35vw, 1.02rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 6px 16px rgba(23, 56, 9, 0.06);
  transition:
    color 320ms ease,
    border-color 320ms ease,
    background-color 320ms ease,
    box-shadow 420ms ease,
    transform 420ms ease;
}

.hero-cta:hover {
  border-color: rgba(119, 90, 25, 0.62);
  background: rgba(255, 252, 245, 0.98);
  color: #5a4512;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 0 0 1px rgba(233, 193, 118, 0.22),
    0 10px 22px rgba(23, 56, 9, 0.1);
  transform: translateY(-1px);
}

.hero-cta:focus-visible {
  outline-offset: 3px;
}

/* Secondary decor: quieter so content leads */
.gold-border > [aria-hidden="true"] svg {
  opacity: 0.035;
}

.home-hero-side-mark {
  color: rgba(119, 90, 25, 0.24);
  font-size: 0.64rem;
  letter-spacing: 0.35em;
}

.site-header-ornament-line {
  opacity: 0.55;
}

.site-header-cross--end img {
  filter: none;
}

/* Header polish overrides */
.site-header-vrule {
  display: none !important;
}

.site-header-nav {
  padding-inline: 0.35rem;
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .site-nav-link {
    font-size: 0.86rem !important;
    letter-spacing: 0.04em !important;
  }
  /* При 7+ пунктах они не помещаются по центру — уходят за бренд.
     flex-start: переполнение вправо (обрезается header overflow:hidden), не влево. */
  .site-header-nav {
    justify-content: flex-start;
    gap: clamp(0.55rem, 1.1vw, 1rem);
  }
}

/* Section rhythm */
.iconostasis-frame .gold-border {
  padding-top: 0.25rem;
}

.iconostasis-frame .carved-stone p,
.iconostasis-frame article .font-headline.italic {
  max-width: 68ch;
}

/* News detail: article text should span the FULL width of the article card,
   not a narrow 68ch column. Override the general iconostasis-frame rule. */
.iconostasis-frame article.carved-stone .sacred-copy,
.iconostasis-frame article.carved-stone .sacred-copy p {
  max-width: none !important;
  width: 100%;
  margin-inline: 0;
}

.sacred-copy--justified {
  width: 100%;
  max-width: none;
}

/* News gallery: for portrait icons keep the head/top visible (crop only the bottom padding). */
.news-detail-gallery .home-gallery-carousel__image {
  object-fit: cover;
  object-position: top center; /* head + icon face never gets cut */
}
.news-cover-frame--detail img.news-cover--portrait {
  object-fit: cover;
  object-position: top center;
}

.iconostasis-frame .carved-stone .sacred-copy--justified > p:not(:first-child) {
  width: 100%;
  max-width: none;
  text-align: justify;
  text-align-last: left;
  text-wrap: pretty;
  hyphens: auto;
}

/* ══════════════════════════════════════════════
   РУКОВОДСТВО ДЛЯ НАЧИНАЮЩИХ — полный стиль
   ══════════════════════════════════════════════ */

/* Анимация раскрытия аккордеона */
@keyframes guide-body-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
details[open] .guide-accordion__body {
  animation: guide-body-in 0.22s ease both;
}

/* ── Навигационные чипы ── */
.guide-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(119, 90, 25, 0.28);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(23, 56, 9, 0.85);
  font-family: "PonomarUnicodeTTRegular", "Cormorant Garamond", serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.guide-chip:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(119, 90, 25, 0.5);
  transform: translateY(-1px);
}

/* ── Декоративный заголовок секции ── */
.guide-section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.guide-section-heading::before,
.guide-section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(119,90,25,0.35), transparent);
}
.guide-section-heading__icon {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(119, 90, 25, 0.3);
  background: rgba(255,255,255,0.7);
  color: #775a19;
  font-size: 0.9rem;
}
.guide-section-heading h2 {
  font-family: "PonomarUnicodeTTRegular", "Cormorant Garamond", serif;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 800;
  color: #173809;
  white-space: nowrap;
}

/* ── Аккордеон ── */
.guide-accordion {
  border: 1px solid rgba(119, 90, 25, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.88) 0%, rgba(249,244,232,0.82) 100%);
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.22s, border-color 0.22s;
  border-left: 3px solid transparent;
}
.guide-accordion:hover {
  border-color: rgba(119, 90, 25, 0.28);
  box-shadow: 0 2px 12px rgba(119, 90, 25, 0.08);
}
.guide-accordion[open] {
  border-left-color: #c9a84c;
  box-shadow: 0 4px 20px rgba(119, 90, 25, 0.12);
}

.guide-accordion__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.25rem;
  font-family: "PonomarUnicodeTTRegular", "Cormorant Garamond", serif;
  font-size: clamp(1.05rem, 1.8vw, 1.38rem);
  font-weight: 700;
  color: #173809;
  user-select: none;
  transition: background 0.18s;
}
.guide-accordion__summary::-webkit-details-marker { display: none; }

/* Chevron справа */
.guide-accordion__summary::after {
  content: 'expand_more';
  font-family: 'Material Symbols Outlined';
  font-size: 1.3rem;
  font-weight: 300;
  color: rgba(119, 90, 25, 0.55);
  margin-left: auto;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.guide-accordion[open] > .guide-accordion__summary::after {
  transform: rotate(180deg);
}

.guide-accordion__summary:hover {
  background: rgba(255, 255, 255, 0.6);
}
.guide-accordion[open] > .guide-accordion__summary {
  background: rgba(255, 255, 255, 0.55);
}

/* Номер-бейдж */
.guide-accordion__index {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(119, 90, 25, 0.22);
  color: #775a19;
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-weight: 900;
  transition: background 0.2s, color 0.2s;
}
.guide-accordion[open] .guide-accordion__index {
  background: linear-gradient(135deg, #8b6012, #c9a84c);
  color: #fff;
  border-color: transparent;
}

.guide-accordion__body {
  border-top: 1px solid rgba(119, 90, 25, 0.12);
  padding: 1rem 1.25rem 1.25rem 1.25rem;
  font-family: "Cormorant Garamond", "PonomarUnicodeTTRegular", serif;
  font-size: clamp(1.08rem, 1.7vw, 1.3rem);
  line-height: 1.62;
  color: rgba(27, 28, 25, 0.84);
}
.guide-accordion__body p { margin-top: 0.8rem; }
.guide-accordion__body p:first-child { margin-top: 0; }

/* Буквица — первая буква первого абзаца */
.guide-accordion__body > p:first-child::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: 0.72;
  font-weight: 900;
  font-family: "Cormorant Garamond", serif;
  color: #8b6012;
  padding-right: 0.08em;
  margin-top: 0.06em;
}

/* ── Карточки 4 основ ── */
.guide-pillar-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(119, 90, 25, 0.16);
  padding: 0;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.guide-pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(119, 90, 25, 0.14);
}
/* Золотая полоса сверху */
.guide-pillar-card::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #8b6012, #e0bf6a, #8b6012);
}
.guide-pillar-card__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.35rem 1.35rem;
  flex: 1;
}
.guide-pillar-card__header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.guide-pillar-card__icon {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #7a5410, #c9a84c);
  box-shadow: 0 2px 8px rgba(119, 90, 25, 0.28);
}
.guide-pillar-card__title {
  font-family: "PonomarUnicodeTTRegular", "Cormorant Garamond", serif;
  font-size: clamp(1.1rem, 1.8vw, 1.28rem);
  font-weight: 800;
  color: #173809;
}
.guide-pillar-card__desc {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1rem, 1.55vw, 1.18rem);
  font-style: italic;
  line-height: 1.55;
  color: rgba(27, 28, 25, 0.72);
  flex: 1;
}
.guide-pillar-card__practice {
  margin-top: auto;
  border-top: 1px solid rgba(119, 90, 25, 0.12);
  padding-top: 0.75rem;
}
.guide-pillar-card__practice-label {
  display: block;
  font-family: "PonomarUnicodeTTRegular", serif;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: #775a19;
  margin-bottom: 0.3rem;
}
.guide-pillar-card__practice-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.93rem;
  color: rgba(27, 28, 25, 0.68);
  line-height: 1.45;
}

/* ── Карточки 4 основ — счётчик ── */
.guide-pillar-grid {
  counter-reset: pillar;
}
.guide-pillar-card {
  counter-increment: pillar;
}
.guide-pillar-card__inner {
  position: relative;
}
.guide-pillar-card__inner::after {
  content: '0' counter(pillar);
  position: absolute;
  top: 0;
  right: 0;
  font-family: "PonomarUnicodeTTRegular", "Cormorant Garamond", serif;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(119, 90, 25, 0.28);
  line-height: 1;
}

/* ── Цитата с декоративной кавычкой ── */
.guide-pullquote {
  position: relative;
  margin: 1.25rem 0 0.5rem;
  padding: 0.9rem 1.1rem 0.9rem 3rem;
  border-left: 3px solid rgba(119, 90, 25, 0.5);
  background: linear-gradient(90deg, rgba(119,90,25,0.06), rgba(119,90,25,0.01));
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: rgba(23, 56, 9, 0.72);
}
.guide-pullquote::before {
  content: '\275D';
  position: absolute;
  left: 0.75rem;
  top: 0.4rem;
  font-size: 2rem;
  line-height: 1;
  font-family: "Cormorant Garamond", Georgia, serif;
  color: rgba(119, 90, 25, 0.35);
  font-style: normal;
}
.guide-pullquote p { margin: 0; line-height: 1.6; }

/* ── Чеклист с вертикальной линией ── */
.guide-steps-list {
  position: relative;
  display: grid;
  gap: 0;
}
.guide-steps-list::before {
  content: '';
  position: absolute;
  /* 0.25rem (item padding-left) + 0.875rem (половина кружка 1.75rem) = 1.125rem */
  left: 1.125rem;
  /* от центра первого кружка до центра последнего */
  top: calc(0.75rem + 0.875rem);
  bottom: calc(0.75rem + 0.875rem);
  width: 1px;
  background: linear-gradient(180deg, rgba(119,90,25,0.4), rgba(119,90,25,0.1));
}
.guide-step-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0.25rem;
}
.guide-step-item + .guide-step-item {
  border-top: 1px solid rgba(119, 90, 25, 0.07);
}
.guide-step-item__num {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b6012, #c9a84c);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  font-family: "PonomarUnicodeTTRegular", serif;
  letter-spacing: 0.04em;
  margin-top: 0.05rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px #fff;
}
.guide-step-item__text {
  font-family: "Cormorant Garamond", "PonomarUnicodeTTRegular", serif;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: rgba(27, 28, 25, 0.84);
  line-height: 1.5;
  padding-top: 0.05rem;
}

/* ── Боковая навигация ── */
.guide-toc-link {
  display: block;
  padding: 0.4rem 0.6rem;
  border-left: 2px solid transparent;
  font-family: "PonomarUnicodeTTRegular", "Cormorant Garamond", serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(23, 56, 9, 0.55);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  border-radius: 0 4px 4px 0;
}
.guide-toc-link:hover {
  color: rgba(23, 56, 9, 0.88);
  border-left-color: rgba(119, 90, 25, 0.4);
  background: rgba(119, 90, 25, 0.04);
}
.guide-toc-link--active,
.guide-toc-link--featured {
  font-weight: 800;
  color: #775a19;
  border-left-color: #c9a84c;
  background: rgba(119, 90, 25, 0.06);
}

/* ═══════════════ ТЁМНАЯ ТЕМА ═══════════════ */
html.theme-dark .guide-chip {
  background: rgba(255,255,255,0.07);
  border-color: rgba(201,168,76,0.3);
  color: rgba(210,225,200,0.85);
}
html.theme-dark .guide-chip:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(201,168,76,0.5);
}
html.theme-dark .guide-section-heading__icon {
  background: rgba(255,255,255,0.06);
  border-color: rgba(201,168,76,0.25);
  color: #c9a84c;
}
html.theme-dark .guide-section-heading h2 { color: rgba(210,225,200,0.9); }
html.theme-dark .guide-accordion {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(201,168,76,0.15);
}
html.theme-dark .guide-accordion:hover { border-color: rgba(201,168,76,0.28); }
html.theme-dark .guide-accordion[open] { border-left-color: #c9a84c; }
html.theme-dark .guide-accordion__summary { color: rgba(210,225,200,0.9); }
html.theme-dark .guide-accordion__summary::after { color: rgba(201,168,76,0.5); }
html.theme-dark .guide-accordion__summary:hover { background: rgba(255,255,255,0.04); }
html.theme-dark .guide-accordion[open] > .guide-accordion__summary { background: rgba(255,255,255,0.03); }
html.theme-dark .guide-accordion__index { background: rgba(255,255,255,0.06); border-color: rgba(201,168,76,0.22); color: #c9a84c; }
html.theme-dark .guide-accordion[open] .guide-accordion__index { background: linear-gradient(135deg,#7a5410,#c9a84c); color:#fff; border-color: transparent; }
html.theme-dark .guide-accordion__body { color: rgba(210,225,200,0.78); border-top-color: rgba(201,168,76,0.1); }
html.theme-dark .guide-accordion__body > p:first-child::first-letter { color: #c9a84c; }
html.theme-dark .guide-pullquote { border-left-color: rgba(201,168,76,0.55); background: linear-gradient(90deg,rgba(201,168,76,0.07),rgba(201,168,76,0.01)); color: rgba(210,225,200,0.7); }
html.theme-dark .guide-pullquote::before { color: rgba(201,168,76,0.35); }
html.theme-dark .guide-pillar-card__inner::after { color: rgba(201,168,76,0.2); }
html.theme-dark .guide-pillar-card { background: rgba(255,255,255,0.04); border-color: rgba(201,168,76,0.14); }
html.theme-dark .guide-pillar-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.35); }
html.theme-dark .guide-pillar-card__title { color: rgba(210,225,200,0.9); }
html.theme-dark .guide-pillar-card__desc { color: rgba(210,225,200,0.65); }
html.theme-dark .guide-pillar-card__practice { border-top-color: rgba(201,168,76,0.1); }
html.theme-dark .guide-pillar-card__practice-text { color: rgba(210,225,200,0.55); }
html.theme-dark .guide-pullquote { border-left-color: rgba(201,168,76,0.55); background: linear-gradient(90deg, rgba(201,168,76,0.07), rgba(201,168,76,0.02)); color: rgba(210,225,200,0.7); }
html.theme-dark .guide-steps-list::before { background: linear-gradient(180deg, rgba(201,168,76,0.4), rgba(201,168,76,0.1)); }
html.theme-dark .guide-step-item { border-top-color: rgba(201,168,76,0.07); }
html.theme-dark .guide-step-item__num { box-shadow: 0 0 0 3px #1c201a; }
html.theme-dark .guide-step-item__text { color: rgba(210,225,200,0.82); }
html.theme-dark .guide-toc-link { color: rgba(210,225,200,0.45); }
html.theme-dark .guide-toc-link:hover { color: rgba(210,225,200,0.85); border-left-color: rgba(201,168,76,0.45); background: rgba(201,168,76,0.05); }
html.theme-dark .guide-toc-link--active,
html.theme-dark .guide-toc-link--featured { color: #c9a84c; border-left-color: #c9a84c; background: rgba(201,168,76,0.07); }

.about-hero-pair {
  width: 100%;
}

@media (min-width: 640px) {
  .about-hero-pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.about-hero-pair__hierarchy,
.about-hero-pair__contacts {
  min-height: 100%;
  width: 100%;
}

.contacts-preview--hero {
  height: 100%;
}

.contacts-preview__link {
  color: inherit;
}

@media (hover: hover) and (pointer: fine) {
  .contacts-preview__link:hover {
    box-shadow: 0 14px 32px rgba(23, 56, 9, 0.08);
  }
}

.contacts-preview__portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.contacts-preview__thumb {
  overflow: hidden;
  width: 4.75rem;
  border: 1px solid rgba(119, 90, 25, 0.24);
  background: rgb(var(--c-surface-container-low));
  aspect-ratio: 3 / 4;
  box-shadow: 0 8px 22px rgba(23, 56, 9, 0.1);
}

@media (min-width: 768px) {
  .contacts-preview__thumb {
    width: 6.25rem;
  }
}

.contacts-preview__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.contacts-preview__caption {
  max-width: 6.25rem;
  text-align: center;
  line-height: 1.35;
}

.contacts-preview__hint br {
  display: none;
}

[data-mobile-drawer-root] {
  z-index: 80;
}

[data-mobile-drawer-root].is-open {
  pointer-events: auto;
}

[data-mobile-drawer] {
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
}

[data-mobile-drawer-root].is-open [data-mobile-drawer] {
  transform: translateX(0);
}

.mobile-site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.mobile-site-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.9rem 1.15rem;
  font-size: 0.8125rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgb(var(--c-primary));
  background: rgba(255, 255, 255, 0.62);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-site-nav__link.is-active,
.mobile-site-nav__link[aria-current="page"] {
  color: #fff;
  background: rgb(var(--c-primary-container));
}

html.theme-dark .mobile-site-nav__link,
html.dark .mobile-site-nav__link {
  color: rgba(244, 239, 229, 0.94);
  background: rgba(255, 255, 255, 0.07);
}

html.theme-dark .mobile-site-nav__link.is-active,
html.theme-dark .mobile-site-nav__link[aria-current="page"],
html.dark .mobile-site-nav__link.is-active,
html.dark .mobile-site-nav__link[aria-current="page"] {
  color: #fff;
  background: rgb(var(--c-primary-container));
}

[data-mobile-drawer] a:active,
button:active {
  transform: translateY(0);
}

[data-calendar-tooltip] {
  position: fixed;
  z-index: 70;
  max-width: 16rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(233, 193, 118, 0.45);
  background-color: rgba(27, 28, 25, 0.95);
  color: #ffdea5;
  font-family: "PonomarUnicodeTTRegular", "Cormorant Garamond", serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

[data-calendar-tooltip].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-month-today="true"] {
  box-shadow: inset 0 0 0 1px rgba(233, 193, 118, 0.85);
}

[data-install-banner] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 220ms ease, transform 220ms ease;
}

[data-install-banner].is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

html.theme-dark body,
html.dark body {
  background-color: rgb(var(--c-background));
  color: rgb(var(--c-on-background));
}

html.theme-dark .iconostasis-frame,
html.dark .iconostasis-frame {
  background-color: rgba(0, 0, 0, 0.22);
}

html.theme-dark .site-header,
html.dark .site-header {
  --header-bg: #2a5016;
  background-color: var(--header-bg);
}

html.theme-dark .site-brand-line-main,
html.theme-dark .site-nav-link,
html.dark .site-brand-line-main,
html.dark .site-nav-link {
  color: #f0ead6;
}

html.theme-dark .site-brand-line-sub,
html.dark .site-brand-line-sub {
  color: #f0ead6;
}

html.theme-dark .site-nav-link:hover,
html.theme-dark .site-nav-link.is-active,
html.theme-dark .site-nav-link[aria-current="page"],
html.dark .site-nav-link:hover,
html.dark .site-nav-link.is-active,
html.dark .site-nav-link[aria-current="page"] {
  color: #c9a84c;
}

html.theme-dark .site-header-util-btn,
html.dark .site-header-util-btn {
  color: #f0ead6;
}

html.theme-dark .carved-stone,
html.dark .carved-stone {
  border-color: rgba(var(--c-secondary-fixed-dim), 0.22);
}

html.theme-dark .guide-chip,
html.dark .guide-chip {
  border-color: rgba(233, 193, 118, 0.32);
  background: rgba(233, 193, 118, 0.08);
  color: rgba(255, 241, 212, 0.95);
}

html.theme-dark .guide-accordion,
html.dark .guide-accordion {
  border-color: rgba(233, 193, 118, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(233, 193, 118, 0.06) 100%);
}

html.theme-dark .guide-accordion__summary,
html.dark .guide-accordion__summary {
  color: rgba(255, 247, 227, 0.96);
}

html.theme-dark .guide-accordion__index,
html.dark .guide-accordion__index {
  border-color: rgba(233, 193, 118, 0.35);
  color: rgba(255, 229, 171, 0.96);
  background: rgba(233, 193, 118, 0.12);
}

html.theme-dark .guide-accordion__body,
html.dark .guide-accordion__body {
  border-top-color: rgba(233, 193, 118, 0.2);
  color: rgba(238, 234, 223, 0.9);
}

html.theme-dark .site-brand-line-main,
html.theme-dark .site-brand-line-sub,
html.dark .site-brand-line-main,
html.dark .site-brand-line-sub {
  color: #f0ead6;
}

/* Dark theme: readable text on cards, mini-blocks, and muted copy */
html.theme-dark [class*="bg-white/"],
html.dark [class*="bg-white/"] {
  background-color: rgba(var(--c-surface-container-high), 0.96) !important;
}

html.theme-dark [class*="hover:bg-white"]:hover,
html.dark [class*="hover:bg-white"]:hover {
  background-color: rgb(var(--c-surface-container-highest)) !important;
}

html.theme-dark .text-primary:not(.byzantine-shimmer),
html.dark .text-primary:not(.byzantine-shimmer) {
  color: rgb(var(--c-primary-fixed)) !important;
}

html.theme-dark [class*="text-tertiary"],
html.dark [class*="text-tertiary"] {
  color: rgb(var(--c-on-surface-variant)) !important;
}

html.theme-dark .text-secondary,
html.dark .text-secondary {
  color: rgb(var(--c-secondary-fixed-dim)) !important;
}

html.theme-dark .font-label[class*="text-secondary"],
html.dark .font-label[class*="text-secondary"] {
  color: rgb(var(--c-secondary)) !important;
}

html.theme-dark .sacred-copy,
html.dark .sacred-copy,
html.theme-dark .iconostasis-frame,
html.dark .iconostasis-frame {
  color: rgb(var(--c-on-surface));
}

html.theme-dark .home-hero-plaque,
html.dark .home-hero-plaque {
  background: rgb(var(--c-background));
  color: rgb(var(--c-on-surface));
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.32),
    0 2px 0 rgba(195, 161, 86, 0.14);
}

html.theme-dark .home-hero-plaque .home-hero-title-block,
html.dark .home-hero-plaque .home-hero-title-block {
  background-color: rgb(var(--c-background));
}

html.theme-dark .home-hero-plaque [class*="border-secondary"],
html.dark .home-hero-plaque [class*="border-secondary"] {
  border-color: rgba(195, 161, 86, 0.16) !important;
}

html.theme-dark .home-hero-plaque .home-hero-title-block h1,
html.dark .home-hero-plaque .home-hero-title-block h1 {
  text-shadow: none;
}

html.theme-dark .home-hero-side-mark,
html.dark .home-hero-side-mark {
  color: rgba(233, 193, 118, 0.35);
}

html.theme-dark .news-cover-frame,
html.dark .news-cover-frame {
  background: rgba(var(--c-surface-container), 0.65);
}

html.theme-dark .bg-surface-container-high\/80,
html.dark .bg-surface-container-high\/80 {
  background-color: rgba(var(--c-surface-container-high), 0.92) !important;
}

html.theme-dark footer .text-white\/60,
html.dark footer .text-white\/60,
html.theme-dark footer .text-white\/20,
html.dark footer .text-white\/20 {
  color: rgba(255, 248, 235, 0.88) !important;
}

html.theme-dark footer a.text-white\/60:hover,
html.dark footer a.text-white\/60:hover {
  color: #fff !important;
}

/* News cover frames: card (16:9 on home) and detail page */
.news-cover-frame {
  overflow: hidden;
  background: rgba(23, 56, 9, 0.06);
}

.news-cover-frame--detail {
  background: rgba(23, 56, 9, 0.04);
}

.news-cover--card {
  display: block;
  width: 100%;
  height: 13rem;
}

@media (min-width: 768px) {
  .news-cover--card {
    height: 14rem;
  }
}

.news-cover--landscape.news-cover--card,
.news-cover--square.news-cover--card {
  object-fit: cover;
  object-position: top center; /* лик святых/иконы всегда наверху фото */
}

.news-cover--portrait.news-cover--card {
  object-fit: cover;
  object-position: top center;
}

/* Fallback: cover взята не через настоящее поле, а из галереи — покажем целиком, без обрезки. */
.news-cover--fallback.news-cover--card {
  object-fit: contain !important;
  object-position: center !important;
  background: linear-gradient(180deg, #faf6e8 0%, #f0e8cf 100%);
}

/* Home «Последняя новость» card — excerpt показывается с многоточием, не обрывается на середине слова. */
.home-featured-news-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-cover--detail {
  display: block;
  width: 100%;
  max-height: 26.25rem;
}

.news-cover--landscape.news-cover--detail,
.news-cover--square.news-cover--detail {
  object-fit: cover;
  object-position: center;
}

.news-cover--portrait.news-cover--detail {
  object-fit: contain;
  object-position: top center;
}

/* Saint Alexiy icon: gallery hero and home preview cards */
.gallery-saint-hero-section {
  padding: 0.25rem 0 1.5rem;
}

.gallery-saint-hero-shell {
  box-shadow:
    0 18px 42px rgba(23, 56, 9, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.gallery-saint-hero-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(16rem, 42vw, 24rem);
}

.gallery-saint-hero-backdrop {
  position: absolute;
  inset: 1.25rem 1.5rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 38%, rgba(233, 193, 118, 0.28), transparent 62%),
    radial-gradient(circle at 50% 100%, rgba(23, 56, 9, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(248, 244, 235, 0.95), rgba(243, 236, 220, 0.55));
  box-shadow: inset 0 0 0 1px rgba(119, 90, 25, 0.12);
}

.gallery-saint-hero-image {
  width: min(100%, 22rem);
  height: auto;
  max-height: min(72vh, 24rem);
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 14px 28px rgba(23, 56, 9, 0.18));
}

.gallery-card-saint-frame {
  background:
    radial-gradient(circle at 50% 35%, rgba(233, 193, 118, 0.22), transparent 58%),
    linear-gradient(180deg, var(--surface-cream-strong), rgba(248, 244, 235, 0.72));
}

.gallery-card-saint-image {
  object-fit: contain;
  object-position: center top;
  padding: 0.65rem 0.85rem 0.35rem;
  transform-origin: center center;
}

.gallery-card-saint-frame .gallery-card-saint-image {
  transform: scale(1);
}

.group:hover .gallery-card-saint-image {
  transform: scale(1.04);
}

html.theme-dark .gallery-saint-hero-backdrop,
html.dark .gallery-saint-hero-backdrop {
  background:
    radial-gradient(circle at 50% 38%, rgba(233, 193, 118, 0.16), transparent 62%),
    radial-gradient(circle at 50% 100%, rgba(23, 56, 9, 0.35), transparent 70%),
    linear-gradient(180deg, rgba(35, 38, 32, 0.92), rgba(23, 25, 19, 0.72));
  box-shadow: inset 0 0 0 1px rgba(233, 193, 118, 0.14);
}

html.theme-dark .gallery-card-saint-frame,
html.dark .gallery-card-saint-frame {
  background:
    radial-gradient(circle at 50% 35%, rgba(233, 193, 118, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(35, 38, 32, 0.95), rgba(23, 25, 19, 0.8));
}

.gallery-item__open {
  position: absolute;
  inset: 0;
  z-index: 5;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-item__open:focus-visible {
  outline: 2px solid rgba(119, 90, 25, 0.85);
  outline-offset: -3px;
}

.gallery-lightbox {
  margin: 0;
  padding: clamp(0.75rem, 3vw, 1.5rem);
  border: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: transparent;
}

.gallery-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox::backdrop {
  background: rgba(15, 22, 10, 0.78);
  backdrop-filter: blur(4px);
}

.gallery-lightbox__panel {
  position: relative;
  display: flex;
  width: min(56rem, 100%);
  height: min(86vh, 52rem);
  max-height: calc(100dvh - 2rem);
  flex-direction: column;
  overflow: hidden;
  background: rgba(251, 249, 243, 0.98);
  box-shadow:
    0 28px 64px rgba(15, 22, 10, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.gallery-lightbox__image-wrap {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-height: 10rem;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  background:
    radial-gradient(circle at 50% 20%, rgba(233, 193, 118, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(248, 244, 235, 0.9), rgba(243, 236, 220, 0.45));
}

.gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 16px 36px rgba(23, 56, 9, 0.18);
}

.gallery-lightbox__image--contain {
  max-height: 100%;
}

.gallery-lightbox__meta {
  flex: 0 0 auto;
  max-height: 9rem;
  overflow-y: auto;
  border-top: 1px solid rgba(119, 90, 25, 0.14);
  padding: 1rem 1.25rem 1.25rem;
}

.gallery-lightbox__caption {
  min-height: 1.35rem;
}

.gallery-lightbox__caption.is-empty {
  display: none;
}

.gallery-lightbox__counter {
  margin: 0.65rem 0 0;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(119, 90, 25, 0.22);
  background: rgba(251, 249, 243, 0.94);
  color: rgb(var(--c-primary));
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover {
  border-color: rgba(119, 90, 25, 0.45);
  background: #fff;
}

.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:focus-visible {
  outline: 2px solid rgba(119, 90, 25, 0.85);
  outline-offset: 2px;
}

.gallery-lightbox__close {
  top: 0.65rem;
  right: 0.65rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
}

.gallery-lightbox__nav {
  top: 50%;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  transform: translateY(-50%);
}

.gallery-lightbox__nav--prev {
  left: 0.65rem;
}

.gallery-lightbox__nav--next {
  right: 0.65rem;
}

html.theme-dark .gallery-lightbox__panel,
html.dark .gallery-lightbox__panel {
  background: rgba(35, 38, 32, 0.98);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html.theme-dark .gallery-lightbox__image-wrap,
html.dark .gallery-lightbox__image-wrap {
  background:
    radial-gradient(circle at 50% 20%, rgba(233, 193, 118, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(35, 38, 32, 0.95), rgba(23, 25, 19, 0.75));
}

html.theme-dark .gallery-lightbox__close,
html.dark .gallery-lightbox__close,
html.theme-dark .gallery-lightbox__nav,
html.dark .gallery-lightbox__nav {
  background: rgba(35, 38, 32, 0.94);
  color: rgba(244, 239, 229, 0.94);
  border-color: rgba(233, 193, 118, 0.22);
}

.schedule-month-cell--empty.carved-stone {
  background: rgba(255, 255, 255, 0.6);
  color: #3f4a36;
}

.schedule-month-cell--conifer_green.carved-stone {
  background: linear-gradient(180deg, #2d5a27 0%, #1f4220 100%);
  color: #f4f9ef;
  border-color: #3f6f39;
}

.schedule-month-cell--red.carved-stone {
  background: linear-gradient(180deg, #8f2b2b 0%, #6d1d1d 100%);
  color: #fff5f5;
  border-color: #a33a3a;
}

.schedule-month-cell--dark_purple.carved-stone {
  background: linear-gradient(180deg, #4a2d5e 0%, #321c42 100%);
  color: #f7f0fb;
  border-color: #5f3f78;
}

.schedule-month-cell--gold.carved-stone {
  background: linear-gradient(180deg, #c9a24f 0%, #9a7428 100%);
  color: #2b2208;
  border-color: #b8892f;
}

.schedule-month-cell--black.carved-stone {
  background: linear-gradient(180deg, #2a2a2a 0%, #101010 100%);
  color: #f0f0f0;
  border-color: #444;
}

.schedule-month-cell--dark_blue.carved-stone {
  background: linear-gradient(180deg, #2f4f7a 0%, #1c3558 100%);
  color: #eef5ff;
  border-color: #3f628f;
}

.schedule-month-cell--white.carved-stone {
  background: linear-gradient(180deg, #ffffff 0%, #f3f0e8 100%);
  color: #173809;
  border-color: #d8dccf;
}

html.theme-dark .hero-cta,
html.dark .hero-cta {
  border-color: rgba(233, 193, 118, 0.35);
  background: rgba(35, 38, 32, 0.92);
  color: rgba(244, 239, 229, 0.94);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 18px rgba(0, 0, 0, 0.22);
}

html.theme-dark .hero-cta:hover,
html.dark .hero-cta:hover {
  background: rgba(45, 50, 40, 0.98);
  color: rgb(var(--c-secondary-fixed));
}

@media (max-width: 767px) {
  .home-hero-plaque {
    overflow: visible;
  }

  .home-hero-plaque .home-hero-image-wrap {
    max-height: none;
    overflow: visible;
    background: transparent;
  }

  .home-hero-plaque picture.home-hero-image img {
    min-height: 0;
    max-height: none;
    height: auto;
    width: 100%;
    object-fit: contain;
    object-position: center top;
    transform: none;
    filter: none;
  }

  /* Светлая тема: desktop-правило с max-height выше по специфичности — сбрасываем как у тёмной */
  html:not(.theme-dark):not(.dark) .home-hero-plaque picture.home-hero-image--light img {
    max-height: none;
    min-height: 0;
    object-fit: contain;
    object-position: center top;
  }

  html.theme-dark .home-hero-plaque picture.home-hero-image--dark img,
  html.dark .home-hero-plaque picture.home-hero-image--dark img {
    filter: saturate(0.95) contrast(1.02) brightness(0.98);
  }

  .home-hero-plaque .home-hero-image-wrap::before,
  .home-hero-plaque .home-hero-image-wrap::after,
  html:not(.theme-dark):not(.dark) .home-hero-plaque .home-hero-image-wrap::before,
  html:not(.theme-dark):not(.dark) .home-hero-plaque .home-hero-image-wrap::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .home-hero-cta-row {
    padding-inline: 0.65rem;
  }

  .hero-cta {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 9.5rem;
    padding-inline: 0.75rem;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ── Improvement #2: subtle glow on labels in dark mode ── */
html.theme-dark .font-label,
html.dark .font-label {
  text-shadow: 0 0 14px rgba(var(--c-secondary), 0.3);
}

/* ── Improvement #4: Cormorant Garamond for italic paragraph body text ── */
p.font-headline.italic,
li.font-headline.italic {
  font-family: "Cormorant Garamond", "PonomarUnicodeTTRegular", serif;
  font-weight: 500;
  line-height: 1.62;
}

/* ── Improvement #6: week-day pill strip on schedule page ── */
.week-day-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(var(--c-outline), 0.18);
  background: rgba(255, 255, 255, 0.55);
  color: rgb(var(--c-on-surface-variant));
  text-decoration: none;
  min-width: 3.1rem;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.week-day-pill:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(var(--c-secondary), 0.3);
}

.week-day-pill.is-today {
  background: linear-gradient(
    180deg,
    rgba(var(--c-secondary-container), 0.8) 0%,
    rgba(var(--c-secondary-container), 0.5) 100%
  );
  border-color: rgba(var(--c-secondary), 0.5);
  color: rgb(var(--c-secondary));
}

html.theme-dark .week-day-pill,
html.dark .week-day-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(var(--c-outline), 0.25);
}

html.theme-dark .week-day-pill:hover,
html.dark .week-day-pill:hover {
  background: rgba(255, 255, 255, 0.12);
}

.week-day-pill__name {
  display: block;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.week-day-pill__num {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

/* ── Improvement #7: stronger accessible button visibility ── */
.site-header .site-header-accessible-link {
  border-color: rgba(195, 161, 86, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 235, 0.18),
    0 0 8px rgba(195, 161, 86, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.07);
}

/* ── Improvement #8: footer newsletter carved input ── */
.footer-newsletter-input {
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.38), inset 0 1px 3px rgba(0, 0, 0, 0.22);
  border-color: rgba(195, 161, 86, 0.28) !important;
}

.footer-newsletter-input:focus {
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(195, 161, 86, 0.52);
  outline: none;
}

/* ── Improvement #9: gallery album badge overlay ── */
.gallery-carousel__album-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.22rem 0.68rem;
  background: linear-gradient(
    135deg,
    rgba(23, 56, 9, 0.88) 0%,
    rgba(42, 32, 10, 0.88) 100%
  );
  border: 1px solid rgba(195, 161, 86, 0.38);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgb(var(--c-secondary));
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ── Improvement #10: scroll fade-in animations ── */
@media (prefers-reduced-motion: no-preference) {
  [data-fade-in] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  [data-fade-in].fade-in-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Медальоны таинств и богослужений ── */
.sacrament-medallion,
.service-medallion {
  filter: drop-shadow(0 4px 8px rgba(23, 56, 9, 0.28));
}

/* Тёмная тема: тёмные медальоны видны, светлые скрыты */
html.theme-dark .medallion-light { display: none; }

/* Светлая тема: светлые медальоны видны, тёмные скрыты */
html:not(.theme-dark) .medallion-dark { display: none; }

/* Светлые медальоны — мягкая золотистая тень */
html:not(.theme-dark) .medallion-light {
  filter: drop-shadow(0 4px 12px rgba(140, 100, 20, 0.22));
}

/* ── Активный подраздел в форме записок ── */
button[data-note-subcategory].note-subcat-active {
  background-color: #5c3d10 !important;
  border-color: #5c3d10 !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(60, 38, 8, 0.38);
}

html.theme-dark button[data-note-subcategory].note-subcat-active {
  background-color: #c9a84c !important;
  border-color: #c9a84c !important;
  color: #1a0e00 !important;
}

/* ============================================================
   МОБИЛЬНЫЙ РЕДИЗАЙН (≤640px) — добавлено 2026-06-04
   Контент во всю ширину, без золотой иконостасной рамки и «панели».
   ============================================================ */
@media (max-width: 640px) {
  /* Основной контейнер — в край экрана, без рамки/тени/панели.
     Внутренний p-4 (16px) сохраняем — карточкам нужен лёгкий отступ,
     а hero делает breakout +32px и выходит точно к краям экрана. */
  .iconostasis-frame.site-container {
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-image: none;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  /* Золотой фестон-орнамент над рамкой — убрать */
  .iconostasis-frame::before { display: none; }

  /* Карточки мягче, без тяжёлой «коробки» */
  .carved-stone {
    box-shadow: 0 6px 18px rgba(23, 56, 9, 0.07);
  }

  /* Фото-обложки новостей/служб выше — заметнее на мобиле */
  .news-cover--card { height: 15.5rem; }
}
