/* ============================================================
   Сайт Ардатовского благочиния — дизайн «Небесный»
   Белый фон, синие купола, золотисто-охристые акценты
   ============================================================ */

:root {
  --sky-950: #10233d;
  --sky-900: #16375f;
  --sky-800: #1e4e8f;
  --sky-700: #2b5fa8;
  --sky-600: #3d74bd;
  --sky-500: #4a83c4;
  --sky-300: #9dc0e6;
  --sky-100: #dcebf8;
  --sky-50:  #eef5fc;
  --gold-700: #9a7514;
  --gold-600: #b98a2f;
  --gold-500: #c9a227;
  --gold-400: #dcbb50;
  --gold-100: #f3e9cf;
  --ink: #232b36;
  --ink-soft: #55606e;
  --ink-faint: #8a93a0;
  --paper: #fdfcf8;
  --card: #ffffff;
  --line: #e3e7ee;
  --danger: #b3432c;
  --ok: #2f7a4d;
  --shadow: 0 1px 3px rgba(24, 39, 63, 0.08), 0 4px 14px rgba(24, 39, 63, 0.06);
  --radius: 10px;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Sans", "Segoe UI", system-ui, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  /* Фоновая статичная фотография: содержимое «ездит» поверх неё при прокрутке.
     Реализована через фиксированный слой body::before (см. ниже) — так надёжно
     и на iOS/Android, где background-attachment: fixed не работает. */
  background-color: var(--sky-50);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(238, 245, 252, 0.88), rgba(238, 245, 252, 0.88)), url("../img/background.jpg");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}
img { max-width: 100%; height: auto; }
a { color: var(--sky-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--sky-900); line-height: 1.3; margin: 0 0 0.5em; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }

/* ---------- Шапка ---------- */

