/* Hindu calendar pages, drawn as a printed wall calendar with a tear-off date pad beside it.
   Colours, type, header, footer and buttons come from /styles.css. */

.cal-page {
  padding: 26px 0 84px;
  overflow: hidden; /* the calendar sways and its pages flip past its own edges */
  --cal-paper: var(--surface-raised);
  --cal-ink: var(--text);
  --cal-line: var(--border-strong);
  --cal-heading: var(--maroon);
  /* Printing inks. The text ones follow the theme; the solid ones carry cream text in both themes. */
  --cal-red: var(--live);
  --cal-vrat: var(--success);
  --cal-red-solid: #B93223;
  --cal-vrat-solid: #2E7D4F;
  --cal-plain-solid: #7A6450;
  --cal-on-solid: #FFF4E6;
  --cal-stack: 0 1px 0 var(--cal-line), 0 4px 0 -1px var(--cal-paper), 0 5px 0 -1px var(--cal-line), 0 9px 0 -3px var(--cal-paper), 0 10px 0 -3px var(--cal-line);
}
@media (prefers-color-scheme: dark) {
  .cal-page { --cal-heading: var(--primary-strong); }
}

/* ---------- breadcrumb, heading, lede ---------- */
.cal-crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 8px; color: var(--muted); font-size: 14px; }
.cal-crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--subtle); }
.cal-crumbs a { color: var(--muted); text-decoration: none; }
.cal-crumbs a:hover { color: var(--primary-strong); text-decoration: underline; }
.cal-crumbs [aria-current] { color: var(--text); }
.cal-intro { max-width: 840px; margin: 12px 0 22px; }
.cal-intro h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 46px); line-height: 1.3; color: var(--cal-heading); }
.cal-lede { margin-top: 8px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.cal-note { margin-top: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ---------- controls ---------- */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.cal-today, .cal-select {
  min-height: 44px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background-color: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s;
}
.cal-today:hover, .cal-select:hover { border-color: var(--gold); }
.cal-today { padding: 0 20px; }
.cal-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 36px 0 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A38F7B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.cal-layout { display: grid; gap: 48px 40px; }

/* ---------- wall calendar: nail, wire, ring binding ---------- */
.wallcal {
  position: relative;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding-top: 40px;
  transform-origin: 50% 7px;
  animation: cal-settle 1.9s ease-out both;
}
.wallcal-nail {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFFFF, #B9B2A8 45%, #5E564C);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .4);
}
.wallcal-wire { position: absolute; z-index: 4; left: 50%; top: 3px; width: 120px; height: 40px; margin-left: -60px; }
.wallcal-binding {
  position: relative;
  z-index: 3;
  height: 28px;
  margin: 0 16px -16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='28' viewBox='0 0 20 28'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' x2='1' y1='0' y2='0'%3E%3Cstop offset='0' stop-color='%236B4D16'/%3E%3Cstop offset='.42' stop-color='%23F9E7AF'/%3E%3Cstop offset='.7' stop-color='%23B8892E'/%3E%3Cstop offset='1' stop-color='%235E4312'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cellipse cx='10' cy='21.5' rx='3.7' ry='3' fill='%23281409' fill-opacity='.6'/%3E%3Crect x='7.4' y='1.5' width='5.2' height='21.5' rx='2.6' fill='url(%23b)'/%3E%3C/svg%3E") center top / 20px 28px repeat-x;
}

/* ---------- the sheet ---------- */
.wallcal-pages { position: relative; perspective: 2400px; perspective-origin: 50% 0; }
.wallcal-sheet {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding-top: 22px;
  border-radius: 4px 4px 10px 10px;
  background: var(--cal-paper);
  box-shadow: var(--cal-stack), 0 40px 56px -24px rgba(70, 30, 10, .5), 0 12px 22px -12px rgba(70, 30, 10, .28);
  transform-origin: 50% 0;
  touch-action: pan-y;
}
/* Paper grain. */
.wallcal-sheet::after, .daypad-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: multiply;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Picture panel, as on a printed calendar: the month's deity and the month's name. */
.sheet-head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "art title flip";
  align-items: center;
  gap: 8px 28px;
  margin: 0 14px;
  padding: 24px 18px 30px 26px;
  overflow: hidden;
  border-radius: 6px;
  color: var(--on-maroon);
  background:
    radial-gradient(110% 150% at 100% 0%, rgba(233, 196, 111, .24), transparent 55%),
    linear-gradient(155deg, #7E2C18, var(--maroon) 46%, var(--maroon-deep));
}
/* Rays behind the picture. */
.sheet-head::before {
  content: "";
  position: absolute;
  left: -150px;
  top: 50%;
  width: 560px;
  height: 560px;
  margin-top: -280px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(233, 196, 111, .2) 0 4deg, transparent 4deg 12deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 68%);
  mask-image: radial-gradient(circle, #000 18%, transparent 68%);
}
.sheet-art {
  position: relative;
  grid-area: art;
  width: 172px;
  margin: 0;
  padding: 5px;
  border-radius: 9px;
  background: linear-gradient(135deg, #F8E3A7, #B8862E 38%, #F3D98F 60%, #8F6A1E);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .42);
}
.sheet-art img { width: 100%; height: auto; border-radius: 5px; }
.sheet-art figcaption {
  position: absolute;
  left: 50%;
  bottom: -13px;
  transform: translateX(-50%);
  padding: 3px 14px 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #F6DFA0, #D7A63E);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  color: #3B1409;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  white-space: nowrap;
}
.sheet-title { position: relative; grid-area: title; min-width: 0; }
.sheet-title h2 { font-family: var(--font-display); font-size: clamp(44px, 5.4vw, 62px); line-height: 1.2; color: #FBEFD9; }
.sheet-year { display: block; color: var(--gold-on-maroon); }
.sheet-en { color: var(--gold-on-maroon); font-size: 12.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.sheet-sub { margin-top: 10px; color: var(--on-maroon-muted); font-size: 15.5px; line-height: 1.5; }
.sheet-flip { position: relative; grid-area: flip; align-self: start; display: flex; gap: 8px; }
.sheet-flip button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid rgba(233, 196, 111, .55);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: var(--gold-on-maroon);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.sheet-flip button:hover { background: rgba(255, 255, 255, .14); border-color: var(--gold-on-maroon); }
.sheet-flip button:disabled { opacity: .35; cursor: default; }

.sheet-weekdays, .sheet-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 14px; }
.sheet-weekdays {
  margin-top: 14px;
  border-radius: 5px 5px 0 0;
  background: var(--maroon);
  color: var(--on-maroon);
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.sheet-weekdays span { padding: 7px 0 6px; }
.sheet-weekdays span:first-child { border-radius: 5px 0 0; background: var(--cal-red-solid); color: var(--cal-on-solid); }
.sheet-weekdays small { display: block; opacity: .75; font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }

/* Ruled like print: hairlines between days, no tiles. */
.sheet-grid { border: 1px solid var(--cal-line); border-top: 0; }
.sheet-grid > * { position: relative; min-height: 106px; border: 0; border-right: 1px solid var(--cal-line); border-bottom: 1px solid var(--cal-line); border-radius: 0; }
.sheet-grid > :nth-child(7n) { border-right: 0; }
.sheet-grid > :nth-last-child(-n + 7) { border-bottom: 0; }
.cal-blank { background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--cal-line) 38%, transparent) 7px 8px); }
.cal-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 0 4px;
  padding: 5px 8px 10px;
  background: none;
  color: var(--cal-ink);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s;
}
.cal-cell:hover { background: color-mix(in srgb, var(--secondary) 12%, transparent); }
.cal-cell:focus-visible { outline-offset: -3px; }
.cal-cell.is-selected { background: color-mix(in srgb, var(--secondary) 24%, transparent); box-shadow: inset 0 0 0 2px var(--primary); }

.cal-num {
  position: relative;
  justify-self: start;
  padding-top: 5px;
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.is-sunday .cal-num, .is-holiday .cal-num { color: var(--cal-red); }
/* Today is ringed by hand, in red pen. */
.cal-pen {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% + 26px);
  height: calc(100% + 8px);
  max-width: none;
  transform: translate(-50%, -46%) rotate(-5deg);
  overflow: visible;
  fill: none;
  stroke: var(--cal-red);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.is-fresh .cal-pen path { stroke-dasharray: 1; animation: cal-draw .7s .35s ease-out both; }

.cal-moon { width: 16px; height: 16px; margin-top: 9px; }
.cal-moon .moon-dark, circle.moon-dark { fill: color-mix(in srgb, var(--cal-ink) 22%, transparent); }
.cal-moon .moon-lit, circle.moon-lit { fill: var(--secondary); }

.cal-tithi {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-tithi.is-vrat { color: var(--cal-vrat); font-weight: 600; }
.cal-tithi.is-moon { color: var(--cal-ink); font-weight: 600; }
.t-short { display: none; }

.cal-marks { grid-column: 1 / -1; align-self: end; display: grid; gap: 1px; min-width: 0; padding-top: 2px; }
.cal-mark {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
}
.cal-mark.k-festival { color: var(--cal-red); }
.cal-mark.k-vrat { color: var(--cal-vrat); }
.cal-mark.k-moon { color: var(--cal-ink); }
/* A festival of several days runs as one ribbon along the foot of its days. */
.cal-ribbon { position: absolute; left: 0; right: -1px; bottom: 0; height: 5px; background: var(--cal-red-solid); }
.cal-ribbon.k-vrat { background: var(--cal-vrat-solid); }
.cal-ribbon.is-start { left: 7px; border-radius: 3px 0 0 3px; }
.cal-ribbon.is-end { right: 7px; border-radius: 0 3px 3px 0; }

.sheet-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 0 14px; padding: 14px 0 18px; }
.sheet-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; color: var(--muted); font-size: 13px; }
.sheet-legend li { display: inline-flex; align-items: center; gap: 7px; }
.sheet-legend .cal-moon { width: 11px; height: 11px; margin: 0; }
.cal-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.cal-dot.k-festival { background: var(--cal-red); }
.cal-dot.k-vrat { background: var(--cal-vrat); }
.sheet-imprint { margin-top: 8px; color: var(--subtle); text-align: center; font-size: 11.5px; letter-spacing: .1em; }
/* The months either side, small, as printed in the corners of a wall calendar. */
.mini { padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--cal-ink); cursor: pointer; transition: background-color .15s; }
.mini:hover { background: color-mix(in srgb, var(--secondary) 16%, transparent); }
.mini[hidden] { display: block; visibility: hidden; }
.mini-name { display: block; margin-bottom: 2px; color: var(--cal-heading); font-family: var(--font-display); font-size: 15px; line-height: 1.5; text-align: center; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 16px); color: var(--muted); font-size: 9.5px; line-height: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.mini-grid .sun { color: var(--cal-red); font-weight: 600; }

