/* ============================================
   MODERN CHURCH WEBSITE STYLES
   Design System — профессиональный веб-дизайн
   Цвета подставляются из палитры (tenant-config.js)
   ============================================ */

/* ——— Design Tokens ——— */
:root {
  /* Neutral / fallbacks для текста до загрузки палитры */
  --white: #FFFFFF;
  --text-dark: var(--color-text-on-light, #0f172a);
  --text-light: var(--color-text-on-light, #475569);
  --text-muted: var(--color-text-on-light, #64748b);
  
  /* Shadows — читаемая глубина и иерархия */
  --shadow-sm: 0 4px 12px rgba(var(--color-dark-rgb, 11, 29, 52), 0.08);
  --shadow-md: 0 12px 32px rgba(var(--color-dark-rgb, 11, 29, 52), 0.12);
  --shadow-lg: 0 20px 50px rgba(var(--color-dark-rgb, 11, 29, 52), 0.16);
  --shadow-xl: 0 32px 64px rgba(var(--color-dark-rgb, 11, 29, 52), 0.2);
  --shadow-glow: 0 16px 40px rgba(var(--color-primary-rgb, 0, 94, 68), 0.25);
  
  /* Spacing Scale — 8px base, модифицированная мажорная секунда */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 1rem;     /* 16px */
  --spacing-md: 1.5rem;   /* 24px */
  --spacing-lg: 2.25rem;  /* 36px */
  --spacing-xl: 3.5rem;   /* 56px */
  --spacing-xxl: 5rem;    /* 80px */
  
  /* Typography Scale — модулярная шкала 1.2 */
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  /* Playfair при выборе в админке: задаётся на :root из tenant-config.js */
  --modern-display-heading-font: var(--font-heading);
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 2rem;       /* 32px */
  --text-4xl: 2.5rem;     /* 40px */
  
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  --leading-loose: 1.9;
  
  /* Motion — ease-out для естественности */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radius — согласованная система (мягкие углы для церковной тематики) */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 1000;
  --z-modal: 10000;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-dark);
  line-height: var(--leading-relaxed);
  letter-spacing: 0.01em;
  background: var(--color-background-body, #f2f5fa);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(var(--color-primary-rgb, 44, 95, 124), 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(var(--color-primary-rgb, 44, 95, 124), 0.04), transparent);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  padding-top: 70px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body:has(.header-centered) {
  padding-top: 100px;
}

body.theme-modern:has(.header-centered) {
  padding-top: 96px; /* двухуровневая шапка: компактная верхняя строка + навигация */
}
@media (max-width: 1024px) {
  body.theme-modern:has(.header-centered) {
    padding-top: 72px; /* мобильная шапка — одна строка */
  }
}

/* Floating Decorative Elements */
.floating-elements {
  display: none; /* Убираем фоновые эмодзи храма */
}

.floating-icon {
  position: absolute;
  font-size: 200px;
  color: var(--primary-deep);
  animation: float 20s infinite ease-in-out;
}

.floating-icon:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.floating-icon:nth-child(2) {
  top: 50%;
  right: 15%;
  animation-delay: 7s;
}

.floating-icon:nth-child(3) {
  bottom: 15%;
  left: 20%;
  animation-delay: 14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.03;
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
    opacity: 0.05;
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
    opacity: 0.03;
  }
}

/* Container — оптимальная ширина для контента ~72rem */
.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: all var(--transition-normal);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.main-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(var(--color-dark-rgb, 11, 29, 52), 0.1);
}

body.theme-modern .main-header.scrolled {
  background: var(--color-background-footer, linear-gradient(135deg, #2C5F7C 0%, #1E4258 100%));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.88) 5%, var(--accent-warm, rgba(242, 245, 255, 0.7)) 55%, rgba(var(--color-primary-rgb, 47, 155, 121), 0.4) 100%);
  z-index: -1;
  border-bottom: 1px solid rgba(var(--color-dark-rgb, 16, 28, 47), 0.08);
  transition: background var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

/* Современная тема: шапка в цвет футера, слегка прозрачная */
body.theme-modern .main-header {
  background: transparent;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

body.theme-modern .header-background {
  z-index: 0;
  background: transparent;
  position: relative;
}

body.theme-modern .header-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-background-footer, linear-gradient(135deg, #2C5F7C 0%, #1E4258 100%));
  opacity: 0.92;
  pointer-events: none;
}

body.theme-modern .header-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Верхняя строка: короткое название храма — обрамление на всю ширину экрана */
.header-name-row {
  display: none;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0.45rem var(--spacing-md);
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0.04) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 2px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  box-sizing: border-box;
}

.header-name-row::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255, 255, 255, 0.2) 50%, transparent 95%);
  pointer-events: none;
}

.header-name-row-link {
  display: block;
  text-decoration: none;
  color: inherit;
  max-width: 72rem;
  margin: 0 auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.header-name-row-link:hover {
  opacity: 0.95;
}

.header-church-name-full {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.35;
  color: var(--color-text-on-footer, #f5f8fc);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: none;
  text-transform: uppercase;
  /* до 2 строк при длинном названии (до ~50 символов) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

/* Playfair в админке: короткое название (верхняя строка + мобильный блок) — жирное */
body.theme-modern.modern-heading-playfair .header-church-name-full {
  font-weight: 700;
}

body.theme-modern.modern-heading-playfair .header-logo-mobile .logo-title,
body.theme-modern.modern-heading-playfair .header-logo-mobile .logo-subtitle {
  font-weight: 700;
}

/* Нижняя строка: логотип и навигация */
.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
}

.main-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--color-primary-rgb, 47, 155, 121), 0.25), transparent);
  opacity: 0.8;
  pointer-events: none;
}

/* Современная тема: скрываем декоративную линию под хедером (нижняя граница задаётся .header-background) */
body.theme-modern .main-header::after {
  display: none;
}

/* Орнаменты в шапке (десктоп, современная тема): готовый SVG слева, справа — отражение */
.header-ornament {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(200px, 20vw);
  max-width: 280px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background-repeat: repeat-y;
  background-color: transparent;
}

.header-ornament--left {
  left: 0;
  background-image: url('/img/header_img.svg');
  background-position: left center;
  background-size: auto 100%;
}

.header-ornament--right {
  right: 0;
  background-image: url('/img/header_img.svg');
  background-position: 0% 50%;
  background-size: auto 100%;
  transform: scaleX(-1);
}

@media (min-width: 1025px) {
  body.theme-modern .header-ornament {
    display: block;
  }
}

/* ============================================
   HEADER CENTERED LAYOUT
   Логотип посередине, ссылки автоматически делятся пополам слева и справа
   ============================================ */
@media (min-width: 1025px) {
  /* Двухуровневая шапка modern: верхняя строка — название, нижняя — навигация */
  body.theme-modern .header-centered .header-content {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
  }

  body.theme-modern .header-centered .header-name-row {
    display: block;
    flex-shrink: 0;
  }

  body.theme-modern .header-centered .header-main-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5cm;
    gap: var(--spacing-sm);
    max-width: none;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow: visible;
  }

  .header-centered .header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem var(--spacing-md);
    gap: var(--spacing-md);
  }

  .header-centered .header-logo-mobile {
    display: none !important;
  }

  .header-centered .mobile-menu-toggle {
    display: none;
  }

  .header-centered .main-nav {
    flex: 1;
    display: flex;
    position: relative;
    right: auto;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    justify-content: center;
    margin-left: 0;
    padding: 0;
  }

  .header-centered .header-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    gap: var(--spacing-lg);
  }

  /* Высота строки только от кнопок (макс. раздел); логотип на это не влияет */
  body.theme-modern .header-centered .header-nav-row {
    position: relative;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow: visible;
    min-width: 0;
    align-items: stretch;
  }

  /* Логотип: своя жизнь. Вынесен из потока, фиксированный размер, по центру; при короткой строке может выступать — для этого есть отступы у родителя */
  body.theme-modern .header-centered .header-nav-row .header-branding-wrapper {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: auto;
  }

  body.theme-modern .header-centered .nav-list-left,
  body.theme-modern .header-centered .nav-list-right {
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
    gap: 0.35rem 0.5rem;
    padding-top: 0;
    padding-bottom: 0;
    align-items: stretch;
    align-self: stretch;
  }

  /* Место под логотип по центру, чтобы кнопки не заходили под него */
  body.theme-modern .header-centered .nav-list-left {
    padding-right: 2.5rem;
  }
  body.theme-modern .header-centered .nav-list-right {
    padding-left: 2.5rem;
  }

  /* Пункты сжимаются по ширине; высота строки — по самой высокой кнопке; контейнер для масштаба шрифта */
  body.theme-modern .header-centered .nav-list-left li,
  body.theme-modern .header-centered .nav-list-right li {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: stretch;
    container-type: inline-size;
    container-name: nav-item;
  }

  body.theme-modern .header-centered .nav-list-left li.nav-folder,
  body.theme-modern .header-centered .nav-list-right li.nav-folder {
    position: relative;
  }

  /* Надпись внутри кнопки: до 2 строк; выравнивание по центру по X и Y (flex + внутренний span) */
  body.theme-modern .header-centered .header-nav-row .nav-link {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    align-self: stretch;
  }

  body.theme-modern .header-centered .header-nav-row .nav-link .nav-link-text {
    overflow: hidden;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.2;
    text-align: center;
  }

  .header-centered .nav-list-left,
  .header-centered .nav-list-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-self: center;
    list-style: none;
    margin: 0;
    padding: 0;
    padding-top: 0.4rem;
    gap: 0.25rem 0.6rem;
  }

  .header-centered .nav-list-left {
    justify-content: flex-end;
  }

  .header-centered .nav-list-right {
    justify-content: flex-start;
  }

  .header-centered .header-branding-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    gap: 0.35rem;
  }

  .header-centered .header-church-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(380px, 85vw);
    text-align: center;
  }

  /* Обе части названия храма — один размер и начертание */
  .header-centered .header-church-name .logo-title,
  .header-centered .header-church-name .logo-subtitle {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    display: inline;
  }

  .header-centered .header-church-name .logo-subtitle::before {
    content: ' ';
  }

  .header-centered .header-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(var(--color-primary-rgb, 47, 155, 121), 0.2);
    box-shadow: 
      0 4px 24px rgba(var(--color-dark-rgb, 11, 29, 52), 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  .header-centered .header-branding .logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: 
      0 2px 16px rgba(0, 0, 0, 0.08),
      0 0 0 2px rgba(255, 255, 255, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: box-shadow var(--transition-fast);
  }

  .header-centered .header-branding:hover .logo-icon {
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.1),
      0 0 0 2px rgba(var(--color-primary-rgb, 47, 155, 121), 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }

  .header-centered .mobile-menu-close {
    display: none;
  }

  .header-centered .nav-link {
    font-size: clamp(0.7rem, 0.6vw, 0.8rem);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
  }
}

/* ============================================
   DESKTOP: современная тема — компактная шапка, акцент темы, чёткий контраст
   ============================================ */
