

/* イベント読み込みエリア（ローディング表示範囲） */
.calendar-content {
    position: relative;
    min-height: 280px;
}

/* ローディング表示（イベントエリア内のみ） */
.calendar-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.calendar-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.calendar-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e1e1e1;
    border-top-color: #59acbb;
    border-radius: 50%;
    animation: calendar-loading-spin 0.8s linear infinite;
}

.calendar-loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

@keyframes calendar-loading-spin {
    to { transform: rotate(360deg); }
}

/* カレンダーセクション */
.calendar-section {
    margin-bottom: 40px;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav h2 {
    font-size: 20px;
    font-weight: 500;
    color: #333;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    padding: 5px 10px;
    transition: opacity 0.3s;
    background-color: #f5f5f5;
    border-radius: 5px;
    border: 1px solid #e1e1e1;
}

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

.nav-btn:disabled,
.nav-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* 年月ボタンとプルダウン */
.calendar-nav-month-wrap {
    position: relative;
}

.nav-month-btn {
    background: none;
    border: none;
    font-size: 20px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    padding: 5px 10px;
    font-family: inherit;
    transition: opacity 0.3s;
}

.nav-month-btn:hover {
    opacity: 0.7;
}

.month-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    min-width: 160px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
}

.month-dropdown.is-open {
    display: block;
}

.month-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.month-dropdown-item:hover {
    background-color: #f0f0f0;
}

.month-dropdown-item--empty {
    cursor: default;
    color: #999;
}

/* カレンダーグリッド */
.calendar {
    border-radius: 4px;
    overflow: hidden;
    background-color: #f5f5f5;
    padding: 5px;
    display: flex;
    flex-direction: column;
    /* gap: 5px; */
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    padding: 7px 5px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    background-color: #515151;
    color: #FFFFFF;
    border-radius: 5px;
    margin: 3px;
}

.calendar-day-header.sunday {
    background-color: #d53e3e;
}

.calendar-day-header.saturday {
    background-color: #3a74af;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* border-bottom: 1px solid #eee; */
    position: relative;
    /* gap: 5px; */
}

.calendar-week:last-child {
    border-bottom: none;
}

/* 週のイベントレイヤー */
.week-events-layer {
    position: absolute;
    top: 30px; /* 日付の下から開始 */
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* grid-auto-rows: 18px; */
    gap: 3px 0;
    padding: 0;
    pointer-events: none;
    z-index: 5;
    align-content: start;
}

.calendar-day {
    min-height: 120px;
    padding: 5px;
    background-color: #fff;
    position: relative;
    overflow: visible;
    border-radius: 10px;
    margin: 3px;
}

.calendar-day:last-child {
    border-right: none;
}


.calendar-day.other-month {
    background-color: #f9f9f9;
    color: #999;
}
.calendar-day.other-month.sunday .date-number{
    color: #e27878;
}
.calendar-day.other-month.saturday .date-number{
    color: #65a2e0;
}

.calendar-day.sunday .date-number {
    color: #d53e3e;
}

.calendar-day.saturday .date-number {
    color: #3a73ae;
}

.date-number {
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 5px;
}

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

.calendar-event {
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    padding: 4px 3px;
    background-color: #59acbb;
    color: #FFFFFF;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 99999px;
    margin: 0 8px;
    transition: opacity 0.3s ease;
    min-width: 0; /* 省略表示を有効にする */
    cursor: pointer;
    position: relative;
}

/* ホバー時にツールチップが出ることを示す */
.calendar-event[title] {
    cursor: help;
}

.calendar-event:hover {
    opacity: 0.9;
    color: #FFFFFF;
}

/* 1日のみのイベント */
.calendar-event.event-single {
    pointer-events: auto;
}

/* 複数日にわたるイベント */
.calendar-event.event-multi {
    text-align: center;
    pointer-events: auto;
    margin-left: 3px;
    margin-right: 3px;
    border-radius: 0;
    grid-row: auto;
}

/* 複数日イベントの開始日 */
.calendar-event.event-multi.event-start {
    margin-left: 8px;
    border-top-left-radius: 99999px;
    border-bottom-left-radius: 99999px;
}

/* 複数日イベントの終了日 */
.calendar-event.event-multi.event-end {
    margin-right: 8px;
    border-top-right-radius: 99999px;
    border-bottom-right-radius: 99999px;
}

.calendar-event:hover {
    opacity: 0.8;
}

/* カレンダーイベント用ツールチップ */
.calendar-event-tooltip {
    position: fixed;
    left: -9999px;
    top: -9999px;
    z-index: 9999;
    max-width: 280px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.calendar-event-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}

/* カテゴリ絞り込み（カレンダーとリストの間） */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 0;
}


.category-filter-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.category-filter-btn:hover {
    background-color: #ebebeb;
    border-color: #ccc;
}

.category-filter-btn.is-active {
    background-color: #33B6E3;
    border-color: #33B6E3;
    color: #fff;
}

.category-filter-btn.is-active:hover {
    background-color: #33B6E3;
    border-color: #33B6E3;
    color: #fff;
}

/* リストセクション */
.list-section {
    display: block;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #f5f5f5;
    padding: 20px 10px;
}

/* リスト内：イベントのカテゴリ表示（タイトルの上） */
.event-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.event-category-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #1b62a8;
    background-color: #e9f4fe;
    border-radius: 4px;
}

.long-term-events-section .event-name,
.year-round-events-section .event-name{
   font-size: 14px;
}
/* 長期イベントセクション */
.long-term-events-section {
}