/* ---------- tear-off date pad ---------- */
.daypad { position: relative; width: 100%; max-width: 430px; margin: 0 auto; padding-top: 6px; }
.daypad-clip {
  position: relative;
  z-index: 4;
  height: 34px;
  margin: 0 26px -16px;
  border-radius: 9px 9px 4px 4px;
  background: linear-gradient(180deg, #8A3019, var(--maroon) 55%, var(--maroon-deep));
  box-shadow: 0 4px 7px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.daypad-clip i {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFF4CF, #C89B3C 50%, #6B4D16);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.daypad-clip i:first-child { left: 22%; }
.daypad-clip i:last-child { right: 22%; }
.daypad-pages { position: relative; }
.daypad-page {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 26px 0 14px;
  border-radius: 3px 3px 9px 9px;
  background: var(--cal-paper);
  box-shadow: var(--cal-stack), 0 30px 44px -22px rgba(70, 30, 10, .45);
}
/* A turned-up corner on the top leaf. */
.daypad-page::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  border-top-left-radius: 7px;
  background: linear-gradient(315deg, var(--bg) 0 46%, color-mix(in srgb, var(--cal-line) 85%, transparent) 50%, var(--cal-paper) 57%);
  box-shadow: -2px -2px 5px rgba(60, 25, 8, .1);
}
.pad-band {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 18px;
  border-top: 2px dotted var(--cal-line); /* the perforation the leaf tears along */
  background: var(--cal-red-solid);
  color: var(--cal-on-solid);
  font-size: 14px;
  font-weight: 600;
}
.pad-main { padding: 14px 18px 4px; text-align: center; }
.pad-weekday { color: var(--cal-heading); font-family: var(--font-display); font-size: 27px; line-height: 1.3; }
.pad-weekday small { display: block; color: var(--subtle); font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; }
.pad-num { padding-top: 14px; color: var(--cal-ink); font-family: var(--font-display); font-size: 150px; line-height: .92; font-variant-numeric: lining-nums; }
.pad-num.is-holiday { color: var(--cal-red); }
.pad-tithi { color: var(--cal-heading); font-family: var(--font-display); font-size: 28px; line-height: 1.35; }
.pad-meta { color: var(--muted); font-size: 13.5px; }

.pad-fests { display: grid; gap: 8px; margin: 14px 18px 0; }
.pad-fest { padding: 8px 12px 9px; border-radius: 8px; background: var(--cal-plain-solid); color: var(--cal-on-solid); text-align: center; }
.pad-fest.k-festival { background: var(--cal-red-solid); }
.pad-fest.k-vrat { background: var(--cal-vrat-solid); }
.pad-fest strong { font-family: var(--font-display); font-size: 21px; font-weight: 400; line-height: 1.4; }
.pad-fest-n { margin-left: 8px; opacity: .85; font-size: 12.5px; }
.pad-fest p { opacity: .9; font-size: 13px; line-height: 1.45; }

.pad-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 14px 18px 0; }
.pad-rows dt, .pad-rows dd { padding: 8px 0; border-top: 1px dotted var(--cal-line); }
.pad-rows dt { padding-right: 18px; color: var(--muted); font-size: 14.5px; }
.pad-rows dd { font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.pad-rows small { display: block; color: var(--muted); font-size: 13.5px; }
.pad-sun { display: grid; grid-template-columns: 1fr 1fr; margin: 0 18px; border-top: 1px dotted var(--cal-line); border-bottom: 1px dotted var(--cal-line); }
.pad-sun div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 10px; padding: 9px 0; font-size: 16px; font-variant-numeric: tabular-nums; }
.pad-sun div + div { padding-left: 14px; border-left: 1px dotted var(--cal-line); }
.pad-sun svg { grid-row: span 2; width: 26px; height: 26px; color: var(--secondary); }
.pad-sun small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }

