/* Внутрішні сторінки (курси, блог, контакти) — tools/build_pages.py. Токени, шрифти, кнопки, шапка — з main.css.
   Без 3D-сцени: нічне небо + постер вежі; жодного JS. */
html.inner { scroll-padding-top: calc(var(--header-h) + 16px); }
.inner body { background: #0b1630; }
.inner .sky {
  background:
    radial-gradient(120% 70% at 85% 0%, rgba(107, 74, 106, .45), transparent 60%),
    linear-gradient(180deg, #0b1630 0%, #131f45 55%, #1b2a55 100%);
}
/* зорі неба — у main.css (html.inner .sky::before/::after, основний чат 15.10); тут не дублювати */

/* ── перший екран сторінки ── */
.page-hero {
  position: relative; z-index: 1; display: grid; gap: 32px; align-items: end;
  padding: calc(var(--header-h) + clamp(32px, 6vw, 72px)) var(--gutter) clamp(28px, 4vw, 48px);
  max-width: 1320px; margin: 0 auto;
}
.page-hero--poster { grid-template-columns: 1fr; }
.page-poster { display: none; }
@media (min-width: 960px) {
  .page-hero--poster { grid-template-columns: minmax(0, 1fr) auto; min-height: min(78svh, 760px); }
  .page-poster { display: block; height: min(66svh, 640px); width: auto; align-self: end; margin-bottom: -48px; opacity: .92;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
}
.page-hero-copy { max-width: 44rem; }
.page-hero-copy--wide { max-width: 56rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .875rem; color: var(--muted); }
.crumbs a { color: var(--gold); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-h1 {
  font: 400 clamp(2.25rem, 1.4rem + 3.4vw, 4.25rem)/1.04 var(--f-display);
  letter-spacing: -.015em; margin-top: 16px; text-wrap: balance;
}
.page-lead { margin-top: 18px; color: var(--text-2); font-size: clamp(1.0625rem, 1rem + .25vw, 1.25rem); max-width: 40rem; text-wrap: pretty; }
.page-lead + .page-lead { margin-top: 10px; }
.price { margin-top: 22px; font: italic 400 clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem)/1.1 var(--f-display); color: var(--gold-2, var(--gold)); }
.page-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li { padding: 6px 14px; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: .9375rem; color: var(--text-2); }
.chips--big li { padding: 10px 18px; font-size: 1rem; color: var(--text); background: rgba(255, 255, 255, .03); }
.jump { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 24px; }
.jump a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(226, 184, 92, .4); padding-bottom: 2px; }
.jump a:hover { border-color: var(--gold); }

/* ── тіло сторінки ── */
.page-body { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter) clamp(48px, 8vw, 96px); }
.block { padding-top: clamp(40px, 6vw, 72px); }
.block + .block { border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 72px); }
.block-h { font: 400 clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem)/1.08 var(--f-display); letter-spacing: -.01em; max-width: 24ch; text-wrap: balance; }
.block-p { margin-top: 16px; max-width: 46rem; color: var(--text-2); text-wrap: pretty; }
.block-p strong, .card strong, .article strong { color: var(--text); font-weight: 600; }
.bullets { margin-top: 20px; display: grid; gap: 12px; max-width: 46rem; }
.bullets li { position: relative; padding-left: 28px; color: var(--text-2); }
.bullets li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
.cards { margin-top: 24px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(7, 14, 30, .62); }
.card h3 { font: 600 1.0625rem/1.3 var(--f-text); color: var(--gold); }
.card p { margin-top: 10px; color: var(--text-2); font-size: .9875rem; }
.card-li { padding-left: 18px; position: relative; }
.card-li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.block--cta { padding: clamp(28px, 4vw, 44px); margin-top: clamp(40px, 6vw, 72px); border: 1px solid rgba(226, 184, 92, .45);
  border-radius: var(--r); background: linear-gradient(135deg, rgba(226, 184, 92, .1), rgba(7, 14, 30, .7)); }
.block + .block--cta { border-top: 1px solid rgba(226, 184, 92, .45); }