.long-term-events-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* アコーディオンのスタイル */
.accordion-section {
    background-color: #ffffff;
    border-radius: 10px;
    overflow: hidden;
}
.accordion-toggle {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 10px 20px;
    transition: color 0.2s;
}

.accordion-toggle:hover {
    color: #0066cc;
}

.accordion-toggle::after {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translate3d(0, -50%, 0);
    transition: transform 0.3s ease;
    content: '';
    display: inline-block;
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%23000" d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z" /></svg>');
    mask-repeat: no-repeat;
    mask-position: center center;
    mask-size: contain;
    width: 1em;
    height: 1em;
    background-color: currentColor;
}

.accordion-toggle.accordion-open::after {
    transform: rotate(180deg);
}

.accordion-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 0;
    padding: 10px 20px;
}

.accordion-content[style*="display: block"] {
    max-height: 5000px;
}

/* 通年イベントセクション */
.year-round-events-section {
}

.year-round-events-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.event-date-range {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.normal-events-section{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-date-group {
    overflow: hidden;
    display: flex;
    gap: 10px;
}

.event-date-group:last-child {
    border-bottom: none;
}

.event-date-label {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-align: center;
    color: #FFFFFF;
    padding: 10px;
    border-radius: 10px;
    background-color: #515151;
    width: 100px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.date-slash{
}
.date-weekday{
    font-size: 80%;
}
.date-range-separator{
    display: block;
    font-size: 80%;
}

.event-item-wrap {
    background-color: #ffffff;
    padding: 10px 15px;
    border-radius: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-item + .event-item {
    margin-top: 10px;
    border-top: 1px solid #dddddd;
    padding-top: 10px;
}

.event-name {
    font-size: 16px;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
    display: block;
    transition: color 0.2s;
}

.event-name:hover {
    color: #004499;
    text-decoration: underline;
}

.event-organizer,
.event-sponsor {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    display: flex;
    gap: 5px;
    margin-top: 3px;
}

.event-organizer .label,
.event-sponsor .label {
    font-size: 0.825em;
    font-weight: 600;
    border: 1px solid #cdcdcd;
    border-radius: 3px;
    display: inline-block;
    padding: 3px 6px;
    line-height: 1;
    align-self: flex-start;
    margin-top: 2px;
}

.event-organizer .text,
.event-sponsor .text{
    flex: 1;
}


.no-events {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .calendar-nav h2 {
        font-size: 18px;
    }

    .nav-btn {
        font-size: 14px;
    }

    /* スマホでもカレンダーを表示 */
    .calendar {
        display: flex;
        padding: 2px;
    }

    .calendar-section{
        margin-bottom: 0;
    }

    .list-section {
        display: block;
    }

    .calendar-day-header {
        padding: 5px 3px;
        font-size: 12px;
    }

    .calendar-day {
        min-height: 60px;
        padding: 2px;
        margin: 2px;
        border-radius: 5px;
    }

    .date-number {
        font-size: 13px;
        padding-left: 3px;
    }

    .calendar-event {
        font-size: 9px;
        margin: 0 4px;
        padding: 4px 3px;
    }

    .event-date-group{
        flex-direction: column;
        gap: 0;
    }
    .event-date-label{
        width: 100%;
        min-height: auto;
        border-radius: 10px 10px 0 0;
        justify-content: flex-start;
        text-align: left;
    }
    .date-range-separator{
        display: inline;
    }
    .event-item-wrap{
        border-radius: 0 0 10px 10px;
    }

    .week-events-layer{
        top: 25px;
    }
}

@media (min-width: 769px) {
    /* デスクトップではカレンダーとリストの両方を表示 */
    .calendar-section {
        display: block;
    }
    
    .list-section {
        display: block;
    }
}



.prev-month-arrow{
    display: inline-block;
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="%23000" d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z" /></svg>');
    mask-repeat: no-repeat;
    mask-position: center center;
    mask-size: contain;
    width: 1em;
    height: 1em;
    background-color: currentColor;
}
.next-month-arrow{
    display: inline-block;
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="%23000" d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z" /></svg>');
    mask-repeat: no-repeat;
    mask-position: center center;
    mask-size: contain;
    width: 1em;
    height: 1em;
    background-color: currentColor;
}

a.event-name[target="_blank"]::after{
    content: '';
    display: inline-block;
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path fill="%23000" d="M384 64C366.3 64 352 78.3 352 96C352 113.7 366.3 128 384 128L466.7 128L265.3 329.4C252.8 341.9 252.8 362.2 265.3 374.7C277.8 387.2 298.1 387.2 310.6 374.7L512 173.3L512 256C512 273.7 526.3 288 544 288C561.7 288 576 273.7 576 256L576 96C576 78.3 561.7 64 544 64L384 64zM144 160C99.8 160 64 195.8 64 240L64 496C64 540.2 99.8 576 144 576L400 576C444.2 576 480 540.2 480 496L480 416C480 398.3 465.7 384 448 384C430.3 384 416 398.3 416 416L416 496C416 504.8 408.8 512 400 512L144 512C135.2 512 128 504.8 128 496L128 240C128 231.2 135.2 224 144 224L224 224C241.7 224 256 209.7 256 192C256 174.3 241.7 160 224 160L144 160z" /></svg>');
    mask-repeat: no-repeat;
    mask-position: center center;
    mask-size: contain;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    line-height: 1;
    vertical-align: middle;
    margin-left: 5px;
}

