/* УмноПолис — внутренние страницы (13.10). Тот же язык, что у главной «Каталог направлений»: мятная подложка, белые карточки
   с тонкой рамкой, скругление --r, navy-кнопки, карамельные цены. Подключается после style.css и sv.css (tools/build_umn.py). */
.pg { background: var(--mint-50); }
.pg .section { padding-block: clamp(40px, 5.5vw, 76px); }
.pg .section + .section { padding-top: 0; }
.pg .pg-hero + .section { padding-top: clamp(8px, 1.5vw, 20px); }  /* под первым экраном не было зазора в пол-окна */
.pg-filter .brsw { justify-self: start; margin-top: 0; }

/* крошки */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0 0 14px; padding: 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--mint-200); }
.crumbs a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--mint-200); text-underline-offset: 3px; }
.crumbs a:hover { text-decoration-color: var(--navy); }

/* первый экран раздела: слева текст, справа фото — без пустой половины */
.pg-hero { padding: clamp(18px, 2.4vw, 32px) 0 clamp(36px, 4.5vw, 60px); }
.pg-hero__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--gap); align-items: stretch; }
.pg-hero__grid--one { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.pg-hero__b { background: #fff; border: 1px solid var(--mint-200); border-radius: var(--r); padding: clamp(24px, 2.6vw, 40px); display: flex; flex-direction: column; justify-content: center; }
.pg-tag { font-size: 14px; font-weight: 700; color: var(--caramel-ink); text-transform: none; margin: 0 0 10px; }
.pg-hero h1 { font-size: clamp(30px, 3.2vw, 48px); line-height: 1.06; margin: 0; }
.pg-lead { font-size: 17.5px; line-height: 1.5; color: var(--ink-2); margin: 16px 0 0; max-width: 56ch; }
.pg-facts { margin-top: 22px; }
.pg-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pg-hero__img { border-radius: var(--r); overflow: hidden; min-height: 280px; background: var(--mint-100); }
.pg-hero__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* шапка раздела и карточки */
.pg-sec .head { margin-bottom: clamp(20px, 2.6vw, 32px); }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.pgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 2vw, 28px); display: flex; flex-direction: column; gap: 10px; }
.pcard h3 { font-size: 19px; line-height: 1.25; margin: 0; }
.pcard p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.pcard__ic { width: 44px; height: 44px; border-radius: 14px; background: var(--mint-100); display: grid; place-items: center; }
.pcard__ic .ic { width: 22px; height: 22px; fill: var(--navy); }
.pg-k { display: block; font-size: 13px; font-weight: 700; color: var(--caramel-ink); }
.pg-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }

