/* Theatre of the NO — Calendar panel (ticket 3) */

/* ---------------------------------------------------------------
 * 1. Calendar button in .no-menu — match existing link styles
 * ------------------------------------------------------------- */

.no-menu .totn-cal-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--no-white, #fff);
    font-weight: 600;
    letter-spacing: .04em;
    font-size: 18px;
    line-height: 1.2;
    font-family: inherit;
    padding: 12px 6px;
    display: block;
    border-radius: 6px;
    transition: color .2s ease;
}

.no-menu .totn-cal-toggle:hover,
.no-menu .totn-cal-toggle:focus-visible {
    color: var(--no-yellow, #EDD74A);
}

.no-menu .totn-cal-toggle[aria-expanded="true"] {
    color: var(--no-yellow, #EDD74A);
}

/* While Calendar is open, dim the current-page highlight on other links */
.no-menu.totn-cal-open .is-current {
    color: var(--no-white, #fff) !important;
}

/* While the calendar is open, dim the current-page highlight
   so only the Calendar button is yellow. Restore on close. */
.no-menu.totn-cal-open > li > a.is-current,
.no-menu.totn-cal-open > li > a[aria-current="page"],
.no-menu.totn-cal-open > li > a[aria-current="true"] {
    color: var(--no-white, #fff) !important;
}

@media (min-width: 980px) {
    .no-menu .totn-cal-toggle {
        padding: 8px 2px;
        font-size: 17px;
    }
}

/* ---------------------------------------------------------------
 * 2. Panel — anchored below the black header
 * ------------------------------------------------------------- */

.totn-cal-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 9998;
    display: none;
}

.totn-cal-panel:not([hidden]) {
    display: block;
}

.totn-cal-inner {
    max-width: 920px;
    margin: 8px auto 0;
    background: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
    padding: 24px;
    color: #fff;
}

/* ---------------------------------------------------------------
 * 3. Overlay header — title left, close right
 * ------------------------------------------------------------- */

.totn-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.totn-cal-heading {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------
 * 4. Close button
 * ------------------------------------------------------------- */

.totn-cal-close {
    background: none;
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s ease, color .2s ease;
    flex-shrink: 0;
}

.totn-cal-close:hover,
.totn-cal-close:focus-visible {
    border-color: #EDD74A;
    color: #EDD74A;
}

/* ---------------------------------------------------------------
 * 5. Body — two columns on desktop, stacked on mobile
 * ------------------------------------------------------------- */

.totn-cal-body {
    display: flex;
    gap: 24px;
    min-height: 120px;
}

.totn-cal-grid-wrap {
    flex: 1 1 50%;
    min-width: 0;
}

.totn-cal-preview {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.totn-cal-preview.has-card {
    align-items: stretch;
    justify-content: flex-start;
}

.totn-cal-placeholder {
    color: rgba(255, 255, 255, .4);
    font-size: 15px;
    margin: 0;
}

/* ---------------------------------------------------------------
 * 6. Focus ring — match the existing header
 * ------------------------------------------------------------- */

.totn-cal-panel :focus-visible,
.totn-cal-home :focus-visible {
    outline: 2px dashed #EDD74A;
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
 * 6b. Homepage calendar — under Playing Right Now
 * ------------------------------------------------------------- */

.totn-cal-home:not(.is-placed) {
    display: none;
}

.totn-cal-home.is-placed {
    display: block;
    width: 80%;
    max-width: 1400px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 24px 0 40px;
    background: transparent;
    color: #fff;
}

.totn-cal-home-inner {
    padding: 32px 28px;
    background: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

@media (max-width: 979px) {
    .totn-cal-home.is-placed {
        width: calc(100% - 32px);
        padding: 16px 0 32px;
    }

    .totn-cal-home-inner {
        padding: 20px 16px 24px;
    }

    .totn-cal-home .totn-cal-body {
        flex-direction: column;
        gap: 20px;
    }

    .totn-cal-home .totn-cal-see {
        width: 100%;
    }
}

/* ---------------------------------------------------------------
 * 7. Mobile (<980px) — sheet under the header (ticket 6)
 * ------------------------------------------------------------- */

html.totn-cal-lock,
html.totn-cal-lock body {
    overflow: hidden;
}

/* Complianz sits above the sheet (header stacking context). Hide it only
   while Calendar is open so See the show stays fully tappable. */
html.totn-cal-lock #cmplz-manage-consent,
html.totn-cal-lock .cmplz-cookiebanner {
    display: none !important;
}

@media (max-width: 979px) {
    .totn-cal-panel {
        position: fixed;
        top: var(--totn-cal-header-offset, 80px);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 10000;
        background: rgba(0, 0, 0, .6);
        display: none;
        flex-direction: column;
        overflow: hidden;
    }

    .totn-cal-panel:not([hidden]) {
        display: flex;
    }

    .totn-cal-inner {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 16px 16px 0;
        border-radius: 10px 10px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .totn-cal-panel .totn-cal-header {
        flex-shrink: 0;
        margin-bottom: 0;
        padding-bottom: 12px;
        background: #0b0b0b;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .totn-cal-panel .totn-cal-body {
        flex: 1 1 auto;
        flex-direction: column;
        gap: 20px;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    }

    .totn-cal-dows,
    .totn-cal-days {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .totn-cal-panel .totn-cal-see {
        width: 100%;
    }
}

/* ---------------------------------------------------------------
 * 8. Month grid (ticket 4)
 * ------------------------------------------------------------- */

.totn-cal-monthbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.totn-cal-title {
    margin: 0;
    flex: 1 1 auto;
    text-align: center;
    color: #EDD74A;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.totn-cal-title:focus {
    outline: none;
}

.totn-cal-nav {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.totn-cal-nav:hover {
    border-color: #EDD74A;
    color: #EDD74A;
}

.totn-cal-nav:disabled,
.totn-cal-nav:disabled:hover {
    border-color: rgba(255, 255, 255, .2);
    color: rgba(255, 255, 255, .35);
    cursor: default;
}

.totn-cal-dows,
.totn-cal-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    gap: 1px;
}

.totn-cal-dows span {
    text-align: center;
    font-size: 11px;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .45);
    padding: 4px 0 6px;
}

.totn-cal-day,
.totn-cal-pad {
    position: relative;
    min-height: 44px;
    border-radius: 8px;
}

.totn-cal-day {
    appearance: none;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.totn-cal-day {
    cursor: pointer;
}

button.totn-cal-day:hover {
    color: #EDD74A;
}

.totn-cal-day.is-mute {
    color: rgba(255, 255, 255, .4);
}

.totn-cal-day.is-today {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}

.totn-cal-day.is-selected {
    box-shadow: inset 0 0 0 1px #EDD74A;
}

.totn-cal-dot {
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background: #EDD74A;
}

.totn-cal-empty {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, .55);
    font-size: 14px;
    line-height: 1.4;
}

.totn-cal-textlink {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    background: none;
    border: 0;
    color: #EDD74A;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------------------------------------------------------------
 * 9. Card (ticket 5)
 * ------------------------------------------------------------- */

.totn-cal-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.totn-cal-picks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.totn-cal-pick {
    min-height: 44px;
    padding: 8px 12px;
    text-align: left;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.totn-cal-pick.is-active {
    border-color: #EDD74A;
    color: #EDD74A;
}

.totn-cal-card-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.totn-cal-poster {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #111;
}

.totn-cal-card-copy {
    min-width: 0;
    overflow-wrap: anywhere;
}

.totn-cal-label,
.totn-cal-pretty,
.totn-cal-summary,
.totn-cal-showtitle {
    margin: 0;
}

.totn-cal-label {
    color: #EDD74A;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.totn-cal-panel .totn-cal-showtitle,
.totn-cal-home .totn-cal-showtitle {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.totn-cal-pretty {
    margin-top: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, .7);
}

.totn-cal-summary {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .8);
}

.totn-cal-see {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 44px;
    padding: 0 16px;
    background: #EDD74A;
    color: #000;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
}

.totn-cal-see:hover,
.totn-cal-see:focus-visible {
    color: #000;
}
