/* =========================================
	Schedule Section
========================================= */
.schedule-section {
    max-width: 75rem;
    margin: 4rem auto;
    background: var(--color-white);
    border-radius: 1.25rem;
    box-shadow: 0 0.75rem 2.5rem rgba(0, 51, 102, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.clinic-header {
    background: var(--deep-blue);
    padding: 2.1875rem 1.25rem;
    text-align: center;
}

.clinic-header h1 {
    color: var(--azan-gold-soft);
    margin: 0;
    font-size: 1.75rem;
    letter-spacing: 0.25rem;
    font-weight: 600;
}

/* --- Grid 核心佈局 --- */
.schedule-container {
    width: 100%;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 10rem repeat(7, minmax(5rem, 1fr));
    min-width: 40rem; 
    width: 100%;
}

/* 表頭單元格 */
.grid-header-cell {
    background: var(--color-white);
    color: var(--closed-muted);
    font-weight: 500;
    padding: 1.25rem 0.5rem;
    font-size: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
}

.sun-label {
    color: var(--sunday-red);
}

/* 側邊時間欄位 */
.time-sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-soft);
    padding: 1.5625rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-status);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.period-name {
    display: block;
    color: var(--deep-blue);
    font-size: 1.25rem;
    font-weight: 700;
}

.period-hours {
    display: block;
    color: var(--azan-gold-soft);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* 狀態單元格 */
.status-cell {
    padding: 0.9375rem 0.3125rem;
    text-align: center;
    border-bottom: 1px solid var(--border-status);
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-indicator {
    width: 80%;
    max-width: 5rem;
    padding: 0.625rem 0;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1.0625rem;
}

.is-open {
    color: var(--open-emerald);
    background: rgba(27, 94, 32, 0.05);
    border: 1px solid rgba(27, 94, 32, 0.1);
}

.is-closed {
    color: var(--closed-muted);
    background: var(--bg-sidebar);
    font-weight: 400;
    text-decoration: line-through;
    opacity: 0.6;
}

/* --- 頁尾 --- */
.reservation-footer {
    background: var(--bg-footer);
    padding: 1.875rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--border-footer);
}

.footer-hint {
    color: var(--closed-muted);
    font-weight: 500;
}

.phone-btn {
    background: var(--deep-blue);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.875rem;
    border-radius: 3.125rem;
    font-size: 1.125rem;
    font-weight: 600;
    box-shadow: 0 0.25rem 0.9375rem rgba(0, 51, 102, 0.15);
    transition: 0.2s ease;
}

.phone-btn:hover {
    transform: translateY(-2px);
    background: var(--deep-blue-hover);
}

/* --- RWD 手機端調整 --- */
@media (max-width: 48rem) {

    body { 
        padding: 0; 
    }
    
    .schedule-section {
        margin: 0;
    }

    .schedule-grid {
        grid-template-columns: 4.5rem repeat(3, 1fr);
        grid-auto-flow: column;
        grid-template-rows: repeat(8, auto);
        width: 100%;
        min-width: 0; /* 覆蓋可能的電腦版設定 */
    }

    /* 讓內容物字體縮小 */
    .grid-header-cell, .time-sidebar {
        padding: 1rem 0.25rem;
        font-size: 0.9rem;
    }

    .period-name { font-size: 1rem; }
    .period-hours { font-size: 0.65rem; }

    .status-cell {
        padding: 0.75rem 0.1rem;
    }

    .status-indicator {
        font-size: 0.85rem; /* 手機版字體略微縮小 */
        width: 95%; 		/* 讓它佔滿一點，防止文字折行 */
    }

    .back-btn {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .clinic-header h1 {
        font-size: 1.25rem;
        letter-spacing: 0.1rem;
    }

    .reservation-footer {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
    }

    .phone-btn {
        width: 100%;
        text-align: center;
        font-size: 1rem;
    }
}