.topbar {
  background: var(--sky-950);
  color: #cfe0f2;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.topbar .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 40px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px;
}
.topbar-chains { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-chains span { text-transform: uppercase; }
.topbar-sep { color: var(--gold-500); }
.topbar-contacts { display: flex; gap: 14px; flex-wrap: wrap; }
.topbar a { color: var(--gold-400); }

.site-header {
  position: relative;
  /* Фотография храма Ардатовского благочиния на закате.
     Кроп hero-band.jpg (1600×360) сделан из исходного снимка с крестами:
     крест на золотом куполе звонницы — в верхней трети полосы (y 62–142 из 360),
     крест на большом синем куполе — ниже (y 242–327). background-position
     center 18% смещает видимую часть к верху полосы, поэтому при cover-кропе
     на любом экране — от смартфона 390px до монитора 2560px — крест на куполе
     остаётся в кадре целиком. Тёмно-синие градиенты: слева — под заголовком,
     снизу — переход к меню; в центре градиент ослаблен, чтобы крест
     на куполе читался отчётливо. */
  background-image:
    linear-gradient(90deg, rgba(16, 35, 61, 0.74) 0%, rgba(16, 35, 61, 0.46) 40%, rgba(16, 35, 61, 0.10) 100%),
    linear-gradient(180deg, rgba(16, 35, 61, 0.18) 0%, rgba(16, 35, 61, 0.10) 45%, rgba(16, 35, 61, 0.58) 100%),
    url("../img/hero-band.jpg");
  background-size: cover;
  background-position: center 18%;
  color: #fff;
  overflow: hidden;
}
.cupolas {
  position: absolute; inset: auto 0 0 0; width: 100%; height: 56px;
  display: block; opacity: 0.55; pointer-events: none;
}
.header-inner {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 26px;
  padding: 34px 0 46px;
}
.header-cross {
  flex: none; width: 92px; height: 92px; color: var(--gold-400);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)) drop-shadow(0 0 18px rgba(220, 187, 80, 0.45));
}
.header-titles h1 { color: #fff; font-size: 2.1rem; margin: 0; letter-spacing: 0.01em; text-shadow: 0 2px 14px rgba(16, 35, 61, 0.85), 0 1px 3px rgba(16, 35, 61, 0.9); }
.header-titles .subtitle { color: #f2f7fc; font-size: 1.02rem; margin-top: 6px; text-shadow: 0 1px 10px rgba(16, 35, 61, 0.9); }
.header-titles .hier { color: var(--gold-400); font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 8px; text-shadow: 0 1px 8px rgba(16, 35, 61, 0.95); }

/* ---------- Навигация ---------- */

.mainnav { background: var(--sky-900); position: relative; z-index: 5; box-shadow: 0 3px 10px rgba(16, 35, 61, 0.25); }
.mainnav .container {
  display: flex; flex-wrap: nowrap; justify-content: center;
  align-items: stretch; gap: 0;
}
.mainnav a {
  color: #d9e7f6; padding: 9px 13px; font-size: 0.86rem;
  line-height: 1; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  border-bottom: 3px solid transparent; letter-spacing: 0.01em;
}
.mainnav a + a::before { content: none; }
.mainnav a:hover, .mainnav a.active {
  text-decoration: none;
  color: #fff;
  background: var(--sky-800);
  border-bottom-color: var(--gold-500);
}
.mainnav a.active { background: var(--sky-800); }
.subnav { background: var(--sky-50); border-bottom: 1px solid var(--line); }
.subnav .container { display: flex; flex-wrap: wrap; justify-content: center; }
.subnav a {
  color: var(--sky-800); font-size: 0.88rem; padding: 7px 10px;
  border-bottom: 2px solid transparent;
}
.subnav a:hover { border-bottom-color: var(--gold-500); text-decoration: none; }
.subnav a.active { color: var(--gold-700); border-bottom-color: var(--gold-500); }

.burger { display: none; }

/* ---------- Общие блоки ---------- */

.page {
  padding: 34px 0 60px;
  background: rgba(253, 252, 248, 0.92);
  border: 1px solid rgba(227, 231, 238, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 26px 0 30px;
  padding-left: 30px;
  padding-right: 30px;
}

/* ---------- Каркас: вертикальное меню + контент ---------- */
.body-grid {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 26px;
}
.content-col { min-width: 0; }

.sidemenu {
  background: linear-gradient(180deg, var(--sky-900), var(--sky-950));
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(157, 192, 230, 0.25);
}
.sidemenu .side-head {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-family: var(--serif); font-size: 1.02rem;
  padding: 14px 18px;
  background: rgba(201, 162, 39, 0.12);
  border-bottom: 1px solid rgba(201, 162, 39, 0.4);
  letter-spacing: 0.02em;
}
.side-nav { display: flex; flex-direction: column; padding: 8px 0; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  color: #cfe0f2; padding: 9px 18px; font-size: 0.92rem;
  border-left: 3px solid transparent;
  line-height: 1.3;
}
.side-nav a svg { flex: none; }
.side-nav a:hover {
  background: rgba(157, 192, 230, 0.12); color: #fff;
  border-left-color: var(--gold-500); text-decoration: none;
}
.sidemenu .side-foot { padding: 10px 18px 2px; opacity: .7; }
.side-search { padding: 12px 14px 16px; }
.side-search form { display: flex; gap: 8px; }
.side-search input { padding: 7px 10px; font-size: 0.86rem; }
.side-search input[type=search] { background: rgba(255,255,255,.94); }

.breadcrumb { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 10px; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb .sep { color: var(--gold-600); margin: 0 6px; }

.page-title-row {
  display: flex; align-items: center; gap: 14px;
  margin: 12px 0 22px;
}
.page-title-row h1 { margin: 0; }
.ornament { flex: 1; height: 22px; min-width: 60px; }

.lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 760px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
.news-card { display: flex; flex-direction: column; }
.news-card .cover { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--sky-100); }
.news-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.news-card:hover .cover img { transform: scale(1.04); }
.news-card .cover .date-chip {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(22, 55, 95, 0.88); color: #fff;
  font-size: 0.78rem; padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgba(201,162,39,.6);
}
.news-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card h3 { margin: 0; font-size: 1.06rem; }
.news-card h3 a { color: var(--sky-900); }
.news-card .excerpt { color: var(--ink-soft); font-size: 0.93rem; flex: 1; }
.news-card .meta { font-size: 0.8rem; color: var(--ink-faint); display: flex; gap: 12px; align-items: center; }

.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.dir-card { display: flex; flex-direction: column; }
.dir-card .cover { aspect-ratio: 4/3; overflow: hidden; background: linear-gradient(160deg, var(--sky-100), var(--sky-50)); display: grid; place-items: center; }
.dir-card .cover svg { width: 84px; height: 84px; color: var(--sky-500); }
.dir-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.dir-card .body { padding: 14px 16px; }
.dir-card h3 { font-size: 1rem; margin: 0 0 6px; }
.dir-card .excerpt { font-size: 0.88rem; color: var(--ink-soft); }

/* Статья */
.article { max-width: 820px; }
.article .cover-full { margin: 18px 0 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.article-meta { color: var(--ink-faint); font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.article-meta .gold { color: var(--gold-700); }
.article-body { font-size: 1.02rem; }
.article-body p { margin: 0 0 1em; }
.article-body img { border-radius: 8px; margin: 8px 0; }
.article-body blockquote {
  border-left: 3px solid var(--gold-500);
  margin: 1em 0; padding: 6px 18px;
  color: var(--ink-soft); background: var(--sky-50); border-radius: 0 8px 8px 0;
}
.article-photos { margin: 26px 0; }
.article-photos .ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.article-photos button { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; padding: 0; background: #fff; cursor: pointer; }
.article-photos button img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

/* Разделитель-орнамент */
.divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px 0; color: var(--gold-500); }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--gold-400)); }
.divider::after { background: linear-gradient(90deg, var(--gold-400), transparent); }

/* ---------- Фотогалерея ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.album-card { display: flex; flex-direction: column; height: 100%; }
.album-card .cover { aspect-ratio: 4/3; overflow: hidden; position: relative; background: var(--sky-100); }
.album-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.album-card:hover .cover img { transform: scale(1.05); }
/* Карточка альбома: заголовок по центру, с золотым орнаментом-разделителем
   и бейджем со счётчиком фото внизу (было: прижатый к левому краю текст). */
.album-card .body {
  padding: 20px 22px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; flex: 1;
}
.album-card .body h3 { margin: 0; text-align: center; font-family: var(--serif); }
.album-card .al-div {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  color: var(--gold-500); font-size: 0.62rem; line-height: 1;
}
.album-card .al-div::before, .album-card .al-div::after {
  content: ""; height: 1px; width: 36px;
}
.album-card .al-div::before { background: linear-gradient(90deg, transparent, var(--gold-400)); }
.album-card .al-div::after { background: linear-gradient(90deg, var(--gold-400), transparent); }
.album-card .excerpt { margin: 0; text-align: center; color: var(--ink-soft); font-size: 0.9rem; }
.album-card .al-count {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.8rem; color: var(--gold-700);
  background: var(--gold-100);
  border: 1px solid var(--gold-400);
  padding: 4px 14px; border-radius: 999px;
  margin-top: auto;
}
.album-card:hover .al-count { background: #f6efdb; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.photo-tile { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; background: #fff; padding: 0; }
.photo-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-tile .cap { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(16,35,61,.85)); color: #fff; font-size: .8rem; padding: 18px 10px 8px; }

/* Лайтбокс */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10, 20, 35, 0.93);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px;
}
.lightbox img { max-width: min(92vw, 1200px); max-height: 80vh; border-radius: 6px; box-shadow: 0 10px 50px rgba(0,0,0,.5); }
.lightbox .lb-cap { color: #d7e4f4; margin-top: 14px; font-size: .95rem; max-width: 720px; text-align: center; }
.lightbox .lb-close { position: absolute; top: 18px; right: 22px; color: #fff; font-size: 30px; background: none; border: none; cursor: pointer; }
.lightbox .lb-nav { color: #fff; font-size: 44px; background: none; border: none; cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .lb-prev { left: 24px; }
.lightbox .lb-next { right: 24px; }
.lightbox .lb-counter { color: #9dc0e6; margin-top: 8px; font-size: .85rem; }

/* ---------- Комментарии ---------- */
.comments { margin-top: 40px; }
.comment { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.comment .avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--sky-100); color: var(--sky-800);
  display: grid; place-items: center; font-weight: 700; font-family: var(--serif);
}
.comment .cmeta { font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 4px; }
.comment .cname { color: var(--sky-800); font-weight: 600; margin-right: 10px; font-size: 0.92rem; }
.comment .ctext { white-space: pre-wrap; }
.comment.hidden-c { opacity: .55; }

/* ---------- Формы ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field span.lbl { display: block; font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=search], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--sans); font-size: 0.98rem; color: var(--ink);
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--sky-300); border-color: var(--sky-500); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--sky-800); color: #fff;
  border: 1px solid var(--sky-900);
  padding: 10px 22px; border-radius: 8px;
  font-family: var(--sans); font-size: 0.96rem; cursor: pointer;
  transition: background .2s;
}
.btn:hover { background: var(--sky-700); text-decoration: none; }
.btn.gold { background: var(--gold-600); border-color: var(--gold-700); }
.btn.gold:hover { background: var(--gold-500); }
.btn.ghost { background: #fff; color: var(--sky-800); border: 1px solid var(--sky-300); }
.btn.ghost:hover { background: var(--sky-50); }
.btn.small { padding: 6px 14px; font-size: 0.86rem; }
.btn.danger { background: var(--danger); border-color: #8f351f; }
.btn:disabled { opacity: .55; cursor: default; }

.notice { padding: 10px 14px; border-radius: 8px; font-size: .92rem; margin: 10px 0; }
.notice.ok { background: #e7f4ec; color: var(--ok); border: 1px solid #bfe3cc; }
.notice.err { background: #fbeae5; color: var(--danger); border: 1px solid #eccdc3; }
.notice.info { background: var(--sky-50); color: var(--sky-800); border: 1px solid var(--sky-100); }

/* ---------- Пагинация ---------- */
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 30px; justify-content: center; }
.pagination a, .pagination span {
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--sky-800); font-size: 0.92rem;
}
.pagination .cur { background: var(--sky-800); color: #fff; border-color: var(--sky-900); }
.pagination a:hover { border-color: var(--sky-500); text-decoration: none; }

/* ---------- Поиск ---------- */
.header-search input[type=search] {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
}
.searchform { display: flex; gap: 10px; max-width: 560px; }
.search-results .hit { padding: 14px 0; border-bottom: 1px solid var(--line); }
.search-results .hit .src { font-size: 0.78rem; color: var(--gold-700); text-transform: uppercase; letter-spacing: .06em; }
.search-results .hit p { color: var(--ink-soft); margin: 4px 0; font-size: 0.92rem; }

/* ---------- Вопросы священнику ---------- */
.qa-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.qa-q { font-weight: 600; color: var(--sky-900); }
.qa-q .who { color: var(--gold-700); }
.qa-a { margin-top: 10px; padding: 12px 16px; background: var(--sky-50); border-left: 3px solid var(--gold-500); border-radius: 0 8px 8px 0; }

/* ---------- Таблицы ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th { text-align: left; background: var(--sky-50); color: var(--sky-900); font-family: var(--serif); }
.table th, .table td { padding: 10px 12px; border: 1px solid var(--line); font-size: 0.92rem; vertical-align: top; }
.table tr:hover td { background: #fafcf5; }

/* ---------- Футер ---------- */

.site-footer {
  margin-top: 40px;
  background:
    radial-gradient(1200px 300px at 85% -40%, rgba(201,162,39,.14), transparent),
    linear-gradient(180deg, var(--sky-900), var(--sky-950));
  color: #c9d8e9;
  position: relative;
  overflow: hidden;
}
.site-footer .f-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 30px; padding: 40px 0 18px; }
.site-footer h4 { color: #fff; font-size: 1.02rem; margin-bottom: 12px; }
.site-footer a { color: #9dc0e6; }
.site-footer a:hover { color: var(--gold-400); }
.f-about { font-size: 0.9rem; line-height: 1.6; }
.f-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.f-list li { margin-bottom: 7px; }
.footer-bottom {
  border-top: 1px solid rgba(157,192,230,.25);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  padding: 16px 0 22px; font-size: 0.84rem; position: relative; z-index: 2;
}

/* Счётчик посещаемости */
.counter-box {
  display: inline-flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,162,39,.45);
  padding: 8px 16px; border-radius: 10px;
}
.counter-box .cb-label { font-size: 0.82rem; color: var(--sky-300); }
.counter-digits { display: inline-flex; gap: 3px; }
.counter-digits .dg {
  background: linear-gradient(180deg, #24354c, #0d1a2c);
  color: var(--gold-400);
  font-family: var(--serif);
  min-width: 22px; text-align: center; padding: 4px 2px;
  border-radius: 4px; border: 1px solid rgba(201,162,39,.4);
  font-size: 1rem;
}
.counter-extra { font-size: 0.8rem; color: var(--sky-300); }

/* ---------- Админ-панель ---------- */

.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 130px); }
.admin-side { background: var(--sky-950); padding: 24px 0; }
.admin-side .who { padding: 0 18px 18px; color: #cfe0f2; border-bottom: 1px solid rgba(157,192,230,.2); }
.admin-side .who .nm { color: #fff; font-family: var(--serif); font-size: 1.05rem; }
.admin-side .who .rl { font-size: 0.78rem; color: var(--gold-400); text-transform: uppercase; letter-spacing: .1em; }
.admin-menu { margin-top: 14px; display: flex; flex-direction: column; }
.admin-menu a {
  color: #cfe0f2; padding: 10px 18px; font-size: 0.94rem;
  border-left: 3px solid transparent;
}
.admin-menu a:hover { background: rgba(157,192,230,.08); text-decoration: none; }
.admin-menu a.active { background: rgba(74,131,196,.25); border-left-color: var(--gold-500); color: #fff; }
.admin-main { padding: 26px 30px; background: var(--paper); }
.admin-main h1 { margin-bottom: 20px; }
.admin-hint { font-size: .84rem; color: var(--ink-faint); }
.admin-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .num { font-family: var(--serif); font-size: 1.6rem; color: var(--sky-800); }
.stat-card .cap { font-size: 0.82rem; color: var(--ink-faint); }
.stat-card .sub { font-size: 0.78rem; color: var(--gold-700); margin-top: 2px; }

.editor-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.editor-side .card { padding: 16px; }
.cover-preview { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--sky-50); }

.chart { width: 100%; }
.chart .bar { fill: var(--sky-500); }
.chart .bar.today { fill: var(--gold-500); }
.chart text { font-size: 10px; fill: var(--ink-faint); font-family: var(--sans); }
.chart .axis { stroke: var(--line); }

/* ---------- Главная ---------- */
.hero { position: relative; margin-top: 0; padding: 0 0 6px; }
.hero .container { position: relative; z-index: 2; }
.hero-greet { font-family: var(--serif); font-size: 1.5rem; color: var(--sky-800); }
.hero-text { max-width: 720px; color: var(--ink-soft); }

/* ---------- Эффект «слайдера поверх статичного фона» ----------
   Блоки .reveal плавно въезжают снизу; фоновая фотография страницы
   остаётся неподвижной (фиксированный слой body::before). */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .3, 1);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Приветствие на главной (текст прежнего сайта) ---------- */
.home-greet {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding: 30px 34px;
  background:
    linear-gradient(160deg, rgba(253, 252, 248, .96), rgba(238, 245, 252, .93)),
    var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold-500);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 6px 0 26px;
}
.home-greet .hg-photo {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--sky-100);
  align-self: start;
}
/* Фотография целиком, без обрезки — портрет благочинного показываем полностью */
.home-greet .hg-photo img { width: 100%; height: auto; display: block; }
.home-greet .hg-photo svg { width: 110px; height: 110px; color: var(--sky-300); }
.home-greet .hg-kicker {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--sky-800);
  line-height: 1.35;
}
.home-greet .ornament { display: block; margin: 8px 0 14px; }
.home-greet .hg-body { font-size: 0.99rem; color: var(--ink-soft); }