@media (min-width: 1025px) {
  body.theme-modern .main-header {
    min-height: 0;
    overflow: visible;
    z-index: 1100;
  }

  body.theme-modern .header-centered .header-content {
    max-width: 100%;
    margin: 0;
    padding: 0.6rem 0;
    gap: var(--spacing-sm);
  }

  /* Верхняя строка (название храма) — на всю ширину экрана, только десктоп (на мобильных скрыта ниже) */
  body.theme-modern .header-centered .header-name-row {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    box-sizing: border-box;
  }

  body.theme-modern .header-centered .header-nav-row {
    gap: var(--spacing-md);
  }

  body.theme-modern .header-centered .header-church-name {
    max-width: min(360px, 88vw);
  }

  /* Название храма — тот же шрифт заголовков, что и у разделов (админка: Cormorant / Playfair) */
  body.theme-modern .header-centered .header-church-name .logo-title,
  body.theme-modern .header-centered .header-church-name .logo-subtitle {
    font-family: var(--modern-display-heading-font, var(--font-heading));
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.25;
    opacity: 1;
  }

  body.theme-modern .header-centered .header-branding {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(var(--color-primary-rgb, 44, 95, 124), 0.2);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
  }

  body.theme-modern .header-centered .header-branding:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(var(--color-primary-rgb, 44, 95, 124), 0.35);
  }

  body.theme-modern .header-centered .header-branding .logo-icon {
    width: 42px;
    height: 42px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  }

  /* Убираем подчёркивание у ссылок в шапке */
  body.theme-modern .header-centered .nav-link::after {
    display: none !important;
  }

  /* Навигация: шрифт подстраивается под ширину кнопки — всё влезает (1–2 строки) */
  body.theme-modern .header-centered .nav-link {
    font-family: var(--font-body);
    font-size: clamp(0.5rem, 5.5cqw, calc(0.8125rem + 1px));
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 0.35rem clamp(0.25rem, 2.5cqw, 0.65rem);
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    color: rgba(255, 255, 255, 0.95) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
  }

  /* Узкие кнопки — меньше шрифт и отступы, чтобы текст целиком влезал */
  @container nav-item (max-width: 90px) {
    body.theme-modern .header-centered .nav-link {
      font-size: clamp(0.48rem, 5.2cqw, calc(0.7rem + 1px));
      padding: 0.3rem clamp(0.2rem, 2.2cqw, 0.55rem);
    }
  }
  @container nav-item (max-width: 65px) {
    body.theme-modern .header-centered .nav-link {
      font-size: clamp(0.42rem, 4.8cqw, calc(0.6rem + 1px));
      padding: 0.25rem clamp(0.18rem, 2cqw, 0.45rem);
    }
  }
  @container nav-item (max-width: 45px) {
    body.theme-modern .header-centered .nav-link {
      font-size: clamp(0.38rem, 4.2cqw, calc(0.52rem + 1px));
      padding: 0.2rem 0.22rem;
    }
  }

  body.theme-modern .header-centered .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-1px) scale(1.14);
  }

  /* Папка — выпадающий список: position:fixed и top/left задаются в JS под кнопку (та же логика шрифта у кнопки за счёт container) */
  body.theme-modern .header-centered .nav-folder__menu {
    position: fixed !important;
    top: 0;
    left: 0;
    transform: translateY(-4px) !important;
    display: none !important;
    margin-top: 0;
    min-width: 220px;
    padding: 0.5rem 0;
    background: #fff !important;
    background: var(--color-background-card, var(--background-light, #fff)) !important;
    color: var(--color-text-on-light, var(--primary-deep, #1a1a1a));
    border: 1px solid var(--color-border-light, rgba(0,0,0,0.08));
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 28px var(--color-shadow, rgba(0,0,0,0.15));
    z-index: 10002 !important;
  }

  body.theme-modern .header-centered .nav-folder--open .nav-folder__menu {
    display: block !important;
    transform: translateY(0) !important;
  }

  body.theme-modern .header-centered .nav-folder__link {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--primary-deep, var(--color-text-on-light, #1a1a1a)) !important;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.15s ease, color 0.15s ease;
  }

  body.theme-modern .header-centered .nav-folder__link:hover {
    background: var(--overlayLight, rgba(var(--primary-gold-rgb, 201, 169, 97), 0.12)) !important;
    color: var(--primary-deep, var(--color-text-on-light, #1a1a1a)) !important;
  }

  /* Блок логотипа: стеклянный эффект на тёмном фоне */
  body.theme-modern .header-centered .header-branding {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
  }

  body.theme-modern .header-centered .header-branding:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  }
}

/* Mobile: верхняя строка скрыта, одна полоса — логотип+название слева, гамбургер справа */
@media (max-width: 1024px) {
  .header-name-row {
    display: none !important;
  }

  .header-main-row {
    flex: 1;
    min-width: 0;
  }

  .header-centered .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .header-centered .header-logo-mobile {
    display: grid !important;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 0.65rem;
    order: 1;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
  }

  .header-centered .header-logo-mobile .logo-icon {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  }

  .header-centered .header-logo-mobile .logo-title {
    grid-column: 2;
    grid-row: 1;
    font-family: var(--modern-display-heading-font, var(--font-heading));
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--primary-deep);
    line-height: 1.15;
  }

  .header-centered .header-logo-mobile .logo-subtitle {
    grid-column: 2;
    grid-row: 2;
    font-family: var(--modern-display-heading-font, var(--font-heading));
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.2;
  }

  .header-centered .mobile-menu-toggle {
    order: 2;
  }

  /* Скрыть центрированный блок с логотипом в мобильном меню */
  .header-centered .header-branding-wrapper {
    display: none !important;
  }

  .header-centered .header-nav-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 90px var(--spacing-lg) var(--spacing-xl);
  }

  .header-centered .nav-list-left,
  .header-centered .nav-list-right {
    flex: none;
    justify-content: flex-start;
    flex-direction: column;
    padding: 0;
    margin: 0;
    gap: 0;
    border: none;
  }

  .header-centered .nav-list-right {
    padding-top: 0;
  }

  .header-centered .nav-list-left li,
  .header-centered .nav-list-right li {
    width: 100%;
    border-bottom: 1px solid rgba(var(--color-dark-rgb, 11, 29, 52), 0.08);
  }

  .header-centered .nav-list-left li:last-child,
  .header-centered .nav-list-right li:last-child {
    border-bottom: none;
  }

  .header-centered .header-nav-row .nav-link {
    color: var(--primary-deep);
  }

  .header-centered .header-nav-row .nav-link:hover {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb, 47, 155, 121), 0.1);
  }
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-xs) 0;
  gap: var(--spacing-md);
  position: relative;
  min-height: 0;
}

@media (min-width: 1024px) {
  .header-content {
    padding: calc(var(--spacing-xs) * 1.2) 0;
    gap: var(--spacing-sm);
  }

  .nav-list {
    flex-wrap: wrap;
    column-gap: 0.5rem;
    row-gap: 0.4rem;
    justify-content: flex-end;
    max-width: clamp(620px, 62vw, 760px);
  }

  .nav-list li {
    flex: 0 1 calc(20% - 0.5rem);
    display: flex;
  }

  .nav-link {
    font-size: clamp(0.72rem, 0.65vw, 0.8rem);
    letter-spacing: 0.03em;
    padding: 0.45rem 0.8rem;
    min-width: 0;
  }
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: var(--text-dark);
  z-index: 10;
  flex-shrink: 0;
  min-width: 0;
}

.logo-icon {
  width: 60px;
  height: 60px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
  transition: transform var(--transition-normal);
}

.logo:hover .logo-icon {
  transform: translateY(-2px) scale(1.05);
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.logo-title,
.logo-subtitle {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-deep);
  line-height: 1.25;
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.logo-subtitle {
  font-size: 1.25rem;
}

.logo-meta {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-light);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  z-index: 1001;
  transition: transform var(--transition-fast);
  position: relative;
}

/* Скрываем мобильное меню на десктопе */
@media (min-width: 1025px) {
  .mobile-menu-overlay {
    display: none !important;
  }
  
  .mobile-menu-close {
    display: none !important;
  }
  
  .main-nav {
    position: relative !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    display: flex !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
  }
}

.mobile-menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--primary-deep);
  border-radius: 3px;
  transition: all var(--transition-fast);
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translateY(10px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-10px);
}

/* Navigation */
.main-nav {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--spacing-xs);
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.nav-list li {
  flex: 0 1 auto;
}

.nav-link {
  position: relative;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  background: transparent;
  flex-shrink: 1;
  white-space: nowrap;
  width: 100%;
}

.nav-link:hover {
  color: var(--primary-deep);
  background: rgba(var(--color-primary-rgb, 47, 155, 121), 0.18);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 12px 22px rgba(var(--color-primary-rgb, 0, 94, 68), 0.18);
}

.nav-link:active {
  transform: translateY(1px);
}

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
  }

  .mobile-menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav {
    position: fixed !important;
    top: 0;
    right: -100%;
    width: min(360px, 82vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: linear-gradient(180deg, var(--white) 0%, var(--accent-warm) 100%);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15);
    transition: right var(--transition-normal) ease-in-out;
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    pointer-events: auto;
    touch-action: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav.active {
    right: 0 !important;
  }

  .mobile-menu-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 44px;
    height: 44px;
    background: rgba(var(--color-dark-rgb, 61, 40, 23), 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all var(--transition-fast);
    color: var(--primary-deep);
  }

  .mobile-menu-close span {
    font-size: 2rem;
    line-height: 1;
    font-weight: 300;
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 90px var(--spacing-lg) var(--spacing-xl);
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .nav-list li {
    width: 100%;
    border-bottom: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  }

  .nav-list li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--spacing-md);
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    margin: var(--spacing-xs) 0;
    white-space: normal;
    justify-content: flex-start;
    text-align: left;
  }

  /* Современная тема: мобильное меню — явный градиент в гамме темы (светлее сверху, глубже вниз) */
  body.theme-modern .main-nav {
    background: linear-gradient(165deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 35%,
        rgba(var(--color-dark-rgb, 11, 29, 52), 0.25) 70%,
        rgba(var(--color-dark-rgb, 11, 29, 52), 0.45) 100%),
      var(--color-background-footer, linear-gradient(135deg, #2C5F7C 0%, #1E4258 100%));
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.35);
  }

  body.theme-modern .main-nav .mobile-menu-close {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text-on-footer, #f5f8fc);
  }

  body.theme-modern .main-nav .nav-list li {
    border-bottom-color: rgba(255, 255, 255, 0.15);
  }

  body.theme-modern .main-nav .nav-link,
  body.theme-modern .main-nav .header-nav-row .nav-link {
    color: var(--color-text-on-footer, #f5f8fc);
  }

  body.theme-modern .main-nav .nav-link:hover,
  body.theme-modern .main-nav .header-nav-row .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  /* Папка в мобильной панели — оформленный выпадающий блок */
  body.theme-modern .main-nav .nav-folder {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  body.theme-modern .main-nav .nav-folder__trigger {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--spacing-md);
    font-size: 0.95rem;
    margin: 0;
    justify-content: flex-start;
    text-align: left;
    box-sizing: border-box;
    color: var(--color-text-on-footer, #f5f8fc) !important;
  }

  body.theme-modern .main-nav .nav-folder__menu {
    position: static;
    display: none;
    box-shadow: none;
    list-style: none;
    margin: 0 0 0.5rem 0;
    padding: 0.35rem 0 0.35rem var(--spacing-md);
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    max-height: 60vh;
    overflow-y: auto;
  }

  body.theme-modern .main-nav .nav-folder--open .nav-folder__menu {
    display: block;
  }

  body.theme-modern .main-nav .nav-folder__menu li {
    margin: 0;
    padding: 0;
    border: none;
  }

  body.theme-modern .main-nav .nav-folder__link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    color: #fff !important;
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin: 0.1rem 0;
    transition: background 0.15s ease, color 0.15s ease;
  }

  body.theme-modern .main-nav .nav-folder__link:hover,
  body.theme-modern .main-nav .nav-folder__link:active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
  }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-wrapper {
  position: relative;
}

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: 
    var(--hero-background-image, none),
    linear-gradient(140deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 252, 255, 0.85) 30%, rgba(240, 250, 255, 0.7) 70%, rgba(235, 248, 252, 0.6) 100%);
  background-size: cover;
  background-position: var(--hero-background-position, center), center;
  background-repeat: no-repeat;
  overflow: hidden;
  color: var(--primary-deep);
  margin-bottom: var(--spacing-xxl);
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 70% at 85% 5%, rgba(var(--color-primary-rgb, 0, 94, 68), 0.22) 0%, rgba(var(--color-primary-rgb, 0, 94, 68), 0) 65%),
    radial-gradient(80% 80% at 0% 95%, rgba(var(--color-dark-rgb, 15, 36, 67), 0.12) 0%, rgba(var(--color-dark-rgb, 15, 36, 67), 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.3) 75%, rgba(255, 255, 255, 0.08) 100%);
  z-index: 1;
}

.hero-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(circle at 82% 78%, rgba(var(--color-primary-rgb, 0, 94, 68), 0.18) 0%, rgba(var(--color-primary-rgb, 0, 94, 68), 0) 60%);
  opacity: 0.7;
  mix-blend-mode: soft-light;
  z-index: 1;
}

/* Современная тема: пересветы и анимации hero (на десктопе переход в контент резкий) */
body.theme-modern .hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 120% 80% at 90% 10%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 100% 60% at 10% 90%, rgba(var(--color-primary-rgb, 0, 94, 68), 0.12) 0%, transparent 55%);
  opacity: 0;
  animation: heroGlowIn 1.2s ease-out 0.2s both;
}

body.theme-modern .hero-overlay {
  animation: heroOverlayIn 1s ease-out both;
}

body.theme-modern .hero-pattern {
  animation: heroPatternIn 1.4s ease-out 0.15s both;
}

@keyframes heroGlowIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes heroOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes heroPatternIn {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 0.7;
    transform: scale(1);
  }
}

/* Мягкий «дыхательный» пересвет поверх hero (только современная тема) */
body.theme-modern .hero-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
  animation: heroBreathGlow 8s ease-in-out 2s infinite;
  opacity: 0;
}

@keyframes heroBreathGlow {
  0%, 100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

/* Современные световые блики поверх hero: диагональный пробегающий блик */
body.theme-modern .hero-overlay::before {
  content: '';
  position: absolute;
  inset: -50%;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 35%,
    rgba(255, 255, 255, 0.02) 45%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.02) 55%,
    transparent 65%,
    transparent 100%
  );
  background-size: 60% 100%;
  animation: heroShimmer 12s ease-in-out 3s infinite;
  z-index: 0;
}

@keyframes heroShimmer {
  0% {
    transform: translateX(-80%) skewX(-8deg);
    opacity: 0.4;
  }
  45% {
    opacity: 0.6;
  }
  55% {
    opacity: 0.6;
  }
  100% {
    transform: translateX(80%) skewX(-8deg);
    opacity: 0.4;
  }
}

