/* ==========================================================================
   Special Activities & Events
   Sampled from the template at its 1920px design width. This section runs on a
   wider container than Rooms (1844px vs 1640px) — that is what the template
   draws, so it lives in its own token rather than being quietly normalised.
   ========================================================================== */

.events {
    background-color: var(--bb-black);
}

.events__inner {
    width: 100%;
    max-width: calc(var(--bb-container-wide) + var(--bb-gutter) * 2);
    margin-inline: auto;
    padding: clamp(2.25rem, 3vw, 3.75rem) var(--bb-gutter) clamp(2rem, 2.6vw, 3.25rem);
}

/* The events heading is set larger than the one on Rooms (69px vs 49px). */
.section-head--lg .section-head__title {
    font-size: clamp(1.875rem, 3.6vw, 4.3125rem);
}

.events__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(0.75rem, 0.9vw, 1.0625rem);
    margin-top: clamp(1.5rem, 2.2vw, 2.75rem);
}

@media (min-width: 560px) {
    .events__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .events__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .events__grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* --- Card ---------------------------------------------------------------- */

.event-card {
    display: flex;
}

.event-card__link {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--bb-rule-faint);
    border-radius: 6px;
    background-color: var(--bb-surface);
    transition: border-color var(--bb-dur) var(--bb-ease),
        transform var(--bb-dur) var(--bb-ease);
}

.event-card__link:hover {
    border-color: var(--bb-rule);
    transform: translateY(-2px);
}

.event-card__media {
    display: block;
}

.event-card__media img {
    width: 100%;
    aspect-ratio: 355 / 433;
    object-fit: cover;
    transition: transform 600ms var(--bb-ease);
}

.event-card__link:hover .event-card__media img {
    transform: scale(1.04);
}

/* A little extra veil so the caption keeps its contrast on every photo. */
.event-card__link::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 55%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.9));
    pointer-events: none;
}

/* --- Date badge ---------------------------------------------------------- */

.event-card__date {
    position: absolute;
    top: 7.6%;
    left: 6.2%;
    z-index: 1;
    display: grid;
    justify-items: center;
    min-width: 22%;
    padding: clamp(0.35rem, 0.6vw, 0.7rem) clamp(0.4rem, 0.7vw, 0.85rem);
    border: 1px solid var(--bb-rule-faint);
    border-radius: 5px;
    background-color: rgba(10, 7, 4, 0.88);
}

