/* menespark - セラ詳細ページ 週予約グリッド専用CSS
 * 配置: /assets/therapist-week-grid.css
 * 対象パーツ: /templates_parts/therapist-week-grid.php
 * テーマ: 黒×ゴールド（--gold: #c9a86c 準拠）
 * 外枠は .shop-highlight-card のカード装飾を流用し、ここでは中身のみ定義。
 */

.twg__note {
    font-size: 1.1rem;
    color: var(--shop-text);
    margin: 10px 0;
}

/* 凡例 */
.twg__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 1.2rem;
    color: var(--shop-text);
    margin-bottom: 25px;
}
.twg__legend b {
    font-weight: 500;
}


.twg__legend b.is-open { color: var(--accent-geen); }
.twg__legend b.is-tent { color: #c9a86c; }
.twg__legend b.is-tel  { color: #5a8dd6; }
.twg__legend b.is-book { color: var(--accent-red); }
.twg__legend b.is-off  { color: var(--shop-text-dim); }

/* 週送りナビ */
.twg__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.twg__nav-btn {
    font-size: 12px;
    color: #c9a86c;
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 9px;
    border: 1px solid #3a3a42;
    border-radius: 6px;
    transition: background .15s ease, border-color .15s ease;
}
.twg__nav-btn:hover {
    background: rgba(201, 168, 108, .12);
    border-color: #c9a86c;
}
.twg__nav-btn.is-disabled {
    color: #5a564e;
    border-color: #26262c;
    pointer-events: none;
}
.twg__nav-range {
    flex: 1;
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--shop-text);
}

/* グリッド本体（横スクロール） */
.twg__scroll {
    overflow-x: auto;
    border: 1px solid #2a2a30;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}
.twg__table {
    border-collapse: collapse;
    width: 100%;
    min-width: 520px;
    font-size: 12px;
}

/* ヘッダー行（日付） */
.twg__table thead th {
    padding: 8px 4px;
    border-bottom: 1px solid #2a2a30;
    color: #ece7df;
    font-weight: 500;
    text-align: center;
}
.twg__day small {
    color: #9c968b;
    font-weight: 400;
}
.twg__day.twg-sun { color: #d98b8b; }
.twg__day.twg-sat { color: #8fb0e0; }

/* 時間列（左固定） */
.twg__time-head {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 48px;
    background: #15151a;
}
.twg__time {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #15151a;
    color: var(--shop-text);
    font-weight: 500;
    padding: 10px;
    border-bottom: 1px solid #232329;
    white-space: nowrap;
    text-align: center;
}

/* マス */
.twg__cell {
    padding: 0;
    text-align: center;
    border-bottom: 1px solid #232329;
    border-left: 1px solid #1e1e24;
}
.twg__cell .twg__sym {
    display: block;
    font-size: 1.5rem;
    padding: 7px 0;
}


/* マスの状態色 */
.twg__cell.is-tent {
    color: #c9a86c;
}
.twg__cell.is-book {
    color: var(--accent-red);
}
.twg__cell.is-tel {
    color: #5a8dd6;
    background: rgba(90, 141, 214, .10);
}
.twg__cell.is-tel .twg__sym {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.twg__cell.is-off {
    color: var(--shop-text-dim);
}

/* 今日の終了済み時間帯：マス自体を黒く沈める（表記は −） */
.twg__cell.twg__cell--past {
    background: #0b0b0d;
}
.twg__cell.twg__cell--past .twg__sym {
    color: #35342f;
    cursor: default;
}

.twg__cell.twg__cell--past .twg__sym {
    color: #3a3830;
    cursor: default;
}

/* 予約可マス（○・クリック可） */
.twg__pick {
    display: block;
    font-size: 1.5rem;
    padding: 10px 0;
    color: var(--accent-geen);
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    background: rgba(201, 168, 108, .10);
    background: rgba(126, 207, 143, .12);
    transition: background .12s ease;
}
.twg__pick:hover,
.twg__pick:focus {
    background: rgba(126, 207, 143, .22);
    outline: none;
}

/* 空表示 */
.twg__empty {
    font-size: 1.3rem;
    color: var(--shop-text-dim);
    text-align: center;
    padding: 100px 14px;
    border: 1px solid var(--shop-border);
    background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(201, 168, 108, 0.03) 8px, rgba(201, 168, 108, 0.03) 16px);
    border-radius: 12px;
}

/* ───────── 7日サマリーバー ───────── */

.thera-modal{
    margin-top: 5px;
    align-self: center;
    display: block;
    padding: 8px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    background: #F95A6B;
    background: linear-gradient(to bottom, #AD7EDB 0%, #8A5DB7 75%, #7F51AC 100%);
    border: 1px solid #B386E0;
    background: linear-gradient(to bottom, #FF9BA2 0%, #F95A6B 75%, #F85164 100%);
    border: 1px solid #DA949B;
    border-radius: 4px;
    color: #FFFFFF !important;
    border: none;
    text-align: center;
    border-radius: var(--radius-8);
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    cursor: pointer;
}


.tws-bar {
    display: block;
    width: 100%;
    background: none;
}
.tws-bar__lead{
    font-size: 1rem;
    color: var(--shop-text-mute);
    margin-bottom: 5px;
}
/* "Book with this therapist" button: wraps .thera-modal, opens the week grid modal */
.tws-openbtn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: opacity .15s ease;
}
.tws-openbtn:hover { opacity: .8; }
.tws-openbtn:focus-visible { outline: 1px solid #c9a86c; outline-offset: 2px; }

/* Each day cell is its own link (open days only) */
.tws-bar__link {
    display: block;
    padding: 4px 0;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background .15s ease;
}
a.tws-bar__link:hover { background: rgba(201, 168, 108, .18); }
a.tws-bar__link:focus-visible { outline: 1px solid #c9a86c; outline-offset: -1px; }
.tws-bar__link.is-disabled { cursor: default; opacity: .55; }
.tws-bar__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.tws-bar__day {
    text-align: center;
    padding: 0;              /* moved to .tws-bar__link so the whole cell is clickable */
    overflow: hidden;
    background: var(--shop-bg-card-alt);
    border: 1px solid var(--ap-line);
    background: var(--shop-bg-card);
    border-radius: var(--ap-radius);
}
.tws-bar__day.is-today {
    background: rgba(201, 168, 108, .12);
}
.tws-bar__date {
    display: block;
    font-size: 1.1rem;
    color: var(--shop-text);
    line-height: 1.3;
}
.tws-bar__date small { color: #9c968b; }
.tws-bar__date.is-sun { color: #d98b8b; }
.tws-bar__date.is-sat { color: #8fb0e0; }
.tws-bar__sym {
    display: block;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 2px;
}
.tws-sym--open { color: var(--accent-geen); }
.tws-sym--few  { color: #c9a86c; }
.tws-sym--full { color: var(--accent-red); }
.tws-sym--off  { color: var(--shop-text-dim); }


/* ───────── モーダル ───────── */
.twg-modal[hidden] { display: none; }
.twg-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.twg-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(2px);
}
.twg-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    max-height: 88vh;
    overflow-y: auto;
    background: #17171c;
    border: 1px solid #33333c;
    border-radius: 12px;
    padding: 8px;
    -webkit-overflow-scrolling: touch;

    /* スクロールバー非表示（スクロールは有効なまま） */
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / 旧Edge */
}
.twg-modal__panel::-webkit-scrollbar {
    display: none;                /* Chrome / Safari / 新Edge */
}
.twg-modal__close {
    position: sticky;
    top: 0;
    margin-left: auto;
    display: block;
    background: #22222a;
    color: #e6e0d6;
    border: 1px solid #3a3a42;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    z-index: 2;
}
.twg-modal__close:hover { border-color: #c9a86c; color: #c9a86c; }
/* モーダル内ではグリッドカードの外枠装飾を軽くする（二重枠回避） */
.twg-modal__body .shop-highlight-card {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* SP: 7日→6日（7日目を隠して詰まり回避） */
@media (max-width: 600px) {
    /* 凡例 */
    .twg__legend {
        gap: 7px;
        font-size: 1rem;
    }


    .sws__days {
        grid-template-columns: repeat(6, 1fr);
    }
    .sws__day:nth-child(7) {
        display: none;
    }
    /* セラ詳細のサマリーバー */
    .tws-bar__days {
        grid-template-columns: repeat(6, 1fr);
    }
    .tws-bar__day:nth-child(7) {
        display: none;
    }
    .tws-bar__date{
        font-size: 1rem;
    }

    .twg-modal {
    padding: 10px;
    }
    .twg-modal__panel{
        width: 100%;
        padding: 10px;
    }
}
/* Day-focus mode: keep all 7 columns, grey out the ones that are not selected */
.twg__day.is-dimmed { opacity: .35; }
.twg__cell.is-dimmed {
    position: relative;
    pointer-events: none;
    background: var(--shop-bg-card-alt);
}
.twg__cell.is-dimmed .twg__pick,
.twg__cell.is-dimmed .twg__sym { visibility: hidden; }
.twg__cell.is-dimmed::after {
    content: '\2212';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--shop-text-dim);
}

/* "Back to week view" button inside the day-focus nav */
.twg__nav-week {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    background: none;
    color: var(--shop-text-dim);
    font-size: 1.1rem;
    cursor: pointer;
}
.twg__nav-week:hover { color: #c9a86c; border-color: #c9a86c; }
.twg__nav-btn:disabled { opacity: .4; cursor: default; }

/* Day cell is a button now */
button.tws-bar__link {
    width: 100%;
    border: 0;
    font: inherit;
    background: none;
    cursor: pointer;
}
button.tws-bar__link:hover { background: rgba(201, 168, 108, .18); }

/* [hidden] must beat the .twg__nav display rule */
.twg__nav[hidden] { display: none !important; }
