/* calendar.css - 放棄圖片背景定位，改用彈性流式佈局 (配合 mystic-scroll) */

.yume-cal-page-wrapper {
    width: 100%;
    /* 設定合適的最大寬度，讓在大螢幕上不會無限拉長 */
    max-width: 800px;
    margin: 40px auto;
    font-family: 'Noto Serif TC', serif;
    color: #2f2219;
    padding: 0 15px; /* 給予兩側基本的安全間距 */
}

/* 覆寫 mystic-scroll 預設行為：強制展開並取消最大寬度限制（由 wrapper 控制） */
.mystic-scroll.yume-cal-scroll-override {
    max-width: 100%;
    cursor: default;
    margin: 0;
    width: 100%;
}

.yume-cal-scroll-content {
    /* 移除隱藏與動畫限制，讓內容順其自然推高卷軸紙張 */
    max-height: none !important;
    overflow: visible !important;
    padding: 3rem 1.5rem !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 768px) {
    .yume-cal-scroll-content {
        padding: 4rem 3rem !important;
    }
}

/* 標題設計：融入卷軸的優雅排版 */
.yume-cal-title {
    margin: 0 0 2rem 0;
    font-size: clamp(24px, 4.5vw, 36px);
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #2f2219;
    text-align: center;
    width: 90%;
    border-bottom: 2px solid rgba(47, 34, 25, 0.2);
    padding-bottom: 15px;
    position: relative;
}

/* 在標題下方加上小裝飾 */
.yume-cal-title::after {
    content: '✧';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fbf9f4; /* 取自 scroll-content 的背景色來蓋住線條 */
    padding: 0 10px;
    color: rgba(47, 34, 25, 0.4);
    font-size: 16px;
}

/* Calendar Grid */
.yume-cal-grid-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.yume-cal-weekdays {
    display: grid;
    /* 等分7欄，確保每一格寬度一致 (Align) */
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 900;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #2f2219;
}

.yume-cal-weekdays span {
    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.2;
}

.yume-cal-weekdays small {
    font-size: clamp(10px, 1.5vw, 12px);
    font-weight: 700;
    color: rgba(47, 34, 25, 0.6);
}

.yume-cal-days {
    display: grid;
    /* 完美均分7欄，確保每個日期格子寬度絕對對齊 */
    grid-template-columns: repeat(7, 1fr);
    gap: 1.5%;
}

.yume-cal-day {
    /* 使用 aspect-ratio 讓格子維持漂亮的比例，不會因為文字多寡變形 */
    aspect-ratio: 1 / 0.75;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    position: relative;
    
    /* 預設的黃色紙張質感 */
    background-color: #fdfaf0;
    border: 3px solid #554335;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7), 0 3px 6px rgba(0,0,0,0.05); 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.yume-cal-day:not(.empty):hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7), 0 5px 12px rgba(0,0,0,0.1); 
}

.yume-cal-day.empty {
    visibility: hidden;
}

.yume-cal-day.type-red {
    background-color: #fcdced;
    border-color: #d18cb3;
}

.yume-cal-day.type-green {
    background-color: #eaddfc;
    border-color: #a47bd0;
}

.yume-cal-date-num {
    font-size: clamp(16px, 3.5vw, 28px);
    font-weight: 900;
    line-height: 1;
    color: #2f2219;
    margin-bottom: 5%;
}

.yume-cal-time {
    font-size: clamp(8px, 1.5vw, 12px);
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 2px 5px;
    border-radius: 12px;
    white-space: nowrap;
    color: #2f2219;
    border: 1px solid rgba(0,0,0,0.1);
}

.yume-cal-lantern {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: clamp(18px, 3.5vw, 24px);
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.4));
    z-index: 2;
}

/* 開放時間圖例 */
.yume-cal-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(47, 34, 25, 0.15);
    width: 100%;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(12px, 2.5vw, 16px);
    font-weight: 700;
    color: #2f2219;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #554335;
}

.legend-red {
    background-color: #fcdced;
    border-color: #d18cb3;
}

.legend-green {
    background-color: #eaddfc;
    border-color: #a47bd0;
}

/* 告示板重構，配合 cn-frame */
.yume-cal-notice-board {
    margin-top: 3.5rem;
    width: 85%;
    max-width: 650px;
    background: rgba(251, 249, 244, 0.7);
    /* 移除圓角以符合 corner.svg 的直角設計 */
    border-radius: 0;
    padding: 1.5rem 2rem;
    position: relative;
    /* 這裡不再設定 border，交給 cn-frame 處理 */
}

.yume-cal-notice-list {
    margin: 0;
    padding: 0;
    list-style-type: none;
    text-align: center;
    font-size: clamp(14px, 2.5vw, 18px);
    font-weight: 700;
    line-height: 1.8;
    color: #2f2219;
}

/* 手機版修復與優化 */
@media (max-width: 480px) {
    .yume-cal-page-wrapper {
        padding: 0 5px; /* 減小最外層的安全間距 */
    }
    
    .yume-cal-scroll-content {
        padding: 2.5rem 0.8rem !important; /* 大幅減少左右 padding，留出空間給格子 */
    }
    
    .yume-cal-grid-container {
        width: 100%;
    }
    
    .yume-cal-days {
        gap: 1%; /* 減小格子之間的間距 */
    }
    
    .yume-cal-day {
        border-width: 1px; /* 邊框變細 */
        border-radius: 4px;
    }
    
    .yume-cal-date-num {
        margin-bottom: 0; /* 沒有時間文字了，所以可以置中 */
        font-size: clamp(16px, 4.5vw, 22px); /* 放大日期數字 */
    }
    
    .yume-cal-lantern {
        top: -6px;
        right: -6px;
        font-size: clamp(12px, 3.5vw, 16px);
    }
    
    .yume-cal-notice-board {
        padding: 1.2rem 1rem;
        width: 90%;
    }
    
    .yume-cal-legend {
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }
}
