/* ============================
   AGENDA / CALENDAR (agenda.html)
   ============================ */

/* .calendar__container is a flex row, capped at a comfortable max-width
   and centered on the page (rather than spanning the full window) — so
   .agenda__main (calendar + day detail) isn't stranded hard against the
   browser's left edge on wide screens. "Belangrijkste data" is still
   pushed to the right edge of THIS block with margin-left: auto, which
   reads as "the right side of the page" without needing the block itself
   to stretch the full window width. */
.calendar__container {
    box-sizing: content-box;
    width: 100%;
    max-width: 128rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 3rem;
    padding: 4vh 5vw 8vh;
}

.main__container__agenda {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
}

.agenda__main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 3rem;
    flex: 1 1 60rem;
}

.calendar {
    width: 100%;
    flex: 1 1 40rem;
    max-width: 44rem;
    height: fit-content;
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 3px 0px, rgba(60, 64, 67, 0.15) 0px 2px 7px 2px;
    padding: 2.5rem;
    border-radius: 2.5rem;
    color: black;
    min-width: 0;
}

.calendar__info__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
}

.month {
    width: 100%;
    background-color: var(--rood);
    border-radius: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.8rem 2rem;
    text-align: center;
    color: white;
    margin-bottom: 1.4rem;
}

.angle__calendar {
    /* No icon font involved anymore (the <i> is empty) — the chevron below
       is drawn with plain CSS borders, which centers exactly since it's a
       symmetric shape with no font/glyph metrics to fight with. */
    cursor: pointer;
    color: var(--rood);
    background-color: white;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 3px 0px, rgba(60, 64, 67, 0.15) 0px 2px 7px 2px;
    transition: transform 150ms, background-color 150ms;
    flex-shrink: 0;
    position: relative;
}

.angle__calendar::before {
    content: "";
    display: block;
    width: 0.8rem;
    height: 0.8rem;
    border-style: solid;
    border-color: currentColor;
    border-width: 0 0.2rem 0.2rem 0;
    box-sizing: border-box;
}

.angle__calendar.prev::before {
    transform: rotate(135deg) translate(-0.1rem, -0.1rem);
}

.angle__calendar.next::before {
    transform: rotate(-45deg) translate(-0.1rem, -0.1rem);
}

.angle__calendar:hover {
    transform: scale(1.08);
    background-color: #fff;
}

.month h1 {
    font-size: 2.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15rem;
    margin-bottom: 0.3rem;
}

.month p,
.current__year {
    font-size: 1.3rem;
    opacity: 0.85;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
    padding: 0 0.4rem;
}

.weekdays div {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05rem;
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    color: #888;
}

/* Each day is now a small, fixed-size circle centered in its grid cell
   (via justify-items on .days) instead of a circle that fills the whole
   cell — smaller, calmer, and clearly "around the date" rather than "the
   whole tile". */
.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 0.6rem;
    column-gap: 0.2rem;
    width: 100%;
    padding: 0.4rem 0.2rem;
    justify-items: center;
}

/* Direct-child combinator (>) is deliberate: the event marker div that
   calendar.js nests inside each day cell is also a "div inside .days", so
   a plain descendant selector here would restyle it too (and — since it's
   more specific than a bare .event__on__day rule — defeat the display:none
   further down that's meant to hide it). */
.days > div {
    position: relative;
    width: 3.8rem;
    height: 3.8rem;
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-weight: 500;
    transition: background-color 150ms, color 150ms;
}

.days > div:hover:not(.today) {
    color: var(--rood);
    cursor: pointer;
    background-color: rgba(206, 40, 22, 0.08);
}

.prev-date,
.next-date {
    opacity: 0.3;
}

/* Past / future distinction for this month's real days. */
.days div.past-date {
    color: #b7b7b7;
}

.days div.future-date {
    color: #1a1a1a;
    font-weight: 600;
}

