/* ==========================================================
   Komatsubara Clinic Calendar v1.4.2
   診療日カレンダー（1つのマスに、その日の診療の「札」を並べる）
   色は Custom Header for Lightning に合わせた GOLD 系（#B8860B）

   幅の考え方（2026/9/18 小林さん「もう少し横幅広めで。スマホに優しい表示は必須」
              →「左右余白十分ある、もっと横幅使っていい」で 1120px → 1440px）
     PC（900px〜）  … 最大1440px。2か月を横に並べ、マスを大きく
     タブレット     … 1か月ずつ縦に。マスは中くらい
     スマホ（〜600px）… 1か月ずつ縦に。札は小さく、休みの理由の文字は隠す
   ========================================================== */

.kcc-wrap {
    --kcc-gold: #b8860b;
    --kcc-gold-dark: #996f0a;
    --kcc-ink: #333;
    --kcc-muted: #a3a3a3;
    --kcc-line: #e2ddd2;
    --kcc-open-bg: #fffdf8;
    --kcc-closed-bg: #f5f5f3;

    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    color: var(--kcc-ink);
    font-size: 16px;
    line-height: 1.7;
    box-sizing: border-box;
}

.kcc-wrap *,
.kcc-wrap *::before,
.kcc-wrap *::after {
    box-sizing: border-box;
}

/* 読み上げだけに出す文字 */
.kcc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- 本日の診療 ---------- */

.kcc-today {
    margin: 0 0 28px;
    padding: 18px 24px;
    border-radius: 8px;
    border-left: 6px solid var(--kcc-gold);
    background: #fdf6e6;
}

.kcc-today--closed {
    border-left-color: var(--kcc-muted);
    background: var(--kcc-closed-bg);
}

.kcc-today p {
    margin: 0;
}

.kcc-today__main {
    font-size: 18px;
}

.kcc-today__next {
    margin-top: 6px !important;
    font-size: 15px;
    color: #555;
}

/* ---------- 月の並び ---------- */

.kcc-months {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
}

.kcc-month {
    min-width: 0;
}

.kcc-month__title {
    margin: 0 0 10px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--kcc-gold-dark);
    border: 0;
    background: none;
}

/* ---------- 表 ---------- */

.kcc-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0;
    background: #fff;
}

.kcc-table th,
.kcc-table td {
    border: 1px solid var(--kcc-line);
    padding: 0;
    text-align: center;
    vertical-align: top;
}

.kcc-th {
    padding: 8px 0 !important;
    font-size: 14px;
    font-weight: 600;
    color: #6b6b6b;
    background: #faf8f4;
    vertical-align: middle !important;
}

.kcc-td {
    height: 92px;
    padding: 6px 3px 6px !important;
    position: relative;
}

.kcc-td--empty {
    background: #fcfcfb;
    border-color: #efece6;
}

.kcc-td--open {
    background: var(--kcc-open-bg);
}

.kcc-td--closed {
    background: var(--kcc-closed-bg);
}

.kcc-date {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #3a3a3a;
}

.kcc-td--closed .kcc-date {
    font-weight: 400;
    color: var(--kcc-muted);
}

.kcc-tags {
    display: block;
    margin-top: 4px;
}

/* 休みの理由（祝日名・休診）。PCだけ出す */
.kcc-why {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--kcc-muted);
}

/* 今日 */
.kcc-td--today {
    box-shadow: inset 0 0 0 3px var(--kcc-gold);
}

/* ---------- 札 ---------- */

.kcc-tag {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 4px auto 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: .02em;
    white-space: nowrap;
}