/* каталог */
.pg-filter { background: #fff; border: 1px solid var(--mint-200); border-radius: var(--r); padding: clamp(18px, 2vw, 26px); display: grid; gap: 14px; margin-bottom: var(--gap); }
.pg-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.pg-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg-cards .kc[hidden] { display: none; }
.kc__link { color: inherit; text-decoration: none; }
.kc__link:hover { text-decoration: underline; }
.kc__studio { margin: 0; padding: 22px 20px 0; font-weight: 700; color: var(--caramel-ink); }
.pg-empty { margin-top: 18px; color: var(--muted); }
.pg-link { border: 0; background: none; padding: 0; font: inherit; color: var(--navy); text-decoration: underline; cursor: pointer; }

/* списки, шаги, таблицы */
.pg-check { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px var(--gap); }
.pg-check li { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 18px 16px 52px; position: relative; line-height: 1.45; }
.pg-check li::before { content: ""; position: absolute; left: 18px; top: 17px; width: 20px; height: 20px; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%2313364D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }
.pg-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); counter-reset: st; }
.pg-steps li { counter-increment: st; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: grid; gap: 8px; align-content: start; }
.pg-steps li::before { content: counter(st); width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.pg-steps b { font-size: 18px; }
.pg-steps span { color: var(--ink-2); line-height: 1.45; }
.ptable-w { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: 16px; }
.ptable th, .ptable td { text-align: left; padding: 14px 18px; border-top: 1px solid var(--line-2); vertical-align: top; }
.ptable thead th { border-top: 0; background: var(--bg-soft); font-size: 13.5px; color: var(--muted); font-weight: 700; }
.ptable tbody th { font-weight: 600; }
.ptable td b { color: var(--caramel-ink); white-space: nowrap; }
.ptable a { color: var(--navy); }
.ptable small { color: var(--muted); }

/* неделя: подсветка вместо скрытия — расписание читается целиком */
.week__flt { margin: 0; color: var(--muted); font-size: 15px; }
.wk__e.is-on { opacity: 1; }
.br-ph { background: #fff; border: 1px dashed var(--mint-200); border-radius: var(--r); padding: 28px; display: grid; gap: 14px; justify-items: start; }
.br-ph p b { display: block; font-size: 19px; margin-bottom: 6px; }

/* педагоги */
.tgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 8px; align-content: start; }
.tcard__ph { aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: var(--mint-100); display: grid; place-items: center; margin-bottom: 6px; }
.tcard__ph .ic { width: 40px; height: 40px; fill: var(--navy); opacity: .55; }
.tcard h3 { font-size: 18px; margin: 0; }
.tcard__r { color: var(--caramel-ink); font-weight: 700; font-size: 14px; margin: 0; }
.tcard p { margin: 0; color: var(--ink-2); line-height: 1.45; }
.tcard a { color: var(--navy); }

/* галерея, отзывы, новости, текст */
.pg-gal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.pg-gal figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pg-gal img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.pg-gal figcaption { padding: 12px 16px; font-weight: 600; }
.rev__t { font-size: 17px; line-height: 1.55; color: var(--ink); }
.rev__a { font-weight: 700; color: var(--caramel-ink); margin-top: auto !important; }
.news { padding: 0; overflow: hidden; }
.news > :not(.news__img) { padding-inline: 22px; }
.news > :last-child { padding-bottom: 22px; }
.news__img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.news time { font-size: 14px; color: var(--muted); }
.news h3 a { color: inherit; text-decoration: none; }
.news h3 a:hover { text-decoration: underline; }
.pg-pages { display: flex; gap: 8px; margin-top: var(--gap); }
.pg-pages > * { min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; }
.pg-pages [aria-current] { background: var(--navy); color: #fff; border-color: var(--navy); }
.ptext { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: clamp(22px, 3vw, 44px); max-width: 860px; }
.ptext > * + * { margin-top: 14px; }
.ptext h2 { font-size: 22px; margin-top: 28px; }
.ptext p { line-height: 1.6; color: var(--ink-2); }
.ptext img { width: 100%; border-radius: var(--r-sm); aspect-ratio: 16 / 9; object-fit: cover; }
.pg-faq-w { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.pg-faq { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px clamp(18px, 2vw, 28px); }
.pg-faq .qa:last-child { border-bottom: 0; }
.pg-contacts { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); margin-top: var(--gap); }
.pg-map { display: block; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.pg-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-dl { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); margin: 0 0 18px; }
.pg-dl dt, .pg-dl dd { margin: 0; padding: 12px 0; border-top: 1px solid var(--line-2); }
.pg-dl dt { font-weight: 700; color: var(--muted); padding-right: 18px; }

@media (max-width: 1100px) {
  .pg-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .pg-hero__img { min-height: 0; aspect-ratio: 16 / 9; }
  .pg-cards, .tgrid, .pgrid--4, .pg-gal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-faq-w, .pg-contacts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .pg-cards, .pg-cards--3, .tgrid, .pgrid, .pgrid--4, .pg-gal, .pg-two, .pg-check { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .pg-cards, .pg-cards--3, .tgrid, .pgrid, .pgrid--4, .pg-two, .pg-check { grid-template-columns: minmax(0, 1fr); }
  .pg-hero__b { padding: 22px 18px; }
  .pg-acts .btn { flex: 1 1 100%; }
  .ptable { font-size: 15px; } .ptable th, .ptable td { padding: 11px 12px; }
  .pg-dl { grid-template-columns: minmax(0, 1fr); } .pg-dl dd { border-top: 0; padding-top: 0; }
}

/* 13.10 — каждый блок в окно по высоте (правило Розы для всех макетов, 360×740 … 3840×2160): длинные списки — в рамке
   с прокруткой по высоте окна, на телефоне карточки — лентой со свайпом. Ничего не убрано. */
.pg-hero__img { position: relative; }
.pg-hero__img img { position: absolute; inset: 0; }  /* фото не задаёт высоту первого экрана — её задаёт текст */
.pg-scroll, .pg-sec .pg-cards:not(.pg-cards--3), .tgrid, .ptable-w, .ptext, .pg-faq, .pg-dl {
  max-height: max(320px, calc((100vh / var(--z, 1)) - var(--hdr) - 300px)); max-height: max(320px, calc((100vh / var(--z, 1)) - var(--hdr) - 300px)); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.pg-sec .pg-cards:not(.pg-cards--3) { max-height: max(150px, calc((100vh / var(--z, 1)) - var(--hdr) - 525px)); max-height: max(150px, calc((100vh / var(--z, 1)) - var(--hdr) - 525px)); padding: 2px; }
.pg-contacts { align-items: start; }
.pg-map { max-height: max(150px, calc((100vh / var(--z, 1)) - var(--hdr) - 420px)); max-height: max(150px, calc((100vh / var(--z, 1)) - var(--hdr) - 420px)); }
.ptable thead th { position: sticky; top: 0; z-index: 1; }
.pg .week { max-height: max(200px, calc((100vh / var(--z, 1)) - var(--hdr) - 545px)); max-height: max(200px, calc((100vh / var(--z, 1)) - var(--hdr) - 545px)); min-height: 200px; }
.pg-faq { max-height: max(320px, calc((100vh / var(--z, 1)) - var(--hdr) - 200px)); max-height: max(320px, calc((100vh / var(--z, 1)) - var(--hdr) - 200px)); }
.ptext { max-height: max(320px, calc((100vh / var(--z, 1)) - var(--hdr) - 120px)); max-height: max(320px, calc((100vh / var(--z, 1)) - var(--hdr) - 120px)); }
@media (max-width: 1100px) {
  .pg-hero__img { aspect-ratio: auto; min-height: 0; height: clamp(120px, calc(22vh / var(--z, 1)), 260px); }
  .pgrid, .pgrid--4, .pg-steps, .pg-gal, .pg-cards--3, .pg-check, .pg-two, .tgrid {
    display: grid; grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(44%, 1fr); gap: 12px;
    max-height: none; overflow-x: auto; overflow-y: visible; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); scroll-padding-inline: var(--pad); }
  .pgrid::-webkit-scrollbar, .pg-steps::-webkit-scrollbar, .pg-gal::-webkit-scrollbar, .pg-cards--3::-webkit-scrollbar, .pg-check::-webkit-scrollbar, .pg-two::-webkit-scrollbar, .tgrid::-webkit-scrollbar { display: none; }
  .pgrid > *, .pg-steps > *, .pg-gal > *, .pg-cards--3 > *, .pg-check > *, .pg-two > *, .tgrid > * { scroll-snap-align: start; min-width: 0; }
  .pg-contacts { grid-template-columns: minmax(0, 1fr); }
  .pg-contacts .pg-map { min-height: 0; height: 130px; max-height: none; }
  .pg-contacts { gap: 12px; margin-top: 12px; }
  .pg-faq { max-height: max(240px, calc((100vh / var(--z, 1)) - var(--hdr) - 430px)); max-height: max(240px, calc((100vh / var(--z, 1)) - var(--hdr) - 430px)); }
}
@media (max-width: 760px) {
  .pg .section { padding-block: 26px; }
  .pg .pg-hero + .section { padding-top: 6px; }
  .pg-hero { padding: 8px 0 14px; }
  .pg-hero__b { padding: 16px 14px; }
  .pg-hero h1 { font-size: 25px; }
  .pg-lead { font-size: 14.5px; line-height: 1.45; margin-top: 10px; }
  .pg-tag { margin-bottom: 6px; }
  .crumbs ol { margin-bottom: 8px; font-size: 13px; }
  .pg-facts { margin-top: 12px; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
  .pg-facts li { padding: 7px !important; font-size: 12px !important; line-height: 1.25 !important; min-width: 0; overflow-wrap: anywhere; }
  .pg-facts b { font-size: 14px !important; white-space: normal !important; }
  .pg-acts { margin-top: 14px; flex-wrap: nowrap; }
  .pg-acts .btn { flex: 1 1 0; min-width: 0; min-height: 46px; padding-inline: 12px; }
  .pg-hero__img { height: clamp(110px, calc(17vh / var(--z, 1)), 160px); }
  .pgrid, .pgrid--4, .pg-steps, .pg-gal, .pg-cards--3, .pg-check, .pg-two, .tgrid { grid-auto-columns: minmax(82%, 1fr); }
  .pg-scroll, .pg-sec .pg-cards:not(.pg-cards--3), .ptable-w, .ptext, .pg-dl { max-height: max(260px, calc((100vh / var(--z, 1)) - var(--hdr) - 260px)); max-height: max(260px, calc((100vh / var(--z, 1)) - var(--hdr) - 260px)); }
  .pg-sec .pg-cards:not(.pg-cards--3) { max-height: max(220px, calc((100vh / var(--z, 1)) - var(--hdr) - 430px)); max-height: max(220px, calc((100vh / var(--z, 1)) - var(--hdr) - 430px)); }
  .pg-faq { max-height: max(260px, calc((100vh / var(--z, 1)) - var(--hdr) - 300px)); max-height: max(260px, calc((100vh / var(--z, 1)) - var(--hdr) - 300px)); }
  .pg-filter { padding: 12px; gap: 8px; }
  .pg-filter .fchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pg-filter .fchip { flex: none; }
  .pg .head .lead { font-size: 14.5px; margin-top: 8px; }
  .pcard { padding: 16px; gap: 8px; }
  .pg-contacts .pg-map { display: none; }  /* та же карта — в подвале каждой страницы */
  .pg-contacts { gap: 10px; margin-top: 10px; }
}

/* 13.10 (проверка телефонов): длинная надпись на кнопке («Раздел «Сведения» на официальном сайте») переносится, а не вылезает за экран */
@media (max-width: 760px) { .pg .btn { white-space: normal; text-align: center; height: auto; min-height: 48px; padding-block: 10px; } }

/* 13.10 (проверка «каждый блок в окне», телефон 360×740): первый раздел «Направлений» и «Расписания» был выше окна на 4–12 px —
   на коротком узком телефоне фильтр плотнее к карточкам, нижнее поле раздела меньше */
@media (max-width: 380px) and (max-height: 760px) {
  .pg-sec { padding-bottom: 16px; }
  .pg-sec .pg-filter { margin-bottom: 8px; }
  .pg-sec .pg-cards:not(.pg-cards--3) { max-height: 228px; }  /* лента карточек листается внутри, видна целиком */
}

/* 13.10 (Роза: «расписание — во всю страницу, но чтобы поместилось», «блок в calc(100vh / var(--z, 1))»): фильтр над неделей и каталогом плотнее —
   подпись группы слева от кнопок, а не строкой над ними; так раздел с неделей целиком помещается в окно */
@media (min-width: 761px) {
  .pg-filter { padding: 14px 18px; gap: 10px; }
  .pg-filter .pick__grp { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 12px; }
  .pg-filter .pick__l { margin: 0; }
  .pg-filter .fchips { flex-wrap: wrap; }
}
