/* ==========================================================================
   Храм св. прав. воина Феодора Ушакова — главная страница
   Макеты: Frame 44 (1280), Frame 70 (1920), Frame 47 (428), dropdown-menu, Frame 60 (тёмная тема)
   ========================================================================== */

/* Фирменные шрифты из макета (Opinion Pro, Lighthaus) коммерческие.
   Если файлы шрифтов есть — положите их в assets/fonts/ и раскомментируйте src: url(...). */
@font-face {
  font-family: "Opinion Pro";
  font-weight: 300;
  font-display: swap;
  src: local("Opinion Pro Light"), local("OpinionPro-Light");
  /* src: url("../assets/fonts/OpinionPro-Light.woff2") format("woff2"); */
}
@font-face {
  font-family: "Lighthaus";
  font-weight: 400;
  font-display: swap;
  src: local("Lighthaus"), local("Lighthaus-Regular");
  /* src: url("../assets/fonts/Lighthaus.woff2") format("woff2"); */
}

/* ---------- Токены ---------- */
:root {
  --primary: #3e4092;
  --primary-hover: #34367d;
  --on-primary: #fff;

  --bg: #fff;
  --texture-opacity: .45;
  --accent: #3e4092;          /* заголовки, даты, ссылки */
  --text: #424242;            /* основной текст */
  --text-strong: #343434;     /* названия служб */
  --muted: rgba(66, 66, 66, .4);
  --line: rgba(0, 0, 0, .06);
  --card-border: #f5f2f2;
  --nav-active: #abadff;
  --inner-fg: #565656;        /* шапка/заголовок внутренних страниц */
  --inner-active: #7f82f4;
  --inner-burger: #3e4092;
  --table-bg: #fff;
  --table-border: #b9b9b9;
  --table-head-bg: rgba(0, 0, 0, .06);
  --table-head-fg: #000;

  --menu-bg: #fff;
  --menu-text: #565656;
  --menu-sub: #565656;
  --menu-line: #eee;
  --menu-shadow: 0 8px 24px rgba(0, 0, 0, .08);

  --font-text: "Onest", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-head: "Playfair Display SC", "Playfair Display", Georgia, serif;
  --font-nav: "Opinion Pro", "Onest", system-ui, sans-serif;
  --font-num: "Lighthaus", "Playfair Display SC", Georgia, serif;

  --container: 1192px;
  --gutter: 44px;
  --header-h: 149px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #222;
  --texture-opacity: 0;
  --accent: #a4a5d7;
  --text: #fff;
  --text-strong: #fff;
  --muted: rgba(255, 255, 255, .46);
  --line: rgba(255, 255, 255, .06);
  --card-border: rgba(255, 255, 255, .08);
  --nav-active: #7f82f4;
  --inner-fg: #fff;
  --inner-active: #a4a5d7;
  --inner-burger: #a4a5d7;
  --table-bg: transparent;
  --table-head-bg: #3e4092;
  --table-head-fg: #fff;
  --menu-bg: #222;
  --menu-text: #fff;
  --menu-sub: #9b9b9b;
  --menu-line: rgba(255, 255, 255, .08);
  --menu-shadow: 0 7px 46px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #222;
    --texture-opacity: 0;
    --accent: #a4a5d7;
    --text: #fff;
    --text-strong: #fff;
    --muted: rgba(255, 255, 255, .46);
    --line: rgba(255, 255, 255, .06);
    --card-border: rgba(255, 255, 255, .08);
    --nav-active: #7f82f4;
  --inner-fg: #fff;
  --inner-active: #a4a5d7;
  --inner-burger: #a4a5d7;
  --table-bg: transparent;
  --table-head-bg: #3e4092;
  --table-head-fg: #fff;
    --menu-bg: #222;
    --menu-text: #fff;
    --menu-sub: #9b9b9b;
    --menu-line: rgba(255, 255, 255, .08);
    --menu-shadow: 0 7px 46px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ---------- База ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: normal;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
/* На внутренних страницах текстура идёт и под шапкой */
body:has(.header--solid) { position: relative; isolation: isolate; }
.page--inner { isolation: auto; }
.page--inner::before { display: none; }

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
address { font-style: normal; }

:focus-visible { outline: 2px solid var(--nav-active); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.only-mobile { display: none; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 41px;
  padding: 10px 21px 10px 29px;
  border-radius: 4px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s;
}
.btn:hover { background: var(--primary-hover); }
.btn--pill { border-radius: 28px; }
.btn--wide { min-width: 233px; border-radius: 0; }
.btn--outline {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
}
.btn--outline:hover { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ---------- Шапка ---------- */
.header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  color: #fff;
}

.header__inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: calc(var(--container) + var(--gutter) * 2);
  height: var(--header-h);
  margin: 0 auto;
  padding: 74px var(--gutter) 0;
}

.header__logo {
  position: absolute;
  top: 0;
  left: 50%;
  width: 152px;
  height: 149px;
  transform: translateX(-50%);
  color: #fff;
}
.header__logo svg { width: 100%; height: 100%; }

.header__nav--right { width: 499px; }

.nav { display: flex; align-items: center; gap: 86px; }
.nav--spread { justify-content: space-between; gap: 24px; }
.nav__item { position: relative; }

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-nav);
  font-weight: 300;
  font-size: 19px;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color .2s;
}
.nav__link:hover,
.nav__link--underline { text-decoration: underline; }
.nav__link.is-active { color: var(--nav-active); text-decoration: none; }
.nav__item--dropdown:hover > .nav__link,
.nav__toggle[aria-expanded="true"] { color: var(--nav-active); text-decoration: underline; }
.nav__chevron { flex: none; transition: transform .2s; }
.nav__toggle[aria-expanded="true"] .nav__chevron { transform: rotate(180deg); }
.nav__link + .nav__toggle { margin-left: 8px; }