/* ── посилання на курси ── */
.course-links { margin-top: 24px; display: grid; gap: 10px; }
.course-links--grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.course-link {
  display: grid; gap: 6px; height: 100%; padding: 20px 22px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--r); background: rgba(7, 14, 30, .62);
  transition: border-color .25s, transform .25s var(--ease-out), background .25s;
}
.course-link:hover { border-color: var(--gold); background: rgba(7, 14, 30, .85); transform: translateY(-2px); }
.course-link-name { font: 400 1.375rem/1.15 var(--f-display); }
.course-link-meta { color: var(--muted); font-size: .9375rem; }
.course-link-price { color: var(--gold); font-weight: 600; }
.course-link--all .course-link-name { color: var(--gold); }
@media (min-width: 720px) { .block--more .course-links { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }

/* ── блог ── */
.posts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); padding-top: 8px; }
.post-card { display: grid; gap: 12px; height: 100%; padding: 26px; text-decoration: none; border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(7, 14, 30, .62); transition: border-color .25s, transform .25s var(--ease-out); }
.post-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.post-tag { font: 600 .75rem/1 var(--f-text); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.post-title { font: 400 1.625rem/1.12 var(--f-display); text-wrap: balance; }
.post-excerpt { color: var(--text-2); font-size: .9875rem; }
.post-more { color: var(--gold); font-weight: 600; }
.article { position: relative; z-index: 1; max-width: 46rem; margin: 0 auto; padding: calc(var(--header-h) + clamp(32px, 6vw, 64px)) var(--gutter) clamp(48px, 8vw, 96px); }
.article-h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem); }
.toc { margin-top: 32px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(7, 14, 30, .62); }
.toc-h { font: 600 .8125rem/1 var(--f-text); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.toc ol { margin-top: 14px; padding-left: 1.4em; list-style: decimal; display: grid; gap: 8px; color: var(--muted); }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text); text-decoration: underline; }
.article-sec { margin-top: clamp(36px, 5vw, 56px); }
.article-h2 { font: 400 clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem)/1.12 var(--f-display); text-wrap: balance; }
.article-sec > p { margin-top: 14px; color: var(--text-2); }
.article .bullets { max-width: none; }
.article-cta { margin-top: clamp(48px, 7vw, 72px); }
.more-posts { margin-top: 40px; }
.more-posts ul { margin-top: 12px; display: grid; gap: 8px; }
.more-posts a { color: var(--text-2); }

