/* Патриаршее подворье д. Исаково — стили сайта */

@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/pt-sans-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/pt-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/pt-sans-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/pt-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Old Standard TT"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/old-standard-tt-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Old Standard TT"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/old-standard-tt-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Old Standard TT"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/old-standard-tt-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Old Standard TT"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/old-standard-tt-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --band-top: #c4cdce;
  --band-bottom: #b8bfc0;
  --foot-top: #c0cacb;
  --foot-bottom: #d2dcdd;
  --paper: #f8f8f9;
  --panel: #eaedf0;
  --line: #d3dade;
  --ink: #325c4d;
  --ink-soft: #55615f;
  --link: #656614;
  --accent: #006195;
  --accent-deep: #004376;
  --frame: #e6ddce;
  --sky: #2792c5;
  --serif: "Old Standard TT", "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Sans", "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); }
body.lb-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--ink); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(28px, 4.2vw, 40px); }
h2 { font-size: clamp(24px, 3vw, 30px); }
h3 { font-size: 21px; line-height: 1.25; }
.wrap { max-width: 1128px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; }
.skip:focus { top: 12px; color: #fff; }

/* Шапка */
.head-band { background: linear-gradient(var(--band-top), var(--band-bottom)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 14px; padding-bottom: 12px; }
.head-side { display: flex; flex: none; align-items: center; gap: 12px; }
.phone { font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.menu-toggle { display: none; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid rgba(50, 92, 77, .35); border-radius: 8px; background: rgba(255, 255, 255, .5); color: var(--ink); font: 700 16px/1 var(--sans); cursor: pointer; }
.menu-toggle i { display: block; width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
.nav { flex: 1 1 auto; min-width: 0; }
.nav ul { list-style: none; margin: 0 0 0 -8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 2px; }
.nav a { display: block; padding: 6px 8px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 16px; }
.nav a:hover { background: rgba(255, 255, 255, .5); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; box-shadow: inset 0 -2px 0 var(--accent-deep); }
.nav .nav-phone { display: none; }

.banner-band { padding-top: 6px; background: linear-gradient(to bottom, var(--band-bottom) 0, var(--band-bottom) 52%, var(--paper) 52%); }
.arch { margin: 0 auto; max-width: 981px; padding: 8px; background: var(--frame); border-radius: 50% 50% 12px 12px / 72px 72px 12px 12px; box-shadow: 0 22px 34px -26px rgba(50, 92, 77, .6); }
.arch img { width: 100%; border-radius: 50% 50% 5px 5px / 64px 64px 5px 5px; }

/* Общие элементы */
.framed { background: var(--frame); padding: 6px; border-radius: 10px; }
.btn { display: inline-block; align-self: flex-start; padding: 10px 18px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.btn:hover { background: var(--accent-deep); color: #fff; }
.empty { color: var(--ink-soft); }
.back { display: inline-block; margin-top: 32px; }
.page { padding-top: 36px; padding-bottom: 72px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; font-size: 15px; color: var(--ink-soft); }
.crumbs .sep { color: #9aa6a3; }
.meta { margin: 8px 0 28px; font-size: 16px; color: var(--ink-soft); }
.page > h1 + .intro-text, .page > h1 + .cards, .page > h1 + .entries, .page > h1 + .gallery, .page > h1 + .icons-grid, .page > h1 + .prose { margin-top: 24px; }
.intro-text { max-width: 760px; margin-bottom: 28px; }

/* Тексты: и старый HTML, и новый простой текст */
.prose { overflow-wrap: break-word; }
.prose p { margin: 0 0 14px; }
.prose img { height: auto !important; max-width: 100% !important; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose td, .prose th { padding: 4px 8px; vertical-align: top; }
.prose h2, .prose h3, .prose h4 { margin: 24px 0 10px; }
.prose h2 { font-size: 24px; line-height: 1.25; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose::after { content: ""; display: block; clear: both; }
/* Картинки, вставленные в текст редактором: отдельной строкой по центру, размер — доля колонки */
.prose img.img-third, .prose img.img-half, .prose img.img-full { display: block; margin: 16px auto; border-radius: 6px; }
.prose img.img-third { width: 33.333%; }
.prose img.img-half { width: 50%; }
.prose img.img-full { width: 100%; }
.prose-zoom { cursor: zoom-in; }

/* Главная */
.intro { display: flex; gap: 28px; align-items: center; margin-top: 40px; }
.portrait, .intro picture { flex: none; }
.portrait { width: 138px; }
.lead { margin: 10px 0 0; font-size: 19px; color: var(--ink-soft); }

.tasks { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; margin: 32px 0 56px; }
.task { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.task h2 { font-size: 23px; }
.task p { margin: 0; }
.task-text p + p { margin-top: 8px; }
.task-text h2 { margin: 12px 0 4px; font-size: 19px; }
.task-text h2:first-child { margin-top: 0; }
.tasks-two { grid-template-columns: 1fr 1fr; }
.task .task-link { margin-top: auto; padding-top: 6px; font-weight: 700; }
.task-main { background: var(--accent); border-color: var(--accent-deep); color: #fff; }
.task-main h2 { color: #fff; }
.task-period { font: 700 27px/1.2 var(--serif); }
.task-meta { font-size: 15px; color: rgba(255, 255, 255, .82); }
.task-main .btn { margin-top: auto; background: #fff; color: var(--accent); }
.task-main .btn:hover { background: var(--frame); color: var(--accent-deep); }

.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: start; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 10px; margin-bottom: 20px; border-bottom: 2px solid var(--frame); }
.block-head a { white-space: nowrap; font-size: 16px; }
.block-note { margin: -8px 0 16px; color: var(--ink-soft); }

.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.news-item { display: grid; gap: 2px; }
.news-item.has-img { grid-template-columns: 172px 1fr; gap: 20px; align-items: start; }
.news-item.has-img > picture img, .entry-img img { width: 100%; }
.news-item time, .entry time { font-size: 15px; color: var(--ink-soft); }
.news-item h3 a, .entry-title a { color: var(--ink); text-decoration: none; }
.news-item h3 a:hover, .entry-title a:hover { color: var(--accent); text-decoration: underline; }
.news-item p, .entry p { margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.museum-groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.museum-groups a { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 6px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.museum-groups a:hover { background: var(--panel); color: var(--ink); }
.museum-groups picture { width: 56px; }
.museum-groups img, .g-empty { width: 56px; height: 76px; object-fit: cover; padding: 4px; background: var(--frame); border-radius: 5px; }
.g-name { font: 400 18px/1.3 var(--serif); }
.g-count { font-size: 14px; color: var(--ink-soft); white-space: nowrap; }

.albums { margin: 64px 0 72px; }
.albums-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: start; }
.album-feature { display: grid; gap: 8px; color: var(--ink); text-decoration: none; }
.album-feature:hover { color: var(--accent); }
.mosaic { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: repeat(2, 132px); gap: 6px; padding: 6px; background: var(--frame); border-radius: 12px; }
.mosaic > * { width: 100%; height: 100%; }
.mosaic > *:first-child { grid-row: span 2; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.mosaic-1 { grid-template-columns: 1fr; grid-template-rows: 270px; }
.mosaic-1 img:first-child { grid-row: auto; }
.mosaic-2, .mosaic-3 { grid-template-columns: 2fr 1fr; }
.album-title { margin-top: 6px; font: 700 22px/1.2 var(--serif); }
.album-count, .album-list span { font-size: 15px; color: var(--ink-soft); white-space: nowrap; }
.album-list { list-style: none; margin: 0; padding: 0; }
.album-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.album-list li:first-child { padding-top: 0; }
.album-list a { font: 400 18px/1.3 var(--serif); color: var(--ink); text-decoration: none; }
.album-list a:hover { color: var(--accent); text-decoration: underline; }

/* Списки материалов */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; max-width: 860px; }
.entry { display: grid; gap: 2px; }
.entry.has-img { grid-template-columns: 172px 1fr; gap: 22px; align-items: start; }
.entry-img { display: block; }
.entry-title { font-size: 22px; line-height: 1.25; }
.entry .entry-sub { display: block; overflow: visible; margin: 4px 0 0; color: var(--ink-soft); font: 400 18px/1.35 var(--serif); }

/* Карточки групп и альбомов */
.cards { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 28px 20px; }
.cards-wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cards-portrait { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cards a { display: grid; gap: 8px; align-content: start; color: var(--ink); text-decoration: none; }
.cards a:hover { color: var(--accent); }
.cards a:hover .card-title { text-decoration: underline; }
.card-img { position: relative; display: block; padding: 6px; background: var(--frame); border-radius: 10px; }
.card-img::before { content: ""; display: block; }
.cards-wide .card-img::before { padding-top: 75%; }
.cards-portrait .card-img::before { padding-top: 133%; }
.card-img img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: cover; border-radius: 4px; }
.cards-portrait .card-img img { object-fit: contain; }
.card-title { font: 700 19px/1.25 var(--serif); }
.card-meta { font-size: 15px; color: var(--ink-soft); }

/* Материал */
.article { max-width: 760px; }
.article-body { font-size: 18px; line-height: 1.7; }
/* Картинка материала — в размере своего файла, без растягивания; на экранах двойной плотности
   браузер берёт удвоенный файл, поэтому она чёткая. Рамка (.framed) добавляется снаружи */
.article-img { float: left; max-width: 100%; margin: 6px 26px 14px 0; cursor: zoom-in; }
.article-img img { box-sizing: content-box; max-width: calc(100% - 12px) !important; }
.article-img img:not([width]) { max-width: min(280px, calc(100% - 12px)) !important; }
.article > h1 + .article-body, .article > .subtitle + .article-body { margin-top: 24px; }
.subtitle { margin: 8px 0 0; font: 400 20px/1.35 var(--serif); color: var(--ink-soft); }
.subtitle + .meta { margin-top: 4px; }
.article-album { margin: 8px 0 0; }

/* Фото */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gallery-item { display: block; padding: 5px; border-radius: 8px; background: var(--frame); cursor: zoom-in; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }

/* Иконы музея */
.icons-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 30px 22px; }
.icons-grid a { display: grid; gap: 12px; color: var(--ink); text-align: center; text-decoration: none; }
.icons-grid a:hover { color: var(--accent); }
.icons-grid a:hover .icon-name { text-decoration: underline; }
.icon-frame { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--frame); border-radius: 6px; }
.icon-frame img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.icon-name { font: 400 17px/1.35 var(--serif); }
.icon-sub { margin-top: -8px; font-size: 15px; color: var(--ink-soft); }
.icon-frame + .icon-sub { margin-top: 0; }
/* Служащие плиткой той же ширины и в той же рамке, что разделы музея (cards-portrait),
   но рамка ниже (5:6 вместо 3:4) и фото заполняет её целиком: лишнее срезается по краям,
   поэтому все снимки получаются одной высоты. Файлы фото при этом не меняются */
.people-cards { margin-bottom: 0; }
.people-cards .card-img::before { padding-top: 120%; }
.people-cards .card-img img { object-fit: cover; }

/* Листалка */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 40px; }
.pager a, .pager span { min-width: 40px; padding: 7px 12px; border-radius: 8px; text-align: center; }
.pager a { border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager-current { background: var(--accent); color: #fff; font-weight: 700; }
.pager-gap { color: var(--ink-soft); }

/* Расписание */
.schedule { margin-top: 32px; padding-top: 28px; border-top: 2px solid var(--frame); }
.page > h1 + .schedule, .page > .intro-text + .schedule { margin-top: 24px; padding-top: 0; border-top: 0; }
/* Листы, название, дата и кнопка — по центру колонки; заголовок страницы и крошки остаются слева */
.schedule { text-align: center; }
.schedule h2 { font-size: 26px; }
.sheet { display: grid; gap: 12px; max-width: 900px; margin: 0 auto; }
.sheet img { width: 100%; background: #fff; border: 8px solid var(--frame); border-radius: 10px; }
.schedule-actions { margin: 16px 0 0; }

/* Контакты */
.map { position: relative; max-width: 900px; margin-top: 32px; padding: 6px; background: var(--frame); border-radius: 12px; }
.map iframe { display: block; width: 100%; height: 420px; border: 0; border-radius: 6px; }

.notfound p { max-width: 560px; }
.notfound-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }

/* Подвал */
.site-foot { padding: 40px 0 28px; background: linear-gradient(var(--foot-top), var(--foot-bottom)); border-top: 3px solid var(--sky); font-size: 16px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.foot-grid p { margin: 0 0 6px; }
.foot-name { font: 700 21px/1.2 var(--serif); }
.site-foot a { color: var(--ink); }
.site-foot ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.site-foot li { margin-bottom: 6px; }
.foot-copy { margin-top: 26px; padding-top: 14px; border-top: 1px solid rgba(50, 92, 77, .25); font-size: 14px; color: var(--ink-soft); }

/* Просмотр фото */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 16px; background: rgba(20, 34, 30, .92); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 10px; }
.lightbox img { max-width: 94vw; max-height: 82vh; width: auto; border: 6px solid var(--frame); border-radius: 6px; background: var(--frame); }
.lb-count { color: #dfe6e4; font-size: 15px; }
.lightbox button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .28); }
.lb-close { position: absolute; top: 12px; right: 14px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { visibility: hidden; }

@media (max-width: 960px) {
  .head-row { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .head-side { order: 1; margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .nav { display: none; order: 2; flex-basis: 100%; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 2px; margin: 0; padding: 4px 0 6px; }
  .nav a { padding: 10px 12px; font-size: 18px; }
  .tasks { grid-template-columns: 1fr 1fr; }
  .task-main { grid-column: 1 / -1; }
  .split, .albums-grid { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 16px; }
  .head-row { padding-top: 10px; padding-bottom: 10px; }
  .head-side .phone { display: none; }
  .nav .nav-phone { display: block; }
  .nav .nav-phone a { font-weight: 700; }
  .arch { padding: 5px; border-radius: 50% 50% 8px 8px / 34px 34px 8px 8px; }
  .arch img { border-radius: 50% 50% 4px 4px / 29px 29px 4px 4px; }
  .intro { gap: 16px; align-items: flex-start; margin-top: 28px; }
  .portrait { width: 78px; padding: 4px; }
  .intro h1 { font-size: 25px; }
  .lead { font-size: 17px; }
  .tasks { grid-template-columns: 1fr; margin-bottom: 44px; }
  .news-item.has-img, .entry.has-img { grid-template-columns: 1fr; }
  .news-item.has-img > picture, .news-item.has-img img, .entry-img { max-width: 220px; }
  .mosaic { grid-template-rows: repeat(2, 88px); }
  .mosaic-1 { grid-template-rows: 180px; }
  .article-img { float: none; display: block; width: -moz-fit-content; width: fit-content; max-width: 100%; margin: 0 auto 16px; }
  .prose img.img-third { width: 50%; }
  .prose img.img-half { width: 100%; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .icons-grid, .cards-portrait { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .cards-wide { grid-template-columns: 1fr; }
  .icon-name { font-size: 15.5px; }
  .map iframe { height: 320px; }
  .foot-grid { grid-template-columns: 1fr; gap: 18px; }
  .lightbox { grid-template-columns: 1fr; padding: 60px 8px 84px; }
  .lb-prev, .lb-next { position: absolute; bottom: 20px; }
  .lb-prev { left: 22px; }
  .lb-next { right: 22px; }
}

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