/* Выпадающее меню десктопа (Rectangle 38 + текст «Святой адмирал Ушаков…») */
.dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: -16px;
  z-index: 5;
  min-width: 293px;
  padding: 18px 12px 20px;
  border-radius: 15px;
  background: var(--menu-bg);
  box-shadow: 0 7px 46px rgba(0, 0, 0, .25);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.dropdown::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("../img/texture.png");
  opacity: var(--texture-opacity);
  pointer-events: none;
}
.dropdown::after { /* мостик, чтобы ховер не терялся между пунктом и меню */
  content: "";
  position: absolute;
  inset: -16px 0 auto;
  height: 16px;
}
.dropdown--right { left: auto; right: -16px; }
.nav__item--dropdown:hover > .dropdown,
.nav__item--dropdown:focus-within > .dropdown,
.nav__toggle[aria-expanded="true"] + .dropdown {
  visibility: visible;
  opacity: 1;
  transform: none;
}
.dropdown > li { position: relative; }
.dropdown__link {
  display: block;
  padding: 3px 4px;
  border-radius: 4px;
  font-family: var(--font-nav);
  font-weight: 300;
  font-size: 19px;
  line-height: 1.4;
  color: var(--menu-text);
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.dropdown__link:hover { background: var(--primary); color: #fff; }
.dropdown__link--accent { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dropdown__sub { margin: 2px 0 10px; }
.dropdown__sub a {
  display: block;
  padding: 0 4px;
  font-family: var(--font-text);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.48;
  color: var(--menu-sub);
  text-decoration: none;
}
.dropdown__sub a:hover,
.dropdown__sub a.is-active { color: var(--accent); }

/* Переключатель темы (в макете не показан — плавающая кнопка, не мешающая сетке) */
.theme-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
  transition: background-color .2s, transform .2s;
}
.theme-toggle:hover { background: var(--primary-hover); transform: scale(1.06); }
.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}

.burger { display: none; color: #fff; }

/* ---------- Мобильное меню ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  background: rgba(0, 0, 0, .35);
  animation: fade .2s;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__panel {
  position: relative;
  max-width: 428px;
  min-height: 100%;
  margin-left: auto;
  padding-bottom: 24px;
  overflow: hidden;
  background: var(--menu-bg);
  box-shadow: var(--menu-shadow);
  animation: slide-in .25s ease-out;
}
.mobile-menu__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/texture.png");
  opacity: var(--texture-opacity);
  pointer-events: none;
}
.mobile-menu__head { position: relative; height: 117px; }
.mobile-menu__logo {
  position: absolute;
  top: 0;
  left: 50%;
  width: 116px;
  height: 113px;
  transform: translateX(-50%);
  color: var(--menu-text);
}
.mobile-menu__logo svg { width: 100%; height: 100%; }
.mobile-menu__close {
  position: absolute;
  top: 40px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  color: var(--accent);
}

.m-nav { position: relative; }
.m-nav__item { border-bottom: 1px solid var(--menu-line); }
.m-nav__item--last,
.m-nav__item--group.is-open { border-bottom: 0; }
.m-nav__item--last + .m-nav__item { border-top: 1px solid var(--menu-line); }
.m-nav__item--group.is-open + .m-nav__item { border-top: 1px solid var(--menu-line); }
.m-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 24px;
  font-family: var(--font-nav);
  font-weight: 300;
  font-size: 19px;
  line-height: normal;
  color: var(--menu-text);
  text-align: left;
  text-transform: uppercase;
  text-decoration: none;
}
.m-nav__link svg { flex: none; opacity: .5; transition: transform .2s; }
.m-nav__link.is-active { z-index: 0; color: #fff; }
.m-nav__link.is-active::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 16px;
  z-index: -1;
  width: calc(100% - 32px);
  max-width: 148px;
  border-radius: 4px;
  background: var(--primary);
}
.m-nav__link--accent,
.m-nav__item--group.is-open > .m-nav__link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.m-nav__item--group.is-open > .m-nav__link svg { transform: rotate(90deg); }
.m-nav__sub { display: none; padding: 0 24px 4px 48px; list-style: disc; color: var(--menu-sub); }
.m-nav__item--group.is-open > .m-nav__sub { display: block; }
.m-nav__sub a {
  font-weight: 300;
  font-size: 16px;
  line-height: 1.48;
  color: var(--menu-sub);
  text-decoration: none;
}
.m-nav__sub a:hover,
.m-nav__sub a.is-active { color: var(--accent); }

@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }

/* ---------- Страница / текстура ---------- */
.page { position: relative; isolation: isolate; }
.page::before,
body:has(.header--solid)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/texture.png");
  opacity: var(--texture-opacity);
  pointer-events: none;
}

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  height: 837px;
  overflow: hidden;
  color: #fff;
  background: #2c3048;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .4);
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 293px;
  text-align: center;
}
.hero__eyebrow { font-size: 16px; text-transform: uppercase; }
.hero__title {
  max-width: 1092px;
  margin-top: 39px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 53px;
  line-height: 1;
  text-transform: uppercase;
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 31px;
}
.hero__btn { min-width: 172px; }
.hero__link { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.hero__link:hover { text-decoration-thickness: 2px; }

.timeline {
  display: flex;
  gap: 64px;
  align-self: flex-start;
  margin: 78px 0 0 89px;
  text-align: left;
}
.timeline__item { display: flex; flex-direction: column; width: 222px; }
.timeline__year {
  font-family: var(--font-head);
  font-size: 40px;
  line-height: 1.32;
  font-feature-settings: "case" 1, "cpsp" 1;
}
.timeline__text {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .7);
  max-width: 211px;
  font-size: 12px;
  text-transform: uppercase;
}