.today {
    background-color: var(--rood);
    color: white;
    font-weight: 700;
}

/* Days with an activity get a clear tinted, ringed fill via :has() —
   picking up the presence of the .event__on__day marker calendar.js
   already injects — instead of a small, easy-to-miss dot. Written after
   .past-date/.future-date so it wins on equal specificity and always
   shows through regardless of whether the day is past or future.

   Two flavors, picked by the marker's data-type (set in calendar.js from
   each entry's "type"): a real one-off "event" stays red; a
   "regular_sunday" (the weekly Chiro afternoon) gets the same treatment in
   green instead (a light tint + ring, distinct from today/selected's solid
   fill below), so at a glance the calendar reads "special thing happening"
   vs. "just the usual Sunday chiro" without needing to click into it. */
.days div:has(.event__on__day[data-type="event"]) {
    background-color: var(--rood-light);
    color: var(--rood);
    font-weight: 700;
    box-shadow: inset 0 0 0 2px var(--rood);
}

.days div:has(.event__on__day[data-type="event"]):hover {
    background-color: var(--rood);
    color: white;
}

.days div:has(.event__on__day[data-type="regular_sunday"]) {
    background-color: var(--groen-light);
    color: #14522f;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px var(--groen);
}

.days div:has(.event__on__day[data-type="regular_sunday"]):hover {
    background-color: var(--groen);
    color: white;
}

/* An event/regular-Sunday day that's already in the past stays recognizable
   but visibly muted, rather than as vivid as an upcoming one. Higher
   specificity than the plain :has() rules above (extra .past-date class),
   so it always wins regardless of source order. Matches on either type, so
   one rule covers both colors. */
.days div.past-date:has(.event__on__day) {
    opacity: 0.55;
}

/* Today's own red fill wins regardless of which type (if any) of activity
   is also on it — no need to split this one by type. */
.today:has(.event__on__day) {
    background-color: var(--rood);
    color: white;
    box-shadow: inset 0 0 0 2px white;
}

/* The currently selected day (see calendar.js selectDay) is simply
   retinted solid — no separate ring around the circle — so it reads as
   "this one" at a glance regardless of whether it's also today or an
   event day. Placed last so it wins over those on equal specificity. */
.days div.selected {
    background-color: var(--rood);
    color: white;
    font-weight: 700;
    /* !important: a selected day that's also a past event has higher
       specificity fighting it (.past-date:has(...) above), but selection
       should always render fully opaque, never faded. */
    opacity: 1 !important;
}

/* calendar.js still injects the day number again into this marker's
   innerHTML (used by :has() above to flag the cell) but it's no longer
   shown as a dot or duplicate number — the tinted ring on the cell itself
   is the indicator now. */
.event__on__day {
    display: none;
}

/* SIDEBAR CARDS
   calendar.js toggles which day's info the detail card shows by directly
   rewriting its text content on every click (see updateOverviewDay), so
   the card itself never needs to move, resize or be hidden — it always
   just holds whatever is currently selected. */
.day__overview {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1 1 28rem;
    max-width: 34rem;
    color: black;
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 3px 0px, rgba(60, 64, 67, 0.15) 0px 2px 7px 2px;
    border-radius: 2rem;
    padding: 2.4rem 2.2rem;
    font-size: 1.3rem;
    min-width: 0;
}

/* Pushed to the far right of .calendar__container by margin-left: auto
   (its parent is a flex row, not a centered group), and sized up — this
   card is meant to stand on its own on the right of the window, not read
   as a small appendix next to the calendar. */
.important-dates {
    border-top: 6px solid var(--rood);
    margin-left: auto;
    flex: 0 1 40rem;
    min-width: 30rem;
    max-width: 42rem;
    height: fit-content;
    padding: 3rem 2.8rem;
    font-size: 1.5rem;
}