/* Второй слой: мягкий движущийся ореол (световое пятно) */
body.theme-modern .hero-pattern::after {
  content: '';
  position: absolute;
  width: 140%;
  height: 80%;
  top: -20%;
  left: -20%;
  pointer-events: none;
  background: radial-gradient(
    ellipse 40% 60% at 50% 50%,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.03) 40%,
    transparent 70%
  );
  animation: heroSpotMove 18s ease-in-out 4s infinite;
  z-index: 0;
}

@keyframes heroSpotMove {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }
  25% {
    transform: translate(8%, -5%) scale(1.05);
    opacity: 0.7;
  }
  50% {
    transform: translate(-5%, 6%) scale(0.95);
    opacity: 0.6;
  }
  75% {
    transform: translate(-8%, -4%) scale(1.02);
    opacity: 0.65;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  animation: fadeInUp 1s ease-out;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--spacing-xl) 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  align-items: stretch;
}

@media (min-width: 1024px) {
  .hero-content {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--spacing-xl);
    max-width: 100%;
  }

  .hero-col--card {
    margin-left: auto;
    margin-right: 8.5vw;
    flex-direction: row;
    align-items: stretch;
    gap: var(--spacing-lg);
    max-width: clamp(720px, 62vw, 760px);
  }

  .hero-col--card .hero-card {
    flex: 1 1 0;
    min-width: 260px;
    max-width: 380px;
    height: 480px;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    align-self: stretch;
  }

  .hero-col--card .hero-card .hero-card-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .hero-col--card .vk-widget-wrapper {
    flex: 0 0 auto;
    min-width: 260px;
    max-width: 380px;
    height: 480px;
  }

  /* Блок ссылок: высота по контенту, без пустого места (виджет ВК по-прежнему 480px) */
  .hero-col--card .vk-widget-wrapper.hero-info-item.hero-info-item--social-links {
    height: auto !important;
    min-height: 0;
    max-height: none;
    flex: 0 1 auto !important;
    align-self: flex-start;
  }
}

.hero-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
}

.hero-col--text {
  max-width: 580px;
  gap: var(--spacing-md);
  align-items: flex-start;
  text-align: left;
}

/* Карточка богослужения и виджет ВК — одинаковая высота (по высоте виджета) */
.hero-col--card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  max-width: 420px;
  align-items: stretch;
}

/* Класс viewport-desktop выставляется скриптом в начале <body> до первой отрисовки.
   Без него считаем мобильным: карточка и виджет всегда скрыты, кнопка ВК — внизу hero. */
body:not(.viewport-desktop) .hero-col--card .hero-card,
body:not(.viewport-desktop) .hero-col--card .vk-widget-wrapper {
  display: none !important;
}

body.viewport-desktop .hero-col--card .hero-card {
  display: flex !important;
}

/* Кнопки соцсетей в hero (мобильная) — раскладка переписана с нуля: равные отступы от краёв экрана */
.hero-social-mobile {
  display: none;
  box-sizing: border-box;
}
.hero-social-mobile .hero-vk-mobile-btn,
.hero-social-mobile .hero-social-mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: auto;
  max-width: 260px;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: auto;
  margin-right: auto;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-social-mobile--count-2 .hero-vk-mobile-btn,
.hero-social-mobile--count-2 .hero-social-mobile-btn,
.hero-social-mobile--count-3 .hero-vk-mobile-btn,
.hero-social-mobile--count-3 .hero-social-mobile-btn,
.hero-social-mobile--count-4 .hero-vk-mobile-btn,
.hero-social-mobile--count-4 .hero-social-mobile-btn {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  max-width: 220px;
}
.hero-social-mobile--count-2 .hero-vk-mobile-btn__icon,
.hero-social-mobile--count-2 .hero-social-mobile-btn__icon,
.hero-social-mobile--count-3 .hero-vk-mobile-btn__icon,
.hero-social-mobile--count-3 .hero-social-mobile-btn__icon,
.hero-social-mobile--count-4 .hero-vk-mobile-btn__icon,
.hero-social-mobile--count-4 .hero-social-mobile-btn__icon {
  width: 28px;
  height: 28px;
}
.hero-social-mobile .hero-vk-mobile-btn:hover,
.hero-social-mobile .hero-vk-mobile-btn:focus,
.hero-social-mobile .hero-social-mobile-btn:hover,
.hero-social-mobile .hero-social-mobile-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.hero-vk-mobile-btn__icon,
.hero-social-mobile-btn__icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  line-height: 0;
}
.hero-social-mobile-btn__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}
.hero-vk-mobile-btn__text,
.hero-social-mobile .hero-social-mobile-btn .hero-vk-mobile-btn__text {
  color: #1a1a2e;
  white-space: nowrap;
}
body.theme-modern .hero-vk-mobile-btn__text,
body.theme-modern .hero-social-mobile-btn .hero-vk-mobile-btn__text {
  color: var(--color-text-on-light, #1a1a2e);
}

@media (max-width: 1023px) {
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* Чтобы кнопки соцсетей не заходили на название: резерв внизу + hero растягивается при длинном тексте */
    min-height: calc(100dvh - 220px);
    padding-bottom: 220px;
    box-sizing: border-box;
  }

  /* Hero и обёртка без боковых отступов (без привязки к body.theme-modern) */
  .hero-wrapper,
  .hero {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }
  .hero-wrapper { width: 100% !important; max-width: 100% !important; }
  .hero { width: 100% !important; max-width: 100% !important; }

  /* Ширина под viewport — иначе при полосе прокрутки «центр» смещается влево */
  body.theme-modern {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  html:has(body.theme-modern) {
    width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Hero на всю ширину экрана (дублируем с body для специфичности) */
  body.theme-modern .hero-wrapper,
  body.theme-modern .hero {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Обёртка плашек: на всю ширину hero, равные отступы; центрирование flex + text-align */
  .hero .hero-social-mobile {
    position: absolute !important;
    bottom: 60px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    z-index: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    text-align: center !important;
  }
  /* Одна кнопка без inner: центрируем */
  .hero .hero-social-mobile > a.hero-vk-mobile-btn {
    display: inline-flex !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  /* Inner: каждая строка по центру */
  .hero .hero-social-mobile__inner {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
  /* Плашки как inline-flex — центрируются и по flex, и по text-align */
  .hero .hero-social-mobile__inner .hero-vk-mobile-btn,
  .hero .hero-social-mobile__inner .hero-social-mobile-btn {
    display: inline-flex !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  /* 1 плашка: одна строка, по центру */
  .hero .hero-social-mobile__inner--count-1 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  /* 2 плашки: две строки, каждая по центру */
  .hero .hero-social-mobile__inner--count-2 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }
  /* 3 плашки: первая строка — одна по центру; вторая строка — две в ряд, пара центрирована (равные отступы от краёв экрана) */
  .hero .hero-social-mobile__inner--count-3 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .hero .hero-social-mobile__inner--count-3 > a:first-child {
    flex-basis: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }
  .hero .hero-social-mobile__inner--count-3 > a:nth-child(2),
  .hero .hero-social-mobile__inner--count-3 > a:nth-child(3) {
    flex-basis: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .hero .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: static; /* кнопка ВК привязывается к .hero, а не к контейнеру */
  }

  .hero-content {
    flex: 1;
    position: static;
    justify-content: flex-start;
    align-items: stretch;
    display: flex;
    flex-direction: column;
  }

  .hero-col--text {
    align-items: center;
    text-align: center;
  }

  .hero-col--card {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin-top: auto;
  }

  .hero-col--card .hero-card {
    width: auto;
  }

  .hero-info {
    justify-items: stretch;
  }

  /* Бейдж «Мы ВКонтакте» на мобиле — появление как у остальных элементов hero */
  body.theme-modern .hero-vk-mobile-btn {
    animation: heroBadgeInCenter 0.7s ease-out 0.5s both;
  }

  /* На мобильных меньше боковых отступов у секции и у контейнера — блоки почти на всю ширину */
  body.theme-modern .main-content .container {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
  body.theme-modern .modern-section-body {
    padding: var(--spacing-xl) var(--spacing-sm);
  }

  /* Расписание и content-block на всю ширину секции; !important перебивает style.css и любые конфликты */
  body.theme-modern .modern-section-body .schedule-list,
  body.theme-modern .modern-section-body .schedule-day,
  body.theme-modern .modern-section-body .schedule-item,
  body.theme-modern .modern-section-body .content-block {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Нижние 10% hero постепенно полупрозрачны — виден фон страницы, без своей окраски */
  body.theme-modern .hero {
    -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

/* Десктоп: блок соцсетей в hero скрываем, карточка и виджет показываем */
@media (min-width: 1024px) {
  .hero-social-mobile,
  .hero-vk-mobile-btn,
  .hero-social-mobile-btn {
    display: none !important;
  }

  .hero-col--card {
    flex-direction: row !important;
  }

  .hero-col--card .hero-card {
    display: flex !important;
  }
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1.25rem;
  background: rgba(var(--color-primary-rgb, 0, 94, 68), 0.12);
  border: 1px solid rgba(var(--color-primary-rgb, 0, 94, 68), 0.35);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0;
  backdrop-filter: blur(10px);
  color: var(--primary-gold-dark);
}

/* Современная тема: мягкое появление + спокойная «дыхательная» пульсация стикера */
body.theme-modern .hero-badge {
  position: relative;
  animation: heroBadgeIn 0.7s ease-out both, heroBadgeBreathe 4s ease-in-out 0.7s infinite;
  transform-origin: center center;
  overflow: visible;
}

/* Лёгкие волновые цвета от бейджа «Добро пожаловать» */
body.theme-modern .hero-badge::before {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50px;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(var(--color-primary-rgb, 0, 94, 68), 0.06) 0deg,
    rgba(255, 255, 255, 0.08) 90deg,
    rgba(var(--color-primary-rgb, 0, 94, 68), 0.05) 180deg,
    rgba(255, 255, 255, 0.06) 270deg,
    rgba(var(--color-primary-rgb, 0, 94, 68), 0.06) 360deg
  );
  animation: heroBadgeWave 8s linear infinite;
  z-index: -1;
  pointer-events: none;
  filter: blur(12px);
}

body.theme-modern .hero-badge::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50px;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    rgba(var(--color-primary-rgb, 0, 94, 68), 0.08) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 70%
  );
  animation: heroBadgeWaveGlow 6s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes heroBadgeWave {
  to {
    transform: rotate(360deg);
  }
}

@keyframes heroBadgeWaveGlow {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes heroBadgeIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* То же появление, но с сохранением translateX(-50%) для центрирования (кнопка ВК) */
@keyframes heroBadgeInCenter {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes heroBadgeBreathe {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb, 0, 94, 68), 0.08);
  }
  50% {
    transform: scale(1.02);
    opacity: 0.97;
    box-shadow: 0 0 12px 0 rgba(var(--color-primary-rgb, 0, 94, 68), 0.12);
  }
}

.hero-intro {
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-light);
  text-shadow: 0 6px 18px rgba(var(--color-dark-rgb, 11, 29, 52), 0.22);
}

/* Текст «По благословению …» под бейджем «Добро пожаловать» — крупно и читаемо как название */
.hero-blessing {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow:
    0 0 20px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.8),
    0 2px 8px rgba(0, 0, 0, 0.7),
    0 1px 3px rgba(0, 0, 0, 0.6);
  margin-top: 0.6rem;
  margin-bottom: 0.5rem;
  max-width: 560px;
  line-height: 1.35;
}

.hero-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(var(--color-dark-rgb, 11, 29, 52), 0.12);
  max-width: 820px;
}

/* Современная тема: читаемость названия hero — контур и тень на любом фоне */
body.theme-modern .hero-intro,
body.theme-modern .hero-subtitle {
  text-shadow:
    0 0 28px rgba(0, 0, 0, 1),
    0 0 14px rgba(0, 0, 0, 0.95),
    0 0 8px rgba(0, 0, 0, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

body.theme-modern .hero-title,
body.theme-modern .hero-title .title-line {
  text-shadow:
    0 0 20px rgba(0, 0, 0, 1),
    0 0 12px rgba(0, 0, 0, 0.95),
    0 0 6px rgba(0, 0, 0, 0.9),
    1px 1px 0 rgba(0, 0, 0, 0.9),
    -1px -1px 0 rgba(0, 0, 0, 0.9),
    1px -1px 0 rgba(0, 0, 0, 0.9),
    -1px 1px 0 rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(0, 0, 0, 0.9),
    0 -1px 0 rgba(0, 0, 0, 0.9),
    1px 0 0 rgba(0, 0, 0, 0.9),
    -1px 0 0 rgba(0, 0, 0, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.8),
    0 4px 16px rgba(0, 0, 0, 0.6) !important;
}

.title-line {
  display: block;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.title-line.highlight {
  background: linear-gradient(135deg, var(--primary-gold-light) 0%, var(--primary-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease-out 0.4s both;
  filter: drop-shadow(0 10px 24px rgba(var(--color-dark-rgb, 15, 34, 58), 0.26));
}

/* Современная тема: название храма в hero — один цвет для всех строк, без градиента на highlight */
body.theme-modern .hero-title .title-line,
body.theme-modern .hero-title .title-line.highlight {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: inherit !important;
  background-clip: unset !important;
  color: inherit !important;
  filter: none;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  margin: var(--spacing-md) 0;
  opacity: 0.92;
  line-height: 1.9;
  animation: fadeInUp 1s ease-out 0.6s both;
  max-width: 560px;
  text-shadow: 0 8px 20px rgba(var(--color-dark-rgb, 11, 29, 52), 0.18);
}

@media (max-width: 768px) {
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
}

.hero-actions {
  display: flex;
  justify-content: flex-start;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  animation: fadeInUp 1s ease-out 0.8s both;
}

@media (max-width: 768px) {
  .hero-actions {
    justify-content: center;
  }
}

.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.95rem 2.5rem;
  transition: all var(--transition-normal);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.primary-action {
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  color: var(--white);
}

.primary-action:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.secondary-action {
  background: rgba(255, 255, 255, 0.65);
  color: var(--primary-deep);
  border: 1px solid rgba(var(--color-dark-rgb, 16, 28, 47), 0.08);
}

.secondary-action:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.85);
}

.hero-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
  animation: fadeInUp 1s ease-out 1s both;
}

.hero-info-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--color-dark-rgb, 16, 28, 47), 0.08);
  box-shadow: 0 18px 36px rgba(var(--color-dark-rgb, 11, 29, 52), 0.08);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  min-height: auto;
  width: 100%;
}

.hero-info-item .info-logo-wrapper {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(42px, 9vw, 56px);
  height: clamp(42px, 9vw, 56px);
}

.hero-info-item .info-logo {
  width: clamp(36px, 7vw, 48px);
  height: clamp(36px, 7vw, 48px);
  object-fit: contain;
  opacity: 0.72;
}

.hero-info-item .info-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-info-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hero-info-item strong {
  font-size: 1.1rem;
  color: var(--primary-deep);
}

@media (max-width: 600px) {
  .hero-info-item {
    align-items: center;
    gap: var(--spacing-sm);
  }

  .hero-info-item .info-copy {
    gap: 0.25rem;
  }
}

.link-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.link-card .info-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--primary-gold-dark);
  font-weight: 600;
  opacity: 1;
}