.event-card__month {
    color: var(--bb-gold-400);
    font-size: clamp(0.625rem, 0.78vw, 0.9375rem);
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.event-card__day {
    color: var(--bb-text);
    font-size: clamp(1.25rem, 1.8vw, 2.125rem);
    font-weight: 600;
    line-height: 1.15;
}

/* --- Caption ------------------------------------------------------------- */

.event-card__body {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    padding: clamp(0.9rem, 1.25vw, 1.5rem);
}

.event-card__title {
    color: var(--bb-gold-400);
    font-family: var(--bb-font-sans);
    font-size: clamp(0.9375rem, 1.15vw, 1.375rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: uppercase;
}

.event-card__sub {
    margin-top: clamp(0.3rem, 0.5vw, 0.6rem);
    color: var(--bb-text-muted);
    font-size: clamp(0.8125rem, 0.94vw, 1.0625rem);
    line-height: 1.35;
}

/* --- Footnote ------------------------------------------------------------ */

.events__note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: clamp(1.5rem, 2.5vw, 3rem);
    color: var(--bb-text-muted);
    font-size: clamp(0.8125rem, 0.94vw, 1.0625rem);
    text-align: center;
}

.events__note::before,
.events__note::after {
    content: "";
    flex: 1;
    height: 1px;
    max-width: 34rem;
    background: linear-gradient(90deg, transparent, var(--bb-gold-700));
}

.events__note::after {
    background: linear-gradient(90deg, var(--bb-gold-700), transparent);
}

.events__note-icon {
    flex: none;
    width: 1.35em;
    height: 1.35em;
    color: var(--bb-gold-500);
}

@media (max-width: 700px) {
    .events__note::before,
    .events__note::after {
        display: none;
    }
}

/* ==========================================================================
   /events — special-events calendar, the guide to the regular nights and
   the detail card. Hero, heads and closing band come from facilities.css.
   ========================================================================== */

.events-page > .container {
    padding-bottom: clamp(4rem, 8vw, 7.5rem);
}

.events-page .fx-hero__inner .btn {
    margin-top: 2rem;
}

.events-page__featured {
    margin-top: clamp(2.25rem, 4vw, 3.5rem);
}

/* --- Category colours ------------------------------------------------------
   One hook per CalendarEvent::CATEGORIES key, three values each, all
   checked against WCAG AA (4.5:1 for text):
     --cat       the solid fill of an entry (and bars, dots); at least 3:1
                 against both the black page and the light calendar card
     --cat-fg    text on that fill — dark on the light fills, white on the
                 deep ones (4.5:1 to 10:1)
     --cat-text  a light tint for coloured text on the black page (7.6:1+) */

.cal-cat--party   { --cat: #b8862b; --cat-fg: #140d02; --cat-text: #f0c766; }
.cal-cat--contest { --cat: #c42a40; --cat-fg: #ffffff; --cat-text: #ff7a8a; }
.cal-cat--show    { --cat: #7e4fd0; --cat-fg: #ffffff; --cat-text: #c4a2ff; }
.cal-cat--dance   { --cat: #0b7a6d; --cat-fg: #ffffff; --cat-text: #4fd8c4; }
.cal-cat--food    { --cat: #c4661c; --cat-fg: #140a02; --cat-text: #ffa868; }
.cal-cat--holiday { --cat: #2e6fd1; --cat-fg: #ffffff; --cat-text: #7fb3ff; }

/* --- Toolbar: month, navigation, filters ---------------------------------- */

.cal {
    scroll-margin-top: calc(var(--bb-logo-h-compact) + (var(--bb-header-pad) * 2));
}

.cal__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

.cal__month {
    color: var(--bb-text);
    font-family: var(--bb-font-serif);
    font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem);
    font-weight: 400;
    line-height: 1;
}

.cal__month span {
    color: var(--bb-gold-400);
}

.cal__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cal__navbtn,
.cal__today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    border: 1px solid var(--bb-hairline);
    border-radius: 999px;
    color: var(--bb-text);
    transition: border-color var(--bb-dur) var(--bb-ease), background-color var(--bb-dur) var(--bb-ease);
}

.cal__navbtn {
    width: 2.75rem;
}

.cal__navbtn svg {
    width: 1.1rem;
    height: 1.1rem;
    transform: rotate(180deg);
}

.cal__navbtn--next svg {
    transform: none;
}

.cal__today {
    padding-inline: 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: var(--bb-tracking-wider);
    text-transform: uppercase;
}

.cal__today.is-current {
    border-color: var(--bb-gold-500);
    color: var(--bb-gold-300);
}

.cal__navbtn:hover,
.cal__today:hover {
    border-color: var(--bb-gold-400);
    background-color: rgba(192, 141, 48, 0.08);
}

.cal__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.cal__filters[hidden] {
    display: none;
}

.cal__filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--bb-rule-faint);
    border-radius: 999px;
    background: none;
    color: var(--bb-text-dim);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: color var(--bb-dur) var(--bb-ease), border-color var(--bb-dur) var(--bb-ease),
        background-color var(--bb-dur) var(--bb-ease);
}

.cal__filter:hover {
    color: var(--bb-text);
}

.cal__filter.is-on {
    border-color: var(--cat-text, var(--bb-gold-500));
    background-color: color-mix(in srgb, var(--cat, var(--bb-gold-500)) 16%, transparent);
    color: var(--bb-text);
}

.cal__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background-color: var(--cat);
}

/* --- Month grid ------------------------------------------------------------
   A light parchment card on the black page (19.5:1 against it), so the
   month reads at a glance; the brand cream the request form uses. Every
   pairing below is checked against WCAG AA:
     day numbers #2b2113 on the cells           14.7:1
     out-of-month numbers #665a42 on #efe6d3     5.5:1
     weekday names on the ink header bar        10.7:1
     past entries #463f33 on #e6dece             7.8:1  */

.cal__grid {
    margin-top: 1.25rem;
    overflow: hidden;
    border: 1px solid var(--bb-gold-700);
    border-radius: 8px;
    background-color: #fbf6ec;
    box-shadow: var(--bb-shadow-lg);
}

.cal__week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal__week + .cal__week {
    border-top: 1px solid rgba(109, 76, 25, 0.18);
}

.cal__week--head {
    background-color: #1a140c;
}

.cal__dow {
    padding: 0.85rem 0.5rem;
    color: var(--bb-gold-300);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--bb-tracking-wider);
    text-align: center;
    text-transform: uppercase;
}

.cal__day {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    min-height: clamp(9rem, 11vw, 11.5rem);
    padding: 0.5rem 0.5rem 0.75rem;
}

.cal__day + .cal__day {
    border-left: 1px solid rgba(109, 76, 25, 0.18);
}

.cal__date {
    align-self: flex-end;
    min-width: 1.85rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    color: #2b2113;
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.cal__day.is-outside {
    background-color: #efe6d3;
}

.cal__day.is-outside .cal__date {
    color: #665a42;
    font-weight: 500;
}

/* Past entries go muted rather than translucent, so they stay readable
   while clearly done; the category stays as a thin edge. */
.cal__day.is-past .cal-chip {
    background-color: #e6dece;
    box-shadow: inset 3px 0 0 var(--cat);
    color: #463f33;
}

.cal__day.is-today {
    background-color: #fff3d1;
    box-shadow: inset 0 0 0 2px var(--bb-gold-500);
}

.cal__day.is-today .cal__date {
    background-color: var(--bb-red-500);
    color: #ffffff;
    font-weight: 700;
}

/* --- Entries --------------------------------------------------------------- */

.cal-chip {
    display: block;
    width: 100%;
    padding: 0.4rem 0.6rem;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background-color: var(--cat);
    color: var(--cat-fg);
    font: inherit;
    font-size: clamp(0.8125rem, 0.72rem + 0.22vw, 0.9375rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-align: left;
    overflow-wrap: break-word;
    cursor: pointer;
    transition: filter var(--bb-dur) var(--bb-ease), opacity var(--bb-dur) var(--bb-ease);
}

.cal-chip:hover,
.cal-chip:focus-visible {
    filter: brightness(1.12);
}

.cal-chip:focus-visible {
    outline: 2px solid var(--cat-text);
    outline-offset: 2px;
}

.cal-chip__time {
    font-weight: 700;
}

.cal-chip.is-dimmed,
.cal__day.is-past .cal-chip.is-dimmed {
    opacity: 0.14;
}

/* --- Agenda (phones) ------------------------------------------------------- */

.cal__agenda {
    display: none;
    margin-top: 1.25rem;
    padding: 0;
    list-style: none;
}

.cal__agenda-day {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    gap: 0.9rem;
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--bb-rule-faint);
}

.cal__agenda-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0.15rem;
}

.cal__agenda-dow {
    color: var(--bb-gold-400);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--bb-tracking-wider);
    text-transform: uppercase;
}