/* 札の色（設定画面の「色」で選ぶ。v1.3.0〜） */
.kcc-tag--c-gold   { background: var(--kcc-gold); color: #fff; }
.kcc-tag--c-rose   { background: #f7e3ea; color: #8a3b52; }
.kcc-tag--c-blue   { background: #e4edf3; color: #34566f; }
.kcc-tag--c-green  { background: #e2efe4; color: #2e6a3c; }
.kcc-tag--c-purple { background: #ebe5f4; color: #5a4485; }
.kcc-tag--c-orange { background: #fbe8d6; color: #97501a; }
.kcc-tag--c-gray   { background: #ececea; color: #555; }

.kcc-tag--none {
    background: var(--kcc-closed-bg);
    border: 1px solid var(--kcc-line);
    min-width: 2.6em;
}

.kcc-star {
    margin-left: 1px;
    color: var(--kcc-gold);
}

/* 札＝予約画面へのリンク（v1.4.0〜）。見た目は札のまま、触れると少し沈む */
a.kcc-tag--link,
a.kcc-tag--link:visited {
    text-decoration: none !important;
    cursor: pointer;
    transition: filter .15s, box-shadow .15s, transform .05s;
}
a.kcc-tag--link.kcc-tag--c-gold,
a.kcc-tag--link.kcc-tag--c-gold:visited { color: #fff !important; }
a.kcc-tag--link.kcc-tag--c-rose,
a.kcc-tag--link.kcc-tag--c-rose:visited { color: #8a3b52 !important; }
a.kcc-tag--link.kcc-tag--c-blue,
a.kcc-tag--link.kcc-tag--c-blue:visited { color: #34566f !important; }
a.kcc-tag--link.kcc-tag--c-green,
a.kcc-tag--link.kcc-tag--c-green:visited { color: #2e6a3c !important; }
a.kcc-tag--link.kcc-tag--c-purple,
a.kcc-tag--link.kcc-tag--c-purple:visited { color: #5a4485 !important; }
a.kcc-tag--link.kcc-tag--c-orange,
a.kcc-tag--link.kcc-tag--c-orange:visited { color: #97501a !important; }
a.kcc-tag--link.kcc-tag--c-gray,
a.kcc-tag--link.kcc-tag--c-gray:visited { color: #555 !important; }

a.kcc-tag--link:hover {
    filter: brightness(.93);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
a.kcc-tag--link:active {
    transform: translateY(1px);
}
a.kcc-tag--link:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 1px;
}

/* 過ぎた日は薄く（札もリンクにしない） */
.kcc-td--past .kcc-date,
.kcc-td--past .kcc-tags {
    opacity: .45;
}

/* 「札をタップすると予約画面が開きます」 */
.kcc-hint {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--kcc-gold-dark);
}

/* ---------- 凡例 ---------- */

.kcc-legend {
    list-style: none;
    margin: 24px 0 0;
    padding: 16px 20px;
    background: #faf8f4;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 28px;
    font-size: 15px;
}

.kcc-legend__item {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kcc-legend__item .kcc-tag {
    margin: 0;
    flex: 0 0 auto;
}

/* ---------- 注記 ---------- */

.kcc-note {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

.kcc-note p {
    margin: 0 0 4px;
}

/* ---------- 予約ボタン ---------- */

.kcc-cta-wrap {
    margin: 24px 0 0;
    text-align: center;
}

.kcc-cta {
    display: inline-block;
    padding: 15px 44px;
    background: var(--kcc-gold);
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 16px;
    letter-spacing: .05em;
    transition: background .2s;
}

.kcc-cta:hover,
.kcc-cta:focus {
    background: var(--kcc-gold-dark);
    color: #fff !important;
}

/* ==========================================================
   タブレット（〜899px）：1か月ずつ縦に
   ========================================================== */

@media (max-width: 899px) {
    .kcc-months {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .kcc-td {
        height: 84px;
    }
}

/* ==========================================================
   スマホ（〜600px）
   1マス＝約46px幅。札は2〜3文字・小さめで、横にはみ出さない
   ========================================================== */

@media (max-width: 600px) {
    .kcc-wrap {
        font-size: 15px;
    }

    .kcc-today {
        margin-bottom: 22px;
        padding: 14px 16px;
        border-left-width: 5px;
    }

    .kcc-today__main {
        font-size: 16px;
    }

    .kcc-today__next {
        font-size: 14px;
    }

    .kcc-months {
        gap: 26px;
    }

    .kcc-month__title {
        font-size: 18px;
    }

    .kcc-th {
        padding: 6px 0 !important;
        font-size: 12px;
    }

    .kcc-td {
        height: 64px;
        padding: 4px 1px !important;
    }

    .kcc-date {
        font-size: 13px;
    }

    .kcc-tags {
        margin-top: 2px;
    }

    .kcc-tag {
        margin-top: 3px;
        padding: 1px 3px;
        border-radius: 3px;
        font-size: 10.5px;
        letter-spacing: 0;
    }

    /* 休みの理由は、細いマスでは読めないので出さない（読み上げには残っている） */
    .kcc-why {
        display: none;
    }

    .kcc-td--today {
        box-shadow: inset 0 0 0 2px var(--kcc-gold);
    }

    .kcc-legend {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px 16px;
        font-size: 14px;
    }

    .kcc-legend__item .kcc-tag {
        font-size: 12px;
        padding: 1px 6px;
    }

    .kcc-note {
        font-size: 13px;
    }

    .kcc-cta {
        display: block;
        padding: 15px 10px;
    }
}

/* とても細い画面（〜340px）：「にきび」が入るよう、もう一段小さく
   （2026/9/18 実測：360pxなら10.5pxのままで収まる。320pxで9.5pxなら収まる） */
@media (max-width: 340px) {
    .kcc-tag {
        padding: 1px 2px;
        font-size: 9.5px;
    }

    .kcc-date {
        font-size: 12px;
    }
}