.pad-chog { margin: 0 18px; }
.pad-chog summary { display: flex; align-items: center; min-height: 46px; font-size: 15px; font-weight: 600; cursor: pointer; }
.chog-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px 22px; padding: 0 30px 8px 0; }
.chog-cols h3 { margin-bottom: 2px; color: var(--muted); font-size: 13px; font-weight: 600; }
.chog-cols li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chog-cols .good { color: var(--success); font-weight: 600; }
.chog-cols .bad { color: var(--live); }
.chog-cols .neutral { color: var(--muted); }

/* ---------- month list ---------- */
.cal-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 34px; }
.cal-pager a { padding: 10px 0; color: var(--primary-strong); font-weight: 600; text-decoration: none; }
.cal-pager a:hover { text-decoration: underline; }
.cal-section { margin-top: 56px; }
.cal-section h2 { margin-bottom: 16px; font-family: var(--font-display); font-size: clamp(27px, 4vw, 36px); line-height: 1.3; color: var(--cal-heading); }
.cal-events { display: grid; gap: 10px; }
.cal-event {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 10px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s;
}
.cal-event:hover { border-color: var(--gold); }
/* Each date as a small leaf of the pad. */
.ev-leaf { overflow: hidden; border: 1px solid var(--cal-line); border-radius: 7px; background: var(--cal-paper); box-shadow: 0 2px 0 var(--cal-line); text-align: center; }
.ev-leaf span { display: block; background: var(--cal-plain-solid); color: var(--cal-on-solid); font-size: 11.5px; font-weight: 600; line-height: 19px; }
.k-festival .ev-leaf span { background: var(--cal-red-solid); }
.k-vrat .ev-leaf span { background: var(--cal-vrat-solid); }
.ev-leaf b { display: block; padding-top: 4px; font-family: var(--font-display); font-size: 25px; font-weight: 400; line-height: 30px; font-variant-numeric: lining-nums; }
.ev-name { display: block; font-size: 16.5px; line-height: 1.45; }
.ev-sub { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; }

