/**
 * はいむるぶしで歌う夜（トップのパネル .hl ／ イベント一覧のカレンダー .hc）
 *
 * パネルは「朗読」（css/components/roudoku-teaser.css）と同じ語彙:
 *   地は --bg-inset ／ 上端に織りの耳 ／ 右上に錘 ／ 扉は罫だけのリンク
 * 新しい色・フォント・画像は足していない。色は semantic トークンだけなので、
 * ダーク専用のブロックは書かない（global-design-system.css の再マップに従う）。
 *
 * 「歌う」と「休み」は色だけで分けない。字（歌う／休み）を必ず添える。
 */

/* ------------------------------------------------------------------
   トップのパネル
   ------------------------------------------------------------------ */

.hl__panel {
    position: relative;
    background: var(--bg-inset);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
    padding: 30px 36px 26px;
    overflow: hidden;
}

.hl__ear {
    position: absolute;
    inset: 0 0 auto 0;
    --kk-band-h: 6px;
    opacity: 0.85;
}

.hl__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin: 6px 0 20px;
}

/* --heading は淡い地で足りないので本文色（.rdt__title と同じ判断） */
.hl__panel .hl__title {
    color: var(--text-primary);
}

/* 錘: 今月歌う夜の数。明朝の等幅数字 */
.hl__count {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.28em;
    font-family: var(--font-serif);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hl__count-n {
    font-size: 2.1rem;
    font-weight: 500;
    line-height: 1;
    color: var(--text-primary);
}

.hl__count-u { font-size: 0.95rem; }

/* 一言。この面でいちばん大きい字 */
.hl__tonight {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.03em;
    color: var(--text-primary);
}

/* 歌う夜だけ、左に海の色の罫を立てる（地としての --accent-strong は可） */
.hl__tonight--sing {
    padding-left: 14px;
    border-left: 4px solid var(--accent-strong);
}

.hl__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin: 12px 0 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.hl__meta .kk-icon {
    color: var(--text-muted);
}

/* アイコンと字を離さない。折り返すのは項目の間だけ */
.hl__meta-i {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.hl__note {
    max-width: var(--measure);
    margin: 8px 0 0;
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.hl__sub {
    margin: 22px 0 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* この先2週間。1日＝日付・曜日・状態の3段 */
.hl__days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hl__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 2px 7px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    font-variant-numeric: tabular-nums;
}

.hl__day-d {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.hl__day-w {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hl__day-s {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hl__day--sing {
    border-color: var(--accent);
    box-shadow: inset 0 -3px 0 var(--accent);
}

.hl__day--sing .hl__day-s {
    color: var(--text-accent);
}

.hl__day--rest {
    opacity: 0.75;
}

.hl__doors {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin: 20px 0 0;
}

/* 組みは .rdt__read と同じ。--link は本文リンクに使わない */
.hl__read,
.hc__source a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.hl__read {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 11px 0 4px;
    font-size: 1.02rem;
    font-weight: 500;
}

.hl__read:hover,
.hl__read:focus-visible,
.hc__source a:hover,
.hc__source a:focus-visible {
    color: var(--text-accent);
    border-bottom-color: currentColor;
}

.hl__read:focus-visible,
.hc__source a:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 4px;
}

.hl__source,
.hc__source {
    margin: 14px 0 0;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-muted);
}

/* ------------------------------------------------------------------
   イベント一覧のカレンダー
   ------------------------------------------------------------------ */

.hc {
    margin-bottom: 40px;
    padding: 28px 30px 24px;
    scroll-margin-top: 90px;
}

.hc__lead {
    max-width: var(--measure);
    margin: 0 0 18px;
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-primary);
}

.hc__months {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px 28px;
}

.hc__month-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 8px;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.hc__month-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hc__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    table-layout: fixed;
}

.hc__table th {
    padding: 2px 0 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.hc__table th.hc__we {
    color: var(--text-secondary);
}

.hc__cell {
    height: 52px;
    padding: 4px 0;
    border-radius: 8px;
    text-align: center;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.hc__cell--blank {
    background: transparent;
}

.hc__d {
    display: block;
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.hc__s {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hc__cell--sing {
    background: var(--bg-inset-strong);
    box-shadow: inset 0 -3px 0 var(--accent);
}

.hc__cell--sing .hc__s {
    color: var(--text-accent);
}

/* 休みの日は地を敷かない。歌う日だけが面として浮く */
.hc__cell--rest {
    background: transparent;
}

.hc__cell--rest .hc__d,
.hc__cell--unknown .hc__d {
    color: var(--text-muted);
}

.hc__cell--unknown .hc__s {
    font-weight: 400;
}

/* 今日（JS が日本時間で付ける） */
.hc__cell.is-today {
    outline: 2px solid var(--accent-strong);
    outline-offset: -2px;
}

/* ------------------------------------------------------------------
   狭い画面
   ------------------------------------------------------------------ */

@media (max-width: 768px) {
    .hl__panel {
        padding: 24px 18px 22px;
    }

    .hl__head {
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    /* index.css が狭い画面で下線を中央に寄せるので戻す（97 の札） */
    .hl__panel .hl__title::after {
        margin-left: 0;
        margin-right: 0;
    }

    .hl__count-n {
        font-size: 1.7rem;
    }

    .hl__tonight {
        font-size: 1.2rem;
    }

    .hl__days {
        gap: 4px;
    }

    .hl__day-d {
        font-size: 1rem;
    }

    .hl__day-s {
        font-size: 0.75rem;
    }

    .hc {
        padding: 22px 14px 20px;
    }

    .hc__cell {
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hl__read,
    .hc__source a {
        transition: none;
    }
}
