/* 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 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-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;
}

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

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

    .wrap {
        padding: 0 16px;
    }

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

    .nav {
        gap: 2px 16px;
    }

    .board {
        border-width: 12px;
        padding: 32px 22px 28px;
    }

    .page-head .board {
        padding: 28px 22px 26px;
    }

    .tray {
        padding: 0 22px;
    }

    .hero h1 {
        font-size: 64px;
    }

    .hero h1 .line-2 {
        padding-left: 24px;
    }

    .hero h1 .line-3 {
        padding-left: 48px;
    }

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

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

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

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

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

    .paper {
        padding: 40px 0 64px;
    }

    .board-section {
        padding: 56px 16px 64px;
    }

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

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

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

    .gallery .polaroid {
        max-width: none;
    }
}

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