@charset "utf-8";
/* =========================================================
   協和医院｜診療時間表・診療科目担当表・医師紹介
   ファイル: css/timetable.css
   読み込み: <link rel="stylesheet" href="css/timetable.css">
             ※ style.css より後に読み込んでください

   【重要】サイト既存の style.css が h4 / h5 / ul / li / p などに
   スタイルを当てているため、このブロックでは見出しやリストのタグを
   使わず div / span だけで組んでいます。表組みだけは table を使い、
   影響を受ける指定に !important を付けています。
   ========================================================= */

.tt, .tt *,
.duty, .duty *,
.drs, .drs * {
  box-sizing: border-box;
}

/* =========================================================
   1. 診療時間表
   ========================================================= */
.tt {
  --tt-yoriko: #d97f8b;  /* 頼子院長 */
  --tt-keiju:  #4cb79b;  /* 恵樹医師 */
  --tt-alt:    #f2c14e;  /* 第2・第4のセル */
  --tt-dark:   #3f3f3f;  /* 見出し */
  --tt-empty:  #dcdcdc;  /* 休診 */
  margin: 0 0 1.6em;
  color: #333;
  line-height: 1.4;
}

/* ---- 担当医の凡例 ---- */
.tt-legend { margin: 0 0 1.2em; }
.tt-lg {
  display: flex;
  align-items: baseline;
  margin-bottom: .4em;
  font-size: 15px;
}
.tt-swatch {
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
  margin-right: .5em;
  border-radius: 2px;
  transform: translateY(.15em);
}
.tt-name {
  margin-right: .5em;
  font-weight: bold;
  font-size: 17px;
}
.tt-lg-y .tt-swatch { background: var(--tt-yoriko); }
.tt-lg-y .tt-name   { color: var(--tt-yoriko); }
.tt-lg-k .tt-swatch { background: var(--tt-keiju); }
.tt-lg-k .tt-name   { color: var(--tt-keiju); }

/* ---- 表本体（CSSグリッド） ----
   列の順番： 時間帯 / 月 / 火 / 水 / 木 / 金 / 土
   水曜は休診のため列幅を狭くしています（4番目の .5fr） */
.tt-grid {
  display: grid;
  gap: 6px;
  grid-template-columns:
    1.15fr
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, .5fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  grid-auto-flow: column;   /* 曜日ごとに縦に並ぶ */
}
.tt-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 5px;
}
.tt-corner { background: none; padding: 0; }

/* 曜日の見出し（曜日名は上端で揃える） */
.tt-day {
  justify-content: flex-start;
  background: var(--tt-dark);
  color: #fff;
  padding: 10px 4px 12px;
}
.tt-d {
  display: block;
  font-size: 30px;
  font-weight: bold;
  line-height: 1.1;
}
.tt-day .tt-sub {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.3;
}

/* 時間帯の見出し */
.tt-slot {
  background: var(--tt-dark);
  color: #fff;
}
.tt-s1 {
  display: block;
  font-size: 24px;
  font-weight: bold;
  line-height: 1.2;
}
.tt-s2 { display: block; font-size: 21px; }
.tt-s3 {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
}