.important-dates h2 {
    font-size: 2.3rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.important-dates__link {
    margin-top: 0.8rem;
    font-size: 1.4rem;
}

.upcoming__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    /* Smaller than the card's own 1.5rem — the event rows themselves
       should read quieter than the "Belangrijkste data" heading. */
    font-size: 1.2rem;
}

/* Grid instead of flex for each row: the date column has a fixed track
   width, so every title lines up at the same x regardless of how long
   ("Elke zo." vs "3 & 4 apr") the date text before it is. A border
   between rows (skipped on the last one) separates each event instead of
   relying on gap alone. */
.upcoming__list li {
    display: grid;
    grid-template-columns: 9rem 1fr;
    column-gap: 1rem;
    align-items: baseline;
    padding: 1.2rem 0;
    border-bottom: 1px solid #eee;
}

.upcoming__list li:first-child {
    padding-top: 0;
}

.upcoming__list li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.upcoming__list .upcoming__date {
    font-weight: 700;
    color: var(--rood);
    text-transform: capitalize;
    white-space: nowrap;
}

.upcoming__list .upcoming__title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.upcoming__empty {
    opacity: 0.7;
}

.day__overview__head__day h1 {
    font-size: 1.9rem;
    overflow-wrap: anywhere;
}

.date__overview__detail {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.date__overview__detail .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 20;
    font-size: 1.8rem;
    color: #999;
    flex-shrink: 0;
}

.calander__selected__date {
    overflow-wrap: anywhere;
}

.calandar__selected__hours {
    font-weight: 600;
    white-space: nowrap;
}

.day__overview hr {
    height: 1px;
    background-color: #eee;
    border: none;
    margin: 1.4rem 0;
    width: 100%;
}

/* The actual fix for text spilling outside the card: long, unbroken
   strings (like the URL in one of the event descriptions) now wrap
   inside the card instead of overflowing it. */
.description__day {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.6;
}

/* Below this width there isn't room for the calendar+detail group and the
   important-dates card in one row, so the container stacks them: the
   group first, important-dates on its own full-width row underneath
   (margin-left: auto has no effect once it's the only thing on its row). */
@media (max-width: 1200px) {
    .calendar__container {
        flex-direction: column;
        /* Switching to column changes what align-items: flex-start means
           (it now controls the horizontal axis), which would otherwise
           shrink .agenda__main to its content width and force an early,
           unwanted wrap between the calendar and the detail card. */
        align-items: stretch;
        max-width: 76rem;
    }

    .agenda__main {
        width: 100%;
    }

    .important-dates {
        /* Same fix as .agenda__main above: the base flex-basis (40rem) is
           meant for the side-by-side row and would otherwise set a 400px
           minimum HEIGHT once the container is a column, leaving a slab
           of empty space under the card's actual content. */
        flex: 0 1 auto;
        width: 100%;
        max-width: none;
    }
}

/* Below this width there isn't room for the calendar and the detail card
   side by side either, so those two stack as well. */
@media (max-width: 900px) {
    .calendar__container {
        max-width: 46rem;
        padding: 4vh 4vw 6vh;
    }

    .agenda__main {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar,
    .day__overview {
        /* flex-basis (set for the side-by-side row layout above 900px)
           would otherwise control height instead of width now that
           .agenda__main is a column, stretching these cards with blank
           space. Reset it explicitly for the stacked layout. */
        flex: 0 1 auto;
        width: 100%;
        max-width: 46rem;
    }
}

@media (max-width: 480px) {
    .calendar {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }

    .month {
        padding: 1.2rem 1rem;
    }

    .month h1 {
        font-size: 2.1rem;
    }

    .weekdays div {
        font-size: 1.15rem;
        padding: 0.6rem 0;
    }

    .days div {
        width: 3.2rem;
        height: 3.2rem;
        font-size: 1.2rem;
    }

    .day__overview,
    .important-dates {
        padding: 1.8rem 1.6rem;
        font-size: 1.15rem;
    }
}
