/* ============================================================
   KARTUL — events page
   Loads AFTER style.css (shares fonts, colours, nav, lang switch).
   ============================================================ */

:root {
    /* ========== TUNE HERE — events page only ====================== */
    --ev-size: 40px;
    --ev-fill: #ffe100;
    --ev-stroke: #e5001c;
    --ev-stroke-w: 1.5px;
    --ev-gap: 1em;

    --cal-w: 30vw;
    --cal-line: #ffe100;
    --cal-ink: #ffe100;
    --cal-bg-on-active: #000;
    --cal-size: 18px;
    --cal-border-w: 2px;
    --cal-event-bg: #339966;
    --cal-event-hover: #e5001c;
    --cal-text-stroke-w: 1.5px;

    /* ============================================================== */
}

/* Same horizontal chrome inset as Home (logo band aligns). */
.events-page {
    position: relative;
}

.events-stage {
    position: relative;
    z-index: 0;
    height: auto;
    padding-inline: var(--side-inset);
    padding-bottom: 24px;
    display: grid;
    grid-template-columns: var(--cal-w) 1fr;
    gap: 0 32px;
    align-items: start;
}

.events-banner {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: min(28rem, 100%);
    margin: 0 0 1.25rem;
    padding: 0.85em 1.1em;
    background: var(--ev-fill);
    color: var(--ev-stroke);
    border: var(--ev-stroke-w) solid var(--ev-stroke);
    box-shadow: 4px 4px 0 var(--ev-stroke);
    transform: rotate(-2.5deg);
    font-family: "Kommuna", "Courier New", monospace;
    font-size: clamp(14px, 2.2vw, 18px);
    font-weight: 700;
    line-height: 1.25;
    pointer-events: auto;
}

.events-banner p {
    margin: 0;
}

.events-stage::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--page-bg, url("../img/bg-kitchen.png")) center / cover no-repeat;
    pointer-events: none;
}

.cal {
    font-size: var(--cal-size);
    font-weight: 500;
    color: var(--cal-ink);
    -webkit-text-stroke: var(--cal-text-stroke-w) var(--ev-stroke);
    paint-order: stroke fill;
}
.cal-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    margin: 0 0 14px;
    padding: 0 6px;
}
.cal-label {
    text-align: center;
    letter-spacing: .04em;
}
.cal-nav {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font: inherit;
    color: inherit;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cal-nav:focus { outline: none; }
.cal-nav:hover,
.cal-nav:focus-visible { opacity: .6; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: var(--cal-border-w) solid var(--cal-line);
    border-left: var(--cal-border-w) solid var(--cal-line);
}

.cal-dow,
.cal-cell {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font: inherit;
    color: var(--cal-ink);
    text-align: center;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;

    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-right: var(--cal-border-w) solid var(--cal-line);
    border-bottom: var(--cal-border-w) solid var(--cal-line);
}
.cal-cell { cursor: default; }
.cal-cell:focus { outline: none; }

.cal-cell.is-outside { opacity: .45; }
.cal-cell[disabled]  { opacity: .75; }

.cal-cell.has-event {
    cursor: pointer;
    opacity: 1;
    background: var(--cal-event-bg);
}
.cal-cell.has-event:hover,
.cal-cell.has-event:focus-visible {
    background: var(--cal-event-hover);
    color: var(--cal-bg-on-active);
}
.cal-cell.is-active {
    background: var(--cal-event-hover);
    color: var(--cal-bg-on-active);
}

/* Desktop /events: sticky calendar; list grows — page scrolls like Home. */
@media (min-width: 781px) {
    .events-stage[data-cal-mode="month"] .cal {
        position: sticky;
        top: var(--stage-top);
        align-self: start;
    }
}

.events-stage[data-cal-mode="scroll"] .events-list {
    padding: 0 4px 40vh 0;
    height: auto;
    overflow: visible;
}

.events-list {
    list-style: none;
    margin: 0;
    padding: 0 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--ev-gap);
}

.events-list li {
    font-family: "Kommuna", "Courier New", monospace;
    font-size: var(--ev-size);
    font-weight: 600;
    line-height: 1.15;
    color: var(--ev-fill);
    -webkit-text-stroke: var(--ev-stroke-w) var(--ev-stroke);
    paint-order: stroke fill;
    scroll-margin-top: 8px;
}

.events-list li.is-cancelled,
.events-list li.is-cancelled a {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--ev-stroke);
}

.events-list-empty {
    font-family: "Kommuna", "Courier New", monospace;
    font-size: var(--ev-size);
    color: var(--ev-fill);
    -webkit-text-stroke: var(--ev-stroke-w) var(--ev-stroke);
    paint-order: stroke fill;
    opacity: 0.75;
    list-style: none;
}

.events-list a {
    color: inherit;
    text-decoration: none;
}
.events-list a:hover,
.events-list a:focus-visible {
    text-decoration: underline;
}

.event-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.event-images img {
    display: block;
    height: 120px;
    width: auto;
    max-width: 100%;
    object-fit: cover;
}

.event-title {
    font-family: "Kommuna", "Courier New", monospace;
    font-size: var(--ev-size);
    color: var(--ev-fill);
    -webkit-text-stroke: var(--ev-stroke-w) var(--ev-stroke);
    paint-order: stroke fill;
    margin: 0 0 .6em;
}

.event-title.is-cancelled {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--ev-stroke);
}

.event-stage .inline-img {
    transform: none;
}

.event-stage .inline-img img {
    display: block;
    width: 100%;
    height: var(--img-height);
    object-fit: cover;
}

@media (max-width: 780px) {
    :root { --ev-size: 20px; --cal-size: 13px; --cal-w: 100%; }

    .events-stage {
        grid-template-columns: 1fr;
        padding-inline: var(--side-inset-mobile);
        padding-bottom: 0;
    }

    .events-stage[data-cal-mode="month"] .cal {
        position: static;
    }

    .cal { margin-bottom: 28px; }

    .events-stage[data-cal-mode="month"] .events-list {
        max-height: none;
        overflow: visible;
    }

    .events-stage[data-cal-mode="scroll"] .events-list {
        height: auto;
        overflow: visible;
        padding-bottom: 0 !important;
    }

    .events-list li {
        scroll-margin-top: 16px;
    }
}
