/* Tablica theme: chalkboard and school paper. No build step. */

:root {
    --board: #1f3a33;
    --board-light: #26473e;
    --chalk: #f4efe1;
    --chalk-dim: #e9e4d6;
    --chalk-yellow: #f1d77a;
    --chalk-pink: #f6b3bb;
    --wood: #7a4b2a;
    --wood-dark: #5c361c;
    --tray: #6b4123;
    --paper: #f6eedb;
    --paper-2: #efe4cc;
    --paper-card: #fbf5e6;
    --paper-line: #c6d6e3;
    --ink: #22302b;
    --ink-muted: #4d5a55;
    --red: #9e1b25;
    --red-dark: #6f1018;
    --footer: #b01f2c;
    --font-chalk: 'Caveat', cursive;
    --font-serif: 'Young Serif', Georgia, serif;
    --font-sans: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.55;
    color: var(--chalk);
    background-color: var(--board);
    background-image:
        radial-gradient(ellipse 60% 40% at 15% 10%, rgba(255, 255, 255, 0.06), transparent 70%),
        radial-gradient(ellipse 50% 35% at 85% 30%, rgba(255, 255, 255, 0.05), transparent 70%),
        radial-gradient(ellipse 70% 30% at 40% 60%, rgba(255, 255, 255, 0.035), transparent 70%);
}

img {
    max-width: 100%;
}

/* Keep the footer at the bottom of short pages: the last paper section fills the free space. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

main > .paper:last-child {
    flex: 1 0 auto;
}

a {
    color: var(--chalk);
}

a:hover {
    color: var(--chalk-yellow);
}

.wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
    z-index: 10;
    background: var(--chalk);
    color: var(--ink);
    padding: 8px 14px;
}

/* ---------- Header ---------- */

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 22px;
    padding-bottom: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--chalk);
    text-decoration: none;
}

.brand:hover {
    color: var(--chalk);
}

.flag {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 34px;
    height: 24px;
    border: 2px solid var(--chalk);
    border-radius: 3px;
    overflow: hidden;
    transform: rotate(-4deg);
}

.flag span {
    flex: 1;
}

.flag span:first-child {
    background: var(--chalk);
}

.flag span:last-child {
    background: #d0283a;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-name {
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 32px;
}

.brand-sub {
    margin-top: 4px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 22px;
}