/* ---------- Лента приходских новостей на главной (как news_i прежнего сайта) ---------- */
.home-news-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.home-news-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  transition: background .18s;
}
.home-news-list li:last-child { border-bottom: none; }
.home-news-list li:hover { background: var(--sky-50); }
.home-news-list .hnl-link {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  color: var(--ink);
  line-height: 1.45;
}
.home-news-list .hnl-link:hover { text-decoration: none; color: var(--sky-800); }
.home-news-list .hnl-link img {
  flex: none;
  width: 84px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.home-news-list .hnl-title { min-width: 0; }
.home-news-list .hnl-date {
  flex: none;
  font-size: 0.8rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- Блоки разделов на главной ---------- */
.home-block { margin: 30px 0 6px; }
.home-block-card { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: stretch; }
.home-block-card .cover {
  overflow: hidden;
  background: linear-gradient(160deg, var(--sky-100), var(--sky-50));
  display: grid;
  place-items: center;
}
.home-block-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.home-block-card:hover .cover img { transform: scale(1.04); }
.home-block-card .body { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.home-block-card .body h3 { margin: 0; font-size: 1.15rem; }
.home-block-card .body .excerpt { color: var(--ink-soft); font-size: 0.94rem; flex: 1; }
.home-block-card .body .meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 0.84rem;
  color: var(--ink-faint);
}
.home-block-card .body .meta .more {
  color: var(--gold-700);
  font-weight: 600;
  margin-left: auto;
}
.home-block-card:hover { text-decoration: none; }
.home-block-card h3 { color: var(--sky-900); }

/* ---------- Слайдер на главной ---------- */
.slider {
  position: relative; height: 430px; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: var(--sky-950);
}
.slider .slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.1s ease-in-out;
}
.slider .slide.on { opacity: 1; }
.slider .slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,35,61,0) 30%, rgba(16,35,61,0.72) 100%);
}
.slide-cap {
  position: absolute; left: 34px; bottom: 58px; z-index: 2; max-width: 640px;
  display: flex; flex-direction: column; gap: 4px;
}
.slide-cap-kicker {
  color: var(--gold-400); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.74rem;
}
.slide-cap-title {
  color: #fff; font-family: var(--serif); font-size: 1.5rem;
  text-shadow: 0 2px 14px rgba(0,0,0,.55); line-height: 1.3;
}
.snav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(16,35,61,.55); color: #fff; border: 1px solid rgba(220,187,80,.5);
  font-size: 30px; line-height: 1; cursor: pointer;
}
.snav:hover { background: rgba(16,35,61,.8); }
.s-prev { left: 14px; }
.s-next { right: 14px; }
.dots {
  position: absolute; bottom: 16px; right: 20px; z-index: 3;
  display: flex; gap: 8px;
}
.dots .dot {
  width: 11px; height: 11px; border-radius: 50%; padding: 0;
  background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.7);
  cursor: pointer;
}
.dots .dot.on { background: var(--gold-500); border-color: var(--gold-400); box-shadow: 0 0 8px rgba(201,162,39,.8); }

