/* The holiday calendar page (templates/includes/swieta.html). Loaded on its page only. Colours are
   tokens from variables.css; the cards (.tool-card) and the year switch (.seg) come from site.css.
   One meaning, one colour everywhere on the page: teal is a day off, amber a Saturday holiday (another
   day off is due), sand a Sunday holiday and the weekend. */

.hero--page { padding-bottom: clamp(20px, 3vw, 32px); }
/* A day's hint may stick out of a month near the screen's edge: it must not widen the page. */
.hcal-band { padding-block: 0 clamp(56px, 7vw, 96px); overflow-x: clip; }
.hcal { display: grid; gap: 18px; }
.hcal__switch { justify-self: start; }
.hcal__year { display: grid; gap: 18px; min-width: 0; }
.hcal__card { gap: 14px; }
.hcal__lead { font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 70ch; }

/* --- the year in six numbers ---------------------------------------------------- */
.hcal__facts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.hcal__fact { display: grid; gap: 2px; align-content: start; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.hcal__fact b { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.hcal__fact span { font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.hcal__fact--weekday { background: var(--teal-bg); border-color: transparent; }
.hcal__fact--weekday b { color: var(--teal-ink); }
.hcal__fact--saturday { background: var(--amber-bg); border-color: transparent; }
.hcal__fact--saturday b { color: var(--amber); }
.hcal__fact--sunday { background: var(--sand); border-color: transparent; }

/* --- the list of holidays ------------------------------------------------------- */
.hcal__scroll { overflow-x: auto; margin-inline: -4px; padding-inline: 4px; }
.hcal__table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.hcal__table th { padding: 8px 12px 10px 0; text-align: left; font-size: 14px; font-weight: 700; color: var(--ink-3); border-bottom: 1px solid var(--line-strong); }
.hcal__table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.hcal__table tbody tr:last-child td { border-bottom: 0; }
.hcal__date { white-space: nowrap; font-weight: 700; color: var(--ink); }
.hcal__name { color: var(--ink); font-weight: 600; }
.hcal__mark { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.hcal__mark--weekday { background: var(--teal-bg); color: var(--teal-ink); }
.hcal__mark--saturday { background: var(--amber-bg); color: var(--amber); }
.hcal__mark--sunday { background: var(--sand); color: var(--ink-2); }
.hcal__note { padding: 12px 16px; border-radius: 14px; background: var(--amber-bg); color: var(--ink); font-size: 14.5px; line-height: 1.5; }

/* --- twelve months -------------------------------------------------------------- */
.hcal__legend { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--ink-2); }
.hcal__legend li { display: inline-flex; align-items: center; gap: 8px; }
.hcal__swatch { display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 5px; }
.hcal__months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 26px; }
.hcal__month { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.hcal__month caption { padding: 0 0 6px 2px; text-align: left; font-size: 15px; font-weight: 800; color: var(--ink); }
.hcal__month th { padding: 2px 0 4px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-align: center; }
.hcal__month td { height: 30px; padding: 0; text-align: center; font-size: 13.5px; color: var(--ink); border-radius: 7px; }
.hcal__d--weekend { background: var(--sand); color: var(--ink-3); }
.hcal__d--hol-weekday { background: var(--teal-btn); color: var(--white); font-weight: 800; }
.hcal__d--hol-saturday { background: var(--amber-bg); color: var(--amber); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--amber); }
.hcal__d--hol-sunday { background: var(--sand); color: var(--ink); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.hcal__d[data-tip] { position: relative; cursor: help; }
.hcal__d[data-tip]:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.hcal__d[data-tip]:hover::after, .hcal__d[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; z-index: 5; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 6px 9px; border-radius: 8px; background: var(--ink); color: var(--white); font-size: 12.5px; font-weight: 600;
  line-height: 1.3; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-sm);
}

/* --- working time and long weekends --------------------------------------------- */
.hcal__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.hcal__table--norm th[scope="row"] { padding: 10px 12px 10px 0; font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.hcal__table--norm td, .hcal__table--norm thead th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.hcal__table--norm td { color: var(--ink); }
.hcal__table--norm tfoot th, .hcal__table--norm tfoot td { border-bottom: 0; border-top: 2px solid var(--line-strong); font-weight: 800; color: var(--ink); }
.hcal__sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--amber); }
.hcal__weekends { margin: 0; padding: 0; list-style: none; display: grid; }
.hcal__wk { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-areas: "days range" "days leave"; gap: 2px 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.hcal__wk:last-child { border-bottom: 0; }
.hcal__wk-days { grid-area: days; font-size: 14px; color: var(--ink-2); }
.hcal__wk-days b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.hcal__wk--free .hcal__wk-days b { color: var(--teal-ink); }
.hcal__wk-range { grid-area: range; font-size: 15px; font-weight: 700; color: var(--ink); }
.hcal__wk-leave { grid-area: leave; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.hcal__wk--free .hcal__wk-leave { color: var(--teal-ink); font-weight: 700; }

@media (max-width: 1140px) {
  .hcal__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hcal__months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 940px) {
  .hcal__pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  .hcal__months { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .hcal__month td { height: 28px; font-size: 13px; }
  .hcal__table { font-size: 14px; }
  .hcal__table th, .hcal__table td { padding-right: 10px; }
  .hcal__wk { grid-template-columns: 76px minmax(0, 1fr); }
  /* site.css lays the switch out in two columns on a phone; three years sit in one row. */
  .hcal__switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Four columns do not fit a phone: each holiday becomes a small block, date and day on top, the
     name under them, what it means for the employee last. */
  .hcal__table--list thead { display: none; }
  .hcal__table--list, .hcal__table--list tbody { display: block; }
  .hcal__table--list tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .hcal__table--list tbody tr:last-child { border-bottom: 0; }
  .hcal__table--list td { padding: 0; border: 0; }
  .hcal__table--list td:nth-child(3), .hcal__table--list td:nth-child(4) { grid-column: 1 / -1; }
  .hcal__table--list td:nth-child(4) { margin-top: 6px; }
}
@media (max-width: 420px) {
  .hcal__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