.link-card .info-meta::after {
  content: '→';
}

@media (max-width: 768px) {
  .hero-info {
    gap: var(--spacing-sm);
  }

  .hero-info-item {
    flex: 1 1 100%;
  }
}

/* Стрелка в .hero-wrapper (вне .hero), чтобы не попадать под маску прозрачности hero на мобильных */
.hero-scroll-indicator {
  position: absolute;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}

.scroll-arrow {
  width: 30px;
  height: 30px;
  border-right: 3px solid var(--primary-deep);
  border-bottom: 3px solid var(--primary-deep);
  transform: rotate(45deg);
}

/* Современная тема: аккуратная стрелка (шеврон), чуть выразительнее */
body.theme-modern .hero-scroll-indicator {
  bottom: calc(var(--spacing-lg) + 4px);
}

/* Мобильная версия: стрелка чуть ниже, чтобы сильнее отступала от бейджа «Мы ВКонтакте» */
@media (max-width: 1023px) {
  body.theme-modern .hero-scroll-indicator {
    bottom: calc(var(--spacing-lg) - 6px);
  }
}

body.theme-modern .scroll-arrow {
  width: 32px;
  height: 32px;
  border-right: 3px solid color-mix(in srgb, var(--primary-deep) 85%, white);
  border-bottom: 3px solid color-mix(in srgb, var(--primary-deep) 85%, white);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  position: relative;
  z-index: 2;
  padding: var(--spacing-xxl) 0;
  min-height: 60vh;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  left: 0;
  right: 0;
}
.content-section {
  margin-bottom: var(--spacing-xxl);
  animation: fadeIn 0.8s ease-out;
  background: transparent;
}

#news-section,
#schedule-section,
#donations-section {
  background: transparent;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Section Headers — как на сайте /hram: линии по бокам + точки у заголовка */
.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: transparent !important;
}

.section-decoration {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-gold, var(--color-primary, #C9A961)), transparent);
  max-width: 150px;
}

.section-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  text-align: center;
  color: var(--primary-deep, var(--color-text-on-light, #0f172a)) !important;
  position: relative;
  padding: 0 calc(var(--spacing-md) + 20px);
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: var(--leading-tight);
  background: transparent !important;
}

.section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--primary-gold, var(--color-primary, #C9A961));
  border-radius: 50%;
  opacity: 0.7;
  box-shadow:
    0 0 0 1px rgba(218, 165, 32, 0.3),
    0 0 0 2px rgba(218, 165, 32, 0.15);
}

.section-title::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--primary-gold, var(--color-primary, #C9A961));
  border-radius: 50%;
  opacity: 0.7;
  box-shadow:
    0 0 0 1px rgba(218, 165, 32, 0.3),
    0 0 0 2px rgba(218, 165, 32, 0.15);
}

/* Единый контейнер тела секции для всех разделов modern (страницы, духовенство, требы и т.д.) */
.modern-section-body {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: var(--spacing-xl);
}

.content-section.modern-section {
  margin-bottom: var(--spacing-xxl);
  animation: fadeIn 0.8s ease-out;
  background: transparent;
}

/* Только modern: единая «карточка» секции — одна ширина, фон, отступы (классическую тему не трогаем) */
body.theme-modern .modern-section-body {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--white, #fff);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(var(--color-dark-rgb, 11, 29, 52), 0.08), 0 0 0 1px rgba(var(--color-dark-rgb, 16, 28, 47), 0.04);
  margin-top: 0;
}

/* В разделах расписание, пожертвования, духовенство, контент — убираем обёртку-карточку: контент по ширине как секция (контейнер). Страницы с фото (section-page-layout) не трогаем. */
body.theme-modern .modern-section-body:has(.schedule-list),
body.theme-modern .modern-section-body:has(.clergy-grid),
body.theme-modern .modern-section-body:has(.content-block):not(:has(.section-page-layout)) {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  border: none;
}

/* Одна ширина контента во всех разделах modern — без разного max-width */
body.theme-modern .modern-section-body .full-news-container,
body.theme-modern .modern-section-body .donations-container,
body.theme-modern .modern-section-body .schedule-day {
  max-width: 100%;
}

/* Кнопка «На главную» под контентом раздела — по ширине как блок контента, стиль как у кнопки возврата из полной новости */
body.theme-modern .section-back-home-wrap {
  margin-top: var(--spacing-xl);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.theme-modern .btn-back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-deep);
  background: var(--white);
  border: 2px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-normal);
  box-sizing: border-box;
}

body.theme-modern .btn-back-home:hover {
  background: var(--primary-gold);
  color: #fff !important;
  border-color: var(--primary-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
}

body.theme-modern .btn-back-home:active {
  transform: translateY(0);
}

body.theme-modern .btn-back-home:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 2px;
}

/* Разделы с фото/каруселью: обтекание — фото слева, текст справа и под фото */
body.theme-modern .modern-section-body:has(.section-page-layout) {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

/* Один общий отступ для всего содержимого (фото и текст) — задаём на контейнере */
body.theme-modern .section-page-layout {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: var(--spacing-md);
}

/* Контент страницы может рендериться без .content-block, прямо в .section-page-layout */
body.theme-modern .section-page-layout p {
  line-height: var(--leading-relaxed);
  margin: 0;
  text-align: inherit;
  white-space: pre-wrap;
}

body.theme-modern .section-page-layout ul,
body.theme-modern .section-page-layout ol {
  margin: var(--spacing-md) 0;
  margin-left: 0;
  padding-left: 2.2em;
  list-style-position: outside;
}

body.theme-modern .section-page-layout ul li,
body.theme-modern .section-page-layout ol li {
  line-height: 1.6;
  margin-bottom: var(--spacing-xs);
  white-space: pre-wrap;
}

body.theme-modern .section-page-layout [style*="text-align:center"],
body.theme-modern .section-page-layout [style*="text-align: center"],
body.theme-modern .section-page-layout .ql-align-center {
  text-align: center;
}

body.theme-modern .section-page-layout [style*="text-align:right"],
body.theme-modern .section-page-layout [style*="text-align: right"],
body.theme-modern .section-page-layout .ql-align-right {
  text-align: right;
}

body.theme-modern .section-page-layout [style*="text-align:justify"],
body.theme-modern .section-page-layout [style*="text-align: justify"],
body.theme-modern .section-page-layout .ql-align-justify {
  text-align: justify;
}

body.theme-modern .section-page-layout .ql-align-left {
  text-align: left;
}

body.theme-modern .section-page-layout::after {
  content: '';
  display: table;
  clear: both;
}

/* Фото/карусель — float слева, ~50%, текст обтекает справа и продолжается под фото */
body.theme-modern .section-page-media {
  float: left;
  width: 50%;
  max-width: 50%;
  margin: 0 var(--spacing-xl) var(--spacing-md) 0;
  box-sizing: border-box;
  padding: 0;
}

/* Убираем глобальный margin у обёрток — фото начинается с самого верха, как и текст */
body.theme-modern .section-page-media .page-image-wrapper,
body.theme-modern .section-page-media .page-carousel {
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
  padding: 0;
  border-radius: var(--radius-lg) 0 0 0;
  overflow: hidden;
}

/* Карусель в блоке обтекания подстраивается под размер фото (нет фиксированной высоты) */
body.theme-modern .section-page-media .page-carousel {
  height: auto;
  min-height: 0;
}
body.theme-modern .section-page-media .page-carousel .carousel-container {
  height: auto;
}
body.theme-modern .section-page-media .page-carousel .carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
body.theme-modern .section-page-media .page-carousel .carousel-slide.active {
  position: relative;
  height: auto;
  opacity: 1;
  z-index: 1;
}
body.theme-modern .section-page-media .page-carousel .carousel-slide img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

body.theme-modern .section-page-media img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  margin: 0;
}

/* Десктоп: первая строка текста на одной высоте с верхом фото */
body.theme-modern .section-page-layout > .section-page-media + * {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
body.theme-modern .section-page-layout > .section-page-media + * > *:first-child {
  margin-top: 0 !important;
}

@media (max-width: 768px) {
  body.theme-modern .section-page-media {
    float: none;
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-bottom: var(--spacing-md);
    margin-top: 0;
  }
  body.theme-modern .section-page-media .page-image-wrapper,
  body.theme-modern .section-page-media .page-carousel {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

/* ============================================
   NEWS SECTION — как на референсе
   ============================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

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

@media (max-width: 640px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

.news-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(var(--color-dark-rgb, 11, 29, 52), 0.08), 0 0 0 1px rgba(var(--color-dark-rgb, 16, 28, 47), 0.04);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  border: none;
  animation: fadeInUp 0.6s ease-out both;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }
.news-card:nth-child(6) { animation-delay: 0.6s; }

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(var(--color-dark-rgb, 11, 29, 52), 0.16), 0 0 0 1px rgba(var(--color-primary-rgb, 0, 94, 68), 0.08);
}

.news-card img,
.news-card .news-carousel {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.news-card .news-carousel {
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  height: 220px;
}

.news-card .news-carousel img {
  border-radius: 0;
}

/* Видеогалерея: область превью — одна кнопка, клик открывает видео в модалке (как фото в новостях) */
.news-card.video-gallery-card .video-card-poster {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  flex-shrink: 0;
  background: #111;
}
.news-card.video-gallery-card .video-card-poster-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
}
.news-card.video-gallery-card .video-card-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.news-card.video-gallery-card .video-card-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.news-card-content {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  flex: 1;
}

.news-card h3,
.news-card .news-card-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-deep);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.news-card p,
.news-card .news-card-excerpt {
  color: var(--text-light);
  margin: 0;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
}

.news-card-date {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

.news-read-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: var(--spacing-md);
  padding: 0.75rem 1.5rem;
  background: rgba(var(--color-primary-rgb, 0, 94, 68), 0.12);
  color: var(--primary-deep);
  border: 1px solid rgba(var(--color-primary-rgb, 0, 94, 68), 0.3);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: var(--font-body);
  text-decoration: none;
  box-sizing: border-box;
}

.news-read-more-btn:hover {
  background: rgba(var(--color-primary-rgb, 0, 94, 68), 0.2);
  color: var(--primary-deep);
  border-color: rgba(var(--color-primary-rgb, 0, 94, 68), 0.5);
}

.news-read-more-btn:active {
  transform: scale(0.98);
}

.news-card-content {
  cursor: pointer;
}

/* Пагинация новостей */
.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
}

.pagination-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(var(--color-dark-rgb, 16, 28, 47), 0.1);
  color: var(--primary-deep);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: var(--font-body);
  box-shadow: 0 12px 24px rgba(var(--color-dark-rgb, 11, 29, 52), 0.08);
}

.pagination-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  color: var(--white);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(var(--color-primary-rgb, 0, 94, 68), 0.3);
}

.pagination-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0 var(--spacing-md);
}

/* Адаптивность для пагинации */
@media (max-width: 768px) {
  .news-pagination {
    flex-wrap: wrap;
    gap: var(--spacing-md);
  }
  
  .pagination-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.9rem;
  }
  
  .pagination-info {
    width: 100%;
    text-align: center;
    order: -1;
  }
}

