/* 월별 달력(/calendar/, /calendar/YYYY-MM/) 전용 스타일 — Seeknoter
 * ../styles.css(디자인 시스템) 다음에 읽는다. 글꼴은 styles.css 의 var(--font)(한글 시스템 글꼴 폴백)를 그대로 쓴다. 외부 폰트 없음.
 * 화면: 한 달을 크게(넓은 화면은 칸 안에 공휴일 이름, 좁은 화면은 이름을 숨기고 아래 목록으로). 표는 table-layout: fixed + width 100% 라 360px 에서도 옆으로 넘치지 않는다.
 * 인쇄: 기본(Ctrl+P, 「A4 세로 인쇄」)은 A4 세로 한 장. 「A4 가로 인쇄」는 month.js 가 <html> 에 print-landscape 를 붙이고 @page 크기를 가로로 바꾼다.
 * 2027 연도 달력(/calendar/2027/, 원본 2027-calendar/calendar.css)과 같은 색·모양을 쓴다.
 */
:root { --lw-soft: #e6effd; --lw-line: #8fa9d3; }
@media screen and (prefers-color-scheme: dark) { :root { --lw-soft: #1b2940; --lw-line: #4a6796; } }

.page-cal .site-header p, .page-cal main section > p { max-width: 46rem; }
@media (min-width: 48rem) { .page-cal .hero-split { grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem); } .page-cal .hero-split .hero-art { max-width: none; } }
@media (max-width: 47.99rem) {
  .page-month .hero { padding: var(--s4) 0 var(--s3); }
  .page-month .hero .eyebrow, .page-month .hero .lede, .page-month .hero .meta { display: none; }
  .page-month .hero h1 { font-size: clamp(1.375rem, 6.2vw, 1.75rem); }
}
/* 데스크톱(64rem~): 히어로를 한 줄로 줄이고 삽화를 빼서 1280×900 첫 화면에 달력 전체가 들어오게. 칸 높이는 줄 수(rows-4~6)와 화면 높이로 정한다 */
@media screen and (min-width: 64rem) {
  .page-month .hero { padding: var(--s4) 0 var(--s2); }
  .page-month .hero-split { display: block; }
  .page-month .hero-split .hero-art, .page-month .hero .eyebrow, .page-month .hero .meta { display: none; }
  .page-month .hero h1 { margin: 0; font-size: 1.75rem; }
  .page-month .hero h1 .h1-sub { display: inline; margin: 0 0 0 8px; font-size: 1.125rem; }
  .page-month .hero .lede { margin: 4px 0 0; font-size: .9375rem; max-width: none; }
  .page-month .month-nav-top { margin-top: var(--s2); }
  .page-month .month-nav-top a { min-height: 44px; padding: 4px 12px; font-size: .875rem; }
  .page-month main > section#month { margin-top: var(--s3); padding: var(--s4) var(--s6) var(--s6); }
  .page-month .cal-month { margin-top: var(--s3); padding: var(--s3) var(--s4) var(--s4); }
  .page-month .mhead { padding-bottom: 4px; }
  /* 26rem = 상단바·한 줄 히어로·앞뒤 달·범례·달 제목·요일 머리칸의 높이 합(실측 1280×900 에서 표 위쪽 341~366px) + 여유 */
  .rows-4 .bigcal td { height: clamp(4rem, calc((100vh - 26rem) / 4), 7rem); }
  .rows-5 .bigcal td { height: clamp(3.75rem, calc((100vh - 26rem) / 5), 6.5rem); }
  .rows-6 .bigcal td { height: clamp(3.25rem, calc((100vh - 26rem) / 6), 6rem); }
}

/* 앞뒤 달 이동 */
.month-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s2); align-items: stretch; margin: var(--s3) 0 0; }
.month-nav-bottom { margin-top: var(--s5); }
.month-nav a { display: inline-flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-weight: 700; font-size: .9375rem; line-height: 1.35; text-decoration: none; }
.month-nav a:hover { border-color: var(--brand-line); color: var(--brand); }
.month-nav .mn-k { display: block; font-size: .6875rem; font-weight: 600; color: var(--subtle); }
.month-nav .mn-prev { justify-self: start; }
.month-nav .mn-next { justify-self: end; text-align: right; }
.month-nav .mn-hub { align-items: center; color: var(--brand); background: var(--brand-soft); border-color: transparent; }
@media (max-width: 30rem) {
  .month-nav a { padding: 6px 10px; font-size: .8125rem; }
  .month-nav .mn-hub { padding: 6px 8px; }
}

