/*
 * What a merged school (ZŠ + MŠ) adds to theme.css, the stylesheet of the running
 * school website (left unchanged next to this file):
 *   1. the bridge to the kindergarten skin (ms/skin.css),
 *   2. the labels that say which part a news item, an event or a person belongs to,
 *   3. the two parts on the home page,
 *   4. small pieces of the pages that are new (the hub of the elementary school,
 *      two addresses in the contact band).
 */

/* ---------- 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(--zs-font);
    --site-gutter: var(--zs-gutter);
    --site-wrap: calc(var(--zs-max) - 2 * var(--zs-gutter));
    --site-sticky-top: calc(4.5rem + 1px);          /* the sticky navbar */
    --site-after-ms: var(--zs-surface-2);           /* the footer follows a kindergarten page */

    /* The colour of each part wherever the two meet on one page. */
    --zs-part-zs: var(--zs-accent);
    --zs-part-zs-bg: var(--zs-accent-soft);
    --zs-part-zs-ink: var(--zs-accent-hover);
    --zs-part-ms: #FFC738;
    --zs-part-ms-bg: #FFEFBA;
    --zs-part-ms-ink: #6B4700;
}

[data-bs-theme="dark"] {
    --zs-part-zs-ink: var(--zs-accent);
    --zs-part-ms-bg: #473B1F;
    --zs-part-ms-ink: #FFDD85;
}

/* The menu item of the page (the mockup marks it with data-current). */
.zs-nav .nav-link[data-current] {
    color: var(--zs-accent);
    background: var(--zs-accent-tint);
}

/* A kindergarten page: the school's footer comes straight after the hills. */
.is-ms .zs-footer {
    margin-top: 0;
    border-top: 0;
}

/* ---------- 2. Part labels ---------- */

.zs-part-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--zs-surface-2);
    color: var(--zs-ink-2);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.zs-part-chip--zs {
    background: var(--zs-part-zs-bg);
    color: var(--zs-part-zs-ink);
}

.zs-part-chip--ms {
    background: var(--zs-part-ms-bg);
    color: var(--zs-part-ms-ink);
}

.zs-part-chip img {
    width: 1.05rem;
    height: 1.05rem;
    margin-left: -.15rem;
}

/* A news card of a part: the label sits on the line of the date, the top edge takes
   the part's colour the way a class page tints its cards. */
.zs-news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .75rem;
}

.zs-news-card[data-for="zs"] { --zs-card-accent: var(--zs-part-zs); }
.zs-news-card[data-for="ms"] { --zs-card-accent: var(--zs-part-ms); }

/* The switch above the news: everything, or one part (what belongs to the whole school stays). */
.zs-filter {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .25rem;
    border: 1px solid var(--zs-border);
    border-radius: 999px;
    background: var(--zs-surface);
}

.zs-filter button {
    padding: .4rem .95rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--zs-ink-2);
    font-size: .92rem;
    font-weight: 600;
}

.zs-filter button:hover {
    background: var(--zs-surface-2);
    color: var(--zs-ink);
}

.zs-filter button[aria-pressed="true"] {
    background: var(--zs-accent);
    color: var(--zs-accent-contrast);
}

/* ---------- 3. The two parts on the home page ---------- */

.zs-parts {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
    .zs-parts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }
}

/* The elementary school's block: the same shape as the kindergarten's next to it
   (a name, a sentence, four ways in, one button), in the school's own quiet look. */
.zs-part-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: clamp(1.4rem, 2.6vw, 2.25rem);
}

.zs-part-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.zs-part-card-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: clamp(4rem, 6vw, 5.5rem);
    aspect-ratio: 1;
    border-radius: 1.5rem;
    background: var(--zs-accent-soft);
    color: var(--zs-accent);
    font-size: clamp(1.7rem, 2.6vw, 2.4rem);
}

.zs-part-card h2 {
    margin: 0;
    font-size: clamp(1.7rem, 1.2rem + 1.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.08;
}

.zs-part-card .zs-eyebrow {
    margin-bottom: .35rem;
}

.zs-part-card-text {
    max-width: 34em;
    margin: 1rem 0 0;
    color: var(--zs-ink-2);
    font-size: 1.0625rem;
}

.zs-part-links {
    display: grid;
    flex: 1 0 auto;             /* the four ways in fill what the taller block leaves */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: .5rem;
    margin: 1.4rem 0 1.5rem;
    padding: 0;
    list-style: none;
}

.zs-part-links li {
    display: grid;
}

.zs-part-links a {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: .6rem;
    height: 100%;
    padding: .9rem .3rem .8rem;
    border: 1px solid var(--zs-border);
    border-radius: var(--zs-radius);
    background: var(--zs-surface);
    color: var(--zs-ink);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.zs-part-links a:hover {
    transform: translateY(-2px);
    border-color: var(--zs-tile-ink, var(--zs-accent));
    box-shadow: var(--zs-shadow);
}

.zs-part-links i {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    background: var(--zs-tile-bg, var(--zs-accent-soft));
    color: var(--zs-tile-ink, var(--zs-accent));
    font-size: 1.35rem;
}

.zs-part-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.5rem;
    margin-top: auto;
}

.zs-part-foot .zs-section-link {
    font-weight: 600;
    text-decoration: none;
}

.zs-part-foot .zs-section-link:hover {
    text-decoration: underline;
}

@media (max-width: 420px) {
    .zs-part-links a { font-size: .85rem; }
    .zs-part-links i { width: 2.75rem; height: 2.75rem; font-size: 1.15rem; }
}

/* ---------- 4. New pieces ---------- */

/* Two addresses in the contact band and on the contacts page. */
.zs-addresses {
    display: grid;
    gap: 1.25rem 2rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    margin-top: 1.25rem;
}

.zs-addresses h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .25rem;
    font-size: 1.1rem;
}

.zs-addresses .zs-contact-lines {
    margin-top: .5rem;
}

.zs-map svg {
    display: block;
    width: 100%;
    height: auto;
}