.cal__agenda-num {
    color: var(--bb-text);
    font-family: var(--bb-font-serif);
    font-size: 1.75rem;
    line-height: 1.1;
}

.cal__agenda-day.is-today .cal__agenda-num {
    color: var(--bb-gold-300);
}

.cal__agenda-list {
    display: grid;
    gap: 0.4rem;
}

.cal-chip--row {
    padding-block: 0.6rem;
    font-size: 0.9375rem;
    white-space: normal;
}

.cal__empty {
    padding: 2rem 0;
    color: var(--bb-text-dim);
    text-align: center;
}

.events-page .events__note {
    margin-top: 1.5rem;
}

@media (max-width: 760px) {
    .cal__grid {
        display: none;
    }

    .cal__agenda {
        display: block;
    }
}

/* --- Guide: the regular nights -------------------------------------------- */

.guide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
    gap: clamp(1rem, 1.6vw, 1.5rem);
    margin: clamp(2.25rem, 4vw, 3.5rem) 0 0;
    padding: 0;
    list-style: none;
}

.guide__card {
    position: relative;
    padding: clamp(1.4rem, 2vw, 1.85rem);
    border: 1px solid var(--bb-hairline-soft);
    border-radius: var(--bb-radius);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--cat) 9%, transparent), transparent 55%),
        var(--bb-surface-raised);
}