/* ---------- questions, other months, the app ---------- */
.cal-faq { display: grid; gap: 12px; }
.cal-qa { padding: 18px 20px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.cal-qa h3 { font-size: 17.5px; font-weight: 600; line-height: 1.5; }
.cal-qa p { margin-top: 6px; color: var(--muted); font-size: 16px; line-height: 1.7; }

.cal-months { display: grid; gap: 16px; }
.cal-year { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: baseline; gap: 12px; }
.cal-year h3 { color: var(--cal-heading); font-family: var(--font-display); font-size: 24px; font-variant-numeric: lining-nums; }
.cal-year ul { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-year a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s;
}
.cal-year a:hover { border-color: var(--gold); }
.cal-year a[aria-current] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }

.cal-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  margin-top: 56px;
  padding: 28px 30px 30px;
  border-radius: var(--radius);
  background: radial-gradient(90% 160% at 100% 0%, rgba(233, 196, 111, .22), transparent 60%), linear-gradient(155deg, #7E2C18, var(--maroon) 46%, var(--maroon-deep));
  color: var(--on-maroon-muted);
}
.cal-cta h2 { color: #FBEFD9; font-family: var(--font-display); font-size: clamp(25px, 3.4vw, 32px); line-height: 1.35; }
.cal-cta p { margin-top: 2px; font-size: 16px; }

/* ---------- motion ---------- */
.sheet-ghost { position: absolute; z-index: 2; left: 0; right: 0; top: 0; pointer-events: none; }
.sheet-ghost.flip-away { animation: cal-flip-away .6s cubic-bezier(.45, 0, .85, .55) forwards; }
.sheet-ghost.is-under { z-index: 0; }
.wallcal-sheet.flip-in { z-index: 2; animation: cal-flip-in .6s cubic-bezier(.15, .45, .3, 1) both; }
.pad-ghost { position: absolute; z-index: 3; left: 0; right: 0; top: 0; pointer-events: none; transform-origin: 14% 0; animation: cal-tear .42s cubic-bezier(.5, 0, .9, .4) forwards; }
.sheet-ghost .cal-pen path { animation: none; }

@keyframes cal-settle { 0% { transform: rotate(-1.1deg); } 30% { transform: rotate(.75deg); } 56% { transform: rotate(-.4deg); } 80% { transform: rotate(.16deg); } 100% { transform: rotate(0); } }
@keyframes cal-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cal-flip-away { 0% { transform: rotateX(0); } 75% { opacity: 1; } 100% { transform: rotateX(96deg); opacity: 0; } }
@keyframes cal-flip-in { 0% { transform: rotateX(96deg); opacity: 0; } 25% { opacity: 1; } 100% { transform: rotateX(0); } }
@keyframes cal-tear { to { transform: translateY(70px) rotate(8deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .wallcal, .is-fresh .cal-pen path { animation: none; }
}

/* ---------- wide screens ---------- */
@media (min-width: 760px) {
  .cal-events, .cal-faq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .cal-layout { grid-template-columns: minmax(0, 1.72fr) minmax(320px, 1fr); align-items: start; }
  .daypad { margin-top: 34px; }
}

/* ---------- phones: a short tithi and dots in each day; the pad below carries the detail ---------- */
@media (max-width: 719px) {
  .cal-toolbar { gap: 6px; margin-bottom: 24px; }
  .cal-select { padding: 0 30px 0 13px; background-position: right 10px center; font-size: 15px; }
  .cal-today { padding: 0 16px; }
  .cal-layout { gap: 40px; }

  .wallcal { width: auto; margin: 0 -12px; }
  .wallcal-binding { margin: 0 10px -16px; }
  .sheet-head {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    grid-template-areas: "art title title" "sub sub flip";
    gap: 22px 16px;
    margin: 0 8px;
    padding: 16px 12px 14px 14px;
  }
  .sheet-head::before { left: -220px; }
  .sheet-art { width: 92px; padding: 4px; }
  .sheet-art figcaption { bottom: -12px; padding: 2px 10px 0; font-size: 12.5px; }
  .sheet-title { display: contents; }
  .sheet-name { position: relative; grid-area: title; min-width: 0; }
  .sheet-title h2 { font-size: clamp(31px, 9.6vw, 40px); }
  .sheet-en { font-size: 11px; letter-spacing: .2em; }
  .sheet-sub { position: relative; grid-area: sub; align-self: center; margin: 0; font-size: 13.5px; }
  .sheet-flip { align-self: center; }

  .sheet-weekdays, .sheet-grid, .sheet-foot { margin: 0 8px; }
  .sheet-weekdays { margin-top: 10px; font-size: 12.5px; }
  .sheet-weekdays span { padding: 6px 0 5px; }
  .sheet-weekdays small { display: none; }
  .sheet-grid > * { min-height: 64px; }
  .cal-cell { gap: 0 1px; padding: 2px 3px 8px 4px; }
  .cal-num { padding-top: 4px; font-size: 23px; }
  .cal-pen { width: calc(100% + 14px); height: calc(100% + 4px); stroke-width: 2.2; }
  .cal-moon { width: 11px; height: 11px; margin-top: 7px; }
  .cal-tithi { font-size: 10.5px; }
  .t-full { display: none; }
  .t-short { display: inline; }
  .cal-marks { display: flex; gap: 3px; padding-top: 3px; }
  .cal-mark { display: block; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; font-size: 0; }
  .cal-ribbon { height: 4px; }
  .cal-ribbon.is-start { left: 4px; }
  .cal-ribbon.is-end { right: 4px; }
  .sheet-foot { grid-template-columns: minmax(0, 1fr); padding: 12px 0 16px; }
  .mini { display: none; }

  .pad-num { font-size: 132px; }
  .cal-section, .cal-cta { margin-top: 48px; }
  /* On a phone the calendar comes first: the lede is three lines until it is tapped. */
  .cal-lede { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 16px; cursor: pointer; }
  .cal-lede.is-open { -webkit-line-clamp: unset; }
  .cal-cta { padding: 24px 20px 26px; }
}
/* The narrowest phones have no room for the Moon beside a two-digit date. */
@media (max-width: 349px) {
  .cal-cell .cal-moon { display: none; }
}
