.archive__header {
    border-bottom: none;
    padding-bottom: 0;
}

/* カレンダーページ */
.calendar-page {
    padding: 9.2rem 6rem 8rem;
    max-width: 100%;
}

.calendar-container {
    --cal-border-color: rgba(77, 77, 77, 0.15);
    --cal-border: 0.1rem solid var(--cal-border-color);
    --cal-theater-w: 20rem;
    --cal-color-sat: #2563F5;
    --cal-color-sun: #F53325;
    --cal-color-muted: #999;

    overflow: clip;
    max-width: 1920px;
    margin: 0 auto;
    position: relative;
}

/* ヘッダー */
.calendar-header {
    position: sticky;
    top: 0;
    padding: 2rem 0 3.2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: var(--color-light);
    z-index: 997;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: #fff;
    border-radius: 10rem;
    border: 0.2rem solid var(--color-darkgray);
    padding: 1rem 2em;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-btn:hover {
    opacity: 0.5;
}

.nav-btn:focus-visible {
    outline: 0.3rem solid var(--color-darkgray);
    outline-offset: 0.2rem;
}

.nav-btn::before {
    content: '';
    display: inline-block;
    width: 0.7rem;
    height: 1.1rem;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    flex-shrink: 0;
}

.prev-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='11' viewBox='0 0 7 11' fill='none'%3E%3Cpath d='M5.41406 9.41431L1.41406 5.41431L5.41406 1.41431' stroke='%234D4D4D' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
}

.next-btn::before {
    order: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='11' viewBox='0 0 7 11' fill='none'%3E%3Cpath d='M1.41406 9.41431L5.41406 5.41431L1.41406 1.41431' stroke='%234D4D4D' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
}

/* 月セレクター */
select.calendar-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    padding: 1rem 3rem 1rem 2rem;
    border: 0.2rem solid var(--color-darkgray);
    border-radius: 10rem;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none'%3E%3Cpath d='M1.41406 1.41431L5.41406 5.41431L9.41406 1.41431' stroke='%234D4D4D' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    transition: var(--transition-base);
}

select.calendar-title:hover {
    opacity: 0.5;
}


.today-btn {
    color: #333;
    border: var(--cal-border);
    padding: 0.8rem 1.6rem;
    border-radius: 2rem;
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.today-btn:hover {
    background: #f5f5f5;
}

.calendar-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 1.4rem;
    table-layout: fixed;
}

.calendar-table thead {
    position: sticky;
    top: 9rem;
    left: 0;
    z-index: 997;
    background-color: var(--color-light);
}

.calendar-wrapper {
    min-height: 30rem;
}

/* 劇団名ヘッダー */
.theater-header {
    color: var(--cal-color-muted);
    padding: 1rem;
    text-align: left;
    font-weight: 400;
    font-size: 1.3rem;
    position: sticky;
    left: 0;
    z-index: 10;
    width: var(--cal-theater-w);
    min-width: var(--cal-theater-w);
    max-width: var(--cal-theater-w);
    border-bottom: var(--cal-border);
}

/* 日付ヘッダー */
.date-header {
    padding: 1rem 0.5rem;
    text-align: center;
    border-bottom: var(--cal-border);
    border-left: var(--cal-border);
    min-width: 4.5rem;
    width: 4.5rem;
    font-weight: 400;
    vertical-align: top;
    background-color: var(--color-light);
}

.date-header:last-child {
    border-right: var(--cal-border);
}

.date-header .date-month {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--cal-color-muted);
    height: 1.3rem;
    line-height: 1.3rem;
}

.date-header .day-name {
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-weight: 400;
    height: 1.4rem;
    line-height: 1.4rem;
}

.date-header .date-number {
    margin-top: 0.7rem;
    font-family: var(--font-en);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.03rem;
    height: 1.7rem;
    line-height: 1.7rem;
}



.date-header .holiday-name {
    display: none;
}

/* 土曜日 */
.date-header.saturday .day-name {
    color: var(--cal-color-sat);
}

/* 日曜日・祝日 */
.date-header.sunday .day-name,
.date-header.holiday .day-name {
    color: var(--cal-color-sun);
}

/* 今日 */
.date-header.today .day-name,
.date-header.today .date-number {
    color: var(--color-orange);
}

/* 劇団行 */
.theater-row {
    content-visibility: auto;
    contain-intrinsic-size: auto 5rem;
}

.theater-row:hover {
    background: #fafafa;
}

