/* ============================================================
   Design: "tear-off calendar" — paper white, ink, red-letter days.
   No webfonts by design: instant render, better AdSense vitals.
   ============================================================ */
:root {
  --paper: #FCFCFA;
  --ink: #14181D;
  --red: #C42837;
  --slate: #66707A;
  --rule: #E4E2DC;
  --sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-feature-settings: "tnum";
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* Header: almanac masthead with double rule */
header.site {
  border-bottom: 3px double var(--ink);
  padding: 18px 0 14px;
  margin-bottom: 28px;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.logo b { color: var(--red); }
nav.langs { font-size: 13px; color: var(--slate); }
nav.langs a { color: var(--slate); text-decoration: none; margin-left: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
nav.langs a.active { color: var(--red); font-weight: 700; }
nav.langs a:hover { color: var(--ink); }

.crumbs { font-size: 13px; color: var(--slate); margin-bottom: 18px; }
.crumbs a { color: var(--slate); }

h1 { font-size: clamp(26px, 4.5vw, 38px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; font-weight: 800; }
h2 { font-size: 20px; margin: 36px 0 12px; font-weight: 700; }
.lede { color: var(--slate); font-size: 17px; margin: 0 0 24px; max-width: 62ch; }

/* Signature element: tear-off countdown sheet */
.sheet {
  border: 1px solid var(--ink);
  max-width: 420px;
  margin: 28px 0;
  text-align: center;
  background: #fff;
  box-shadow: 4px 4px 0 var(--rule);
}
.sheet .band {
  background: var(--red);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 10px;
  font-weight: 700;
}
.sheet .big {
  font-size: clamp(72px, 18vw, 128px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  padding: 22px 10px 6px;
  font-variant-numeric: tabular-nums;
}
.sheet .unit { color: var(--slate); text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; padding-bottom: 14px; }
.sheet .hms {
  border-top: 1px solid var(--rule);
  display: flex;
  font-variant-numeric: tabular-nums;
}
.sheet .hms div { flex: 1; padding: 10px 4px; font-size: 15px; }
.sheet .hms div + div { border-left: 1px solid var(--rule); }
.sheet .hms small { display: block; color: var(--slate); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }

/* Holiday tables: hairline rules, red-letter dates */
table.cal { width: 100%; border-collapse: collapse; margin: 18px 0 8px; font-size: 15px; }
table.cal th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--slate); border-bottom: 2px solid var(--ink); padding: 8px 10px 6px;
}
table.cal td { border-bottom: 1px solid var(--rule); padding: 10px; vertical-align: top; }
table.cal td.d { color: var(--red); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.cal td.wd { color: var(--slate); white-space: nowrap; }
table.cal td.n a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
table.cal td.n a:hover { border-color: var(--red); color: var(--red); }
table.cal td.left { text-align: right; font-variant-numeric: tabular-nums; color: var(--slate); white-space: nowrap; }
.badge { display: inline-block; font-size: 11px; color: var(--red); border: 1px solid var(--red); border-radius: 2px; padding: 0 5px; margin-left: 6px; letter-spacing: 0.04em; vertical-align: 1px; }

/* Grids of links */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px; margin: 16px 0; }
.grid a {
  display: block; padding: 12px 14px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); background: #fff; font-size: 15px;
}
.grid a:hover { border-color: var(--red); color: var(--red); }
.grid a small { display: block; color: var(--slate); font-size: 12px; margin-top: 2px; }
.grid a:hover small { color: inherit; }

.years { margin: 10px 0 4px; }
.years a { display: inline-block; margin-right: 8px; padding: 5px 12px; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.years a.active, .years a:hover { border-color: var(--red); color: var(--red); font-weight: 700; }

/* Calculators */
.calc { border: 1px solid var(--ink); background: #fff; padding: 20px; max-width: 520px; margin: 20px 0; box-shadow: 4px 4px 0 var(--rule); }
.calc label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--slate); margin: 12px 0 4px; }
.calc input, .calc select { font: inherit; padding: 9px 10px; border: 1px solid var(--slate); width: 100%; background: var(--paper); border-radius: 0; }
.calc button {
  font: inherit; font-weight: 700; margin-top: 16px; padding: 10px 22px;
  background: var(--red); color: #fff; border: none; cursor: pointer; letter-spacing: 0.03em;
}
.calc button:hover { background: #A81F2D; }
.calc .out { margin-top: 16px; font-size: 18px; font-weight: 700; min-height: 24px; font-variant-numeric: tabular-nums; }
.calc .out small { display: block; font-weight: 400; color: var(--slate); font-size: 14px; }

.note { font-size: 13px; color: var(--slate); border-left: 3px solid var(--red); padding: 6px 12px; margin: 16px 0; max-width: 62ch; }

/* Ad slots */
.ad { margin: 26px 0; min-height: 90px; text-align: center; }
.ad-placeholder { border: 1px dashed var(--rule); color: var(--rule); font-size: 12px; padding: 34px 0; letter-spacing: 0.1em; text-transform: uppercase; }

footer.site {
  border-top: 3px double var(--ink);
  margin-top: 56px; padding: 20px 0 40px;
  font-size: 13px; color: var(--slate);
}
footer.site a { color: var(--slate); }

a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 560px) {
  table.cal td.left { display: none; }
  table.cal th:last-child { display: none; }
}

/* Hero sheet on landing */
.sheet-link { display: block; text-decoration: none; color: inherit; max-width: 420px; margin: 26px 0; }
.sheet-link .sheet { margin: 0; }
.sheet-link:hover .sheet { border-color: var(--red); }
.sheet .meta { border-top: 1px solid var(--rule); padding: 9px 10px; font-size: 13px; color: var(--slate); }

/* Mini calendars */
.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; margin: 18px 0; }
.mini .m { border: 1px solid var(--rule); background: #fff; padding: 10px 10px 12px; }
.mini .mh { font-size: 13px; font-weight: 700; margin-bottom: 6px; text-transform: capitalize; }
.mini .mg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 11.5px; text-align: center; font-variant-numeric: tabular-nums; }
.mini .mg b { color: var(--slate); font-weight: 400; font-size: 10px; text-transform: uppercase; }
.mini .mg span { padding: 3px 0; border-radius: 50%; line-height: 1.5; }
.mini .mg span.h { color: var(--red); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--red); }
.mini .mg span.r { background: #F6E2E4; border-radius: 0; }
.mini .mg span.h.r { border-radius: 50%; }
.mini .mg span.t { background: var(--ink); color: #fff; border-radius: 50%; }

/* Weekends in calendar red; today mark must stay ink-on-white */
.mini .mg b.w { color: var(--red); }
.mini .mg span.w { color: var(--red); }
.mini .mg span.t { background: var(--ink); color: #fff; }

/* Landing: centered hero sheet + upcoming line */
.sheet-link { margin-left: auto; margin-right: auto; }
.upcoming { text-align: center; font-size: 14px; color: var(--slate); max-width: 66ch; margin: 0 auto 10px; line-height: 1.7; }
.upcoming b { color: var(--ink); font-weight: 700; }
.upcoming a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.upcoming a:hover { color: var(--red); border-color: var(--red); }

/* Stylized CountDia logo */
.logo { display: inline-flex; align-items: center; gap: 9px; font-size: 21px; letter-spacing: -0.03em; line-height: 1; }
.logo svg { display: block; flex: none; margin-top: 1px; }
.logo span { display: inline-block; line-height: 1; transform: translateY(1px); }
.logo span b { color: var(--red); font-weight: 800; }
