/* 年間休日カレンダー作成ツール 専用スタイル */

/* ---------- 集計 ---------- */

.verdict {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-left-width: 6px;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0 16px;
}

.verdict-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }

.verdict-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 4px 0;
}

.verdict-sub { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }

/* ---------- 月別の集計表 ---------- */

.monthly { font-size: .85rem; }
.monthly th, .monthly td { text-align: center; padding: 6px 8px; }
.monthly th.tl, .monthly td.tl { text-align: left; font-weight: 600; }
.monthly td { font-variant-numeric: tabular-nums; }
.monthly td.sum { font-weight: 700; background: var(--surface-2); }

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

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  font-size: .8rem;
}

.lg { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }

.lg::before {
  content: '';
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.lg.off::before { background: var(--surface-2); }
.lg.hol::before { background: #ffe0e0; border-color: #e8a0a0; }
.lg.ov::before { background: var(--accent-soft); border-color: var(--accent); border-width: 2px; }

.lg-note { color: var(--text-muted); font-size: .78rem; }

/* ---------- 年間カレンダー ---------- */

.year-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 4px;
}

.months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
}

.month-head {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.month-off {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
}

table.cal {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table.cal th {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 0;
  background: none;
  border: 0;
  text-align: center;
  position: static;
}

table.cal th.sun { color: #b3261e; }
table.cal th.sat { color: #2d6ca8; }

table.cal td {
  text-align: center;
  padding: 4px 0;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

table.cal td:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
table.cal td.empty { cursor: default; }
table.cal td.empty:hover { outline: none; }

table.cal td.work { color: var(--text); }
table.cal td.off { background: var(--surface-2); color: var(--text-muted); font-weight: 600; }
table.cal td.sun { color: #b3261e; }
table.cal td.sat { color: #2d6ca8; }
table.cal td.hol.off { background: #ffe0e0; color: #8a2020; }
table.cal td.ov { border-color: var(--accent); border-width: 2px; font-weight: 700; }

@media (prefers-color-scheme: dark) {
  table.cal td.hol.off { background: #4a2626; color: #f0b8b8; }
  table.cal th.sun, table.cal td.sun { color: #e2857f; }
  table.cal th.sat, table.cal td.sat { color: #7fb0e0; }
  .lg.hol::before { background: #4a2626; border-color: #7a4040; }
}

/* ---------- 計算式 ---------- */

.formula {
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 1rem;
  font-weight: 600;
  overflow-x: auto;
}

ul { padding-left: 1.4em; }
ul li { margin-bottom: 6px; }

/* ---------- 印刷（A4に1年ぶんを収める） ---------- */

@media print {
  .verdict {
    border: 1px solid #999;
    background: #fff !important;
    padding: 10px 14px;
    margin: 0 0 10px;
  }
  .verdict-value { font-size: 1.2rem; color: #000; }
  .year-title { font-size: 1rem; margin: 0 0 8px; }

  .months { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .month { border: 1px solid #999; padding: 4px 6px 6px; break-inside: avoid; }
  .month-head { font-size: .8rem; margin-bottom: 3px; }

  table.cal td, table.cal th { font-size: 7.5pt; padding: 1px 0; }
  table.cal td.off { background: #eee !important; -webkit-print-color-adjust: exact; }
  table.cal td.hol.off { background: #f8d8d8 !important; -webkit-print-color-adjust: exact; }

  h2, h3, p, ul, .table-scroll, .ad-slot, .lead { display: none; }
  @page { size: A4 landscape; margin: 8mm; }
}

@media (max-width: 600px) {
  .verdict-value { font-size: 1.6rem; }
  .months { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .month { padding: 8px; }
  table.cal td { font-size: .75rem; padding: 3px 0; }
}