/* ---------- Секции ---------- */
.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-align: center;
}
.section-title {
  max-width: 571px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.33;
  color: var(--accent);
}
.section-title--narrow { max-width: 570px; }
.ornament { display: block; max-width: 100%; height: auto; color: var(--accent); }
.section-cta { display: flex; justify-content: center; }

/* ---------- Расписание ---------- */
.schedule { padding-top: 77px; }
.schedule__list { max-width: 996px; margin: 65px auto 0; }
.service {
  display: grid;
  grid-template-columns: 114px 1fr;
  padding: 0 0 30px;
  color: var(--accent);
}
.service + .service { padding-top: 21px; border-top: 1px solid var(--line); }
.service__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0;
  margin-top: -11px;
}
.service__day { font-family: var(--font-num); font-size: 36px; line-height: 1.29; }
.service__month { font-size: 16px; text-transform: uppercase; }
.service__weekday { display: none; font-size: 16px; text-transform: uppercase; }
.service__title { font-weight: 700; font-size: 18px; text-transform: uppercase; }
.service__feast { max-width: 543px; font-size: 18px; }
.service__times { margin-top: 6px; }
.service__times > div { display: flex; gap: 21px; }
.service__times dt { width: 52px; font-weight: 700; font-size: 18px; }
.service__times dd { font-size: 18px; color: var(--text-strong); text-transform: uppercase; }
.schedule .section-cta { margin-top: 48px; }

/* ---------- Новости ---------- */
.news { padding-top: 86px; }
.news__track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 39px;
}
.news__track:focus-visible { outline-offset: 8px; }
.news-card { min-width: 0; }
.news-card__media {
  position: relative;
  display: block;
  aspect-ratio: 375 / 306;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #d9d9d9;
}
.news-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card__media:hover img { transform: scale(1.03); }
.photo-dots {
  position: absolute;
  left: 50%;
  bottom: 21px;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}