/* 診療セル */
.tt-cell {
  background: var(--tt-empty);
  min-height: 104px;
}
.tt-nm {
  display: block;
  font-size: 17px;
  font-weight: bold;
  line-height: 1.3;
}
.tt-cell .tt-sub2 {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
}
.tt-y   { background: var(--tt-yoriko); color: #fff; }
.tt-k   { background: var(--tt-keiju);  color: #fff; }
.tt-alt { background: var(--tt-alt);    color: #333; }
.tt-alt .tt-nm { font-size: 15px; }
.tt-alt .tt-sub2 { margin-top: 8px; }

/* PCでは非表示（スマホ用のラベル・休診表記） */
.tt-lbl,
.tt-cell .tt-off { display: none; }

.tt-notes { margin: 1em 0 0; font-size: 13px; line-height: 1.7; }
.tt-notes span { display: block; }
.tt-notes span::before { content: "・"; }

/* =========================================================
   2. 診療科目担当表
   ========================================================= */
.duty {
  --duty-y: #d97f8b;
  --duty-k: #4cb79b;
  --duty-n: #8a94a6;
  margin: 0 0 1.8em;
  color: #333;
}
.duty-cap {
  text-align: center;
  font-size: 17px;
  font-weight: bold;
  padding-bottom: .8em;
}
.duty table {
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: collapse !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  background: none !important;
}
.duty th,
.duty td {
  border: 0 !important;
  border-bottom: 1px solid #dfe4e6 !important;
  padding: 10px 6px !important;
  background: none !important;
  font-weight: normal !important;
  vertical-align: middle !important;
}
.duty thead th {
  border-bottom: 2px solid #b9c2c6 !important;
  font-weight: bold !important;
  text-align: center !important;
  white-space: nowrap;
}
.duty .duty-h-subject {
  text-align: left !important;
  font-weight: normal !important;
  font-size: 14px;
  color: #666;
}
.duty thead .duty-y { color: var(--duty-y); }
.duty thead .duty-k { color: var(--duty-k); }
.duty thead .duty-n { color: var(--duty-n); }
.duty tbody th {
  text-align: left !important;
  width: 40%;
}
.duty tbody td {
  text-align: center !important;
  width: 20%;
}
.duty tbody tr:nth-child(even) th,
.duty tbody tr:nth-child(even) td { background: #f7f9fa !important; }
.duty-mark {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.duty td.is-y { color: var(--duty-y); }
.duty td.is-k { color: var(--duty-k); }
.duty td.is-n { color: var(--duty-n); }
.duty-note {
  margin: .9em 0 0;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

/* =========================================================
   3. 医師紹介カード
   ========================================================= */
.drs {
  --drs-y: #d97f8b;
  --drs-k: #4cb79b;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 1.6em;
  color: #333;
  line-height: 1.5;
}
.dr {
  border: 1px solid #e2e6e8;
  border-top: none;
  background: #fff;
}
.dr-head {
  padding: 12px 14px;
  color: #fff;
}
.dr-nm {
  font-size: 19px;
  font-weight: bold;
}
.dr-role {
  display: inline-block;
  margin-left: .5em;
  padding: 2px 8px;
  border-radius: 11px;
  background: rgba(255,255,255,.25);
  font-size: 12px;
  vertical-align: 2px;
}
.dr-spec {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}
.dr-y .dr-head { background: var(--drs-y); }
.dr-k .dr-head { background: var(--drs-k); }

.dr-body { padding: 14px; }
.dr-sec {
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e6e8;
  font-size: 14px;
  font-weight: bold;
  color: #5b6669;
}
.dr-list { margin-bottom: 18px; }
.dr-list:last-child { margin-bottom: 0; }
.dr-item {
  margin-bottom: 9px;
  padding-left: 12px;
  border-left: 3px solid #e2e6e8;
}
.dr-y .dr-item { border-left-color: #f0d3d7; }
.dr-k .dr-item { border-left-color: #cfe9e1; }
.dr-t {
  display: block;
  font-size: 15px;
  font-weight: bold;
}
.dr-d {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: #666;
}

/* =========================================================
   4. タブレット（〜800px）
   ========================================================= */
@media screen and (max-width: 800px) {
  .tt-d { font-size: 24px; }
  .tt-s1 { font-size: 19px; }
  .tt-s2 { font-size: 16px; }
  .tt-cell { min-height: 92px; }
  .tt-nm { font-size: 15px; }
  .tt-alt .tt-nm { font-size: 13px; }
  .tt-grid > div { padding: 10px 3px; }

  .duty table { font-size: 14px !important; }
  .duty tbody th { width: 46%; }

  .drs { gap: 12px; }
  .dr-nm { font-size: 17px; }
}

/* =========================================================
   5. スマートフォン（〜480px）
   ========================================================= */
@media screen and (max-width: 480px) {
  /* --- 診療時間表：曜日ごとのカード --- */
  .tt-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 4px;
  }
  .tt-corner,
  .tt-slot { display: none; }

  .tt-day {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    margin-top: 10px;
    padding: 7px 12px;
    text-align: left;
  }
  .tt-d { font-size: 20px; margin-right: .6em; }
  .tt-day .tt-sub { display: inline; margin-top: 0; }
  .tt-day br { display: none; }

  .tt-cell { min-height: 78px; padding: 10px 6px; }
  .tt-nm { font-size: 16px; }
  .tt-lbl {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    opacity: .9;
  }
  .tt-cell .tt-off {
    display: block;
    font-size: 13px;
    color: #7b8386;
  }
  .tt-alt .tt-nm { font-size: 13px; }
  .tt-lg { font-size: 13px; flex-wrap: wrap; }
  .tt-name { font-size: 15px; }

  /* --- 担当表：科目ごとのカード --- */
  .duty-cap { font-size: 15px; }
  .duty table, .duty tbody, .duty tbody tr { display: block !important; }
  .duty thead { display: none !important; }
  .duty tbody tr {
    border: 1px solid #dfe4e6 !important;
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 8px 10px 10px !important;
    background: #fff !important;
  }
  .duty tbody th {
    display: block !important;
    width: auto !important;
    border: 0 !important;
    padding: 0 0 6px !important;
    font-weight: bold !important;
    font-size: 14px !important;
    background: none !important;
  }
  .duty tbody td { display: none !important; }
  .duty tbody td.is-on {
    display: inline-block !important;
    width: auto !important;
    border: 0 !important;
    margin-right: 6px;
    padding: 3px 9px !important;
    border-radius: 12px;
    font-size: 12px !important;
    color: #fff !important;
  }
  .duty tbody td.is-on .duty-mark { display: none; }
  .duty tbody td.is-on::before { content: attr(data-name); }
  .duty tbody td.is-y { background: var(--duty-y) !important; }
  .duty tbody td.is-k { background: var(--duty-k) !important; }
  .duty tbody td.is-n { background: var(--duty-n) !important; }

  /* --- 医師カード --- */
  .drs { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dr-body { padding: 12px; }
  .dr-item { margin-bottom: 8px; }
}

/* =========================================================
   6. 印刷
   ========================================================= */
@media print {
  .tt-grid > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