/* Карусель изображений в новостях */
.news-carousel {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom; /* Разрешаем вертикальную прокрутку и масштабирование, но предотвращаем горизонтальную прокрутку браузера */
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none; /* Полный контроль над жестами для свайпа */
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 2;
  pointer-events: none;
}

.carousel-btn {
  background: rgba(var(--color-dark-rgb, 11, 29, 52), 0.5);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--white);
  transition: all var(--transition-normal);
  pointer-events: all;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: rgba(var(--color-dark-rgb, 11, 29, 52), 0.7);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.carousel-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all var(--transition-normal);
  padding: 0;
}

.carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.carousel-indicator.active {
  background: var(--white);
  transform: scale(1.3);
}

.news-card:hover .carousel-btn {
  opacity: 1;
}

/* Изображения в новостях - курсор указатель */
.news-image-clickable {
  cursor: pointer;
  transition: transform var(--transition-normal);
}

.news-image-clickable:hover {
  transform: scale(1.02);
}

/* Модальное окно для просмотра изображений */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.image-modal.active {
  opacity: 1;
}

.image-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.image-modal-content {
  position: relative;
  z-index: 10001;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: transform 0.3s ease-in-out;
}

.image-modal.active .image-modal-content {
  transform: scale(1);
}

.image-modal-content img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  z-index: 10002;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--white);
  transform: rotate(90deg);
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
  .image-modal-content {
    max-width: 95%;
    max-height: 85%;
  }
  
  .image-modal-content img {
    max-height: 85vh;
  }
  
  .image-modal-close {
    top: -35px;
    width: 35px;
    height: 35px;
    font-size: 24px;
  }
}

/* ============================================
   SCHEDULE SECTION
   ============================================ */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

/* День расписания */
.schedule-day {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: 0 4px 20px rgba(var(--color-dark-rgb, 61, 40, 23), 0.06), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.1);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  animation: fadeInUp 0.6s ease-out both;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.schedule-day::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition-normal);
}

.schedule-day:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(var(--color-dark-rgb, 61, 40, 23), 0.12), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.25);
  border-color: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
}

.schedule-day:hover::before {
  transform: scaleY(1);
}

/* Выделение дня цветом */
.schedule-day--red::before { background: linear-gradient(180deg, #c62828 0%, #b71c1c 100%); }
.schedule-day--green::before { background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%); }
.schedule-day--purple::before { background: linear-gradient(180deg, #6a1b9a 0%, #4a148c 100%); }
.schedule-day--blue::before { background: linear-gradient(180deg, #1565c0 0%, #0d47a1 100%); }
.schedule-day--cyan::before { background: linear-gradient(180deg, #00838f 0%, #006064 100%); }
.schedule-day--red .schedule-day-date { color: #b71c1c; }
.schedule-day--green .schedule-day-date { color: #1b5e20; }
.schedule-day--purple .schedule-day-date { color: #4a148c; }
.schedule-day--blue .schedule-day-date { color: #0d47a1; }
.schedule-day--cyan .schedule-day-date { color: #006064; }
.schedule-day--red .schedule-day-info { border-left-color: #c62828; }
.schedule-day--green .schedule-day-info { border-left-color: #2e7d32; }
.schedule-day--purple .schedule-day-info { border-left-color: #6a1b9a; }
.schedule-day--blue .schedule-day-info { border-left-color: #1565c0; }
.schedule-day--cyan .schedule-day-info { border-left-color: #00838f; }

/* Заголовок дня */
.schedule-day-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--accent-warm-dark);
}

.schedule-day-date {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-deep);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.schedule-day-date::before {
  content: '';
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A961' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0.85;
  flex-shrink: 0;
}

/* Информация о дне (седмица, церковное описание) */
.schedule-day-info {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-md);
  background: linear-gradient(135deg, rgba(var(--primary-gold-rgb, 201, 169, 97), 0.08) 0%, rgba(var(--primary-gold-rgb, 201, 169, 97), 0.03) 100%);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-gold);
}

.schedule-day-info div {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
}

.schedule-day-info div:last-child {
  margin-bottom: 0;
}

.schedule-day-info div:first-child {
  color: var(--primary-deep);
  font-weight: 600;
}

/* Контейнер событий дня */
.schedule-day-events {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

/* Одно событие */
.schedule-event {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 230, 211, 0.25) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.2);
  transition: all var(--transition-fast);
  position: relative;
}

.schedule-event::before {
  display: none;
}

.schedule-event:hover {
  background: linear-gradient(135deg, rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15) 0%, rgba(245, 230, 211, 0.4) 100%);
  border-color: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.4);
  transform: translateX(6px);
  box-shadow: 0 4px 16px rgba(var(--color-dark-rgb, 61, 40, 23), 0.1);
}

.schedule-event:hover::before {
  opacity: 0.4;
}

/* Время события */
.schedule-event-time {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-gold-dark);
  min-width: 80px;
  text-align: right;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Разделитель */
.schedule-event-separator {
  color: var(--primary-gold);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 var(--spacing-xs);
  flex-shrink: 0;
  opacity: 0.6;
}

/* Название службы */
.schedule-event-name {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.6;
}

/* Описание события */
.schedule-event-description {
  grid-column: 1 / -1;
  margin-top: var(--spacing-sm);
  font-size: 0.95rem;
  color: var(--text-light);
  font-style: italic;
  line-height: 1.7;
  padding: var(--spacing-sm) var(--spacing-md);
  padding-left: calc(var(--spacing-md) + var(--spacing-lg));
  border-left: 3px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.35);
  background: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.05);
  border-radius: var(--radius-sm);
}

/* ============================================
   CONTENT BLOCKS
   ============================================ */
.content-block {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 255, 0.88) 100%);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(var(--color-dark-rgb, 16, 28, 47), 0.08);
  transition: all var(--transition-normal);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}

.content-block::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(var(--color-primary-rgb, 0, 94, 68), 0.25), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.content-block:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-6px);
}

.content-block:hover::before {
  opacity: 1;
  transform: translate(-10px, 10px);
}

.content-block h2 {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 2rem;
  color: var(--primary-deep);
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

.content-block p {
  line-height: var(--leading-relaxed);
  color: var(--text-dark);
  margin-bottom: var(--spacing-md);
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
}

.content-block img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0;
}

.content-block ul,
.content-block ol {
  margin: var(--spacing-md) 0;
  padding-left: var(--spacing-xl);
}

.content-block ul li,
.content-block ol li {
  margin-bottom: var(--spacing-xs);
  line-height: 1.5;
}

.content-block h1,
.content-block h3 {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  color: var(--primary-deep);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

.content-block h1 {
  font-size: 2rem;
}

.content-block h3 {
  font-size: 1.5rem;
}

.content-block a {
  color: var(--primary-gold-dark);
  text-decoration: underline;
  transition: color var(--transition-normal);
}

.content-block a:hover {
  color: var(--primary-gold);
}

.content-block u {
  text-decoration: underline;
}

.content-block s {
  text-decoration: line-through;
}

.content-block [style*="text-align:center"],
.content-block [style*="text-align: center"],
.content-block .ql-align-center {
  text-align: center;
}

.content-block [style*="text-align:right"],
.content-block [style*="text-align: right"],
.content-block .ql-align-right {
  text-align: right;
}

.content-block [style*="text-align:justify"],
.content-block [style*="text-align: justify"],
.content-block .ql-align-justify {
  text-align: justify;
}

.content-block .ql-align-left {
  text-align: left;
}

.content-block blockquote {
  border-left: 4px solid var(--primary-gold);
  padding-left: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  font-style: italic;
  color: var(--text-light);
}

/* Page Content Styles */
.page-content-full {
  width: 100%;
}

/* Page Images Styles */
.page-image-wrapper {
  margin: var(--spacing-xl) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.page-image-wrapper img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
}

.page-carousel {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.page-carousel .carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.page-carousel .carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.page-carousel .carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.page-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Предотвращение горизонтальной прокрутки для медиа-элементов */
img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* ============================================
   WIDGETS
   ============================================ */
.widgets-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.widget {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 20px rgba(var(--color-dark-rgb, 61, 40, 23), 0.06), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.1);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.widget::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.widget:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(var(--color-dark-rgb, 61, 40, 23), 0.1), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.25);
  border-color: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.25);
}

.widget:hover::after {
  transform: scaleX(1);
}

.widget-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.5rem;
  color: var(--primary-deep);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--primary-gold);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Как /hram: эмодзи перед заголовком виджета («Последние новости» и т.д.) */
.widget-title::before {
  content: '✨';
  font-size: 1.2rem;
}

/* Calendar Widget */
.calendar-widget {
  text-align: center;
  padding: var(--spacing-md) 0;
}

.calendar-widget .current-date {
  font-size: 4rem;
  font-weight: 700;
  color: var(--primary-gold);
  font-family: var(--font-heading);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.calendar-widget .current-month {
  font-size: 1.2rem;
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: var(--spacing-md);
  text-transform: capitalize;
}

.calendar-widget .current-holiday {
  color: var(--primary-deep);
  font-size: 1rem;
  font-weight: 500;
  padding: var(--spacing-sm);
  background: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* ============================================
   DONATIONS SECTION
   ============================================ */
.donations-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Описание пожертвований */
.donation-description-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  animation: fadeInUp 0.6s ease-out;
}

.donation-text-content {
  color: var(--text-dark);
  font-size: 1.1rem;
  line-height: 1.8;
}

.donation-text-content p {
  margin-bottom: var(--spacing-md);
  color: var(--text-dark);
}

.donation-text-content p:last-child {
  margin-bottom: 0;
}

.donation-text-content strong {
  color: var(--primary-deep);
  font-weight: 600;
}

/* Секция с реквизитами */
.donation-details-section {
  margin-top: var(--spacing-xl);
}

.donation-details-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--primary-deep);
  text-align: center;
  margin-bottom: var(--spacing-xl);
  position: relative;
  padding-bottom: var(--spacing-md);
}

.donation-details-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
  border-radius: 2px;
}

.donation-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

@media (min-width: 1024px) {
  .donation-details-grid {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  }
}

/* Карточка реквизита */
.donation-detail-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out both;
  min-width: 0; /* Позволяет карточке сжиматься при необходимости */
  width: 100%;
}

.donation-detail-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.donation-detail-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
}

.donation-detail-card:hover::before {
  transform: scaleX(1);
}

.donation-detail-card:nth-child(1) { animation-delay: 0.1s; }
.donation-detail-card:nth-child(2) { animation-delay: 0.2s; }
.donation-detail-card:nth-child(3) { animation-delay: 0.3s; }
.donation-detail-card:nth-child(4) { animation-delay: 0.4s; }

/* Заголовок карточки */
.donation-detail-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--accent-warm);
}

.donation-type-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.donation-type-card {
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
}

.donation-type-sbp {
  background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

.donation-type-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-deep);
  margin: 0;
  flex: 1;
}

/* Тело карточки */
.donation-detail-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.donation-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.donation-field-label {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.donation-field-value {
  font-size: 1.05rem;
  color: var(--text-dark);
  font-weight: 500;
}

.donation-payment-number {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  color: var(--primary-deep);
  font-family: 'Courier New', 'Monaco', monospace;
  letter-spacing: 0.05em;
  padding: var(--spacing-sm) var(--spacing-md);
  background: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-warm-dark) 100%);
  border-radius: var(--radius-md);
  text-align: center;
  border: 2px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.2);
  margin-top: var(--spacing-xs);
  transition: all var(--transition-normal);
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donation-payment-number:hover {
  background: linear-gradient(135deg, var(--accent-warm-dark) 0%, var(--accent-warm) 100%);
  border-color: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.4);
  transform: scale(1.02);
}

/* Благодарность */
.donation-thanks {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, var(--accent-warm) 0%, var(--white) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.2);
}

/* Адаптивность */
@media (max-width: 768px) {
  .donation-details-grid {
    grid-template-columns: 1fr;
  }
  
  .donation-description-section {
    padding: var(--spacing-lg);
  }
  
  .donation-text-content {
    font-size: 1rem;
  }
  
  .donation-payment-number {
    font-size: 1.1rem;
    padding: var(--spacing-sm);
  }
  
  .donation-detail-card {
    padding: var(--spacing-md);
  }
}


/* ============================================
   FOOTER
   ============================================ */
.main-footer {
  background: var(--primary-deep-dark);
  color: var(--white);
  margin-top: var(--spacing-xxl);
  position: relative;
  padding: var(--spacing-xxl) 0 var(--spacing-lg);
  overflow: hidden;
}

.main-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-gold-rgb, 201, 169, 97), 0.4), transparent);
  opacity: 0.9;
  z-index: 1;
}

.footer-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(135deg, var(--primary-deep-dark) 0%, var(--primary-deep) 100%),
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(var(--primary-gold-rgb, 201, 169, 97), 0.05) 2px, rgba(var(--primary-gold-rgb, 201, 169, 97), 0.05) 4px);
  opacity: 0.95;
  z-index: -1;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer-section {
  position: relative;
  z-index: 1;
}

.footer-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.5rem;
  margin-bottom: var(--spacing-md);
  color: var(--primary-gold-light);
}

