/* ─── Page layout ──────────────────────────────────────────────────────── */

.page-playbill {
    background: #fff;
}

.playbill-page {
    width: 100%;
}

.playbill-months-content {
    width: calc(100% - 8rem);
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* ─── Sticky nav ──────────────────────────────────────────────────────── */

.playbill-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid #eee;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 6rem;
}

.playbill-heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.playbill-months {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.playbill-month-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: #999;
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    text-transform: lowercase;
}

.playbill-month-link:hover {
    color: #000;
}

.playbill-month-link.is-active {
    color: #000;
    border-bottom-color: #000;
}

.playbill-month-year {
    color: #999;
    font-size: 0.8em;
}

.playbill-month-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #000;
    text-decoration: none;
    transition: opacity 0.15s;
}

.playbill-month-arrow:hover {
    opacity: 0.6;
}

.playbill-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.playbill-control-btn {
    background: transparent;
    border: 1px solid #000;
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    color: #000;
    position: relative;
    transition: background 0.15s, color 0.15s;
}

.playbill-control-btn:hover {
    background: #000;
    color: #fff;
}

.playbill-filter-count {
    background: #d40000;
    color: #fff;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 1em;
    margin-left: 0.5rem;
}

/* ─── Month sections ──────────────────────────────────────────────────── */

.playbill-month {
    padding: 3rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.playbill-month:last-child {
    border-bottom: none;
}

.playbill-empty {
    padding: 3rem 0;
    text-align: center;
    color: #999;
}

/* ─── Day blocks ──────────────────────────────────────────────────────── */

.playbill-day {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: start;
    transition: background 0.4s;
}

.playbill-day:last-child {
    border-bottom: none;
}

.playbill-day.is-highlighted {
    background: #fffbcc;
}

.playbill-day-date {
    font-weight: 700;
}

.playbill-day-num {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.playbill-day-weekday {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
}

.playbill-day-events {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ─── Performance items ──────────────────────────────────────────────── */

.playbill-item {
    transition: opacity 0.2s;
}

.playbill-item.is-past {
    opacity: 0.5;
}

.playbill-item-meta {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #000;
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
}

.playbill-item-sep {
    color: #ccc;
}

.playbill-item-tag-premiere {
    color: #d40000;
    letter-spacing: 0.15em;
}

.playbill-item-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 0.5rem;
}

.playbill-item-title a {
    color: inherit;
    text-decoration: none;
}

.playbill-item-title a:hover {
    color: #666;
}

.playbill-item-subtitle {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
    margin-bottom: 0.5rem;
}

.playbill-item-banner {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.playbill-item-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.playbill-item-buy {
    background: #d40000;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.15s;
}

.playbill-item-buy:hover {
    background: #b00000;
}

.playbill-item-buy-free {
    background: #000;
}

.playbill-item-buy-free:hover {
    background: #333;
}

/* ─── Longtime events ────────────────────────────────────────────────── */

.playbill-longtime {
    padding: 1rem 0 2rem;
    border-bottom: 2px solid #000;
    margin-bottom: 1rem;
}

.playbill-longtime-item {
    padding: 1.5rem 0;
}

.playbill-longtime-dates {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #d40000;
    margin-bottom: 0.5rem;
}

/* ─── Drawers (placeholder; refined in steps 4–5) ────────────────────── */

.playbill-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 100vw;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.25s;
    z-index: 100;
    padding: 2rem;
    overflow-y: auto;
}

.playbill-drawer.is-open {
    transform: translateX(0);
}

.playbill-drawer[hidden] {
    /* Override [hidden] when drawer is in the DOM but not yet styled */
    display: block;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .playbill-nav {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .playbill-months {
        flex-wrap: wrap;
    }

    .playbill-day {
        grid-template-columns: 120px 1fr;
        gap: 1rem;
    }

    .playbill-day-num {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .playbill-page {
        padding: 0 1rem 2rem;
    }

    .playbill-day {
        grid-template-columns: 1fr;
    }

    .playbill-day-date {
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
    }

    .playbill-item-title {
        font-size: 1.25rem;
    }
}

/* ─── Drawer mechanics (replaces placeholder rules) ─────────────────── */

.playbill-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.playbill-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.playbill-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 100vw;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.25s;
    z-index: 100;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.playbill-drawer.is-open {
    transform: translateX(0);
}

.playbill-drawer[hidden] {
    display: flex !important;
    /* override [hidden] so transform works */
}

.playbill-drawer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.playbill-drawer-close:hover {
    color: #666;
}

.playbill-drawer-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #eee;
}

.playbill-drawer-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.playbill-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* ─── Calendar grid ─────────────────────────────────────────────────── */

.calendar-month-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: #000;
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-grid th {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    padding: 0.5rem 0;
    text-align: center;
}

.calendar-day {
    padding: 0;
    text-align: center;
    height: 40px;
    vertical-align: middle;
    border: 1px solid transparent;
}

.calendar-day span,
.calendar-day a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.9rem;
    color: #ccc;
    /* default: no events */
    text-decoration: none;
}

.calendar-day.has-events a {
    color: #000;
    font-weight: 600;
    cursor: pointer;
}

.calendar-day.has-events a:hover {
    background: #f0f0f0;
}

.calendar-day.is-today a,
.calendar-day.is-today span {
    background: #000;
    color: #fff;
}

.calendar-day.is-today.has-events a:hover {
    background: #333;
}

.calendar-day.is-past:not(.is-today).has-events a {
    color: #999;
}

.calendar-day.calendar-day-empty {
    background: transparent;
}

/* ─── Day highlight after calendar click ─────────────────────────────── */

.playbill-day.is-highlighted {
    background: #fffbcc;
    transition: background 0.4s;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .playbill-drawer {
        width: 100%;
    }

    .playbill-drawer-body {
        padding: 1rem;
        gap: 1.5rem;
    }
}

/* ─── Filter form ───────────────────────────────────────────────────── */

.playbill-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 1.75rem;
}

@media (max-width: 520px) {
    .playbill-filter-form { grid-template-columns: 1fr; }
}

.filter-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin: 0 0 0.75rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-options-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Hide the native checkbox; style the label as a button-ish row */
.filter-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    transition: color 0.15s;
    user-select: none;
}

