/*
 * What a merged school (ZŠ + MŠ) adds to jerabinov.css, the stylesheet of the elementary
 * school's design (left unchanged next to this file):
 *   1. the bridge to the kindergarten skin (ms/skin.css),
 *   2. the frame: a longer menu and the kindergarten's mark in it,
 *   3. the labels of the parts and the switch above the news,
 *   4. the two parts on the home page,
 *   5. new pieces of the pages (the strip of today, two addresses, the hub, contacts).
 */

/* ---------- 1 The bridge to the kindergarten skin ---------- */
:root {
    /* What the skin asks the site for (see the head of ms/skin.css). */
    --site-text-font: var(--sans);
    --site-gutter: var(--gutter);
    --site-wrap: calc(var(--wrap) - 2 * var(--gutter));
    --site-sticky-top: var(--bar-h);        /* the sticky bar */
    --site-after-ms: var(--paper);          /* the footer is a panel set in the page, so the page follows a kindergarten page */

    /* The colour of each part wherever the two meet on one page. */
    --part-zs-dot: var(--forest);
    --part-ms-bg: var(--gold-soft);
    --part-ms-ink: #5F4300;
}
[data-theme="dark"] {
    --part-zs-dot: #7DB89A;
    --part-ms-ink: var(--gold);
}

[hidden] { display: none !important; }

/* The design takes the underline off every link; inside the skin a plain link keeps the browser's. */
[data-part="ms"] a { text-decoration: underline; }
/* The bar of the kindergarten is the second row of the header: it spans the page as the
   school's bar does (logo under logo), while the kindergarten's pages keep the content column. */
[data-part="ms"] .ks-partbar { --ks-gutter: calc(var(--frame) + clamp(10px, 1.6vw, 26px)); --ks-wrap: 100vw; }
.is-ms .site-header { box-shadow: 0 1px 0 var(--line); }
.is-ms .site-header.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 16px 32px -24px rgba(20, 38, 31, .45); }

