/* =========================================================
   calendar-table-narrow.css
   12ヶ月を必ず全表示するための「超圧縮スタイル」
   地域区分は崩れてOK、列の見やすさより全列表示を優先
   ========================================================= */

.md-typeset table.calendar-table-narrow {
  width: 100%;
  table-layout: fixed;     /* ← 全列均等化のため必須 */
  border-collapse: collapse;
}

/* =========================================================
   1列目：地域区分（崩れてもよい → 限界まで圧縮）
   ========================================================= */

.md-typeset table.calendar-table-narrow th:nth-child(1),
.md-typeset table.calendar-table-narrow td:nth-child(1) {
  min-width: 2.5rem !important;   /* ← 極限まで狭く */
  width: 2.5rem !important;
  padding: 0.2rem !important;
  font-size: 0.75rem !important;
  line-height: 1.05 !important;
  word-break: break-word !important; /* ← 縦に崩れてOK */
  text-align: left;
}

/* =========================================================
   2〜13列目（1月〜12月）
   極細化して13列すべてを100%内に押し込む
   ========================================================= */

.md-typeset table.calendar-table-narrow th:nth-child(n+2):nth-child(-n+13),
.md-typeset table.calendar-table-narrow td:nth-child(n+2):nth-child(-n+13) {
  min-width: 1.9rem !important;   /* ← これが“全列表示”の決め手 */
  width: 1.9rem !important;
  padding: 0.15rem !important;
  font-size: 0.70rem !important;  /* ← 文字縮小 */
  line-height: 1.05 !important;
  text-align: center;
  word-break: keep-all;
}

/* =========================================================
   セルの基本設定（折返し）
   ========================================================= */

.md-typeset table.calendar-table-narrow th,
.md-typeset table.calendar-table-narrow td {
  white-space: normal;
  overflow-wrap: anywhere;
  border: 1px solid var(--math-box-border);
}

/* 列境界を太くする（可読性アップ） */
.md-typeset table.calendar-table-narrow th + th,
.md-typeset table.calendar-table-narrow td + td {
  border-left-width: 2px;
}

/* =========================================================
   スマホ最適化（768px 以下）：さらに極限圧縮
   ========================================================= */

@media (max-width: 768px) {

  /* 地域区分 */
  .md-typeset table.calendar-table-narrow th:nth-child(1),
  .md-typeset table.calendar-table-narrow td:nth-child(1) {
    min-width: 2.0rem !important;
    width: 2.0rem !important;
    font-size: 0.70rem !important;
  }

  /* 月列（12ヶ月） */
  .md-typeset table.calendar-table-narrow th:nth-child(n+2):nth-child(-n+13),
  .md-typeset table.calendar-table-narrow td:nth-child(n+2):nth-child(-n+13) {
    min-width: 1.6rem !important;  /* ← PCでは1.9rem、スマホは1.6rem */
    width: 1.6rem !important;
    font-size: 0.65rem !important;
  }
}