/* 범례·인쇄 버튼 */
.page-cal .legend { margin: var(--s2) 0 var(--s3); font-size: .8125rem; }
.legend .l-lw { width: 22px; border-radius: 4px; background: var(--lw-soft); box-shadow: inset 0 0 0 1px var(--lw-line); }
.legend .l-sun { color: var(--hol); font-weight: 800; }
.legend .l-sat { color: var(--sat); font-weight: 800; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); margin: 0; }
.page-cal .cal-toolbar .legend { margin: 0; }
.print-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0; }
.print-bar .btn { min-height: 44px; margin-top: 0; padding: 0 var(--s5); font-size: .9375rem; }
.print-bar .help-wrap { align-self: center; }
@media (max-width: 30rem) { .print-bar { width: 100%; flex-wrap: nowrap; } .print-bar .btn { flex: 1 1 0; padding: 0 10px; font-size: .875rem; text-align: center; } }
.page-month main > section#month { padding-top: var(--s5); }
@media (max-width: 47.99rem) { .page-month .month-nav-top { margin-top: var(--s3); } }

/* 한 달 크게 */
.cal-month { margin-top: var(--s4); padding: var(--s3) 0 var(--s4); }
@media (min-width: 48rem) { .cal-month { padding: var(--s4) var(--s4) var(--s5); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); } }
.mhead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); padding: 0 4px var(--s2); }
.mhead h2 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
@media (min-width: 48rem) { .mhead h2 { font-size: 1.75rem; } }
.mhead-sub { margin: 0; font-size: .8125rem; color: var(--subtle); white-space: nowrap; }
table.bigcal { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 1rem; }
.bigcal thead th { padding: 6px 0; border-bottom: 1px solid var(--line-strong); background: none; text-align: center; font-size: .75rem; font-weight: 700; color: var(--subtle); white-space: nowrap; }
.bigcal thead th.sun { color: var(--hol); }
.bigcal thead th.sat { color: var(--sat); }
.bigcal td { position: relative; height: 3.25rem; min-width: 0; padding: 4px 2px; border: 0; border-bottom: 1px solid var(--line); text-align: center; vertical-align: top; }
.bigcal td.empty { background: var(--surface-2); }
.bigcal td time { display: inline-flex; align-items: center; justify-content: center; width: 2.15rem; height: 2.15rem; border-radius: 999px; font-variant-numeric: tabular-nums; font-weight: 600; }
.bigcal td.sun, .bigcal td.sun time { color: var(--hol); }
.bigcal td.sat, .bigcal td.sat time { color: var(--sat); }
.bigcal td.hol, .bigcal td.hol time { color: var(--hol); }
.bigcal td.hol time { background: var(--hol-soft); font-weight: 800; }
.bigcal td.sub, .bigcal td.sub time { color: var(--sub); }
.bigcal td.sub time { background: var(--sub-soft); box-shadow: inset 0 0 0 2px var(--sub); }
.bigcal td.lw { background: var(--lw-soft); }
/* 공휴일 이름: 좁은 화면은 칸이 좁아 숨기고(스크린리더는 읽음) 아래 목록으로, 40rem 이상은 칸 안에 표시 */
.bigcal .hn { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (min-width: 40rem) {
  .bigcal td { height: 5.25rem; padding: 6px 6px 8px; text-align: left; }
  .bigcal td time { width: auto; height: auto; min-width: 2rem; padding: 2px 8px; border-radius: 999px; }
  .bigcal .hn { position: static; display: block; width: auto; height: auto; margin: 4px 0 0; overflow: visible; clip: auto; white-space: normal; overflow-wrap: break-word; word-break: keep-all; font-size: .8125rem; line-height: 1.35; font-weight: 700; }
}
@media (min-width: 64rem) { .bigcal { font-size: 1.0625rem; } }
/* 공휴일 없는 달: 앞뒤 공휴일과 D-n */
.dday-static { color: var(--muted); }
.dday { margin-left: 6px; color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.dday:empty { display: none; }

/* 이 달의 공휴일 목록(물음표 도움말 포함) */
.hlist { display: grid; gap: 6px; margin: var(--s3) 4px 0; padding: var(--s3) 0 0; border-top: 1px dashed var(--line); list-style: none; }
.hlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; min-height: 32px; font-size: .9375rem; line-height: 1.5; }
.hlist time { font-weight: 800; color: var(--hol); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hlist .is-sub time, .hlist li.is-sub time { color: var(--sub); }
.hlist .hname { font-weight: 700; }
.hlist .tag { margin-left: 0; }
.hlist .help-wrap { margin-left: -4px; }
.mh.none { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: var(--s3) 4px 0; padding: var(--s3) 0 0; border-top: 1px dashed var(--line); font-size: .9375rem; color: var(--subtle); }
.page-cal #month .stats { margin-top: var(--s5); }

/* 인쇄할 때만 보이는 출처 줄 */
.psrc { display: none; }

/* 공휴일 근거 표 */
.cal-hol-table td { overflow-wrap: break-word; }
.cal-hol-table td:first-child { width: 1%; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-hol-table tr.is-sub td { background: var(--sub-soft); }
.cal-hol-table tr.is-sub td:first-child { box-shadow: inset 3px 0 0 var(--sub); }
@media (max-width: 30rem) { .cal-hol-table th, .cal-hol-table td { padding-left: .6rem; padding-right: .6rem; } .cal-hol-table td:first-child { white-space: normal; } }

/* 목록 페이지: 달 카드 */
.month-list { display: grid; gap: var(--s3); margin: var(--s4) 0 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .month-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .month-list { grid-template-columns: repeat(3, 1fr); } }
.month-list li { margin: 0; }
.mcard { display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 44px; padding: var(--s4) var(--s5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.mcard:hover { border-color: var(--brand-line); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.mc-title { font-size: 1.1875rem; font-weight: 800; letter-spacing: -.02em; }
.mc-hol { font-size: .875rem; line-height: 1.55; color: var(--muted); }
.mc-lw { font-size: .8125rem; line-height: 1.5; color: var(--brand); font-weight: 700; }
.mcard .tool-go { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: var(--s2); color: var(--brand); font-size: .9375rem; font-weight: 700; }
.mcard .tool-go::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.promise-list { display: grid; gap: var(--s3); margin: var(--s4) 0 0; padding: 0; list-style: none; }
@media (min-width: 44rem) { .promise-list { grid-template-columns: repeat(3, 1fr); } }
.promise-list li { margin: 0; padding: var(--s4); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); font-size: .9375rem; line-height: 1.6; color: var(--muted); }
.promise-list b { display: block; margin-bottom: 4px; color: var(--text); font-size: 1rem; }

/* ------------------------------------------------------------------ 인쇄 (A4 한 장) */
@page { size: A4 portrait; margin: 10mm; }

@media print {
  :root {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #f1f2ee; --surface-3: #eceff3; --text: #111; --muted: #333; --subtle: #333; --line: #9a9ea5; --line-strong: #9a9ea5; --brand: #1f5fbf;
    --hol: #b8282b; --hol-soft: #fbe1e1; --sub: #8a4a00; --sub-soft: #ffeac8; --sat: #2a5ca6; --lw-soft: #e1eaf8; --lw-line: #8fa9d3;
  }
  html, body { background: #fff !important; color: #111; }
  body { font-size: 10pt; line-height: 1.4; }
  .topbar, .toc, .site-header, .site-footer, .no-print, .ad-slot, .skip, .month-nav, .help-wrap, .hero-art { display: none !important; }
  .page-month main > section:not(#month) { display: none !important; }
  .page-cal .wrap { max-width: none; margin: 0; padding: 0; }
  .page-month main section#month { border: 0; border-radius: 0; margin: 0; padding: 0; background: none; box-shadow: none; }
  .legend, .legend i, .cal-month, .bigcal td, .bigcal td time, .hlist { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cal-toolbar { margin: 0 0 2mm; }
  .page-cal .legend { font-size: 8pt; margin: 0; color: #333; }
  .cal-month { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
  .mhead { padding: 0; }
  .mhead h2 { font-size: 24pt; margin: 0 0 3mm; }
  .bigcal { font-size: 15pt; }
  .bigcal thead th { font-size: 10pt; padding: 1.5mm 0; border-bottom: .5mm solid #111; }
  .bigcal td { height: 33mm; padding: 1.2mm 1.5mm; border: .3mm solid #9a9ea5; text-align: left; vertical-align: top; }
  .bigcal td.empty { background: #f7f7f5; }
  .bigcal td time { display: inline-block; width: auto; height: auto; min-width: 0; padding: 0 1.5mm; border-radius: 1.5mm; line-height: 1.35; }
  .bigcal td.sub time { box-shadow: inset 0 0 0 .35mm var(--sub); }
  .bigcal .hn { position: static; display: block; width: auto; height: auto; margin: 1mm 0 0; overflow: visible; clip: auto; white-space: normal; font-size: 8.5pt; line-height: 1.25; font-weight: 700; }
  .hlist { display: block; margin: 3mm 0 0; padding: 2mm 0 0; border-top: .3mm solid #9a9ea5; font-size: 9.5pt; color: #333; }
  .hlist li { display: inline; margin: 0 4mm 0 0; min-height: 0; font-size: 9.5pt; }
  .hlist li::after { content: " "; }
  .hlist time { margin-right: 1mm; }
  .hlist .tag { padding: 0 1.5mm; }
  .mh.none { margin: 3mm 0 0; padding: 2mm 0 0; border-top: .3mm solid #9a9ea5; font-size: 9.5pt; }
  .psrc { display: block; margin: 2mm 0 0; font-size: 7.5pt; color: #333; }

  /* 가로(A4 landscape): month.js 가 @page 크기를 가로로 바꾸고 이 클래스를 붙인다 — 칸은 낮고 넓게 */
  html.print-landscape .mhead h2 { font-size: 20pt; margin-bottom: 2mm; }
  html.print-landscape .bigcal { font-size: 13pt; }
  html.print-landscape .bigcal thead th { padding: 1mm 0; }
  html.print-landscape .bigcal td { height: 21mm; padding: 1mm 1.5mm; }
  html.print-landscape .bigcal .hn { font-size: 8pt; margin-top: .5mm; }
  html.print-landscape .hlist { margin-top: 2mm; padding-top: 1.5mm; font-size: 9pt; }
  html.print-landscape .hlist li { font-size: 9pt; }
}
