/* Shared by the isolated print document and the Ctrl+P fallback. */
/* Weekday rows with custom column headings. */
@page {
  size: A4 landscape;
  margin: 5mm;
}

body.weekly-planner-print-page {
  margin: 0;
  padding: 0;
  background: #fff;
}

#weekly-planner-print-root {
  display: none;
  --wp-accent: #b94f1b;
  --wp-soft: #fff3e9;
  --wp-notes: #087d85;
  box-sizing: border-box;
  color: #243a38;
  font: 10pt/1.35 'Segoe UI', Arial, sans-serif;
  text-align: left;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

body.weekly-planner-print-page > #weekly-planner-print-root { display: block; }
#weekly-planner-print-root * { box-sizing: border-box; }
#weekly-planner-print-root[data-theme="sky"] { --wp-accent: #367ca6; --wp-soft: #edf5fa; --wp-notes: #8b5a8c; }
#weekly-planner-print-root[data-theme="sage"] { --wp-accent: #56765c; --wp-soft: #f0f5eb; --wp-notes: #947044; }
#weekly-planner-print-root[data-theme="ink"] { --wp-accent: #4d5856; --wp-soft: #fff; --wp-notes: #4d5856; }

#weekly-planner-print-root .wp-print-sheet {
  display: flex;
  flex-direction: column;
  width: 287mm;
  max-width: 100%;
  height: 199mm;
  margin: 0;
  padding: 2mm;
  border: .4mm solid #d0dcd5;
  border-top: 1.5mm solid #477b61;
  background: #fff;
  overflow: visible;
}

#weekly-planner-print-root .wp-print-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1mm 4mm;
  flex: 0 0 auto;
  margin: 0 0 2mm;
}
#weekly-planner-print-root h1 { margin: 0; font: 24pt/1.1 Georgia, serif; color: #243a38; overflow-wrap: anywhere; }
#weekly-planner-print-root .wp-print-dates {
  margin: 0;
  max-width: 130mm;
  font-size: 8pt;
  text-align: right;
}
#weekly-planner-print-root .wp-print-heading .wp-print-credit {
  grid-column: 2;
  max-width: 130mm;
  margin: 0;
  text-align: right;
}
#weekly-planner-print-root .wp-print-focus { margin: 0 0 2mm; padding: 0 0 1.5mm; border-bottom: .2mm solid #d6ded9; white-space: pre-wrap; overflow-wrap: anywhere; }
#weekly-planner-print-root .wp-print-weather { display: flex; gap: 2mm; flex: 0 0 auto; padding: 1.5mm 1mm; color: #536960; font-size: 8pt; }
#weekly-planner-print-root .wp-print-weather svg { flex: 0 0 6mm; width: 6mm; height: 6mm; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#weekly-planner-print-root .wp-print-forecast { font-weight: 600; }
#weekly-planner-print-root .wp-print-weather-detail { font-size: 7pt; }
#weekly-planner-print-root .wp-print-credit { flex: 0 0 auto; margin: 2mm 0 0; font-size: 6.5pt; line-height: 1.3; color: #536960; }
#weekly-planner-print-root a { color: inherit; text-decoration: none; }

/* Long entries expand rather than being cut off at the bottom of a cell. */
#weekly-planner-print-root[data-overflow="true"] .wp-print-sheet { height: auto; min-height: 199mm; }

#weekly-planner-print-root {
  --day-0: #e4e6cf;
  --day-0-ink: #326885;
  --day-1: #e7a3b8;
  --day-1-ink: #683d4c;
  --day-2: #e8754e;
  --day-3: #54876d;
  --day-4: #b85a58;
  --day-5: #4e88aa;
  --day-6: #c9b657;
  --day-6-ink: #704833;
}

#weekly-planner-print-root[data-theme="sky"] {
  --day-0: #e0edf3;
  --day-1: #8db8cc;
  --day-1-ink: #234b63;
  --day-2: #6a9cb8;
  --day-3: #567eaa;
  --day-4: #6b849f;
  --day-5: #487894;
  --day-6: #b9d5df;
  --day-6-ink: #315c70;
}

#weekly-planner-print-root[data-theme="sage"] {
  --day-0: #e4eadc;
  --day-0-ink: #3b604e;
  --day-1: #b1c8a7;
  --day-1-ink: #345241;
  --day-2: #71987b;
  --day-3: #4d7863;
  --day-4: #778c68;
  --day-5: #537b71;
  --day-6: #d0d6ab;
  --day-6-ink: #4d603c;
}


#weekly-planner-print-root { --columns: 5; }
#weekly-planner-print-root[data-columns="2"] { --columns: 2; }
#weekly-planner-print-root[data-columns="3"] { --columns: 3; }
#weekly-planner-print-root[data-columns="4"] { --columns: 4; }
#weekly-planner-print-root[data-columns="5"] { --columns: 5; }
#weekly-planner-print-root[data-columns="6"] { --columns: 6; }