.theater-name {
    padding: 2.7rem 2rem;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.6;
    letter-spacing: 0.075rem;
    position: sticky;
    left: 0;
    z-index: 5;
    width: var(--cal-theater-w);
    min-width: var(--cal-theater-w);
    max-width: var(--cal-theater-w);
    vertical-align: top;
    border-bottom: var(--cal-border);
}

.theater-row:hover .theater-name {
    background: #fafafa;
}

/* カレンダーセル */
.calendar-cell {
    padding: 0.8rem 0.2rem;
    border: none;
    border-left: var(--cal-border);
    border-bottom: var(--cal-border);
    text-align: left;
    vertical-align: top;
    min-width: 4.5rem;
    width: 4.5rem;
    min-height: 5rem;
    position: relative;
}

.calendar-cell.today {
    background: #FFF;
}

.calendar-cell:last-child {
    border-right: var(--cal-border);
}

/* イベントカード */
.event-card {
    position: absolute;
    left: 0.2rem;
    top: 0.8rem;
    height: 4rem;
    border-radius: 10rem;
    padding: 0 2rem;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    border: 0.2rem solid var(--color-orange);
    color: var(--color-orange);
    background: #fff;
    text-decoration: none;
}

.event-card.overflow-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.event-card.overflow-left {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.event-card:hover {
    color: #fff;
    background: var(--color-orange);
}

.event-card:focus-visible {
    outline: 0.3rem solid var(--color-orange);
    outline-offset: 0.2rem;
}

.event-title {
    font-size: 1.3rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ローディング */
.calendar-loading {
    width: 100%;
    height: 100lvh;
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    z-index: 1000;
}

.calendar-spinner {
    width: 4rem;
    height: 4rem;
    border: 0.3rem solid var(--cal-border-color);
    border-top-color: #FF7043;
    border-radius: 50%;
    animation: calendarSpin 0.8s linear infinite;
}

@keyframes calendarSpin {
    to {
        transform: rotate(360deg);
    }
}

/* セルスライドアニメーション（劇団名列は不変） */
.calendar-table.cells-animating .calendar-cell,
.calendar-table.cells-animating .date-header {
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.calendar-table.cells-slide-left .calendar-cell,
.calendar-table.cells-slide-left .date-header {
    opacity: 0;
    transform: translateX(-2rem);
}

.calendar-table.cells-slide-right .calendar-cell,
.calendar-table.cells-slide-right .date-header {
    opacity: 0;
    transform: translateX(2rem);
}

/* レスポンシブ */
@media (max-width: 750px) {
    .calendar-container {
        --cal-theater-w: 10rem;
    }

    .calendar-wrapper {
        min-height: 15rem;
    }

    .section__title {
        padding: 0 2rem;
    }

    .calendar-page {
        padding: 4rem 0;
    }

    .calendar-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .date-header .date-month {
        height: 1.4rem;
        line-height: 1.4rem;
    }

    .date-header .day-name {
        margin-top: 0.4rem;
        font-size: 1.3rem;
    }

    .date-header .date-number {
        margin-top: 0.4rem;
        height: 2rem;
        line-height: 2rem;
    }

    .calendar-nav {
        width: 100%;
        justify-content: center;
        gap: 0.8rem;
        padding: 0 2rem;
    }

    /* SP: 円形ナビボタン（アイコンのみ） */
    .nav-btn {
        width: 3.6rem;
        height: 3.6rem;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
        flex-shrink: 0;
    }

    .nav-btn:hover {
        opacity: 1;
    }

    .nav-btn .nav-text {
        display: none;
    }

    /* SP: 月セレクター */
    select.calendar-title {
        flex: 1;
        font-size: 1.4rem;
        padding: 0.8rem 3rem 0.8rem 1.2rem;
        text-align: center;
        text-align-last: center;
        background-size: 1.2rem 0.9rem;
        background-position: right 2rem center;
    }

    select.calendar-title:hover {
        opacity: 1;
    }

    .theater-header {
        min-width: 0;
    }

    .calendar-table thead {
        top: 7rem;
    }

    .theater-name {
        font-size: 1.3rem;
        letter-spacing: 0.065rem;
        min-width: 0;
        padding: 2rem 1.2rem;
    }

    .date-header,
    .calendar-cell {
        width: auto;
        min-width: 0;
    }

    .event-title {
        font-size: 1.1rem;
    }
}

/* スクリーンリーダー専用 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 印刷用 */
@media print {
    .calendar-header {
        page-break-inside: avoid;
    }

    .nav-btn,
    .today-btn {
        display: none;
    }
}