.filter-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #999;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.filter-check input:checked {
    background: #000;
    border-color: #000;
}

.filter-check input:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-check:hover input:not(:checked) {
    border-color: #000;
}

.filter-check:hover {
    color: #000;
}

/* Pill variant for age filters */
.filter-check-pill {
    padding: 0.4rem 1rem;
    border: 1px solid #ddd;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-check-pill input {
    display: none;
}

.filter-check-pill:has(input:checked) {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Fallback for browsers without :has() — JS will toggle .is-checked */
.filter-check-pill.is-checked {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* ─── Actions row ───────────────────────────────────────────────────── */

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    gap: 1rem;
}

.filter-action-clear {
    background: transparent;
    border: 1px solid #000;
    padding: 0.6rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    color: #000;
    transition: background 0.15s, color 0.15s;
}

.filter-action-clear:hover {
    background: #000;
    color: #fff;
}

.filter-active-count {
    font-size: 0.85rem;
    color: #666;
}

/* ─── Longtime events ────────────────────────────────────────────────── */

.playbill-day-longtime {
    background: #fafafa;
    border-left: 3px solid #d40000;
    padding-left: calc(2rem - 3px);
    margin-left: -2rem;
    padding-right: 2rem;
    margin-right: -2rem;
}

.playbill-day-longtime .playbill-day-num {
    color: #d40000;
    font-size: 1.4rem;
    line-height: 1.2;
}

.playbill-day-longtime-label {
    color: #d40000;
    font-size: 0.65rem;
}

/* Remove the bottom border for stacked longtime groups (visual cohesion) */
.playbill-day-longtime+.playbill-day-longtime {
    border-top: 1px solid #f0f0f0;
    border-bottom: none;
}

@media (max-width: 768px) {
    .playbill-day-longtime {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: calc(1rem - 3px);
        padding-right: 1rem;
    }
}

/* ─── Expandable detail panel: full-bleed takeover ───────────────────── */

.playbill-item-detail {
    display: none;
}

.playbill-item.is-expanded .playbill-item-basic {
    display: none;
}

.playbill-item.is-expanded .playbill-item-detail {
    display: block;
}

.playbill-day:has(.playbill-item.is-expanded) {
    grid-template-columns: 1fr;
}

.playbill-day:has(.playbill-item.is-expanded) .playbill-day-date {
    display: none;
}

.detail-takeover {
	position: relative;
	/* left: 50%; */
	/* right: 50%; */
	margin-left: -50vw;
	margin-right: -50vw;
	width: 100%;
	margin-top: 1.5rem;
	background: #000;
	color: #fff;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	min-height: 480px;
	overflow: hidden;
	margin: 0 auto;
}

.detail-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.15s;
}