/* ---------- 2 The frame ---------- */
.brand-name small { letter-spacing: .14em; }
.panel-pic { width: 40px; height: 40px; flex: none; }
.panel-link[aria-current] { background: var(--sage-2); }
/* "Pro rodiče" is the third item now and holds four links: one column, so the panel stays inside a narrow desktop. */
@media (min-width: 1101px) { #panel-rodice { grid-template-columns: 1fr; width: 320px; } }
/* Six items with two long names: between the phone menu and a wide screen the bar tightens. */
@media (min-width: 1101px) and (max-width: 1340px) {
    .bar { gap: 12px; }
    .nav-link { padding: 10px 11px; font-size: 15px; gap: 4px; }
    .brand-name b { font-size: 26px; }
    .brand-name small { font-size: 10px; letter-spacing: .1em; }
}
@media (min-width: 1101px) and (max-width: 1220px) {
    .bar-edookit { display: none; }
}

/* ---------- 3 Part labels ---------- */
.part { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px; background: var(--sage); color: var(--ink); font: 650 12.5px/1.4 var(--sans); letter-spacing: 0; text-transform: none; white-space: nowrap; }
.part::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--part-zs-dot); }
.part-ms { padding-left: 6px; background: var(--part-ms-bg); color: var(--part-ms-ink); }
.part-ms::before, .part-all::before { content: none; }
.part-ms img { width: 18px; height: 18px; margin-block: -2px; }
.part-all { padding-left: 11px; background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.frame-forest .part { background: rgba(243, 240, 230, .13); color: #F3F0E6; }
.frame-forest .part::before { background: #9CCFB4; }
.frame-forest .part-ms { background: var(--gold); color: #1D1706; }
.frame-forest .part-all { background: none; box-shadow: inset 0 0 0 1px rgba(243, 240, 230, .3); color: rgba(243, 240, 230, .82); }

/* The switch above the news: everything, or one part (what belongs to the whole school stays). */
.part-switch { display: inline-flex; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.part-switch button { padding: 8px 16px; border-radius: 999px; font-weight: 650; font-size: 14.5px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.part-switch button:hover { background: var(--sage-2); color: var(--ink); }
.part-switch button[aria-pressed="true"] { background: var(--forest); color: var(--on-forest); }
[data-theme="dark"] .part-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.news-row.is-plain .meta + h3 { margin-top: 9px; }
.news-foot { margin-top: clamp(26px, 3vw, 40px); }
/* One part chosen: the rows become a ruled list, and without the lead item they fill the width. */
.news.is-filtered .news-list { border-bottom: 1px solid var(--line); }
.news.is-filtered .news-row, .news.is-filtered .news-row:first-child, .news.is-filtered .news-row:nth-child(2), .news.is-filtered .news-row:last-child { padding-block: 20px; border-top: 1px solid var(--line); }
.news.no-lead { grid-template-columns: 1fr; }
.news.no-lead .news-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(28px, 4.5vw, 72px); border-bottom: 0; }
.news.no-lead .news-row { border-bottom: 1px solid var(--line); margin-top: -1px; }

/* The label of an event: its own column on a wide screen, under the name on a phone. */
.event-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* ---------- 4 The two parts on the home page ---------- */
.parts { padding-top: clamp(16px, 2vw, 28px); }
.parts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 26px); align-items: stretch; }
/* The elementary school's block: the same anatomy as the kindergarten's next to it
   (a name, a sentence, four ways in, one button), in the school's own quiet look. */
.part-zs { position: relative; overflow: hidden; display: flex; flex-direction: column; height: 100%; padding: clamp(24px, 2.8vw, 40px); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--card); }
.part-deco { position: absolute; right: clamp(-34px, -1.8vw, -14px); top: clamp(-44px, -2.4vw, -20px); width: clamp(150px, 15vw, 216px); pointer-events: none; }
.part-top { position: relative; display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); padding-right: clamp(60px, 8vw, 120px); }
.part-mark { width: clamp(60px, 5.6vw, 80px); height: auto; aspect-ratio: 1; flex: none; }
.part-title { margin-top: 10px; font: 400 clamp(36px, 3.6vw, 54px)/1 var(--serif); letter-spacing: -.012em; }
.part-title em { font-style: italic; color: var(--berry-ink); }
.part-text { margin-top: 18px; max-width: 46ch; color: var(--ink-2); }
.part-ways { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 24px 0 26px; }
.part-ways a { display: grid; justify-items: center; align-content: start; gap: 10px; height: 100%; padding: 16px 6px 14px; border-radius: var(--r-m); background: var(--sage-2); font-weight: 650; font-size: 15.5px; line-height: 1.25; text-align: center; transition: background .25s, color .25s, transform .25s var(--ease); }
.part-way-ico { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: var(--card); color: var(--forest); transition: background .25s, color .25s; }
[data-theme="dark"] .part-way-ico { color: var(--ink); }
.part-way-ico .ico { width: 26px; height: 26px; }
.part-ways small { display: block; margin-top: 3px; font-weight: 400; font-size: 13px; color: var(--ink-2); transition: color .25s; }
.part-ways a:hover { background: var(--forest); color: var(--on-forest); transform: translateY(-2px); }
.part-ways a:hover small { color: rgba(243, 240, 230, .75); }
.part-ways a:hover .part-way-ico { background: var(--gold); color: #1D1706; }
.part-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: auto; }

/* ---------- 5 New pieces ---------- */
/* The strip of today without the date: the nearest event leads it. */
.today-three { grid-template-columns: 1.05fr 1.3fr 1.2fr; }
.today-lead { border-left: 0; background: var(--forest); color: var(--on-forest); }
.today-lead .eyebrow { color: rgba(243, 240, 230, .78); }
.today-lead .berries { background: var(--gold); box-shadow: 8px -4px 0 var(--gold), 7px 5px 0 var(--gold); }
.today-lead .today-note { color: rgba(243, 240, 230, .74); }
.today-lead .more { color: var(--on-forest); }
.today-lead .more .ico { color: var(--gold); }
.today-lead .part { align-self: flex-start; }
.today-lead .part-ms { background: var(--gold); color: #1D1706; }
.today-classes .today-face { width: 34px; height: 34px; margin-top: -4px; border-radius: 50%; }
.today-classes li.is-ms { align-items: center; }

/* Two addresses: the contact of the home page, the contacts page. */
.contact-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 28px; margin: 34px 0; }
.contact-part h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; font: 400 27px/1.1 var(--serif); }
.contact-part ul { display: grid; gap: 10px; }
.contact-part li { display: flex; gap: 12px; font-size: 16.5px; line-height: 1.4; }
.contact-part .ico { margin-top: 3px; color: var(--berry-ink); }
.contact-part a:hover { text-decoration: underline; text-underline-offset: 4px; }
.map-school-ms rect { fill: #B88A2E; }
.map-pin-ms path { fill: var(--gold); }
.map-pin-ms circle { fill: #2B1B14; }
.map-card b + span { display: block; }

/* The head of a page that is not a class. */
.class-hero-grid.is-single { grid-template-columns: 1fr; }
.page-h1 { font: 400 clamp(44px, 5.6vw, 88px)/.98 var(--serif); letter-spacing: -.014em; text-wrap: balance; }
.page-h1 em { font-style: italic; color: var(--berry-ink); }

/* The hub of the elementary school: družina, kroužky, poradenství. */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.service { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 26px 24px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--card); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.service:hover { transform: translateY(-4px); border-color: var(--forest); box-shadow: var(--shadow); }
.service-ico { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 8px; border-radius: 50%; background: var(--sage); color: var(--forest); }
[data-theme="dark"] .service-ico { color: var(--ink); }
.service b { font: 400 30px/1.05 var(--serif); }
.service p { font-size: 15.5px; color: var(--ink-2); }
.service .more { margin-top: auto; padding-top: 10px; }
.service .more::after { content: ""; position: absolute; inset: 0; }

/* Contacts. */
.addr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 1.8vw, 26px); }
.addr { padding: clamp(24px, 2.6vw, 38px); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--card); }
.addr h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 20px; font: 400 clamp(28px, 2.7vw, 40px)/1.05 var(--serif); letter-spacing: -.01em; }
.addr .contact-part ul { gap: 12px; }
.group + .group { margin-top: clamp(48px, 5.5vw, 84px); }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: clamp(20px, 2.4vw, 32px); }
.group-head .h2 { margin: 0; }
.group-note { max-width: 62ch; margin: -8px 0 clamp(20px, 2.4vw, 32px); color: var(--ink-2); }
.staff-grid.is-three { grid-template-columns: repeat(3, 1fr); }
.staff.has-links { align-items: flex-start; }
.staff-links { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 7px; font-size: 14px; }
.staff-links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.staff-links a:hover { color: var(--ink); }
.avatar.is-ms { background: var(--part-ms-bg); color: var(--part-ms-ink); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1240px) {
    .today-three { grid-template-columns: 1fr 1.25fr 1.15fr; }
    .today-three .today-cell:nth-child(3) { border-left: 1px solid var(--line); }
    .today-three .today-cell:nth-child(n+3) { border-top: 0; }
}
@media (max-width: 1100px) {
    .parts-grid { grid-template-columns: 1fr; }
    .part-zs { height: auto; }
    .staff-grid.is-three { grid-template-columns: 1fr 1fr; }
    .news.no-lead .news-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
    .today-three { grid-template-columns: 1fr; }
    .today-three .today-cell, .today-three .today-cell:nth-child(3) { border-left: 0; }
    .today-three .today-cell + .today-cell, .today-three .today-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
    .services, .addr-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .contact-parts { grid-template-columns: 1fr; }
    .staff-grid.is-three { grid-template-columns: 1fr; }
    .news.no-lead .news-list { grid-template-columns: 1fr; }
    .part-switch button { padding: 8px 12px; font-size: 13.5px; }
    .event-tags { grid-column: 2; grid-row: 2; justify-content: flex-start; margin-top: -8px; }
    .event-tags .tag { display: inline-flex; }
    .event:has(.event-tags) .event-date, .event:has(.event-tags) > .ico { grid-row: 1 / span 2; }
    .part-top { padding-right: 0; }
    .part-deco { display: none; }
    .part-ways { gap: 6px; }
    .part-ways a { padding: 12px 2px 10px; font-size: 14px; }
    .part-way-ico { width: 50px; height: 50px; }
    .part-ways small { display: none; }
}

/* The head of the hub borrows the two photographs of the design's "about" section. */
.class-hero.is-sage, [data-theme="dark"] .class-hero.is-sage { background: var(--sage); }
.class-hero .about-img-b { border-color: var(--sage); }
.class-hero .about-body .lead { margin-top: 26px; }
.class-hero .stats { margin-block: 30px; }
@media (max-width: 520px) {
    /* Four narrow tiles would squeeze "Poradenství": two rows of two, the picture beside the word. */
    .part-ways { grid-template-columns: 1fr 1fr; }
    .part-ways a { grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 10px; padding: 9px 12px 9px 9px; font-size: 15px; text-align: left; }
    .part-way-ico { width: 42px; height: 42px; }
    .part-way-ico .ico { width: 21px; height: 21px; }
}
[data-theme="dark"] .map-school-ms rect { fill: #8C6A22; }

/* The list beside the lead item of the news is the longer one (six rows of both
   parts): on a wide screen the lead item travels with it instead of leaving a hole. */
@media (min-width: 1101px) {
    .news:not(.no-lead) .news-lead { position: sticky; top: calc(var(--site-sticky-top, 78px) + 28px); }
}