.greet-band {
  margin: 22px 0 4px; padding: 26px 30px;
  background: rgba(253, 252, 248, 0.94);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.greet-band .hero-greet { text-align: center; }
.greet-band .hero-text { margin: 10px auto 0; text-align: center; }
.greet-band .ornament { display: block; margin: 6px auto 10px; }

.tiles-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 26px 0 8px; align-items: start; }
.tiles-row .card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.tiles-row h3 { font-size: 1.08rem; margin: 0; }
.tiles-row .btn { margin-top: 4px; align-self: flex-start; }
.tiles-row .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0; }

.home-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; align-items: start; padding: 20px 0 10px; }
.home-side .card { padding: 18px; margin-bottom: 22px; }
.home-side h3 { font-size: 1.05rem; }
.home-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.home-photos button { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: #fff; }
.home-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }

.anons-band { background: var(--gold-100); border: 1px solid var(--gold-400); border-radius: var(--radius); padding: 18px 22px; display: flex; gap: 18px; align-items: flex-start; }
.anons-band .ic { flex: none; width: 44px; height: 44px; color: var(--gold-600); }
.anons-band h3 a { color: var(--gold-700); }
.anons-band .d { color: var(--ink-soft); font-size: 0.92rem; margin-top: 6px; }

/* ---------- Мелочи ---------- */
.tag {
  display: inline-block; font-size: 0.76rem; padding: 2px 10px;
  border-radius: 999px; background: var(--sky-50); color: var(--sky-800);
  border: 1px solid var(--sky-100);
}
.tag.gold { background: var(--gold-100); color: var(--gold-700); border-color: var(--gold-400); }
.tag.red { background: #fbeae5; color: var(--danger); border-color: #eccdc3; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-faint); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.mt0 { margin-top: 0; }
.muted { color: var(--ink-faint); }
.small { font-size: 0.86rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1200px) {
  /* заголовок компактнее, чтобы не задевать крест на куполе справа */
  .header-titles h1 { font-size: 1.7rem; }
}
@media (max-width: 900px) {
  .header-inner { padding: 28px 0 40px; gap: 16px; }
  .header-titles h1 { font-size: 1.4rem; }
  .header-cross { width: 60px; height: 60px; }
  .cupolas { display: none; }
  .body-grid { grid-template-columns: 1fr; margin-top: 12px; }
  .sidemenu { display: none; }
  .page { padding: 22px 16px 40px; margin: 16px 0 24px; }
  .home-greet { grid-template-columns: 1fr; padding: 20px 18px; }
  .home-greet .hg-photo { max-width: 340px; margin: 0 auto; }
  .home-block-card { grid-template-columns: 1fr; }
  .home-block-card .cover { aspect-ratio: 16/9; }
  .home-cols { grid-template-columns: 1fr; }
  .tiles-row { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { padding: 10px 0; }
  .admin-menu { flex-direction: row; flex-wrap: wrap; }
  .admin-menu a { border-left: none; border-bottom: 3px solid transparent; }
  .admin-menu a.active { border-bottom-color: var(--gold-500); }
  .site-footer .f-inner { grid-template-columns: 1fr; gap: 18px; }
  .topbar { display: none; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .mainnav a { padding: 8px 8px; font-size: 0.78rem; }
}
@media (max-width: 760px) {
  .mainnav .container { display: none; }
  .subnav .container { display: none; }
  /* На смартфоне шапка выше: сверху «фотозона» с куполом и крестом,
     текст — в нижней части, крест не перекрывается заголовком. */
  .site-header .header-inner {
    min-height: 236px;
    align-items: flex-end;
    padding: 0 0 16px;
  }
  .header-titles h1 { font-size: 1.15rem; line-height: 1.25; }
  .header-titles .subtitle { font-size: 0.9rem; margin-top: 4px; }
  .header-titles .hier { font-size: 0.72rem; margin-top: 5px; }
  .burger {
    display: block; width: 100%;
    background: var(--sky-900); color: #fff; border: none;
    padding: 12px 20px; font-size: 1rem; text-align: left; cursor: pointer;
    font-family: var(--sans);
  }
  .m-menu { background: var(--sky-950); padding: 6px 0 10px; }
  .m-menu a { display: block; color: #cfe0f2; padding: 8px 20px; }
  .mainnav.expanded { position: relative; }
  .mainnav .m-list { padding-bottom: 8px; }
  .header-search { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  h1 { font-size: 1.5rem; }
  .news-grid, .dir-grid, .album-grid, .photo-grid { grid-template-columns: 1fr; }
  .home-photos { grid-template-columns: repeat(2, 1fr); }
  .searchform { flex-direction: column; }
}

/* ---------- Православный календарь (месяцеслов) ---------- */
.cal { margin-top: 8px; }
.cal-head {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-bottom: 14px; flex-wrap: wrap;
}
.cal-title {
  font-family: var(--serif); font-size: 1.3rem; color: var(--sky-900);
  min-width: 190px; text-align: center; font-weight: 700;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.cal-wd {
  background: var(--sky-50); color: var(--sky-800);
  font-family: var(--serif); font-weight: 700; font-size: 0.82rem;
  text-align: center; padding: 8px 4px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cal-wd:last-child { color: var(--danger); }
.cal-cell {
  position: relative; min-height: 58px; padding: 6px 4px 4px;
  background: #fff; border-right: 1px solid rgba(227, 231, 238, 0.7);
  border-bottom: 1px solid rgba(227, 231, 238, 0.7);
  display: flex; flex-direction: column; align-items: center; justify-content: start;
  cursor: pointer; text-align: center; font: inherit; color: inherit;
  transition: background 0.15s;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--sky-50); }
.cal-cell.empty { background: #fafbfc; cursor: default; border-right-color: rgba(227,231,238,.4); }
.cal-n { font-size: 1.06rem; line-height: 1.25; font-weight: 600; }
.cal-o { font-size: 0.72rem; color: var(--ink-faint); line-height: 1.2; }
.cal-cell.red .cal-n { color: var(--danger); }
.cal-cell.great .cal-n { color: var(--danger); }
.cal-cell.great::after {
  content: "†"; position: absolute; top: 5px; right: 7px;
  font-size: 0.7rem; color: var(--gold-500);
}
.cal-fast {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-500); margin-top: 4px; flex: none;
}
.cal-cell.today { outline: 2px solid var(--gold-500); outline-offset: -2px; background: var(--gold-100); }
.cal-cell.on { background: var(--sky-100); outline: 2px solid var(--sky-700); outline-offset: -2px; }
.cal-cell.today.on { outline-color: var(--gold-600); }

.cal-day {
  margin-top: 18px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px;
}
.cal-day-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.cal-fast-line { margin: 0 0 12px; font-size: 0.95rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cal-saints ul, .cal-events ul { margin: 0; padding-left: 18px; }
.cal-saints li { margin-bottom: 5px; font-size: 0.97rem; }
.cal-saints li.lead-saint { font-weight: 700; }
.cal-src { margin-top: 14px; text-align: center; }
@media (max-width: 760px) {
  .cal-cell { min-height: 46px; padding: 4px 2px; }
  .cal-n { font-size: 0.92rem; }
  .cal-o { font-size: 0.64rem; }
  .cal-title { min-width: 130px; font-size: 1.05rem; }
}

/* ---------- Правки PHP-версии ---------- */
a.cal-cell { text-decoration: none; }
a.cal-cell:hover { color: inherit; }
.cal-cell:hover { background: var(--sky-50); }
.side-nav a.on { background: rgba(157,192,230,.12); color: #fff; border-left-color: var(--gold-500); }
.photo-tile { -webkit-appearance: none; }
a.photo-tile, a.dir-card, a.album-card, a.home-block-card { text-decoration: none; color: inherit; }
a.news-card { text-decoration: none; }
.card h3 a { text-decoration: none; }