.footer-subtitle {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-md);
  color: var(--primary-gold-light);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all var(--transition-fast);
  padding: var(--spacing-xs) 0;
  position: relative;
  padding-left: var(--spacing-md);
}

.footer-nav a::before {
  content: '→';
  position: absolute;
  left: 0;
  opacity: 0;
  transition: all var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--primary-gold);
  padding-left: var(--spacing-lg);
}

.footer-nav a:hover::before {
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.15), transparent);
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 1;
}

.footer-credits-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
  transition: opacity var(--transition-normal);
}

.footer-credits-link:hover {
  opacity: 0.9;
}

/* Иконки соцсетей в футере — современная тема */
.footer-social-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
}
.footer-social-label {
  font-size: 0.95rem;
  color: var(--color-text-on-footer, rgba(255, 255, 255, 0.9));
  opacity: 0.95;
}
.footer-social-links__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}
.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text-on-footer, rgba(255, 255, 255, 0.9));
  border-radius: 50%;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
.footer-social-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.08);
}
.footer-social-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}
.footer-social-icon {
  display: block;
  width: 24px;
  height: 24px;
  line-height: 0;
}
.footer-social-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ============================================
   FOOTER — СОВРЕМЕННАЯ ТЕМА (в духе хедера)
   ============================================ */
body.theme-modern .main-content {
  padding-bottom: var(--spacing-lg);
}

body.theme-modern .main-footer {
  margin-top: var(--spacing-lg);
  padding: 0;
  background: transparent;
  border-top: none;
  position: relative;
  overflow: hidden;
}

body.theme-modern .main-footer::before {
  height: 1px;
  background: linear-gradient(90deg, transparent 8%, rgba(255, 255, 255, 0.2) 50%, transparent 92%);
  opacity: 1;
}

body.theme-modern .footer-background {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  background: var(--color-background-footer, linear-gradient(135deg, #2C5F7C 0%, #1E4258 100%)) !important;
  opacity: 1 !important;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12), 0 -1px 0 rgba(255, 255, 255, 0.06) inset;
}

body.theme-modern .footer-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 35%, transparent 65%, rgba(0, 0, 0, 0.06) 100%);
  pointer-events: none;
}

body.theme-modern .main-footer .container {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

body.theme-modern .footer-bottom {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
  margin-top: 0;
  border-top: none;
  background: transparent;
  text-align: center;
}
/* Иконки соцсетей — отдельная строка сверху, не в одну линию с копирайтом */
body.theme-modern .footer-bottom .footer-social-links {
  order: -1;
  margin-bottom: 0.5rem;
  margin-top: 0;
}
/* На десктопе текстовые строки (копирайт, юридическое, кредит) в одну группу */
@media (min-width: 768px) {
  body.theme-modern .footer-bottom .footer-social-links {
    margin-bottom: 0.75rem;
  }
  body.theme-modern .footer-bottom p {
    max-width: 42rem;
  }
}

body.theme-modern .footer-bottom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 32rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}

body.theme-modern .footer-bottom p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-on-footer, rgba(255, 255, 255, 0.9)) !important;
  line-height: 1.5;
}

body.theme-modern .footer-credits-link {
  color: var(--color-text-on-footer, #e8dcc8) !important;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease, text-decoration-color 0.15s ease;
}

body.theme-modern .footer-credits-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Секции футера — компактно, с явными hover */
body.theme-modern .footer-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--spacing-lg);
  align-items: start;
  padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
  margin-bottom: 0;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

body.theme-modern .footer-map-block {
  min-width: 0;
}

body.theme-modern .footer-map-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-on-footer, rgba(255, 255, 255, 0.9)) !important;
  margin: 0 0 0.5rem;
}

body.theme-modern .footer-map-wrap {
  width: 100%;
  max-width: 320px;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.15);
}

@media (min-width: 1024px) {
  body.theme-modern .footer-map-wrap {
    max-width: 460px;
    height: 300px;
  }
}

body.theme-modern .footer-map-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

body.theme-modern .footer-brand {
  min-width: 0;
}

body.theme-modern .footer-brand .footer-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-on-footer, #e8dcc8) !important;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

body.theme-modern .footer-description {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-on-footer, rgba(255, 255, 255, 0.8)) !important;
  margin: 0;
}

body.theme-modern .footer-description:empty {
  display: none;
}

body.theme-modern .footer-links {
  min-width: 0;
}

body.theme-modern .footer-links-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-on-footer, rgba(255, 255, 255, 0.9)) !important;
  margin: 0 0 0.5rem;
}

body.theme-modern .footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

body.theme-modern .footer-nav a,
body.theme-modern .footer-section a {
  display: inline-block;
  color: var(--color-text-on-footer, rgba(255, 255, 255, 0.85)) !important;
  padding: 0.35rem 0.5rem;
  margin: 0 -0.5rem;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

body.theme-modern .footer-nav a::before {
  content: none;
}

body.theme-modern .footer-nav a:hover,
body.theme-modern .footer-nav a:focus-visible,
body.theme-modern .footer-section a:hover,
body.theme-modern .footer-section a:focus-visible {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12);
}

body.theme-modern .footer-credits-link:focus-visible {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12);
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

body.theme-modern .footer-section h3 {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-text-on-footer, #ffffff) !important;
  margin-bottom: var(--spacing-sm);
}

@media (max-width: 640px) {
  body.theme-modern .footer-content {
    grid-template-columns: 1fr;
    padding: var(--spacing-md) var(--spacing-md);
    gap: var(--spacing-md);
  }

  body.theme-modern .footer-map-wrap {
    max-width: 100%;
    height: 180px;
  }

  body.theme-modern .footer-brand .footer-title {
    font-size: 1.1rem;
  }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-normal);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--white) 0%, var(--accent-warm) 100%);
  color: var(--primary-deep);
  border: 2px solid var(--primary-gold);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--primary-gold-light) 0%, var(--primary-gold) 100%);
  color: var(--white);
}

/* ============================================
   FULL NEWS PAGE
   ============================================ */
.full-news-section {
  padding: var(--spacing-xl) 0 var(--spacing-xl) 0;
  margin-top: 0;
  min-height: 70vh;
}

/* Дополнительный отступ сверху для полной новости, чтобы не пряталась под хедером */
#main-content .full-news-section {
  padding-top: var(--spacing-lg);
  margin-top: 0;
}

.full-news-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.full-news-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--white);
  border: 2px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
  color: var(--primary-deep);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: var(--font-body);
  flex: 0 0 auto;
}

.full-news-back-btn:hover {
  background: var(--primary-gold);
  color: var(--white);
  border-color: var(--primary-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
}

.full-news-back-btn:active {
  transform: translateY(0);
}

.full-news-article {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xxl);
  box-shadow: 0 4px 20px rgba(var(--color-dark-rgb, 61, 40, 23), 0.06), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.1);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  backdrop-filter: blur(10px);
}

.full-news-header {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 2px solid var(--accent-warm-dark);
}

.full-news-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--primary-deep);
  margin-bottom: var(--spacing-lg);
  line-height: 1.3;
}

.full-news-meta {
  display: flex;
  gap: var(--spacing-xl);
  flex-wrap: wrap;
  align-items: center;
}

.full-news-author,
.full-news-date {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 500;
}

.news-date-icon {
  font-size: 1.1rem;
}

.full-news-image-wrapper {
  margin: var(--spacing-xl) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.full-news-image-wrapper img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
}

.full-news-carousel {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.full-news-carousel .carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.full-news-carousel .carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.full-news-carousel .carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.full-news-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.full-news-content {
  margin-top: var(--spacing-xl);
  line-height: 1.9;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.full-news-content p {
  margin-bottom: var(--spacing-lg);
  text-align: justify;
}

.full-news-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--spacing-lg) 0;
}

.full-news-content strong {
  color: var(--primary-deep);
  font-weight: 600;
}

.full-news-content ul,
.full-news-content ol {
  margin: var(--spacing-md) 0;
  padding-left: var(--spacing-xl);
}

.full-news-content ul li,
.full-news-content ol li {
  margin-bottom: var(--spacing-xs);
  line-height: 1.8;
}

.full-news-content h1,
.full-news-content h2,
.full-news-content h3 {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  color: var(--primary-deep);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

.full-news-content h1 {
  font-size: 2rem;
}

.full-news-content h2 {
  font-size: 1.75rem;
}

.full-news-content h3 {
  font-size: 1.5rem;
}

.full-news-content a {
  color: var(--primary-gold-dark);
  text-decoration: underline;
  transition: color var(--transition-normal);
}

.full-news-content a:hover {
  color: var(--primary-gold);
}

.full-news-content u {
  text-decoration: underline;
}

.full-news-content s {
  text-decoration: line-through;
}

.full-news-content [style*="text-align:center"],
.full-news-content [style*="text-align: center"],
.full-news-content .ql-align-center {
  text-align: center;
}

.full-news-content [style*="text-align:right"],
.full-news-content [style*="text-align: right"],
.full-news-content .ql-align-right {
  text-align: right;
}

.full-news-content [style*="text-align:justify"],
.full-news-content [style*="text-align: justify"],
.full-news-content .ql-align-justify {
  text-align: justify;
}

.full-news-content .ql-align-left {
  text-align: left;
}

.full-news-content blockquote {
  border-left: 4px solid var(--primary-gold);
  padding-left: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  font-style: italic;
  color: var(--text-light);
}

.full-news-footer {
  margin-top: var(--spacing-xxl);
  padding-top: var(--spacing-xl);
  border-top: 2px solid var(--accent-warm-dark);
}

.full-news-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.full-news-navigation > div:empty {
  flex: 1 1 0;
  min-width: 0;
}

.full-news-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--white);
  border: 2px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
  color: var(--primary-deep);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  font-family: var(--font-body);
  white-space: nowrap;
}