.guide__card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background-color: var(--cat);
}

.guide__name {
    color: var(--bb-text-warm);
    font-family: var(--bb-font-display);
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.1875rem);
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.3;
    text-transform: uppercase;
}

.guide__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin-top: 0.75rem;
    color: var(--cat-text);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.guide__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.guide__meta svg {
    width: 0.95rem;
    height: 0.95rem;
}

.guide__body {
    margin-top: 1rem;
    color: var(--bb-text-dim);
    font-size: clamp(0.875rem, 0.85rem + 0.15vw, 0.9688rem);
    line-height: 1.7;
}

/* --- Holiday specials: the flyers under the guide --------------------------- */

.specials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    align-items: center;
    gap: clamp(1rem, 1.6vw, 1.5rem);
    margin: clamp(2.25rem, 4vw, 3.5rem) 0 0;
    padding: 0;
    list-style: none;
}

.specials__item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: var(--bb-radius);
    background: none;
    cursor: zoom-in;
    transition: transform 0.25s ease;
}

.specials__item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--bb-radius);
}

.specials__item:hover,
.specials__item:focus-visible {
    transform: translateY(-3px);
}

.specials__item:focus-visible {
    outline: 2px solid var(--bb-gold-500);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .specials__item {
        transition: none;
    }
}

/* --- Detail card ----------------------------------------------------------- */

.cal-pop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
}

.cal-pop[hidden] {
    display: none;
}

.cal-pop__card {
    position: relative;
    width: min(30rem, 100%);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    padding: 2rem 1.75rem 1.75rem;
    border: 1px solid var(--bb-hairline);
    border-top: 4px solid var(--cat, var(--bb-gold-500));
    border-radius: 6px;
    background-color: var(--bb-surface-raised);
    box-shadow: var(--bb-shadow-lg);
}

.cal-pop__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--bb-rule-faint);
    border-radius: 999px;
    background: none;
    color: var(--bb-text);
    cursor: pointer;
}

.cal-pop__close svg {
    width: 1rem;
    height: 1rem;
}

.cal-pop__close:hover {
    border-color: var(--bb-gold-400);
}

.cal-pop__cat {
    color: var(--cat-text, var(--bb-gold-400));
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--bb-tracking-wider);
    text-transform: uppercase;
}

.cal-pop__title {
    margin-top: 0.5rem;
    padding-right: 2.5rem;
    color: var(--bb-text);
    font-family: var(--bb-font-serif);
    font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
    font-weight: 400;
    line-height: 1.15;
}

.cal-pop__facts {
    display: grid;
    gap: 0.6rem;
    margin: 1.25rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid var(--bb-rule-faint);
    list-style: none;
}

.cal-pop__facts li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--bb-text-muted);
    font-size: 0.9375rem;
}

.cal-pop__facts li[hidden],
.cal-pop__desc[hidden] {
    display: none;
}

.cal-pop__facts svg {
    flex: none;
    width: 1.05rem;
    height: 1.05rem;
    color: var(--cat-text, var(--bb-gold-400));
}

.cal-pop__desc {
    margin-top: 1.1rem;
    color: var(--bb-text-dim);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.cal-pop__cta {
    width: 100%;
    justify-content: center;
    margin-top: 1.5rem;
}

/* The light tint the focus ring uses elsewhere vanishes on the cream card. */
.cal__grid .cal-chip:focus-visible {
    outline-color: #2b2113;
}

/* In the narrow grid cells the time gets its own line, so the name keeps
   the full width instead of wrapping early. */
.cal__grid .cal-chip__time {
    display: block;
    font-size: 0.9em;
    opacity: 0.9;
}