.nav a {
    display: inline-block;
    padding: 10px 2px;
    font-weight: 600;
    color: var(--chalk);
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.nav a:hover {
    color: var(--chalk-yellow);
}

.nav a.active {
    border-bottom-color: var(--chalk-yellow);
}

.btn-chalk {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 20px;
    border: 2px dashed var(--chalk-yellow);
    border-radius: 999px;
    color: var(--chalk-yellow);
    font-weight: 800;
    text-decoration: none;
}

.nav a.btn-chalk {
    display: inline-flex;
    padding: 0 20px;
    border-bottom: 2px dashed var(--chalk-yellow);
}

.btn-chalk:hover {
    background: rgba(241, 215, 122, 0.12);
}

/* ---------- Framed chalkboard ---------- */

.board {
    border: 18px solid var(--wood);
    border-radius: 10px;
    box-shadow:
        inset 0 0 0 3px var(--wood-dark),
        inset 0 0 80px rgba(0, 0, 0, 0.45),
        0 18px 40px rgba(0, 0, 0, 0.35);
    background-color: var(--board-light);
    background-image:
        radial-gradient(ellipse 40% 30% at 25% 35%, rgba(255, 255, 255, 0.07), transparent 70%),
        radial-gradient(ellipse 35% 25% at 75% 70%, rgba(255, 255, 255, 0.05), transparent 70%);
    padding: 56px 48px 48px;
}

.tray {
    margin: 0 6px;
    height: 20px;
    background: var(--tray);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 48px;
}

.tray span {
    margin-top: -7px;
    height: 11px;
    border-radius: 6px;
}

.tray .chalk-white { width: 54px; background: var(--chalk); }
.tray .chalk-yellow { width: 38px; background: var(--chalk-yellow); }
.tray .chalk-pink { width: 44px; background: var(--chalk-pink); }

.tray .eraser {
    margin-top: -12px;
    width: 90px;
    height: 18px;
    border-radius: 4px;
    background: #3a2a20;
    border-top: 6px solid #c9b79a;
}

/* ---------- Home hero ---------- */

.hero {
    padding-top: 24px;
}

.hero .board {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.hero-text {
    flex: 999 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.hero-kicker {
    font-family: var(--font-chalk);
    font-size: 28px;
    color: var(--chalk-yellow);
}

.hero h1 {
    margin: 0;
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 104px;
    line-height: 0.92;
    letter-spacing: -0.01em;
}

.hero h1 span {
    display: block;
}

.hero h1 .line-2 {
    color: var(--chalk-yellow);
    padding-left: 48px;
}

.hero h1 .line-3 {
    color: var(--chalk-pink);
    padding-left: 96px;
}

.hero-lead {
    margin: 0;
    max-width: 560px;
    font-size: 20px;
    color: var(--chalk-dim);
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.facts li {
    border: 2px solid rgba(244, 239, 225, 0.7);
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 800;
}

.hero-note {
    flex: 1 1 300px;
    display: flex;
    justify-content: center;
}

/* ---------- Paper note with tape ---------- */

.note {
    position: relative;
    width: 300px;
    max-width: 100%;
    color: var(--ink);
    padding: 34px 28px 28px;
    transform: rotate(2.5deg);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
    background-color: var(--paper-card);
    background-image: repeating-linear-gradient(var(--paper-card) 0 33px, var(--paper-line) 33px 34px);
}

.note h2 {
    margin: 0 0 8px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 26px;
    color: var(--red);
}

.note .handwritten {
    margin: 0;
    font-family: var(--font-chalk);
    font-size: 30px;
    line-height: 34px;
}

.note p {
    margin: 16px 0 0;
    font-size: 15px;
}

.tape {
    position: absolute;
    top: -14px;
    left: 50%;
    width: 110px;
    height: 28px;
    margin-left: -55px;
    background: rgba(241, 215, 122, 0.75);
    transform: rotate(-3deg);
}

/* ---------- Torn paper edges ---------- */

.torn {
    display: block;
    height: 34px;
    background: var(--paper);
}

/* Overlap the next or previous section by 1px, so no thin line shows between them. */
.torn--top {
    margin-bottom: -1px;
}

.torn--bottom {
    margin-top: -1px;
}

.torn--paper-2 {
    background: var(--paper-2);
}

.torn--top {
    margin-top: 96px;
    clip-path: polygon(0 60%, 3% 30%, 6% 55%, 9% 20%, 13% 50%, 16% 25%, 20% 60%, 24% 30%, 27% 55%, 31% 15%, 35% 50%, 38% 35%, 42% 65%, 46% 25%, 50% 55%, 53% 30%, 57% 60%, 61% 20%, 64% 50%, 68% 35%, 72% 65%, 75% 25%, 79% 55%, 83% 30%, 86% 60%, 90% 20%, 93% 50%, 97% 30%, 100% 55%, 100% 100%, 0 100%);
}

.torn--top.torn--flush {
    margin-top: 0;
}

.torn--top.torn--near {
    margin-top: 56px;
}

.torn--bottom {
    clip-path: polygon(0 0, 100% 0, 100% 45%, 96% 75%, 92% 40%, 88% 70%, 85% 35%, 81% 80%, 77% 45%, 73% 70%, 70% 30%, 66% 75%, 62% 40%, 58% 65%, 55% 35%, 51% 80%, 47% 45%, 43% 70%, 40% 30%, 36% 75%, 32% 45%, 28% 65%, 25% 35%, 21% 80%, 17% 40%, 13% 70%, 10% 35%, 6% 75%, 3% 45%, 0 70%);
}

/* ---------- Paper sections ---------- */

.paper {
    background: var(--paper);
    color: var(--ink);
    padding: 56px 0 88px;
}

.paper--2 {
    background: var(--paper-2);
}

.paper a {
    color: var(--red);
}

.paper a:hover {
    color: var(--red-dark);
}

.link-strong {
    font-weight: 800;
    text-decoration: none;
}

.link-strong:hover {
    text-decoration: underline;
}

.section-title {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 52px;
    line-height: 1.05;
}

.section-title--small {
    font-size: 36px;
}

.highlight {
    background: linear-gradient(transparent 55%, var(--chalk-yellow) 55%);
    padding: 0 4px;
    white-space: nowrap;
}

.board-section {
    padding: 80px 24px 96px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.board-section__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.chalk-aside {
    font-family: var(--font-chalk);
    font-size: 28px;
    color: var(--chalk-yellow);
}

.split {
    display: flex;
    flex-wrap: wrap;
    gap: 56px;
}

.split > * {
    flex: 1 1 400px;
    min-width: 0;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- News ---------- */

.news {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: flex-start;
}

.news-text {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-text p {
    margin: 0;
}

.news-title {
    font-weight: 800;
    font-size: 20px;
}

/* ---------- Polaroids ---------- */

.polaroid {
    display: block;
    margin: 0;
    background: #fff;
    padding: 12px 12px 16px;
    box-shadow: 0 10px 24px rgba(34, 48, 43, 0.18);
    color: var(--ink);
    text-decoration: none;
}

.polaroid img {
    display: block;
    width: 100%;
    object-fit: cover;
}

.polaroid figcaption,
.polaroid .caption {
    display: block;
    margin-top: 10px;
    font-family: var(--font-chalk);
    font-size: 24px;
    text-align: center;
}

.polaroid--flyer {
    width: 240px;
    transform: rotate(-2deg);
}

.polaroid--flyer img {
    height: 320px;
    object-position: top;
}

.paper .polaroid,
.paper .polaroid:hover {
    color: var(--ink);
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
}

.gallery .polaroid {
    flex: 1 1 240px;
    max-width: 280px;
}

.gallery .polaroid img {
    height: 200px;
}

.gallery .polaroid:nth-child(4n+1) { transform: rotate(-2deg); }
.gallery .polaroid:nth-child(4n+2) { transform: rotate(1.5deg) translateY(14px); }
.gallery .polaroid:nth-child(4n+3) { transform: rotate(-1deg); }
.gallery .polaroid:nth-child(4n+4) { transform: rotate(2deg) translateY(8px); }

.gallery .polaroid:hover {
    transform: rotate(0) scale(1.02);
}

/* ---------- Event list ---------- */

.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 2px solid var(--ink);
}

.event-list li {
    display: flex;
    gap: 20px;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px dashed #9aa6a0;
}

.event-date {
    flex: 0 0 120px;
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.1;
    color: var(--red);
}

.event-list--wide .event-date {
    flex-basis: 230px;
    font-size: 26px;
}

.event-month {
    margin: 48px 0 8px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 30px;
}

.event-month:first-child {
    margin-top: 0;
}

.event-past {
    color: var(--ink-muted);
}

.event-past .event-date {
    color: var(--ink-muted);
}

.event-past .event-title {
    text-decoration: line-through;
    text-decoration-color: rgba(77, 90, 85, 0.6);
}

/* ---------- Index cards ---------- */

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.index-card {
    flex: 1 1 250px;
    min-width: 0;
    color: var(--ink);
    padding: 22px 22px 26px;
    border-top: 4px solid #d0283a;
    background-color: var(--paper-card);
    background-image: repeating-linear-gradient(var(--paper-card) 0 29px, var(--paper-line) 29px 30px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.paper .index-card {
    box-shadow: 0 8px 18px rgba(34, 48, 43, 0.16);
}

.cards .index-card:nth-child(4n+1) { transform: rotate(-1deg); }
.cards .index-card:nth-child(4n+2) { transform: rotate(0.8deg); }
.cards .index-card:nth-child(4n+3) { transform: rotate(-0.6deg); }
.cards .index-card:nth-child(4n+4) { transform: rotate(1.2deg); }

.index-card h3 {
    margin: 0 0 6px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 26px;
    line-height: 1.2;
}

.index-card p {
    margin: 0;
    font-size: 16px;
    line-height: 30px;
}

.board-text {
    margin: 0;
    color: var(--chalk-dim);
}

.board-text a {
    font-weight: 800;
}

/* ---------- Inner page header ---------- */

.page-head {
    padding-top: 16px;
}

.page-head .board {
    padding: 44px 48px 40px;
}

.page-head h1 {
    margin: 0;
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 76px;
    line-height: 1;
}

.page-head p {
    margin: 12px 0 0;
    max-width: 720px;
    font-size: 19px;
    color: var(--chalk-dim);
}

.page-head .kicker {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-chalk);
    font-size: 28px;
    color: var(--chalk-yellow);
}

.paper-text {
    max-width: 760px;
}

.paper-text p {
    margin: 0 0 14px;
}

/* ---------- Schedule ---------- */

.months {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.month {
    background: var(--paper-card);
    border: 1px solid #ded2b6;
    border-top: 4px solid #d0283a;
    padding: 18px 20px 22px;
    box-shadow: 0 6px 14px rgba(34, 48, 43, 0.12);
}

.month h2 {
    margin: 0 0 14px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 26px;
}

.days {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.day {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
}

.day--regular {
    background: var(--board-light);
    color: var(--chalk);
}

.day--theme {
    background: var(--chalk-yellow);
    color: var(--ink);
    box-shadow: inset 0 0 0 3px var(--board-light);
}

.day--off {
    color: var(--ink-muted);
    border: 2px dashed #a9b3ae;
    text-decoration: line-through;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
}

.legend li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.legend .day {
    width: 36px;
    height: 36px;
    font-size: 20px;
}

/* ---------- Books ---------- */

.price-card {
    max-width: 560px;
    flex: 1 1 360px;
    background-image: none;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
}

.price-table th {
    text-align: left;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 20px;
    padding: 0 0 10px;
    border-bottom: 2px solid var(--ink);
}

.price-table th:last-child,
.price-table td:last-child {
    text-align: right;
}

.price-table td {
    padding: 0;
    height: 40px;
    border-bottom: 1px dashed #9aa6a0;
}

.price-table td:last-child {
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 28px;
    color: var(--red);
}

/* ---------- Staff ---------- */

.director {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 32px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 2px dashed rgba(244, 239, 225, 0.4);
}

.director-text {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 32px;
}

.director strong {
    font-family: var(--font-chalk);
    font-size: 34px;
    font-weight: 700;
}

.director a {
    font-weight: 700;
}

.cards--teachers .index-card {
    flex-basis: 320px;
}

/* Teacher photos (SHOW_TEACHER_PHOTOS=true): a small taped polaroid on the card. */
.cards--photos .index-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.teacher-text {
    flex: 1 1 auto;
    min-width: 0;
}

.teacher-photo {
    flex: 0 0 auto;
    display: block;
    width: 92px;
    height: 112px;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 6px 14px rgba(34, 48, 43, 0.22);
    transform: rotate(-3deg);
    background: var(--board-light);
}

.cards--photos .index-card:nth-child(even) .teacher-photo {
    transform: rotate(2.5deg);
}

.cards--photos .teacher-contact {
    font-size: 15px;
}

.teacher-photo--director {
    width: 76px;
    height: 92px;
    border-width: 4px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.teacher-grade {
    display: block;
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 30px;
    line-height: 1.1;
    color: var(--red);
}

.teacher-contact {
    display: flex;
    flex-direction: column;
    margin-top: 2px;
    font-size: 16px;
    line-height: 30px;
}

.teacher-contact a {
    overflow-wrap: anywhere;
}

/* ---------- Contact ---------- */

.contact-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    justify-content: center;
    padding-top: 20px;
}

.contact-notes .note {
    width: 340px;
}

.contact-notes .note:nth-child(2) {
    transform: rotate(-2deg);
}

.note address {
    font-style: normal;
    font-size: 18px;
    line-height: 34px;
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--footer);
    color: #fff6f0;
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    padding-top: 56px;
    padding-bottom: 56px;
}

.site-footer a {
    color: #fff6f0;
}

.site-footer a:hover {
    color: #ffe3a3;
}

.footer-brand {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-brand strong {
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 38px;
    line-height: 1;
}

.site-footer address {
    flex: 1 1 220px;
    font-style: normal;
    font-size: 16px;
    line-height: 1.6;
}

/* ---------- Design system page (/styleguide) ---------- */

.sg-page {
    flex: 1 0 auto;
    background: var(--paper);
    color: var(--ink);
    padding: 48px 0 96px;
}

.sg-page code,
.sg-code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 14px;
}

.sg-page :not(pre) > code {
    background: rgba(34, 48, 43, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
}

.sg-toc {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.sg-toc-title {
    margin: 8px 0 0;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.sg-toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sg-toc a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #cdbf9f;
    border-radius: 999px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    background: var(--paper-card);
}

.sg-toc a:hover {
    border-color: var(--red);
    color: var(--red);
}

.sg-section {
    padding: 48px 0 8px;
    border-top: 2px solid var(--ink);
    margin-top: 40px;
    scroll-margin-top: 16px;
}

.sg-about {
    max-width: 760px;
    margin: 10px 0 6px;
}

.sg-classes {
    margin: 0 0 16px;
    font-size: 15px;
    color: var(--ink-muted);
}

.sg-page a {
    color: var(--red);
}

.sg-stage {
    border-radius: 8px;
    padding: 32px;
    margin: 0 0 12px;
}

.sg-stage.paper {
    padding: 32px;
    border: 1px dashed #c9b996;
}

.sg-stage--board {
    color: var(--chalk);
    background-color: var(--board);
    background-image: radial-gradient(ellipse 60% 50% at 20% 20%, rgba(255, 255, 255, 0.06), transparent 70%);
}

.sg-stage--board a {
    color: var(--chalk);
}

.sg-stage--board a.btn-chalk {
    color: var(--chalk-yellow);
}

.sg-stage--bleed {
    padding: 0;
    overflow: hidden;
    background: var(--board);
}

.sg-stage .note {
    margin: 12px auto;
}

.sg-mini-board,
.sg-mini-paper {
    padding: 24px 32px;
    font-weight: 700;
}

.sg-mini-board {
    color: var(--chalk);
    background: var(--board);
}

.sg-mini-paper {
    color: var(--ink);
    background: var(--paper);
}

.sg-mini-paper--2 {
    background: var(--paper-2);
}

.sg-details summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
    font-weight: 800;
    color: var(--red);
}

.sg-file {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--ink-muted);
}

.sg-code {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    border-radius: 8px;
    background: #1c2a25;
    color: var(--chalk);
    line-height: 1.55;
    white-space: pre;
}

.sg-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.sg-swatch {
    overflow: hidden;
    border: 1px solid #ded2b6;
    border-radius: 8px;
    background: #fffdf7;
}

.sg-swatch-color {
    height: 72px;
    border-bottom: 1px solid #ded2b6;
}

.sg-swatch-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px 14px;
    font-size: 14px;
    line-height: 1.45;
}

.sg-hex {
    color: var(--ink-muted);
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.sg-font-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
    align-items: baseline;
    padding: 20px 0;
    border-bottom: 1px dashed #9aa6a0;
}

.sg-font-meta {
    flex: 0 1 300px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 15px;
}

.sg-font-row p {
    flex: 1 1 320px;
    margin: 0;
}

.sg-font-chalk {
    font-family: var(--font-chalk);
    font-weight: 700;
    font-size: 40px;
    line-height: 1.1;
}

.sg-font-serif {
    font-family: var(--font-serif);
    font-size: 32px;
    line-height: 1.2;
}

.sg-font-sans {
    font-family: var(--font-sans);
    font-size: 20px;
}

.sg-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 56px;
}

.sg-defs {
    flex: 1 1 380px;
    margin: 16px 0 0;
}

.sg-defs dt {
    margin-top: 14px;
    font-weight: 800;
}

.sg-defs dd {
    margin: 2px 0 0;
}

.sg-rules {
    max-width: 760px;
    margin: 16px 0 0;
    padding-left: 22px;
}

.sg-rules li {
    margin: 8px 0;
}

@media (max-width: 720px) {
    .sg-stage,
    .sg-stage.paper {
        padding: 20px 16px;
    }

    .sg-stage--bleed {
        padding: 0;
    }

    .sg-font-chalk {
        font-size: 32px;
    }

    .sg-font-serif {
        font-size: 26px;
    }
}

/* ---------- Phone menu ---------- */

.nav-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px;
    border: 2px solid rgba(244, 239, 225, 0.7);
    border-radius: 999px;
    background: transparent;
    color: var(--chalk);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    border-color: var(--chalk-yellow);
    color: var(--chalk-yellow);
}

.nav-toggle-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 18px;
}

.nav-toggle-bars span {
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

/* Tablets and phones: the menu button shows the navigation as a list.
   Without JavaScript the navigation stays visible. */
@media (max-width: 900px) {
    .js .nav-toggle {
        display: inline-flex;
    }

    .js .nav {
        display: none;
    }

    .js .site-header.is-open .nav {
        display: flex;
    }

    .nav {
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0 4px;
        border-top: 2px dashed rgba(244, 239, 225, 0.35);
    }

    .nav a {
        padding: 12px 4px;
        font-size: 18px;
        border-bottom: 1px dashed rgba(244, 239, 225, 0.2);
    }

    .nav a.active {
        border-bottom: 1px dashed rgba(244, 239, 225, 0.2);
        color: var(--chalk-yellow);
    }

    .nav a.btn-chalk {
        justify-content: center;
        margin-top: 14px;
        border-bottom: 2px dashed var(--chalk-yellow);
    }
}

/* ---------- Language switch ---------- */

/* PL | EN at the end of the menu. The current language has a chalk circle. */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav .lang-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--chalk);
    opacity: 0.75;
}

.nav .lang-switch a:hover {
    color: var(--chalk-yellow);
    opacity: 1;
}

.nav .lang-switch a.active {
    border-color: rgba(244, 239, 225, 0.7);
    opacity: 1;
}

@media (max-width: 900px) {
    .lang-switch {
        justify-content: center;
        gap: 12px;
        margin-top: 14px;
    }

    .nav .lang-switch a,
    .nav .lang-switch a.active {
        padding: 0 16px;
        font-size: 16px;
        border-bottom-style: solid;
    }

    .nav .lang-switch a:not(.active) {
        border-bottom-color: transparent;
    }

    .nav .lang-switch a.active {
        border-bottom-color: rgba(244, 239, 225, 0.7);
        color: var(--chalk);
    }
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
    body {
        font-size: 16px;
    }

    main {
        overflow-x: clip;
    }

    .wrap {
        padding-left: 16px;
        padding-right: 16px;
    }

    .site-header {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .brand {
        gap: 10px;
    }

    .brand-name {
        font-size: 26px;
    }

    .brand-sub-en {
        display: none;
    }

    .board {
        border-width: 12px;
        padding: 28px 20px 26px;
    }

    .hero .board {
        gap: 32px;
    }

    .page-head .board {
        padding: 26px 20px 24px;
    }

    .tray {
        padding: 0 20px;
    }

    .hero-kicker,
    .page-head .kicker {
        font-size: 24px;
    }

    .hero h1 {
        font-size: clamp(40px, 12vw, 64px);
    }

    .hero h1 .line-2 {
        padding-left: 0.4em;
    }

    .hero h1 .line-3 {
        padding-left: 0.6em;
        white-space: nowrap;
    }

    .hero-lead {
        font-size: 17px;
    }

    .facts {
        gap: 10px;
    }

    .facts li {
        padding: 8px 12px;
        font-size: 15px;
    }

    .note {
        transform: rotate(1.5deg);
    }

    .page-head h1 {
        font-size: 50px;
    }

    .page-head p {
        font-size: 17px;
    }

    .section-title {
        font-size: 36px;
    }

    .section-title--small {
        font-size: 30px;
    }

    .torn {
        height: 24px;
    }

    .torn--top {
        margin-top: 56px;
    }

    .torn--top.torn--near {
        margin-top: 40px;
    }

    .paper {
        padding: 36px 0 56px;
    }

    .split {
        gap: 48px;
    }

    .board-section {
        padding-top: 48px;
        padding-bottom: 56px;
        gap: 28px;
    }

    .event-list li {
        flex-direction: column;
        gap: 2px;
    }

    .event-date,
    .event-list--wide .event-date {
        flex-basis: auto;
    }

    .event-month {
        margin-top: 36px;
    }

    .news {
        justify-content: center;
    }

    .polaroid--flyer {
        width: 100%;
        max-width: 280px;
    }

    /* Smaller tilt, so that full-width cards stay inside the screen. */
    .cards .index-card:nth-child(odd) { transform: rotate(-0.5deg); }
    .cards .index-card:nth-child(even) { transform: rotate(0.5deg); }

    .gallery {
        gap: 16px;
    }

    .gallery .polaroid {
        flex: 1 1 140px;
        max-width: none;
        padding: 8px 8px 10px;
    }

    .gallery .polaroid img {
        height: 120px;
    }

    .gallery .polaroid .caption {
        font-size: 19px;
        margin-top: 6px;
    }

    .gallery .polaroid:nth-child(odd) { transform: rotate(-1deg); }
    .gallery .polaroid:nth-child(even) { transform: rotate(1deg); }

    .months {
        grid-template-columns: minmax(0, 1fr);
    }

    .teacher-photo {
        width: 80px;
        height: 98px;
    }

    .director {
        flex-wrap: nowrap;
        gap: 18px;
    }

    .director-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .director strong {
        font-size: 30px;
    }

    .cards--photos .index-card {
        gap: 14px;
    }

    .contact-notes {
        gap: 40px;
    }

    .contact-notes .note {
        width: 100%;
        max-width: 340px;
    }

    .site-footer .wrap {
        gap: 28px;
        padding-top: 44px;
        padding-bottom: 44px;
    }

    .footer-brand strong {
        font-size: 32px;
    }
}

/* Small phones: the menu button shows only its icon, so it fits next to the name. */
@media (max-width: 440px) {
    .site-header {
        flex-wrap: nowrap;
        gap: 12px;
    }

    .js .site-header.is-open {
        flex-wrap: wrap;
    }

    .brand-name {
        font-size: 24px;
    }

    .nav-toggle {
        flex: 0 0 auto;
        width: 44px;
        padding: 0;
        justify-content: center;
    }

    .nav-toggle-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .gallery .polaroid {
        transition: transform 0.2s ease;
    }
}