.full-news-nav-btn:hover {
  background: var(--primary-gold);
  color: var(--white);
  border-color: var(--primary-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
}

.full-news-nav-btn:active {
  transform: translateY(0);
}

.full-news-nav-btn.full-news-prev {
  order: 1;
  flex: 0 1 auto;
}

.full-news-back-btn {
  order: 2;
  flex: 0 0 auto;
}

.full-news-nav-btn.full-news-next {
  order: 3;
  flex: 0 1 auto;
  margin-left: auto;
}

.full-news-error {
  text-align: center;
  padding: var(--spacing-xxl);
  color: var(--text-light);
}

.full-news-error h2 {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  color: var(--primary-deep);
  margin-bottom: var(--spacing-md);
}

/* Адаптивность для полной новости */
@media (max-width: 768px) {
  .full-news-section {
    padding: var(--spacing-xs) 0 var(--spacing-xl) 0;
    margin-top: calc(-1 * var(--spacing-xl) + var(--spacing-xs));
  }
  
  .full-news-container {
    max-width: 100%;
    padding: 0;
  }
  
  .full-news-article {
    padding: var(--spacing-lg);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .full-news-title {
    font-size: 1.75rem;
  }
  
  .full-news-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }
  
  .full-news-content {
    font-size: 1rem;
  }
  
  .full-news-navigation {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .full-news-navigation > div:empty {
    display: none;
  }
  
  .full-news-nav-btn,
  .full-news-back-btn {
    width: 100%;
    justify-content: center;
    order: unset !important;
    margin-left: 0 !important;
  }
  
  .full-news-carousel {
    height: auto;
    min-height: 200px;
    margin: calc(var(--spacing-xl) / 3) 0;
  }
  
  .full-news-carousel .carousel-container {
    height: auto;
  }
  
  .full-news-carousel .carousel-slide {
    position: relative;
    height: auto;
    opacity: 0;
    display: none;
  }
  
  .full-news-carousel .carousel-slide.active {
    position: relative;
    height: auto;
    opacity: 1;
    display: block;
  }
  
  .full-news-carousel .carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
  }
  
  .page-carousel {
    height: auto;
    min-height: 200px;
    margin: calc(var(--spacing-xl) / 3) 0;
  }
  
  .page-carousel .carousel-container {
    height: auto;
  }
  
  .page-carousel .carousel-slide {
    position: relative;
    height: auto;
    opacity: 0;
    display: none;
  }
  
  .page-carousel .carousel-slide.active {
    position: relative;
    height: auto;
    opacity: 1;
    display: block;
  }
  
  .page-carousel .carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
  }
  
  /* Уменьшаем отступы у изображений и каруселей на мобильных в 3 раза */
  .page-image-wrapper {
    margin: calc(var(--spacing-xl) / 3) 0;
  }
  
  .full-news-image-wrapper {
    margin: calc(var(--spacing-xl) / 3) 0;
  }
  
  /* Уменьшаем отступы у изображений внутри контента на мобильных в 3 раза */
  .full-news-content img {
    margin: calc(var(--spacing-lg) / 3) 0;
  }
  
  .content-block img {
    margin: calc(var(--spacing-md) / 3) 0;
  }
  
  /* Контейнеры контента для страниц "О храме", "Воскресная школа", "Социальная деятельность", "История" */
  .content-block {
    padding: var(--spacing-md);
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  
  /* Разделы с контентом (духовенство, требы и т.д.) на мобильных */
  body.theme-modern .content-section.modern-section,
  body.theme-modern .modern-section-body {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Расписание и content-block на всю ширину (app.js рендерит .schedule-item) */
  body.theme-modern .modern-section-body .schedule-list,
  body.theme-modern .modern-section-body .schedule-day,
  body.theme-modern .modern-section-body .schedule-item,
  body.theme-modern .modern-section-body .content-block {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  body.theme-modern .clergy-grid {
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  body.theme-modern .clergy-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
  }
  
  body.theme-modern .clergy-contacts {
    flex-wrap: wrap;
  }
  
  body.theme-modern .clergy-contact-link {
    font-size: 0.875rem;
    line-height: 1.4;
  }
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-light);
  font-size: 1.1rem;
  position: relative;
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%, 100% {
    content: '...';
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  /* Уменьшаем размер навигации на средних экранах */
  .nav-link {
    font-size: 0.8rem;
    padding: var(--spacing-xs) calc(var(--spacing-xs) + 2px);
  }
  
  .nav-list {
    gap: 2px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  body {
    padding-top: 70px;
  }
  
  /* Header Mobile */
  .main-header {
    overflow: visible;
    z-index: 100;
  }
  
  .header-content {
    padding: var(--spacing-sm) 0;
    overflow: visible;
  }
  
  .logo {
    gap: var(--spacing-sm);
    flex: 1;
    min-width: 0;
  }
  
  .logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
  }
  
  .logo-title,
  .logo-subtitle {
    font-size: 1.15rem;
  }
  
  /* Mobile Menu */
  .mobile-menu-toggle {
    display: flex;
  }
  
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    /* Ширина будет установлена через JavaScript в зависимости от ширины меню */
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
  }
  
  .mobile-menu-overlay.active {
    display: block;
    opacity: 1;
    /* Overlay визуальный, но НЕ блокирует события - они проходят через него */
    pointer-events: none;
  }
  
  .main-nav {
    position: fixed !important;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100vh;
    background: linear-gradient(180deg, var(--white) 0%, var(--accent-warm) 100%);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15);
    transition: right var(--transition-normal) ease-in-out;
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    pointer-events: auto;
    touch-action: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .main-nav.active {
    right: 0 !important;
  }
  
  .main-nav * {
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Кнопка закрытия меню (крестик) */
  .mobile-menu-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 44px;
    height: 44px;
    background: rgba(var(--color-dark-rgb, 61, 40, 23), 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all var(--transition-fast);
    color: var(--primary-deep);
    font-size: 0;
  }
  
  .mobile-menu-close span {
    font-size: 2rem;
    line-height: 1;
    font-weight: 300;
    display: block;
  }
  
  .mobile-menu-close:hover {
    background: rgba(var(--color-dark-rgb, 61, 40, 23), 0.2);
    transform: scale(1.1);
  }
  
  .mobile-menu-close:active {
    transform: scale(0.95);
  }
  
  /* Overlay для мобильного меню будет через отдельный элемент */
  
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 90px var(--spacing-lg) var(--spacing-xl);
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .nav-list li {
    width: 100%;
    border-bottom: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  }
  
  .nav-list li:last-child {
    border-bottom: none;
  }
  
  .nav-link {
    display: block;
    padding: var(--spacing-md);
    font-size: 1.05rem;
    width: 100%;
    border-radius: var(--radius-sm);
    margin: var(--spacing-xs) 0;
    white-space: normal;
  }
  
  .nav-link::after {
    display: none;
  }
  
  .nav-link:hover {
    background: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
    transform: translateX(8px);
    padding-left: calc(var(--spacing-md) + 8px);
  }
  
  /* Hero Mobile */
  .hero {
    min-height: 70vh;
    margin-bottom: var(--spacing-xl);
    padding-bottom: calc(var(--spacing-xl) + 40px);
  }
  
  .hero-content {
    padding: var(--spacing-lg) 0;
  }
  
  .hero-info {
    flex-direction: column;
    align-items: center;
  }
  
  /* Sections Mobile */
  .section-header {
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md);
  }
  
  .section-decoration {
    max-width: 100px;
  }
  
  .section-title {
    padding: 0 calc(var(--spacing-sm) + 16px);
  }
  
  .section-title::before,
  .section-title::after {
    width: 6px;
    height: 6px;
  }
  
  .section-title::before {
    left: 4px;
  }
  
  .section-title::after {
    right: 4px;
  }
  
  /* Уменьшаем отступ от шапки до заголовка на мобильных */
  .main-content {
    padding-top: var(--spacing-xs);
    padding-bottom: var(--spacing-md);
  }
  
  /* News Mobile */
  .news-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .news-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
  
  .news-read-more-btn {
    width: 100%;
    text-align: center;
  }
  
  /* Schedule Mobile */
  .schedule-day {
    padding: var(--spacing-md);
  }
  
  .schedule-day-date {
    font-size: 1.4rem;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
  
  .schedule-day-date::before {
    font-size: 1.3rem;
  }
  
  .schedule-day-info {
    padding: var(--spacing-sm);
  }
  
  .schedule-day-info div {
    font-size: 0.9rem;
  }
  
  .schedule-event {
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
  }
  
  .schedule-event::before {
    display: none;
  }
  
  .schedule-event-time {
    min-width: auto;
    text-align: left;
    width: 100%;
    padding: var(--spacing-xs);
  }
  
  .schedule-event-separator {
    display: none;
  }
  
  .schedule-event-name {
    font-size: 1rem;
  }
  
  .schedule-event-description {
    padding-left: var(--spacing-sm);
    font-size: 0.9rem;
  }
  
  /* Widgets Mobile */
  .widgets-wrapper {
    grid-template-columns: 1fr;
  }
  
  /* Footer Mobile */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

@media (max-width: 480px) {
  .logo-title,
  .logo-subtitle {
    font-size: 1rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.75rem;
    padding: 0 calc(var(--spacing-xs) + 14px);
  }
  
  .section-title::before,
  .section-title::after {
    width: 5px;
    height: 5px;
  }
  
  .section-title::before {
    left: 2px;
  }
  
  .section-title::after {
    right: 2px;
  }
  
  .content-block {
    padding: var(--spacing-md);
  }
  
  .news-card-content,
  .widget {
    padding: var(--spacing-md);
  }
  
  .clergy-card img {
    width: 150px;
    height: 150px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .floating-elements,
  .main-header,
  .main-footer,
  .hero-scroll-indicator {
    display: none;
  }
  
  body {
    background: white;
  }
  
  .news-card,
  .content-block,
  .widget {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  
  .hero-scroll-indicator {
    animation: none;
  }
}

/* Focus styles — видимый фокус только при навигации с клавиатуры (focus-visible) */
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Скрываем outline при клике мышью */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.nav-link:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to main content — доступность (скрыт, виден при Tab) */
.skip-link {
  position: fixed;
  top: 0;
  left: var(--spacing-md);
  transform: translateY(-120%);
  background: var(--primary-deep);
  color: var(--white) !important;
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 10001;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-lg);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ============================================
   CLERGY SECTION — современно, структурно, адаптивно (как в классической по логике)
   ============================================ */

/* Секции духовенства и треб — единый стиль через .modern-section */
body.theme-modern .content-section.modern-section {
  margin-bottom: var(--spacing-xxl);
  background: transparent;
}

body.theme-modern .modern-section-body .section-header {
  margin-bottom: var(--spacing-xl);
}

body.theme-modern .modern-section-body .clergy-grid,
body.theme-modern .clergy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xl);
  margin-top: 0;
  padding: 0;
}

body.theme-modern .clergy-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.12);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  position: relative;
  animation: fadeInUp 0.5s ease-out both;
}

body.theme-modern .clergy-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

body.theme-modern .clergy-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.25);
}

body.theme-modern .clergy-card-inner {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
}

body.theme-modern .clergy-photo-wrap {
  width: 160px;
  height: 200px;
  max-width: 160px;
  max-height: 200px;
  flex-shrink: 0;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  background: var(--white);
}

body.theme-modern .clergy-photo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

body.theme-modern .clergy-photo-wrap:has(.clergy-photo-clickable),
body.theme-modern .clergy-photo-clickable {
  cursor: pointer;
}

body.theme-modern .clergy-body {
  flex: 1;
  min-width: 0;
}

body.theme-modern .clergy-name {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-deep);
  margin: 0 0 var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.25);
  line-height: 1.3;
}

body.theme-modern .clergy-fields {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

body.theme-modern .clergy-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

body.theme-modern .clergy-group-basic {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm) var(--spacing-lg);
}

body.theme-modern .clergy-field {
  font-size: 0.9rem;
  line-height: 1.6;
}

body.theme-modern .clergy-field-label {
  display: block;
  font-weight: 600;
  color: var(--primary-deep);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25em;
}

body.theme-modern .clergy-field-value {
  color: var(--text-light);
}

body.theme-modern .clergy-field-value div {
  margin-top: 0.25em;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
}

body.theme-modern .clergy-field-value div:first-child {
  margin-top: 0;
  padding-left: 0;
  border-left: none;
}

body.theme-modern .clergy-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.2);
}

body.theme-modern .clergy-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.08);
  border-radius: var(--radius-md);
  color: var(--primary-gold-dark);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.25);
}

body.theme-modern .clergy-contact-link:hover {
  background: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  color: var(--primary-deep);
  border-color: var(--primary-gold);
}

body.theme-modern .clergy-contact-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

/* Планшет: горизонтальная карточка, как в классической */
@media (min-width: 768px) {
  body.theme-modern .clergy-grid {
    gap: var(--spacing-xl);
  }

  body.theme-modern .clergy-card-inner {
    flex-direction: row;
    align-items: flex-start;
    padding: var(--spacing-xl);
    gap: var(--spacing-xl);
  }

  body.theme-modern .clergy-photo-wrap {
    width: 180px;
    height: 220px;
    max-width: 180px;
    max-height: 220px;
    margin: 0;
  }

  body.theme-modern .clergy-name {
    font-size: 1.5rem;
  }
}

/* Десктоп: больше фото, аккуратные отступы */
@media (min-width: 1024px) {
  body.theme-modern .clergy-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xxl);
  }

  body.theme-modern .clergy-photo-wrap {
    width: 200px;
    height: 260px;
    max-width: 200px;
    max-height: 260px;
  }

  body.theme-modern .clergy-name {
    font-size: 1.6rem;
  }

  body.theme-modern .clergy-field {
    font-size: 0.95rem;
  }
}

/* Мобильные: компактнее фото и кнопки */
@media (max-width: 767px) {
  body.theme-modern .clergy-card-inner {
    padding: var(--spacing-md);
  }

  body.theme-modern .clergy-photo-wrap {
    width: 140px;
    height: 180px;
    max-width: 140px;
    max-height: 180px;
  }

  body.theme-modern .clergy-name {
    font-size: 1.25rem;
  }

  body.theme-modern .clergy-contact-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
  }
}

/* ============================================
   CALENDAR WIDGET — как в классической теме
   ============================================ */

/* Модальное окно календаря */
.calendar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.calendar-modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.calendar-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.calendar-modal-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--spacing-xl);
  padding-top: 3rem;
  background: #F8F7F4 !important;
  background-color: #F8F7F4 !important;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.calendar-modal.active .calendar-modal-content {
  transform: scale(1);
}

.calendar-modal-close {
  position: absolute !important;
  top: 0.75rem !important;
  right: 0.75rem !important;
  width: 44px !important;
  height: 44px !important;
  border: 2px solid var(--primary-gold, #C9A961) !important;
  background: #FFFFFF !important;
  color: var(--primary-deep, #2D2A26) !important;
  font-size: 1.75rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  z-index: 100 !important;
  padding: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.calendar-modal-close:hover {
  background: var(--primary-gold, #C9A961) !important;
  color: #FFFFFF !important;
  border-color: var(--primary-gold-dark, #A0874D) !important;
}

#calendar-container {
  padding-top: 2.5rem;
  min-height: 400px;
  background: #F8F7F4 !important;
  background-color: #F8F7F4 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Стили для содержимого виджета календаря */
#calendar-container > * {
  max-width: 100%;
  box-sizing: border-box;
}

.calendar-modal-content #calendar-container {
  overflow: visible;
}

#calendar-container iframe {
  width: 100% !important;
  max-width: 100% !important;
  border: none !important;
  display: block;
}

#calendar-container [id*="ortox"],
#calendar-container [class*="ortox"],
#calendar-container [id*="calendar"],
#calendar-container [class*="calendar"] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .calendar-modal-content {
    max-width: 95%;
    width: 95%;
    padding: var(--spacing-lg);
  }

  #calendar-container {
    padding-top: var(--spacing-md);
    min-height: 300px;
  }
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: var(--radius-xl);
  background: none;
  border: none;
  overflow: hidden;
  box-shadow: none;
  overflow: hidden;
  flex: 1 1 0;
  min-height: 0;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* Скрытие блока «Ближайшее богослужение», когда расписание выключено. visibility + display:flex сохраняют место в сетке — виджет ВК не смещается и не растягивается */
#hero-service-card.hero-service-card-hidden {
  visibility: hidden !important;
  display: flex !important;
  pointer-events: none !important;
}