#weekly-planner-print-root [data-weekday="0"] { --day-fill: var(--day-0); --day-ink: var(--day-0-ink); }
#weekly-planner-print-root [data-weekday="1"] { --day-fill: var(--day-1); --day-ink: var(--day-1-ink); }
#weekly-planner-print-root [data-weekday="2"] { --day-fill: var(--day-2); --day-ink: #fff; }
#weekly-planner-print-root [data-weekday="3"] { --day-fill: var(--day-3); --day-ink: #fff; }
#weekly-planner-print-root [data-weekday="4"] { --day-fill: var(--day-4); --day-ink: #fff; }
#weekly-planner-print-root [data-weekday="5"] { --day-fill: var(--day-5); --day-ink: #fff; }
#weekly-planner-print-root [data-weekday="6"] { --day-fill: var(--day-6); --day-ink: var(--day-6-ink); }

#weekly-planner-print-root .wp-print-columns {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border: .2mm solid #cfdad3;
}

#weekly-planner-print-root .wp-print-columnheads,
#weekly-planner-print-root .wp-print-row {
  display: grid;
  grid-template-columns: 25mm repeat(var(--columns), minmax(0, 1fr));
}

#weekly-planner-print-root .wp-print-columnheads {
  flex: 0 0 auto;
  min-height: 8mm;
  border-bottom: .2mm solid #cfdad3;
  background: #f7f9f7;
}

#weekly-planner-print-root .wp-print-columnheads > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2mm;
  border-right: .2mm solid #cfdad3;
  font-size: 9pt;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: center;
}

#weekly-planner-print-root .wp-print-rows {
  display: grid;
  grid-template-rows: repeat(7, minmax(0, 1fr));
  flex: 1;
  min-height: 0;
}

#weekly-planner-print-root .wp-print-row {
  min-height: 0;
  border-bottom: .2mm solid #cfdad3;
}

#weekly-planner-print-root .wp-print-row:last-child {
  border-bottom: 0;
}

#weekly-planner-print-root .wp-print-row > :last-child,
#weekly-planner-print-root .wp-print-columnheads > :last-child {
  border-right: 0;
}

#weekly-planner-print-root .wp-print-dayhead {
  min-height: 0;
  padding: 1mm 1.5mm;
  border-right: .2mm solid #cfdad3;
  text-align: center;
}

#weekly-planner-print-root .wp-print-daytab {
  display: block;
  padding: .8mm;
  border-radius: 4mm 1mm 4mm 1mm;
  background: var(--day-fill);
  color: var(--day-ink);
  font: 700 14pt/1 Georgia, serif;
}

#weekly-planner-print-root .wp-print-daydate {
  display: block;
  margin-top: .7mm;
  font-size: 6.5pt;
  line-height: 1.1;
}

#weekly-planner-print-root .wp-print-writing {
  min-width: 0;
  min-height: 0;
  border-right: .2mm solid #cfdad3;
}

#weekly-planner-print-root .wp-print-entry {
  padding: 1mm 1.5mm;
  font-size: 8.5pt;
  line-height: 4.2mm;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#weekly-planner-print-root .wp-print-weather {
  align-items: flex-start;
  justify-content: center;
  gap: .8mm;
  padding: .8mm 0 0;
  font-size: 6.5pt;
  line-height: 1.15;
  text-align: left;
}

#weekly-planner-print-root .wp-print-weather svg {
  flex: 0 0 4mm;
  width: 4mm;
  height: 4mm;
}

#weekly-planner-print-root .wp-print-forecast {
  font-size: 6pt;
  font-weight: 400;
}

#weekly-planner-print-root .wp-print-weather-detail {
  font-size: 5.5pt;
  margin-top: .4mm;
}

#weekly-planner-print-root .wp-print-credit {
  margin-top: 1.5mm;
  font-size: 6pt;
  line-height: 1.25;
}

#weekly-planner-print-root[data-theme="ink"] .wp-print-daytab {
  background: #fff;
  color: #344b42;
  outline: .2mm solid #b6c0ba;
}

#weekly-planner-print-root[data-overflow="true"] .wp-print-rows {
  grid-template-rows: repeat(7, auto);
}

#weekly-planner-print-root[data-overflow="true"] .wp-print-row {
  min-height: 22mm;
  break-inside: avoid;
}

@media print {
  body.wp-print-active,
  body.weekly-planner-print-page { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.wp-print-active > :not(#weekly-planner-print-root),
  body.weekly-planner-print-page > :not(#weekly-planner-print-root) { display: none !important; }
  body > #weekly-planner-print-root { display: block !important; margin: 0 !important; padding: 0 !important; }
  /* Defensive fallback for late ad insertion when printing via Ctrl+P. */
  ins.adsbygoogle,
  .google-auto-placed,
  .adsbygoogle,
  iframe,
  [id^="google_ads"],
  [id^="google_vignette"],
  [data-ad-status],
  [data-ad-client] { display: none !important; }
  #weekly-planner-print-root .wp-print-sheet > :not(.wp-print-heading):not(.wp-print-focus):not(.wp-print-columns):not(.wp-print-credit),
  #weekly-planner-print-root .wp-print-grid > :not(.wp-print-day) { display: none !important; }
}