/* ── контакти ── */
.contact-cards { margin-top: 24px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.contact-card { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; align-items: center; padding: 20px 22px;
  text-decoration: none; border: 1px solid var(--line); border-radius: var(--r); background: rgba(7, 14, 30, .62); transition: border-color .25s; }
.contact-card:hover { border-color: var(--gold); }
.contact-card .ic { grid-row: span 2; width: 28px; height: 28px; color: var(--gold); }
.contact-k { font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-v { font-weight: 600; overflow-wrap: anywhere; }

/* ── підвал-карта сайту: компактно — курси сіткою 2×2, довгі списки у 2 стовпці ── */
.site-foot { position: relative; z-index: 1; border-top: 1px solid var(--line); background: #070e1f; padding: clamp(32px, 4vw, 48px) var(--gutter) calc(20px + env(safe-area-inset-bottom)); }
.site-foot-grid { max-width: 1320px; margin: 0 auto; display: grid; gap: 28px 40px; grid-template-columns: 1fr; }
.site-foot-brand { display: grid; gap: 12px; align-content: start; justify-items: start; }
.site-foot-brand img { width: 128px; height: auto; }
.site-foot-brand p { color: var(--muted); font-size: .9375rem; max-width: 22rem; }
.site-foot-h { font: 600 .75rem/1.3 var(--f-text); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.site-foot-h a { text-decoration: none; }
.sf-groups { margin-top: 14px; columns: 2; column-gap: 20px; } /* стовпці заповнюються згори — висоти рівні */
.sf-group { break-inside: avoid; margin-bottom: 18px; }
.sf-group:last-child { margin-bottom: 0; }
.sf-sub { font: 600 .875rem/1.3 var(--f-text); color: var(--text); }
.sf-sub a { text-decoration: none; }
.sf-sub a:hover { color: var(--gold); }
.site-foot ul { margin-top: 8px; display: grid; gap: 4px 18px; }
.sf-list--2col { grid-template-columns: repeat(2, max-content); }
.site-foot ul a { color: var(--text-2); text-decoration: none; font-size: .875rem; line-height: 1.5; }
.site-foot ul a:hover { color: var(--text); text-decoration: underline; }
.sf-school ul, .sf-contacts ul { margin-top: 12px; }
.sf-school ul { grid-template-columns: repeat(2, max-content); column-gap: 28px; }
@media (min-width: 1100px) { .sf-school ul { grid-template-columns: 1fr; } }
.site-foot-contacts a { display: inline-flex; align-items: center; gap: 10px; }
.site-foot-contacts .ic { width: 16px; height: 16px; color: var(--gold); flex: none; }
.site-foot-copy { max-width: 1320px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
@media (min-width: 560px) {
  .sf-groups { column-gap: 32px; }
  .sf-list--2col-wide { grid-template-columns: repeat(2, max-content); }
  .site-foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-foot-brand, .sf-courses { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .site-foot-grid { grid-template-columns: minmax(200px, .9fr) minmax(0, 2.4fr) minmax(150px, .7fr) minmax(220px, 1fr); }
  .site-foot-brand, .sf-courses { grid-column: auto; }
}

/* захист: елементи сіток не ширші за контейнер (15.10: один прогін показав переповнення 23 сторінок — не відтворилось, правило на випадок) */
.course-links > li, .course-link, .cards > *, .posts > li, .contact-cards > li, .site-foot-grid > *, .sf-group { min-width: 0; }
.course-link-name, .course-link-meta, .post-title, .contact-v { overflow-wrap: anywhere; }

/* ── /courses: перший екран — 4 фото напрямків замість порожньої правої половини (власник: «почему так пусто?») ── */
.mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mosaic-tile { position: relative; display: block; overflow: hidden; border-radius: var(--r); border: 1px solid var(--line); aspect-ratio: 4 / 3; text-decoration: none; isolation: isolate; }
.mosaic-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); z-index: -2; }
.mosaic-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(6, 12, 26, .05) 30%, rgba(6, 12, 26, .88)); }
.mosaic-tile:hover img { transform: scale(1.05); }
.mosaic-tile:hover { border-color: var(--gold); }
.mosaic-label { position: absolute; left: 12px; right: 12px; bottom: 28px; font: 400 clamp(1rem, .85rem + .5vw, 1.25rem)/1.15 var(--f-display); color: #fff; text-wrap: balance; }
.mosaic-count { position: absolute; left: 12px; bottom: 9px; font-size: .8125rem; color: var(--gold-2, var(--gold)); font-weight: 600; }
@media (min-width: 960px) {
  .page-hero--mosaic { grid-template-columns: minmax(0, 1fr) minmax(360px, 44%); align-items: center; min-height: min(72svh, 700px); }
  .mosaic-label { left: 16px; bottom: 34px; } .mosaic-count { left: 16px; bottom: 12px; }
}
@media (max-width: 959px) {
  .mosaic-tile::after { background: linear-gradient(180deg, rgba(6, 12, 26, .15) 10%, rgba(6, 12, 26, .92) 75%); }
  .mosaic-label { font-size: .9375rem; bottom: 26px; left: 10px; right: 10px; }
  .mosaic-count { left: 10px; bottom: 8px; font-size: .75rem; }
}

/* /blogs: без високого першого екрана — статті одразу видно */
.page-hero--compact { min-height: 0; padding-bottom: 12px; }
.posts .post-card { min-height: 260px; align-content: start; }
@media (min-width: 720px) { .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.post-card .post-title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }

/* її картинки статей (оригінал sparkacademy.co.ua, 15.10) */
.post-card { padding: 0; overflow: hidden; }
.post-card > :not(.post-img) { margin-inline: 26px; }
.post-card > .post-tag { margin-top: 22px; }
.post-card > :last-child { margin-bottom: 26px; }
.post-img { width: 100%; height: auto; aspect-ratio: 1200 / 422; object-fit: cover; display: block; }
.article-img { width: 100%; height: auto; margin-top: 24px; border-radius: var(--r); border: 1px solid var(--line); }

/* ── порожнеча праворуч (15.10, «почему так пусто», пошук emptiness.py) ── */
/* курс: закріплена картка курсу праворуч на широких екранах */
.course-aside { display: none; }
@media (min-width: 1100px) {
  .page-body--aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 56px; }
  .page-body--aside > * { grid-column: 1; }
  .page-body--aside > .course-aside { display: block; grid-column: 2; grid-row: 1 / span 40; align-self: start;
    position: sticky; top: calc(var(--header-h) + 24px); margin-top: clamp(40px, 6vw, 72px);
    border: 1px solid var(--line); border-radius: var(--r); background: rgba(7, 14, 30, .78); overflow: hidden; }
  .course-aside img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
  .course-aside-body { padding: 20px 22px 24px; display: grid; gap: 10px; }
  .course-aside-group { font: 600 .75rem/1.3 var(--f-text); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
  .course-aside-title { font: 400 1.5rem/1.15 var(--f-display); text-wrap: balance; }
  .course-aside .chips { margin-top: 0; }
  .course-aside .price { margin-top: 2px; font-size: 1.5rem; }
  .course-aside .btn { width: 100%; }
}
/* стаття: зміст праворуч і закріплений */
@media (min-width: 1200px) {
  .article { max-width: calc(46rem + 320px + 56px); display: grid; grid-template-columns: minmax(0, 46rem) 320px; column-gap: 56px; }
  .article > * { grid-column: 1; }
  .article > .toc { grid-column: 2; grid-row: 1 / span 40; align-self: start; position: sticky; top: calc(var(--header-h) + 24px); margin-top: 0; }
}
/* контакти: 3 в ряд — два рівні ряди замість 4 + 2 */
@media (min-width: 960px) { .contact-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.contact-v { overflow-wrap: normal; word-break: normal; }
@media (max-width: 420px) { .contact-v { overflow-wrap: anywhere; } }
@media (min-width: 1200px) { .article-h1 { font-size: clamp(2rem, 1.2rem + 1.6vw, 2.75rem); } }
