/* Calendar pages — ported from Calendar Machine UI (vanilla/style.css).
   Patterns, holidays and Christmas artwork are intentionally removed.
   Colours come from CSS variables set on .all-container by app.js. */

/* Bundled fonts: the calendar used to name system fonts (Impact, Verdana, Courier New,
   Franklin Gothic Medium). Those aren't installed everywhere — Franklin Gothic Medium in
   particular is Windows-only — so two people on different OSes saw different faces for the
   same calendar. These four open-licence lookalikes (see fonts/OFL.txt) are bundled instead,
   so the look is identical on every OS and browser. */
@font-face {
  font-family: 'SBD Display'; /* stands in for Impact */
  src: url('fonts/Anton-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'SBD Label'; /* stands in for Verdana */
  src: url('fonts/PTSans-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'SBD Mono'; /* stands in for Courier New */
  src: url('fonts/CourierPrime-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'SBD Mono';
  src: url('fonts/CourierPrime-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'SBD End'; /* stands in for Franklin Gothic Medium */
  src: url('fonts/Archivo-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

.all-container {
  --off-bg: #c7ebe1;
  --off-text: #7bc1c0;
  --off-text-opacity: 0.3;
  --text-off: #7d7d7d;
  --text-early: #7d7d7d;
  --text-late: #7d7d7d;
  --early-bg: #ffffff;
  --late-bg: #dfdfdf;
  --nights-bg: #e0d6d6;
  --pay: #7bbf77;
  --holiday: #ffa977;
  --holiday-text: #1a1a1a;
  --pat-color: #7a7a7a;
  --pat-opacity: 0.12;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.all-container *,
.all-container *::after,
.all-container *::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Grid lines are a single shared background colour showing through a 1px gap/padding,
   not a border on every cell. Two independent per-cell borders meeting at a shared edge
   is what let Firefox round each side differently (some edges doubled, some missing,
   some thick) — with only one line ever drawn per boundary, there's nothing to disagree. */
.page-container {
  width: 2200px;
  height: 1535px;
  margin: 2px auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 1px;
  padding: 1px;
  background: #686868;
  overflow: hidden;
  break-after: page;
  page-break-after: always;
}

.day-box {
  position: relative;
}

.off-bg-color { background-color: var(--off-bg); }
.early-bg-color { background-color: var(--early-bg); }
.late-bg-color { background-color: var(--late-bg); }
.nights-bg-color { background-color: var(--nights-bg); }

.pay-day-border { border: 3.5px solid var(--pay); }

.pay-day {
  text-align: center;
  border-radius: 50%;
  color: var(--pay);
  font-size: 55px;
  position: absolute;
  right: -1%;
  top: 43%;
  transform: translate(-50%, -50%);
  font-family: 'SBD Display', sans-serif;
  z-index: 2;
}

.sun-svg,
.moon-svg {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.sun-svg { height: 250px; width: 250px; top: 55%; right: -43%; }
.moon-svg { height: 230px; width: 230px; top: 56%; right: -39%; }

.week-line,
.week-day,
.full-year,
.big-month,
.hours-tag,
.start-tag,
.end-tag {
  position: absolute;
  z-index: 2;
  color: #7d7d7d;
}

.week-line {
  font-size: 18px;
  top: 12%;
  left: 2%;
  font-family: 'SBD Label', sans-serif;
  font-weight: 700;
}

.week-day {
  font-size: 40px;
  left: 1%;
  top: -2%;
  font-family: 'SBD Label', sans-serif;
  font-weight: 700;
}

.full-year {
  font-size: 39px;
  letter-spacing: 1.4px;
  right: 3%;
  top: 66.4px; /* measured: the year's letters sit about 3px under the month-day */
  font-family: 'SBD Mono', monospace;
  font-weight: 400;
  /* the typewriter font only comes in regular and bold, so a hairline outline in the text colour gives a touch more weight */
  -webkit-text-stroke: 0.5px currentColor;
}

.big-month {
  font-size: 65px;
  font-weight: 400;
  right: 3%;
  top: -2%;
  font-family: 'SBD Display', sans-serif;
}

.id-tag {
  text-align: center;
  color: white;
  background-color: #ababab;
  font-size: 20px;
  font-family: 'SBD Label', sans-serif;
  font-weight: 700;
  position: absolute;
  border-radius: 4px;
  padding: 0 10px;
  height: 25px;
  line-height: 25px;
  left: 1.4%;
  bottom: 1.4%;
  z-index: 2;
}

.hours-tag {
  font-size: 20px;
  font-weight: 700;
  right: 1.5%;
  bottom: 1.5%;
  font-family: 'SBD Label', sans-serif;
}

.start-tag {
  font-size: 65px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'SBD Display', sans-serif;
}

.end-tag {
  font-size: 50px;
  font-weight: 700;
  top: 70%;
  left: 50%;
  /* squeezed sideways so finish times are clearly narrower than start times */
  transform: translate(-50%, -50%) scaleX(0.8);
  font-family: 'SBD End', sans-serif;
}

.off-tag {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
  opacity: var(--off-text-opacity);
}
.off-tag text {
  fill: var(--off-text);
  font-size: 140px;
  font-family: 'SBD Display', sans-serif;
}

.no-overflow { z-index: 2; }

/* text colours per background type */
.off-bg-color .week-line, .off-bg-color .week-day, .off-bg-color .full-year, .off-bg-color .big-month,
.off-bg-color .hours-tag, .off-bg-color .start-tag, .off-bg-color .end-tag { color: var(--text-off); }
.early-bg-color .week-line, .early-bg-color .week-day, .early-bg-color .full-year, .early-bg-color .big-month,
.early-bg-color .hours-tag, .early-bg-color .start-tag, .early-bg-color .end-tag { color: var(--text-early); }
.late-bg-color .week-line, .late-bg-color .week-day, .late-bg-color .full-year, .late-bg-color .big-month,
.late-bg-color .hours-tag, .late-bg-color .start-tag, .late-bg-color .end-tag { color: var(--text-late); }

/* Print: A4 landscape, 10px margins, 0.5 scale — same settings the Calendar Machine PDF export uses. */
@page { size: A4 landscape; margin: 10px; }

/* small provenance logo on every day off: sits in the bottom-left corner with a similar footprint
   to the weekday label in the top-left. Real clickable link back to the site. Drawn once as a
   transparent foreground image (reactive to --off-bg) so the PDF stores it once and stays small. */
.brand-mark,
.brand-mark:visited,
.brand-mark:hover,
.brand-mark:active {
  position: absolute;
  left: 6px;
  bottom: 5px;
  width: 60px;
  height: 45px;
  display: block;
  z-index: 1000; /* foreground: always takes precedence over patterns */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left bottom;
  text-decoration: none;
}

@media screen {
  /* Disabled in the live website preview so visitors never accidentally click away
     thinking they lost their session; stays a real clickable link in printed PDFs. */
  .brand-mark { pointer-events: none; cursor: default; }
}

/* day-off pattern: one svg per day-off box with one path per shape (overlaps get darker), behind the text */
.pat-layer {
  position: absolute;
  inset: 0;
  overflow: visible; /* shapes may spill into a neighbouring day off; the page edge clips the rest */
  z-index: 1;
  pointer-events: none;
}
.pat-layer .pi { position: absolute; display: block; background-size: contain; background-repeat: no-repeat; background-position: center; } /* opacity is baked into the picture */
.pat-layer path { fill: var(--pat-color); fill-opacity: var(--pat-opacity); }
/* shapes have up to three tones (1 strongest). Overlaps of any parts get darker because every part is translucent. */
.pat-layer path.t2 { fill-opacity: calc(var(--pat-opacity) * 0.62); }
.pat-layer path.t3 { fill-opacity: calc(var(--pat-opacity) * 0.36); }
.pat-layer path.eo { fill-rule: evenodd; }

/* holiday and clock-change tags (vertical, down the left side of a day box) */
.holiday-tag-stack {
  position: absolute;
  display: flex;
  flex-direction: row;
  gap: 4px;
  z-index: 2;
  left: 1%;
  top: calc(12% + 25px);
}
.holiday-tag-off,
.holiday-tag-work {
  color: var(--holiday-text);
  background-color: var(--holiday);
  font-size: 18px;
  font-family: 'SBD Label', sans-serif;
  font-weight: 700;
  border-radius: 4px;
  padding: 8px 1px 8px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-lr;
}

@media print {
  html, body { margin: 0; padding: 0; background: #fff; }
  .all-container { zoom: 0.5; }
  .page-container { margin: 2px 0; }
  .day-box.pay-day-border { border: 0; box-shadow: inset 0 0 0 3.5px var(--pay); }
  .page-container:last-child { break-after: auto; page-break-after: auto; }

  /* Chromium prints the shared gap/background lines a little softer than the old per-cell
     hairlines did, so Chromium keeps the original technique here: no gap, a single inset
     shadow per cell. Non-Chromium browsers (Firefox) keep the gap/background technique from
     the base rules above — that's what fixed their doubled/missing/thick shared edges. */
  .page-container { gap: 0; padding: 0; background: #fff; box-shadow: inset 0 0 0 1px #686868; }
  .day-box:not(.pay-day-border) { box-shadow: inset 0 0 0 1px #686868; }
  .non-chromium .page-container { gap: 1px; padding: 1px; background: #686868; box-shadow: none; }
  .non-chromium .day-box:not(.pay-day-border) { box-shadow: none; }
}