.photo-dots i,
.slider-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(217, 217, 217, .2);
}
.photo-dots i.is-active,
.slider-dots button.is-active { background: #d9d9d9; }
.news-card__body {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 17px 10px 0 7px;
  font-size: 20px;
}
.news-card__title { font-weight: 700; font-size: 20px; line-height: 1.2; color: var(--accent); }
.news-card__title a { text-underline-offset: 3px; }
.news-card__title a:hover { text-decoration-thickness: 2px; }
.news-card__text { color: var(--text); }
.news-card__date { color: var(--muted); }
.slider-dots { display: none; }
.news .section-cta { margin-top: 42px; }

/* ---------- Таинства ---------- */
.sacraments { padding-top: 160px; }
.sacraments__grid {
  display: grid;
  grid-template-columns: 270fr 488fr 270fr;
  align-items: center;
  column-gap: clamp(32px, 6.4vw, 81px);
}
.sacrament { display: flex; flex-direction: column; min-width: 0; }
.sacrament--baptism { order: 1; }
.sacrament--note { order: 2; }
.sacrament--wedding { order: 3; }
.sacrament__title {
  margin-bottom: 27px;
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  text-transform: uppercase;
}
.sacrament--note .sacrament__title { margin-bottom: 25px; }
.sacrament__img {
  width: 100%;
  aspect-ratio: 270 / 356;
  object-fit: cover;
  background: #d9d9d9;
}
.sacrament--note .sacrament__img { aspect-ratio: 488 / 643; }
.sacrament__link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 41px;
  font-size: 16px;
  color: var(--text);
  text-transform: uppercase;
  text-decoration: none;
}
.sacrament__link span { max-width: 293px; text-decoration: underline; text-underline-offset: 2px; }
.sacrament--wedding .sacrament__link span { max-width: 230px; }
.sacrament__link svg { flex: none; margin-top: 5px; color: var(--accent); transition: transform .2s; }
.sacrament__link:hover svg { transform: translate(3px, -3px); }

/* ---------- О храме ---------- */
.about { padding: 192px 0 96px; }
.about__intro {
  display: grid;
  grid-template-columns: 1fr 486px;
  column-gap: 40px;
  padding-left: 4px;
}
.about__title {
  max-width: 509px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.33;
  color: var(--accent);
}
.about__heading .ornament { margin: 17px 0 0 -5px; }
.about__lead { padding-top: 5px; font-size: 20px; line-height: 1.2; color: var(--accent); }

.about__media {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 762fr) minmax(0, 425fr);
  margin-top: 99px;
  padding-left: 4px;
}
.about__img {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 762 / 456;
  object-fit: cover;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #d9d9d9;
}
.about__aside {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: -48px 0 0 -54px;
}
.about__box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 23px;
  width: 100%;
  min-height: 331px;
  padding: 23px 21px 23px 21.5px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
}
.about__btn { margin-top: 38px; min-width: 209px; }

.videos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  margin-top: 20px;
}
.video__media {
  display: block;
  aspect-ratio: 583 / 306;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #d9d9d9;
}
.video__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.video__media:hover img { transform: scale(1.03); }
.video__caption { margin-top: 33px; font-size: 20px; line-height: 1.2; color: var(--accent); }
.video__caption a { font-weight: 700; text-underline-offset: 3px; }

