/*
Holidays 2027 – based on Tooplate 2118 Chilling Cafe
https://www.tooplate.com/view/2118-chilling-cafe

  Slate (page)      #3a4a58   template background
  Paper             #ffffff
  Ink               #1f2a33
  Muted             #5d6b78
  Red-letter        #c62f2f   holiday on a weekday
  Red, pale         #eeb4ad   holiday on a weekend
  Row               #eef1f4   template's alternate row
*/

:root {
  --slate: #3a4a58;
  --slate-light: #c4cdd6;
  --paper: #ffffff;
  --ink: #1f2a33;
  --muted: #5d6b78;
  --rule: #d9dee4;
  --row: #eef1f4;
  --red: #c62f2f;
  --red-pale: #eeb4ad;
  --red-wash: #fbeceb;
  --weekend: #eceff2;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --font-num: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  background-color: var(--slate);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
  padding: 0 16px;
}

.tm-container {
  max-width: 800px;
  margin: 0 auto;
}

a { color: var(--red); }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid #f0b429;
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ───── Header & footer (on slate) ───── */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 22px 0;
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-num);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand:hover { color: #fff; }

/* A tiny tear-off calendar page. */
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding-top: 7px;
  background: linear-gradient(var(--red) 0 9px, #fff 9px);
  border-radius: 4px;
  color: var(--red);
  font-size: 1.05rem;
  line-height: 1;
}

.brand-sub {
  color: var(--slate-light);
  font-weight: 500;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.site-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px 10px;
  border-radius: 3px;
}

.site-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.site-nav a[aria-current="page"] { background: #fff; color: var(--ink); }

.site-footer {
  color: var(--slate-light);
  text-align: center;
  font-size: 0.9rem;
  padding: 28px 0 36px;
}

.site-footer .site-nav { justify-content: center; margin-bottom: 8px; }

.partner-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  margin-bottom: 8px;
}

.site-footer .partner-nav a { color: var(--slate-light); }
.site-footer .partner-nav a:hover { color: #fff; }
.site-footer p a { color: #fff; }

/* ───── Main card ───── */

.tm-main-content {
  background: var(--paper);
  border-top: 10px solid var(--red);
  border-radius: 2px;
}

.hero { padding: 36px 40px 8px; }

h1 {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--ink);
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 28px;
}

.tm-section {
  padding: 28px 40px 8px;
  scroll-margin-top: 12px;
}

.tm-section + .tm-section { border-top: 1px solid var(--rule); }

.tm-section-header {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--ink);
}

p { margin: 0 0 16px; max-width: 70ch; }

.plain-list { padding-left: 1.2em; margin: 0 0 16px; }
.plain-list li { margin-bottom: 6px; }

.source {
  padding: 16px 40px 28px;
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}

/* ───── Year strip ───── */

.strip { margin: 0 0 24px; }

.strip-months {
  display: flex;
  flex: 1;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: lowercase;
}

.strip-months span {
  min-width: 0;
  overflow: hidden;
  padding-left: 3px;
  border-left: 1px solid var(--rule);
  white-space: nowrap;
}

.strip-row { display: flex; align-items: center; }

.strip-svg {
  display: block;
  flex: 1;
  width: 100%;
  height: 56px;
  background: #f6f7f9;
}

.strip-multi .strip-svg { height: 30px; }
.strip-multi .strip-row + .strip-row { margin-top: 6px; }

.strip-label {
  flex: 0 0 92px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}

a.strip-label:hover { color: var(--red); }

.s-we { fill: var(--weekend); }
.s-month { fill: #aab4be; }
.s-hd { fill: var(--red); }
.s-hw { fill: var(--red-pale); }
.s-cu { fill: #e0827a; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.legend li { display: inline-flex; align-items: center; gap: 6px; }

.key {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.key-hd { background: var(--red); }
.key-hw { background: var(--red-pale); }
.key-cu { background: #e0827a; }

/* ───── Table of contents ───── */

.toc {
  background: var(--row);
  padding: 14px 20px;
  margin-bottom: 20px;
}

.toc h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.toc ol {
  margin: 0;
  padding-left: 1.3em;
  columns: 2;
  column-gap: 32px;
  font-size: 0.95rem;
}

.toc a { color: var(--ink); }
.toc a:hover { color: var(--red); }

/* ───── Tables ───── */

.table-wrap { overflow-x: auto; margin-bottom: 20px; }

table {
  width: 100%;
  border-spacing: 0;
  font-size: 1rem;
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
}

thead tr { background: var(--slate-light); }
thead th { padding: 10px 14px; }

td { padding: 9px 14px; vertical-align: top; }
tbody tr:nth-child(even) { background: var(--row); }

.col-date {
  font-family: var(--font-num);
  font-size: 1.15rem;
  font-weight: 500;
  white-space: nowrap;
}

.holiday-table .is-workday .col-date { color: var(--red); font-weight: 600; }
.holiday-table .is-weekend,
.holiday-table .is-customary { color: var(--muted); }

.tag {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}

.sub { display: block; font-size: 0.85rem; color: var(--muted); }

tfoot th,
tfoot td {
  padding: 10px 14px;
  font-weight: 600;
  border-top: 2px solid var(--ink);
}

.work-table td:not(:first-child),
.work-table tfoot td { font-variant-numeric: tabular-nums; }

.month-table td { font-family: var(--font-num); font-size: 1.1rem; }
.d-wd { color: var(--red); font-weight: 600; }
.d-we { color: var(--muted); }

/* ───── Calendar ───── */

.months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 28px;
  margin: 20px 0 16px;
}

.month {
  width: 100%;
  font-family: var(--font-num);
  font-size: 1rem;
  table-layout: fixed;
}

.month caption {
  text-align: left;
  font-weight: 600;
  font-size: 1.15rem;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 4px;
}

.month thead tr,
.month tbody tr:nth-child(even) { background: none; }

.month th,
.month td {
  padding: 3px 0;
  text-align: center;
}

.month th { font-weight: 500; font-size: 0.85rem; color: var(--muted); }
.month .c-we { color: #8a96a2; }

.month .c-hd,
.month .c-hw,
.month .c-cu {
  font-weight: 600;
  border-radius: 3px;
  cursor: help;
}

.month .c-hd { background: var(--red); color: #fff; }
.month .c-hw { background: var(--red-wash); color: var(--red); }
.month .c-cu { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }

/* ───── FAQ ───── */

.faq { border-bottom: 1px solid var(--rule); }
.faq:first-of-type { border-top: 1px solid var(--rule); }

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
  list-style-position: outside;
}

.faq p { color: var(--muted); margin: 0 0 14px; }

/* ───── Responsive ───── */

@media (max-width: 700px) {
  .months { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 26px 20px 4px; }
  .tm-section { padding: 22px 20px 4px; }
  .source { padding: 14px 20px 22px; }
  .toc ol { columns: 1; }
  .strip-label { flex-basis: 68px; font-size: 0.85rem; }
  .strip-months span:nth-child(even) { color: transparent; }
  td, thead th { padding: 8px 10px; }
  td, thead th { padding: 8px 8px; }
  .holiday-table .tag { display: block; width: max-content; margin-top: 2px; }
  .months { gap: 20px 16px; }
}

@media (max-width: 560px) {
  .holiday-table thead,
  .bridge-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .holiday-table tr,
  .bridge-table tr {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    padding: 8px 10px;
  }
  .holiday-table td,
  .bridge-table td { padding: 0; }
  .holiday-table .col-day { align-self: center; }
  .holiday-table .col-name,
  .bridge-table td:nth-child(n+3) { grid-column: 1 / -1; }
  .bridge-table .col-len { align-self: center; }
  .bridge-table td:nth-child(4) { color: var(--muted); }
}

@media (max-width: 380px) {
  .months { grid-template-columns: 1fr; }
}