.hero-col--card .hero-card {
  box-shadow: var(--shadow-sm);
}

.hero-col--card .hero-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hero-col--card .hero-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.hero-col--card .hero-card-body {
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.hero-card--primary .hero-card-header,
.hero-card--primary .hero-card-body {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
}

.hero-card--secondary {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(238, 245, 255, 0.85) 100%);
}

.hero-card-title {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--primary-deep);
}

.hero-card-time {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
}

.hero-card-meta {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 12;
  line-clamp: 12;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 19.5em;
  color: var(--primary-deep);
  line-height: 1.5;
  overflow: hidden;
  position: relative;
}

.hero-card-meta span {
  display: block;
}

.hero-card-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 16px 32px rgba(var(--color-primary-rgb, 0, 94, 68), 0.35);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-card-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 40px rgba(var(--color-primary-rgb, 0, 94, 68), 0.35);
}

.hero-card-cta--outline {
  background: transparent;
  border: 1px solid rgba(var(--color-dark-rgb, 16, 28, 47), 0.12);
  color: var(--primary-deep);
  box-shadow: none;
}

.hero-card-cta--outline:hover {
  background: rgba(var(--color-primary-rgb, 0, 94, 68), 0.12);
  box-shadow: none;
}

@media (max-width: 1023px) {
  .hero-card {
    max-width: 540px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero-info-item {
    align-items: center;
    text-align: center;
  }
}

.hero-card-label {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  text-transform: none;
  letter-spacing: 0.02em;
}

.hero-col--card .hero-card-header .hero-card-label,
.hero-col--card .hero-card-body .hero-card-meta {
  color: #1a1a2e !important;
}

/* Современная тема: весь текст в блоке «Ближайшее богослужение» — цвета темы (на светлом фоне) */
body.theme-modern .hero-col--card .hero-card-header .hero-card-label,
body.theme-modern .hero-col--card .hero-card-body .hero-card-meta,
body.theme-modern .hero-col--card .hero-card .hero-service-date,
body.theme-modern .hero-col--card .hero-card .hero-service-time,
body.theme-modern .hero-col--card .hero-card .hero-service-name,
body.theme-modern .hero-col--card .hero-card .hero-service-week,
body.theme-modern .hero-col--card .hero-card .hero-service-description {
  color: var(--color-text-on-light, var(--primary-gold-dark, #1a1a2e)) !important;
}

.hero-col--card .hero-card-header .hero-card-label {
  font-size: 0.875rem;
  white-space: nowrap;
}

.hero-col--card .hero-card-cta {
  font-size: 0.875rem;
  white-space: nowrap;
  padding: 0.65rem 1.25rem;
}

.hero-card-meta:empty {
  display: none;
}

.hero-card-empty {
  margin-top: 0.5rem;
  color: var(--text-light);
  font-style: italic;
}

body.theme-modern .hero-col--card .hero-card-empty {
  color: var(--primary-gold-dark, var(--color-text-on-light, #334155)) !important;
}

.hero-service-date {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light);
}

/* ============================================
   VK виджет в hero — под блоком «Ближайшее богослужение»
   Только шапка сверху с фоном, виджет без обводки
   ============================================ */
.hero-col--card .vk-widget-wrapper.hero-info-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  flex: 1 1 0;
  min-height: 0;
  gap: 0;
  padding: 0;
  margin-top: 0;
  background: none !important;
  border: none !important;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-col--card .vk-widget-wrapper.hero-info-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Режим «Блок ссылок»: вся область под заголовком белая; высота по контенту — без пустого места снизу (на десктопе переопределяем height: 480px из media 1024px) */
.hero-col--card .vk-widget-wrapper.hero-info-item.hero-info-item--social-links {
  background: #fff !important;
  flex: 0 1 auto !important;
  align-self: flex-start;
  height: auto !important;
  min-height: 0;
  max-height: none;
}
.hero-col--card .vk-widget-wrapper.hero-info-item.hero-info-item--social-links #hero-info-social-links.hero-social-desktop__links {
  background: #fff !important;
  flex: 0 1 auto !important;
}

/* Полоска между заголовком «Мы в соцсетях» и блоком кнопок */
.hero-col--card .vk-widget-wrapper.hero-info-item.hero-info-item--social-links .vk-widget-header {
  border-bottom: 1px solid rgba(var(--color-primary-rgb, 0, 94, 68), 0.12);
}

/* В режиме «Блок ссылок» полностью убираем #vk_groups из вёрстки (иначе display: block !important перекрывает кнопки) */
.hero-col--card .vk-widget-wrapper.hero-info-item.hero-info-item--social-links #vk_groups {
  display: none !important;
  min-height: 0 !important;
  flex: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.hero-col--card .vk-widget-wrapper .vk-widget-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.hero-col--card .vk-widget-wrapper .vk-widget-header .info-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 1;
}

.hero-col--card .vk-widget-wrapper .vk-widget-header strong {
  font-size: 1rem;
  color: var(--primary-deep);
}

.hero-col--card .vk-widget-wrapper #vk_groups,
.hero-col--card .vk-widget-wrapper #vk_groups iframe,
.hero-col--card .vk-widget-wrapper #vk_groups * {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
}

.hero-col--card .vk-widget-wrapper #vk_groups {
  flex: 1 1 auto;
  min-height: 280px;
  display: block !important;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.hero-col--card .vk-widget-wrapper #vk_groups iframe {
  border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
}

@media (max-width: 1023px) {
  .hero-col--card .vk-widget-wrapper.hero-info-item {
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .hero-col--card .vk-widget-wrapper #vk_groups {
    min-height: 240px;
  }
}

/* Блок «Мы в соцсетях» на десктопе вместо виджета ВК — только для экранов >= 1024px */
@media (max-width: 1023px) {
  .hero-col--card .hero-social-desktop {
    display: none !important;
  }
}

.hero-col--card .hero-social-desktop.hero-info-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  flex: 1 1 0;
  min-height: 0;
  padding: 0;
  margin-top: 0;
  background: none !important;
  border: none !important;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-col--card .hero-social-desktop:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hero-col--card .hero-social-desktop .hero-social-desktop__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.hero-col--card .hero-social-desktop .hero-social-desktop__header strong {
  font-size: 1rem;
  color: var(--primary-deep);
}

.hero-col--card .hero-social-desktop__links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 0.75rem;
  padding: var(--spacing-lg);
  background: #fff;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  flex: 1 1 auto;
  min-height: 0;
}

/* Кнопки соцсетей в блоке «Мы в соцсетях» — в стиле кнопки «Полное расписание» (палитра темы) */
.hero-col--card .hero-social-desktop-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 44px;
  height: 44px;
  padding: 0 1rem;
  color: var(--white, #fff) !important;
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  border: none;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(var(--color-primary-rgb, 0, 94, 68), 0.25);
  transition: color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.hero-col--card .hero-social-desktop-link:hover {
  color: var(--white, #fff) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(var(--color-primary-rgb, 0, 94, 68), 0.35);
}

.hero-col--card .hero-social-desktop-link__icon {
  display: block;
  width: 24px;
  height: 24px;
  line-height: 0;
  flex-shrink: 0;
  color: var(--white, #fff) !important;
}

.hero-col--card .hero-social-desktop-link__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.hero-col--card .hero-social-desktop-link__text {
  white-space: nowrap;
  color: var(--white, #fff) !important;
}

.hero-service-time {
  font-size: 0.9rem;
  color: var(--primary-gold-dark);
  font-weight: 600;
}

.hero-service-name {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.15rem;
  color: var(--primary-deep);
}

.hero-service-week,
.hero-service-description {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ============================================
   СОВМЕСТИМОСТЬ С APP.JS — наша структура
   ============================================ */

/* Пагинация: app.js использует .pagination, .pagination-button */
#news-pagination.pagination,
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
  flex-wrap: wrap;
}

.pagination-button,
.pagination-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(var(--color-dark-rgb, 16, 28, 47), 0.1);
  color: var(--primary-deep);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: var(--font-body);
  box-shadow: 0 12px 24px rgba(var(--color-dark-rgb, 11, 29, 52), 0.08);
}

.pagination-button:hover:not(:disabled),
.pagination-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  color: var(--white);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(var(--color-primary-rgb, 0, 94, 68), 0.3);
}

.pagination-button:disabled,
.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0 var(--spacing-md);
}

/* Расписание: app.js использует .schedule-item (плоский список) */
.schedule-item {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: 0 4px 20px rgba(var(--color-dark-rgb, 61, 40, 23), 0.06), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.1);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
  animation: fadeInUp 0.6s ease-out both;
}

.schedule-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition-normal);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.schedule-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(var(--color-dark-rgb, 61, 40, 23), 0.12), 0 0 0 1px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.25);
  border-color: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
}

.schedule-item:hover::before {
  transform: scaleY(1);
}

.schedule-header {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--accent-warm-dark, var(--color-border-light));
}

.schedule-date {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-deep);
  display: block;
  margin-bottom: var(--spacing-xs);
}

.schedule-time {
  font-size: 1rem;
  color: var(--primary-gold-dark);
  font-weight: 600;
}

.schedule-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.6;
}

.schedule-description {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-top: var(--spacing-sm);
}

/* Духовенство: app.js — clergy-card-inner, clergy-body, clergy-photo-wrap */
.clergy-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
}

.clergy-photo-wrap {
  width: 160px;
  height: 200px;
  max-width: 160px;
  max-height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(var(--color-dark-rgb, 61, 40, 23), 0.15), 0 0 0 4px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.1);
  flex-shrink: 0;
}

.clergy-photo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.clergy-body {
  flex: 1;
  width: 100%;
  text-align: center;
}

.clergy-name {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-deep);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.2);
}

.clergy-fields {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  text-align: left;
}

.clergy-field-label {
  font-weight: 600;
  color: var(--primary-deep);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-xs);
}

.clergy-field-value {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.clergy-contact-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--primary-gold-dark);
  text-decoration: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.clergy-contact-link:hover {
  color: var(--primary-gold);
  background: rgba(var(--primary-gold-rgb, 201, 169, 97), 0.1);
}

/* Пожертвования: app.js — donations-container, donation-method */
.donations-container {
  max-width: 900px;
  margin: 0 auto;
}

.donations-text {
  margin-bottom: var(--spacing-lg);
}

.donations-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.donation-method {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 20px rgba(var(--color-dark-rgb, 61, 40, 23), 0.06);
  border: 1px solid rgba(var(--primary-gold-rgb, 201, 169, 97), 0.15);
  transition: all var(--transition-normal);
}

.donation-method:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(var(--color-dark-rgb, 61, 40, 23), 0.12);
}

.donation-method-clickable {
  cursor: pointer;
}

.donation-method h4 {
  font-family: var(--modern-display-heading-font, var(--font-heading));
  font-size: 1.2rem;
  color: var(--primary-deep);
  margin-bottom: var(--spacing-sm);
}

.donation-method p {
  color: var(--text-light);
  line-height: 1.7;
}

.donation-qr-open-wrap {
  margin-top: var(--spacing-md, 1rem);
  margin-bottom: 0;
}

.donation-link-url {
  margin-top: 1em;
  margin-bottom: 0;
}

.donation-qr-open-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--primary-gold, #C9A961);
  text-decoration: underline;
  cursor: pointer;
}

.donation-qr-open-link:hover {
  color: var(--primary-gold-dark, #B8964A);
}

/* Форма пожертвований через ЮКассу — аккуратное отображение на мобильных */
.donations-yookassa-form {
  max-width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.donation-payment-form {
  max-width: 400px;
  width: 100%;
  box-sizing: border-box;
}

.donation-payment-form .form-group {
  box-sizing: border-box;
}

.donation-payment-form input[type="number"],
.donation-payment-form input[type="email"] {
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
}

/* Кнопка «Пожертвовать» — цвета из палитры темы (tenant-config) */
.btn-donation-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.3);
}
.btn-donation-pay:hover {
  background: linear-gradient(135deg, var(--primary-gold-light) 0%, var(--primary-gold) 100%);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--primary-gold-rgb, 201, 169, 97), 0.4);
}
.btn-donation-pay:active {
  transform: translateY(0);
}
.btn-donation-pay:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  body.theme-modern .modern-section-body:has(#donations-container) .donations-text {
    text-align: justify;
  }

  body.theme-modern .modern-section-body:has(#donations-container) .donations-methods {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
  }

  body.theme-modern .modern-section-body:has(#donations-container) .donation-method {
    width: 100%;
    max-width: 340px;
    box-sizing: border-box;
  }

  body.theme-modern .modern-section-body:has(#donations-container) .donations-yookassa-form {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 480px) {
  .donations-container {
    padding-left: var(--spacing-md, 1rem);
    padding-right: var(--spacing-md, 1rem);
    box-sizing: border-box;
  }

  .donations-yookassa-form {
    margin-left: 0;
    margin-right: 0;
    padding: 0;
  }

  .donation-payment-form {
    max-width: 100%;
    min-width: 0;
  }

  .donation-payment-form input[type="number"],
  .donation-payment-form input[type="email"] {
    min-width: 0;
  }
}

/* Новости: img и карусель — высота и обрезка */
.news-card .news-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