/* ---------- Подвал ---------- */
.footer {
  background: var(--primary);
  color: #fff;
}
.footer__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 331px;
  padding-top: 25px;
  padding-bottom: 24px;
}
.footer__top { display: flex; align-items: flex-start; justify-content: space-between; }
.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
  color: #fff;
  text-decoration: none;
}
.footer__emblem { width: 63px; height: 62px; margin: -5px 0; }
.footer__wordmark {
  font-family: var(--font-head);
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.footer__nav {
  display: grid;
  grid-template-columns: auto auto auto auto 253px;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding-left: 10px;
}
.footer__nav ul,
.footer__contacts { display: flex; flex-direction: column; gap: 13px; }
.footer__nav a,
.footer__contacts {
  font-family: var(--font-nav);
  font-weight: 300;
  font-size: 16px;
  text-transform: uppercase;
}
.footer__nav ul a { text-underline-offset: 2px; }
.footer__nav a:hover { text-decoration-thickness: 2px; }
.footer__contacts a { text-decoration: none; }
.footer__contacts a:hover { text-decoration: underline; }
.socials { display: flex; gap: 15px; margin: 25px 40px 0 0; }
.socials a { display: block; opacity: 1; transition: opacity .2s; }
.socials a:hover { opacity: .7; }
.socials svg { display: block; }
.footer__bottom {
  display: flex;
  align-items: baseline;
  margin-top: auto;
  padding-top: 32px;
  font-size: 14px;
  line-height: 1.2;
}
.footer__old { padding-left: 10px; white-space: nowrap; }
.footer__copy { margin-left: auto; padding-right: 45px; text-align: right; }

/* ==========================================================================
   Широкий десктоп (Frame 70, 1920): контент остаётся в контейнере 1192px,
   растягиваются только фон первого экрана и подвала
   ========================================================================== */
@media (min-width: 1600px) {
  .hero { height: 812px; }
}

/* ==========================================================================
   Узкий десктоп / планшет
   ========================================================================== */
@media (max-width: 1199px) {
  :root { --gutter: 32px; }
  .hero__title { font-size: 46px; }
  .about__intro { grid-template-columns: 1fr 1fr; }
  .footer__nav { grid-template-columns: repeat(3, auto); row-gap: 32px; }
}

/* Навигация сворачивается в бургер, когда пункты перестают помещаться в строку
   (шапка из макета целиком помещается только от 1200px) */
@media (max-width: 1199px) {
  :root { --header-h: 120px; }
  .header__inner { padding-top: 0; }
  .header__nav { display: none; }
  .header__logo { top: 7px; width: 116px; height: 113px; }
  .burger {
    position: absolute;
    top: 37px;
    right: var(--gutter);
    display: block;
    width: 40px;
    height: 40px;
  }
  .burger svg { display: block; }
}

@media (max-width: 1023px) {

  .hero { height: 772px; }
  .hero__inner { padding-top: 160px; }
  .hero__title { font-size: 42px; }

  .news__track {
    display: flex;
    gap: 24px;
    margin: 39px calc(var(--gutter) * -1) 0;
    padding: 0 var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .news__track::-webkit-scrollbar { display: none; }
  .news-card { flex: 0 0 min(375px, 44%); scroll-snap-align: start; }
  .slider-dots { display: flex; justify-content: center; gap: 5px; margin-top: 28px; }

  .about__media { grid-template-columns: 1fr; padding-left: 0; }
  .about__aside { grid-column: 1; grid-row: 2; margin: 24px 0 0; }
  .about__box { min-height: 0; }
  .about__btn { width: 100%; margin-top: 30px; }
}

/* ==========================================================================
   Мобильная версия (Frame 47, 428)
   ========================================================================== */
@media (max-width: 767px) {
  :root { --gutter: 27px; }

  .only-desktop { display: none; }
  .only-mobile { display: inline; }

  .btn { width: 100%; }

  /* первый экран */
  .hero { height: 772px; box-shadow: 0 10px 23.9px rgba(0, 0, 0, .25); }
  .hero__inner { padding-top: 141px; }
  .hero__eyebrow { max-width: 223px; font-size: 12px; }
  .hero__title { max-width: 380px; margin-top: 27px; font-size: 36px; }
  .hero__title-tail { display: none; }
  .hero__actions { flex-direction: column; gap: 14px; margin-top: 27px; width: 100%; max-width: 349px; }
  .hero__btn { min-height: 52px; border-radius: 0; }
  .timeline { flex-direction: column; gap: 18px; margin: 37px 0 0 9px; }
  .timeline__item { width: 242px; }
  .timeline__year { font-size: 38.4px; line-height: 1.3; }
  .timeline__text { width: 222px; max-width: none; margin-top: 7px; padding-top: 13px; font-size: 11px; }

  /* заголовки секций */
  .section-head { gap: 20px; }
  .section-title { max-width: 347px; font-size: 28px; }

  /* расписание */
  .schedule { padding-top: 64px; }
  .schedule__list { margin-top: 43px; }
  .service { grid-template-columns: 76px 1fr; padding-bottom: 20px; }
  .service + .service { padding-top: 13px; }
  .service__date { margin: -4px 0 0 -3px; }
  .service__weekday { display: block; }
  .service__title { font-size: 16px; }
  .service__feast { font-size: 14px; }
  .service__times { margin-top: 18px; }
  .service__times > div { gap: 21px; }
  .service__times dt { font-size: 16px; }
  .service__times dd { font-size: 14px; line-height: 19px; }
  .schedule .section-cta { margin-top: 22px; }

  /* новости */
  .news { padding-top: 74px; }
  .news__track { margin-top: 43px; gap: 16px; }
  .news-card { flex-basis: min(375px, 100%); }
  .photo-dots { display: none; }
  .news-card__body { gap: 17px; padding: 17px 0 0 8px; }
  .news-card__title a { text-decoration: underline; }
  .news-card__text { font-size: 16px; }
  .news .section-cta { margin-top: 50px; }

  /* таинства */
  .sacraments { padding-top: 65px; }
  .sacraments__grid { grid-template-columns: 1fr; row-gap: 46px; }
  .sacrament { order: 0 !important; }
  .sacrament__title,
  .sacrament--note .sacrament__title { margin-bottom: 12px; }
  .sacrament__img,
  .sacrament--note .sacrament__img { aspect-ratio: 373 / 278; }
  .sacrament__link { margin-top: 23px; font-size: 14px; }
  .sacrament__link span,
  .sacrament--wedding .sacrament__link span { max-width: 321px; }
  .sacrament__link svg { margin-top: -5px; }

  /* о храме */
  .about { padding: 109px 0 64px; }
  .about__intro { grid-template-columns: 1fr; padding-left: 0; }
  .about__title { font-size: 28px; }
  .about__heading .ornament { margin: 16px 0 0 14px; }
  .about__lead { max-width: 368px; padding-top: 19px; font-size: 12px; }
  .about__media { margin-top: 35px; }
  .about__img { aspect-ratio: 376 / 226; }
  .about__aside { margin-top: 30px; }
  .about__box { gap: 16px; padding: 23px 21px 23px 23px; font-size: 14px; }
  .videos { grid-template-columns: 1fr; gap: 47px; margin-top: 47px; }
  .video__media { aspect-ratio: 372 / 192; }
  .video__caption { margin-top: 14px; font-size: 16px; }

  /* подвал: на мобильном только копирайт (Frame 47) */
  .footer__inner { min-height: 92px; justify-content: center; padding-top: 24px; }
  .footer__top,
  .footer__nav,
  .footer__old { display: none; }
  .footer__bottom { margin: 0; padding: 0; justify-content: center; }
  .footer__copy { margin: 0; padding: 0; max-width: 362px; text-align: center; }

}

@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .hero__title { font-size: 31px; }
  .timeline__text { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Внутренняя текстовая страница (Frame 26 / 51, тёмная — Frame 69 / 65)
   ========================================================================== */

/* Шапка на фоне страницы, а не поверх фото */
.header--solid { position: relative; color: var(--inner-fg); }
.header--solid .header__logo { color: var(--inner-fg); }
.header--solid .nav__link.is-active,
.header--solid .nav__item--dropdown:hover > .nav__link,
.header--solid .nav__toggle[aria-expanded="true"] { color: var(--inner-active); }
.header--solid .burger { color: var(--inner-burger); }
.header--solid .theme-toggle:hover { background: var(--primary-hover); }

.page--inner { padding-bottom: 180px; }

.container--text { max-width: calc(892px + var(--gutter) * 2); }

.article__head { display: flex; flex-direction: column; align-items: center; padding-top: 24px; text-align: center; }
.breadcrumbs { font-size: 16px; color: var(--inner-fg); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.article__title {
  max-width: 1092px;
  margin-top: 54px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 36px;
  line-height: 1;
  color: var(--inner-fg);
  text-transform: uppercase;
}

.article__cover {
  position: relative;
  margin: 80px auto 0;
  max-width: 1183px;
  aspect-ratio: 1183 / 634;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #d9d9d9;
}
.article__cover img { width: 100%; height: 100%; object-fit: cover; }

.article__body { margin-top: 31px; }

/* Типографика текстовой страницы */
.prose { font-size: 20px; color: var(--text); }
.prose h2 {
  margin-bottom: 17px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  color: var(--accent);
}
.prose h3 { margin: 40px 0 12px; font-size: 22px; color: var(--accent); }
.prose p + p { margin-top: 23px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 16px 0; padding-left: 1.2em; list-style: disc; }
.prose ol { list-style: decimal; }
.prose > * + .media-row,
.prose > * + .table-wrap,
.prose > * + .prose__wide { margin-top: 79px; }
.prose > .table-wrap + * { margin-top: 63px; }
.prose > .prose__wide + * { margin-top: 80px; }
.prose figure { margin: 0; }

.media-row { display: flex; align-items: flex-start; gap: 17px; }
.media-row--reverse { flex-direction: row-reverse; }
.media-row__img {
  flex: 0 0 375px;
  width: 375px;
  aspect-ratio: 375 / 306;
  object-fit: cover;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #d9d9d9;
}
.media-row__text { flex: 1; min-width: 0; }

.prose__wide img {
  width: 100%;
  aspect-ratio: 892 / 498;
  object-fit: cover;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #d9d9d9;
}

/* Таблица */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--table-border);
  border-radius: 4px;
  background: var(--table-bg);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  border-left: 1px solid var(--table-border);
  border-top: 1px solid var(--table-border);
  text-align: left;
  vertical-align: top;
}
.table-wrap tr > :first-child { border-left: 0; }
.table-wrap thead tr:first-child > *,
.table-wrap table > tbody:first-child tr:first-child > * { border-top: 0; }
.table-wrap thead { background: var(--table-head-bg); }
.table-wrap th { font-weight: 600; line-height: 1.3; color: var(--table-head-fg); }
.table-wrap td { color: var(--text); }

/* Фотогалерея */
.gallery { margin-top: 80px; }
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 31px 19.4px;
}
.gallery__grid a {
  display: block;
  aspect-ratio: 285 / 221;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 7px;
  background: #d9d9d9;
}
.gallery__grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery__grid a:hover img { transform: scale(1.04); }

@media (max-width: 1199px) {
  .header--solid .header__inner { height: 120px; }
}

@media (max-width: 1023px) {
  .article__head { padding-top: 14px; }
  .article__title { margin-top: 24px; font-size: 30px; }
  .article__cover { margin-top: 40px; }
}

@media (max-width: 767px) {
  .page--inner { padding-bottom: 96px; }
  .breadcrumbs { font-size: 14px; }
  .article__head { padding-top: 14px; }
  .article__title { max-width: 370px; margin-top: 22px; font-size: 24px; }
  .article__cover { margin-top: 33px; aspect-ratio: 375 / 391; }
  .article__cover .photo-dots { display: flex; }
  .article__body { margin-top: 36px; }

  .prose { font-size: 16px; }
  .prose h2 { font-size: 24px; }
  .prose p + p { margin-top: 18px; }
  .prose > * + .media-row,
  .prose > * + .table-wrap,
  .prose > * + .prose__wide { margin-top: 56px; }
  .prose > .table-wrap + *,
  .prose > .prose__wide + * { margin-top: 56px; }

  .media-row,
  .media-row--reverse { flex-direction: column; }
  .media-row__img { flex: none; width: 100%; }
  .table-wrap table { min-width: 640px; }

  .gallery { margin-top: 56px; }
  .gallery__grid { grid-template-columns: 1fr; gap: 33px; }
  .gallery__grid a { aspect-ratio: 370 / 263; border-radius: 12px; }
  .gallery__more { display: flex; margin: 64px auto 0; max-width: 360px; }
}

/* ==========================================================================
   Типовые страницы-списки: Расписание (Frame 27 / 46), Новости (Frame 24 / 53),
   Новость (Frame 25 / 52). Тёмные версии — Frame 62–68.
   ========================================================================== */

.page--listing { padding-bottom: 84px; }

.listing__title {
  margin-top: 52px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 56px;
  line-height: 1;
  color: var(--inner-fg);
  text-align: center;
  text-transform: uppercase;
}
.listing__more { margin-top: 45px; }

/* ---------- Расписание ---------- */
.week-nav { display: flex; justify-content: space-between; gap: 16px; }
.week-nav--top { margin-top: 101px; }
.week-nav--bottom { margin-top: 68px; }
.week-nav__link { width: 290px; padding: 10px 16px; }
.week-nav__link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.schedule-page__week {
  margin-top: 34px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.33;
  color: var(--accent);
  text-align: center;
}
.schedule-page__sub-week {
  margin-top: 48px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.33;
  color: var(--inner-fg);
  text-align: center;
}
.schedule__list--full { margin-top: 87px; }
.schedule-page__sub-week + .schedule__list--full { margin-top: 32px; }
.schedule__list--full .service__weekday { display: block; margin-top: 6px; }
.schedule__list--full .service__title { font-size: 16px; }
.schedule__list--full .service__feast { max-width: 681px; }
.schedule__list--full .service__times { margin-top: 18px; }
.schedule__list--full .service__times dt { font-size: 16px; }
.schedule__list--full .service__times dd { max-width: 448px; font-size: 16px; }

/* Праздничный (воскресный) день — красным */
.service--holiday .service__title,
.service--holiday .service__month,
.service--holiday .service__weekday { color: #ef1048; }
.service--holiday .service__day { color: #ed1c24; }

/* ---------- Список новостей ---------- */
.year-filter { margin-top: 45px; }
.year-filter__chips { display: flex; flex-wrap: wrap; gap: 12px 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 89px;
  height: 41px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-size: 16px;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.chip:hover { background: rgba(62, 64, 146, .08); }
.chip.is-active { border-color: var(--primary); background: var(--primary); color: #fff; }

.year-filter__select { position: relative; display: none; }
.year-filter__select select {
  width: 100%;
  height: 41px;
  padding: 0 40px 0 12px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 16px;
  appearance: none;
  cursor: pointer;
}
:root[data-theme="dark"] .year-filter__select select { border-color: #fff; color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .year-filter__select select { border-color: #fff; color: #fff; }
}
.year-filter__select select option { color: #222; }
.year-filter__select svg {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--accent);
  transform: translateY(-50%);
  pointer-events: none;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  margin-top: 64px;
}

/* ---------- Новость: лента фотографий и «Другие события» ---------- */
.gallery--strip { margin-top: 95px; }
.gallery--strip .gallery__grid {
  display: flex;
  gap: 33px;
  overflow-x: auto;
  padding: 0 var(--gutter) 12px;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.gallery--strip .gallery__grid li { flex: 0 0 min(484px, 80vw); scroll-snap-align: start; }
.gallery--strip .gallery__grid a { aspect-ratio: 484 / 376; border-radius: 12px; }

.news--related { padding-top: 90px; }

@media (max-width: 1023px) {
  .listing__title { margin-top: 40px; font-size: 44px; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .page--listing { padding-bottom: 64px; }
  .listing__title { margin-top: 53px; font-size: 24px; }
  .listing__more { margin-top: 50px; }

  .week-nav { gap: 12px; }
  .week-nav--top { margin-top: 43px; }
  .week-nav--bottom { margin-top: 40px; }
  .week-nav__link { width: 129px; min-height: 24px; padding: 0 5px; font-size: 12px; }
  .schedule-page__week { max-width: 343px; margin: 29px auto 0; font-size: 20px; }
  .schedule__list--full { margin-top: 60px; }
  .schedule__list--full .service__weekday { margin-top: 3px; }
  .schedule__list--full .service__times { margin-top: 18px; }
  .schedule__list--full .service__times dd { font-size: 14px; }

  .year-filter { margin-top: 54px; }
  .year-filter__chips { display: none; }
  .year-filter__select { display: block; }
  .news-grid { grid-template-columns: 1fr; gap: 40px; margin-top: 44px; }

  .gallery--strip { margin-top: 56px; }
  .gallery--strip .gallery__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 33px;
    overflow: visible;
    padding: 0 var(--gutter);
  }
  .gallery--strip .gallery__more { margin-top: 33px; }

  .news--related { padding-top: 64px; }
}

/* ==========================================================================
   Правила вывода изображений — Типовая текстовая (page.html)
   ========================================================================== */

/* Hero: до 1183px по ширине, высота — по пропорциям загруженного файла */
.article__cover--natural { aspect-ratio: auto; max-width: 1183px; }
.article__cover--natural img { height: auto; }

/* Фото слева/справа от текста: 375px по ширине, высота — по файлу, открывается в лайтбоксе */
.media-row__img {
  display: block;
  flex: 0 0 375px;
  width: 375px;
  aspect-ratio: auto;
  overflow: hidden;
}
.media-row__img img { width: 100%; height: auto; transition: transform .4s; }
.media-row__img:hover img { transform: scale(1.03); }

/* Большое фото: до 892px по ширине, высота — по файлу */
.prose__wide img { aspect-ratio: auto; height: auto; object-fit: initial; }

/* Галерея: превью строго 285×224, файл обрезается по центру; клик — лайтбокс */
.gallery:not(.gallery--strip) .gallery__grid {
  grid-template-columns: repeat(auto-fill, 285px);
  justify-content: space-between;
  column-gap: 0; /* 3 × 285 = 855 из 892 — остаток делится между колонками */
}
.gallery:not(.gallery--strip) .gallery__grid a { aspect-ratio: 285 / 224; }

a[data-lightbox] { cursor: zoom-in; }

/* ТС Новость: лента фото — превью строго 484×376, анонсы — строго 375×306 (обрезка по центру).
   Пропорции превью сохраняются и на мобильном, меняется только масштаб. */
.gallery--strip .gallery__grid a { aspect-ratio: 484 / 376; }
.news-card__media { aspect-ratio: 375 / 306; }

@media (max-width: 767px) {
  .media-row__img { width: 100%; max-width: 375px; }
  .gallery:not(.gallery--strip) .gallery__grid { grid-template-columns: 1fr; }
  .gallery:not(.gallery--strip) .gallery__grid a { aspect-ratio: 285 / 224; border-radius: 12px; }
}

/* ТС Новости: превью анонса строго 375×306; несколько фото новости листаются
   движением мыши по горизонтали (data-scrub), точки показывают текущее фото */
.news-card__media img { position: absolute; inset: 0; opacity: 0; transition: opacity .15s, transform .4s; }
.news-card__media img.is-active { opacity: 1; }
.news-card__media .photo-dots { z-index: 1; }
.news-card__media .photo-dots:empty { display: none; }

/* Главная и анонсы: на десктопе (от 1280px, где помещается контейнер 1192px)
   изображения строго в размерах макета; ниже — те же пропорции, но с масштабом */
@media (min-width: 1280px) {
  .news__track,
  .news-grid { grid-template-columns: repeat(3, 375px); justify-content: space-between; column-gap: 0; }
  .sacraments__grid { grid-template-columns: 270px 488px 270px; justify-content: space-between; column-gap: 0; }
  .about__media { grid-template-columns: 762px minmax(0, 1fr); }
  .videos { grid-template-columns: repeat(2, 583px); justify-content: space-between; column-gap: 0; }
}