.detail-close:hover {
    opacity: 0.7;
}

/* ─── Info column (left, black background) ──────────────────────────── */

.detail-info {
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.detail-when {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
}

.detail-meta span:not(:last-child)::after {
    content: '•';
    margin-left: 0.75rem;
}

.detail-premiere {
    color: #ff5252;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
}

.detail-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 1rem;
    color: #fff;
}

.detail-subtitle {
    font-size: 1.05rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.75rem;
}

.detail-author {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
}

.detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.detail-buy {
    background: #d40000;
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.15s;
}

.detail-buy:hover {
    background: #b00000;
}

.detail-buy-free {
    background: transparent;
    border: 1px solid #fff;
}

.detail-buy-free:hover {
    background: #fff;
    color: #000;
}

.detail-more {
    padding: 1rem 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    border: 1px solid #fff;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.detail-more:hover {
    background: #fff;
    color: #000;
}

/* ─── Poster column (right) ─────────────────────────────────────────── */

.detail-poster {
    position: relative;
    min-height: 540px;
    background: #000;
}

.detail-poster-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
}

.detail-poster-empty {
    background: repeating-linear-gradient(45deg, #1a1a1a, #1a1a1a 20px, #222 20px, #222 40px);
}

/* Diagonal wedge between black panel and poster (legacy detail) */
.detail-poster::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 15%;
    background: #000;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    z-index: 1;
    pointer-events: none;
}

/* ─── Loading state ──────────────────────────────────────────────────── */

.playbill-item.is-loading .playbill-item-detail::after {
    content: '';
    display: block;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 0%, #e8e8e8 50%, #f0f0f0 100%) #f5f5f5;
    background-size: 200% 100%;
    animation: detail-skeleton 1.2s linear infinite;
    margin-top: 1.5rem;
}

@keyframes detail-skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .detail-takeover {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .detail-poster {
        order: -1;
        /* poster on top on mobile */
        min-height: 320px;
    }

    .detail-poster::before {
        display: none;
        /* drop the diagonal wedge on stacked layout */
    }

    .detail-info {
        padding: 2rem 1.5rem;
    }

    .detail-title {
        font-size: 1.75rem;
    }
}

/* ─── Electrozone events back-link bar ────────────────────────────── */

.electrozone-events-back {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 6rem;
    font-size: 0.85rem;
    color: #666;
}

.electrozone-events-back a { color: inherit; text-decoration: underline; }
.electrozone-events-back a:hover { text-decoration: none; color: #000; }

@media (max-width: 1024px) {
    .electrozone-events-back { padding: 1rem 1rem; }
}

.playbill-info {
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.4;
    color: #555;
    max-width: 28em;
    margin-left: 1rem;
}

.playbill-info a {
    color: inherit;
    text-decoration: underline;
}

.playbill-info a:hover {
    color: #000;
    text-decoration: none;
}

@media (max-width: 1280px) {
    .playbill-info {
        max-width: 22em;
        font-size: 0.8rem;
    }
}

@media (max-width: 1024px) {
    .playbill-info {
        max-width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

.playbill-empty-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #ccc;
}