/* ============================================================
   EBKaC labs — Calendar printer
   Page chrome (hero, form panel, preview) + the printable sheets.
   Sheets are sized in mm for A4 landscape (297 × 210 mm); the
   on-screen preview scales them with `zoom` (set by calendar.js),
   print resets that so every sheet lands on exactly one page.
   Theme colours arrive as --t-* custom properties on #cal-pages.
   ============================================================ */

:root{
  --bg:#fbfbfd;
  --surface:#ffffff;
  --ink:#1d1d1f;
  --ink-soft:#6e6e73;
  --line:#e3e3e6;
  --accent:#2563d9;
  --radius:18px;
  --shadow:0 1px 3px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.06);
  --maxw:1380px;
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:var(--font);
  color:var(--ink);
  background:var(--bg);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---- hero (top padding clears the floating nav pill) ---- */
.hero{
  text-align:center;
  padding:120px 22px 44px;
  background:linear-gradient(180deg,#f5f7fb 0%,var(--bg) 100%);
  border-bottom:1px solid var(--line);
}
.hero h1{font-size:clamp(32px,5.5vw,48px);font-weight:600;letter-spacing:-.02em}

/* ---- app layout ---- */
.cal-app{
  max-width:var(--maxw);margin:0 auto;padding:36px 22px 72px;
  display:grid;grid-template-columns:300px minmax(0,1fr);gap:28px;align-items:start;
}

.panel{
  position:sticky;top:96px;
  /* fit the window and scroll on its own, so every option stays reachable on short screens */
  max-height:calc(100vh - 96px - 20px);max-height:calc(100dvh - 96px - 20px);
  overflow-y:auto;overscroll-behavior:contain;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:22px;
  display:flex;flex-direction:column;gap:18px;
}
.panel > *{flex-shrink:0}
.panel fieldset{border:0;display:flex;flex-direction:column;gap:10px}
.panel legend{
  font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  color:var(--ink-soft);margin-bottom:8px;
}
.row{display:flex;gap:10px}
.field{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.field--year{flex:0 0 92px}
.field > span{font-size:13px;color:var(--ink-soft)}
.field select,.field input{
  font:inherit;font-size:15px;color:var(--ink);
  background:var(--surface);border:1px solid #d2d2d7;border-radius:10px;
  padding:8px 10px;width:100%;
}
.field select:focus,.field input:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:transparent}
.check{display:flex;align-items:center;gap:10px;font-size:15px;cursor:pointer}
.check input{width:18px;height:18px;accent-color:var(--accent)}

.swatches{display:flex;flex-wrap:wrap;gap:6px}
.swatch{
  width:26px;height:26px;border-radius:50%;cursor:pointer;
  border:2px solid var(--surface);box-shadow:0 0 0 1px #d2d2d7;
}
.swatch.is-on{box-shadow:0 0 0 2px var(--ink)}
.swatch:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.print-btn{
  font:inherit;font-size:16px;font-weight:600;color:#fff;background:var(--accent);
  border:0;border-radius:12px;padding:13px 18px;cursor:pointer;
}
.print-btn:hover{opacity:.92}
.print-btn:disabled{opacity:.45;cursor:not-allowed}
.summary{font-size:14px;color:var(--ink);text-align:center;margin-top:-8px}
.hint{font-size:12.5px;color:var(--ink-soft)}

.preview{min-width:0}
.error{
  background:#fdecec;color:#a11d1d;border:1px solid #f3c2c2;border-radius:12px;
  padding:12px 16px;font-size:15px;margin-bottom:16px;
}
.pages{display:flex;flex-direction:column;gap:24px;align-items:flex-start}

/* ---- bottom breadcrumb (shared look with products/support) ---- */
.breadcrumb-bottom{border-top:1px solid var(--line);background:var(--bg)}
.breadcrumb-bottom .bc-inner{max-width:var(--maxw);margin:0 auto;padding:16px 22px;display:flex;align-items:center;gap:10px;font-size:13px}
.breadcrumb-bottom .brand{font-weight:600;color:var(--ink)}
.breadcrumb-bottom .crumb{color:var(--ink-soft)}

@media (max-width:860px){
  .cal-app{grid-template-columns:1fr}
  .panel{position:static;max-height:none;overflow:visible}
}
@media (max-width:520px){
  .hero{padding:100px 16px 36px}
  .cal-app{padding:24px 16px 56px}
}

/* ============================================================
   PRINTABLE SHEETS
   ============================================================ */
.pages{
  --t-primary:#FF5600; --t-accent:#1d1d1f; --t-wk-ink:#E04B00; --t-wk-bg:#ffe9dd;
  --t-line:#d9b8a6; --t-ink:#1d1d1f; --t-muted:#5f5a57; --t-holiday:#E04B00;
}
.sheet{
  width:297mm;height:210mm;
  padding:9mm 11mm 10mm;
  background:#fff;color:var(--t-ink);
  font-family:Arial,Helvetica,sans-serif;line-height:1.2;
  display:flex;flex-direction:column;overflow:hidden;position:relative;
  box-shadow:0 1px 3px rgba(0,0,0,.08),0 10px 30px rgba(0,0,0,.10);
  -webkit-print-color-adjust:exact;print-color-adjust:exact;
}

/* grey word mark, bottom-right in the sheet's bottom margin */
.sheet::after{
  content:"ebkaclabs.com";
  position:absolute;right:11mm;bottom:4mm;
  font-size:7.5pt;letter-spacing:.02em;color:#9a9a9f;line-height:1;
}

/* one plain font throughout the printed calendar */
.sheet *{font-family:inherit}

/* ---- month sheet ---- */
/* page heading — shared by month sheets ("January 2027") and the year sheet ("2027") */
.m-title,.y-title{
  text-align:left;font-size:31pt;font-weight:700;letter-spacing:-.01em;
  color:var(--t-primary);line-height:1;margin:0 0 3.5mm;
}
.m-head{display:grid;grid-template-columns:repeat(7,1fr)}
.m-dow{
  text-align:center;font-size:11.5pt;font-weight:700;color:var(--t-muted);
  padding-bottom:1.6mm;
}
.m-dow.is-wk{color:var(--t-wk-ink)}
.m-grid{
  flex:1;min-height:0;
  display:grid;grid-template-columns:repeat(7,minmax(0,1fr));
  border-top:.3mm solid var(--t-line);border-left:.3mm solid var(--t-line);
}
.m-cell{
  border-right:.3mm solid var(--t-line);border-bottom:.3mm solid var(--t-line);
  padding:1.6mm 2mm;min-width:0;min-height:0;overflow:hidden;
}
.m-cell.is-wk{background:var(--t-wk-bg)}
.m-top{display:flex;align-items:flex-start;gap:2mm}
.m-num{font-size:13.5pt;font-weight:700;color:var(--t-ink);line-height:1}
.m-cell.is-wk .m-num{color:var(--t-wk-ink)}
.m-hol{
  flex:1;min-width:0;padding-left:1mm;
  font-size:7pt;color:var(--t-holiday);line-height:1.15;padding-top:.6mm;
}
.m-notes{background:#fff;padding:2.4mm 3.5mm}
.m-notes-label{font-size:10pt;color:var(--t-muted)}

/* ---- year overview sheet ---- */
.y-grid{
  flex:1;min-height:0;
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));
  gap:5mm 7mm;
}
.y-month{display:flex;flex-direction:column;min-height:0}
.y-mname{font-size:13pt;font-weight:700;color:var(--t-primary);line-height:1;margin-bottom:1.4mm}
.y-cal{
  flex:1;min-height:0;
  display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:auto repeat(6,minmax(0,1fr));
}
.y-dow{
  background:var(--t-primary);color:#fff;text-align:center;
  font-size:7pt;font-weight:700;padding:.9mm 0;
}
.y-dow.is-wk{background:var(--t-accent)}
.y-day{
  display:flex;align-items:center;justify-content:center;
  font-size:8.5pt;color:var(--t-ink);
}
.y-day.is-wk{background:var(--t-wk-bg);color:var(--t-wk-ink)}
.y-day.is-hol{font-weight:700;color:var(--t-holiday);text-decoration:underline;text-underline-offset:.5mm}

/* ============================================================
   PRINT — only the sheets, one per A4 landscape page
   ============================================================ */
@page{size:A4 landscape;margin:0}

@media print{
  html,body{background:#fff}
  body > *:not(main){display:none !important}
  .cal-app{display:block;max-width:none;padding:0;margin:0}
  .panel,.error{display:none !important}
  .pages{zoom:1 !important;display:block}
  .sheet{
    box-shadow:none;margin:0;
    height:209.5mm;            /* a hair under 210mm so rounding never spills a blank page */
    break-after:page;page-break-after:always;
    break-inside:avoid;page-break-inside:avoid;
  }
  .sheet:last-child{break-after:auto;page-break-after:auto}
}
