/* The /calendar/ page and each calendar's own page. They load the Hindu calendar's
   stylesheet first, for its paper, inks, date pad, breadcrumb, FAQ and banner, and add
   here what only they have: the leaves, the fact list, the tables. */

/* These pages are for reading, so the lede is shown whole on a phone too. */
.cal-info .cal-lede { display: block; overflow: visible; -webkit-line-clamp: unset; cursor: auto; }
.cal-info .cal-intro { margin-bottom: 30px; }

.cal-prose { max-width: 840px; }
.cal-prose p { font-size: 16.5px; line-height: 1.75; }
.cal-prose p + p { margin-top: 10px; }
.cal-table + .cal-prose, .cal-limbs + .cal-prose, .cal-prose + .cal-table { margin-top: 16px; }

/* ---------- other calendars, as pills ---------- */
.cal-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-pills 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-pills a:hover { border-color: var(--gold); }
.cal-pills a:first-child { border-color: var(--primary); color: var(--primary-strong); }
/* On the hub the pills are the index of every calendar; under a row of leaves they are the rest. */
.cal-index { margin-bottom: 8px; }
.cal-more { margin-top: 26px; }
.cal-sub { margin: 34px 0 14px; color: var(--cal-heading); font-family: var(--font-display); font-size: 25px; line-height: 1.4; }

/* ---------- the hub: every calendar as a leaf showing today's date ---------- */
.leaves { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 22px; margin-top: 18px; }
.leaf {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border-radius: 4px 4px 10px 10px;
  background: var(--cal-paper);
  box-shadow: var(--cal-stack), 0 26px 36px -22px rgba(70, 30, 10, .45);
  color: var(--cal-ink);
  text-align: center;
  text-decoration: none;
  transition: transform .2s;
}
.leaf:hover { transform: translateY(-4px) rotate(-.5deg); }
.leaf-band { padding: 8px 12px 7px; border-bottom: 2px dotted var(--cal-line); background: var(--cal-red-solid); color: var(--cal-on-solid); font-size: 15px; font-weight: 600; }
.leaf-date { display: grid; align-content: center; padding: 10px 12px 12px; }
.leaf-big { padding-top: 12px; font-family: var(--font-display); font-size: 78px; line-height: 1; font-variant-numeric: lining-nums; }
.leaf-big.is-word { padding: 26px 0 12px; font-size: 42px; line-height: 1.3; }
.leaf-line { color: var(--cal-heading); font-family: var(--font-display); font-size: 21px; line-height: 1.45; }
.leaf-small { color: var(--muted); font-size: 13.5px; }
.leaf-about { padding: 11px 14px 16px; border-top: 1px dotted var(--cal-line); color: var(--muted); font-size: 13.5px; line-height: 1.5; text-align: left; }

.cal-limbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.cal-limbs > div { padding: 16px 18px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.cal-limbs dt { color: var(--cal-heading); font-family: var(--font-display); font-size: 25px; line-height: 1.4; }
.cal-limbs dd { margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.65; }

/* ---------- a calendar's own page: facts beside the date pad ---------- */
.cal-top { display: grid; align-items: start; gap: 30px; }
.cal-top .daypad { order: -1; }
.cal-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 4px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.cal-facts dt, .cal-facts dd { padding: 13px 0; border-top: 1px solid var(--border); line-height: 1.55; }
.cal-facts dt:first-of-type, .cal-facts dd:first-of-type { border-top: 0; }
.cal-facts dt { padding-right: 22px; color: var(--muted); font-size: 14.5px; }
.cal-facts dd { font-size: 16px; }
.pad-num.is-word { padding: 26px 0 10px; font-size: 68px; line-height: 1.25; }
.cal-info .daypad-page { padding-bottom: 30px; }
.cal-info .pad-tithi { margin-top: 4px; }

.cal-table { overflow-x: auto; margin-top: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.cal-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; font-variant-numeric: tabular-nums lining-nums; }
.cal-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cal-table th, .cal-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.cal-table thead th { background: var(--secondary-subtle); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.cal-table tbody th { font-weight: 600; }
.cal-table tbody tr:last-child > * { border-bottom: 0; }
.cal-table small { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 400; }
/* The month or year that holds today. */
.cal-table .is-now > * { background: var(--primary-subtle); }
.cal-table .is-now th::after { content: "अभी"; margin-left: 10px; padding: 1px 8px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 600; }
.cal-table + .cal-note { margin-top: 12px; }
.cal-note a, .cal-prose a { color: var(--primary-strong); }

@media (min-width: 900px) {
  .cal-top { grid-template-columns: minmax(0, 1fr) 390px; gap: 44px; }
  .cal-top .daypad { order: 0; margin-top: 0; }
}
@media (max-width: 719px) {
  .leaves { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .leaf-big { font-size: 62px; }
  .leaf-big.is-word { padding: 20px 0 8px; font-size: 30px; }
  .leaf-line { font-size: 17.5px; }
  .leaf-about { padding: 9px 10px 14px; font-size: 13px; }
  .cal-facts { padding: 2px 16px; }
  .cal-table th, .cal-table td { padding: 10px 9px; }
  .cal-table th:first-child { padding-left: 14px; white-space: normal; }
  .cal-table table { font-size: 14.5px; }
  .cal-table small { display: block; margin-left: 0; }
  .pad-num.is-word { font-size: 56px; }
}

/* ---------- each calendar's own look ----------
   A calendar is known by one ink and one emblem, wherever it appears: its leaf on the hub,
   and the date pad, month sheet and tables on its own page. `data-cal` names the calendar;
   everything inside takes its ink (--accent), the ink for words on it (--accent-on) and
   its emblem (--motif, a shape that is filled with whichever ink is wanted). */
[data-cal="hindu"] { --accent: #5A1F12; --accent-on: #FBEFD9; --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext x='50' y='80' font-size='82' text-anchor='middle' font-family='serif'%3Eॐ%3C/text%3E%3C/svg%3E"); } /* Om */
[data-cal="vikram"] { --accent: #C2560F; --accent-on: #FFF4E6; --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='17'/%3E%3Cpath d='M50.0 24.0L50.0 7.0M63.0 27.5L71.5 12.8M72.5 37.0L87.2 28.5M76.0 50.0L93.0 50.0M72.5 63.0L87.2 71.5M63.0 72.5L71.5 87.2M50.0 76.0L50.0 93.0M37.0 72.5L28.5 87.2M27.5 63.0L12.8 71.5M24.0 50.0L7.0 50.0M27.5 37.0L12.8 28.5M37.0 27.5L28.5 12.8' fill='none' stroke='%23000' stroke-width='5.5' stroke-linecap='round'/%3E%3C/svg%3E"); } /* the Sun */
[data-cal="saka"] { --accent: #1F3A6E; --accent-on: #EEF2FB; --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='42' fill='none' stroke='%23000' stroke-width='5'/%3E%3Ccircle cx='50' cy='50' r='7'/%3E%3Cpath d='M50.0 42.0L50.0 9.0M52.1 42.3L60.6 10.4M54.0 43.1L70.5 14.5M55.7 44.3L79.0 21.0M56.9 46.0L85.5 29.5M57.7 47.9L89.6 39.4M58.0 50.0L91.0 50.0M57.7 52.1L89.6 60.6M56.9 54.0L85.5 70.5M55.7 55.7L79.0 79.0M54.0 56.9L70.5 85.5M52.1 57.7L60.6 89.6M50.0 58.0L50.0 91.0M47.9 57.7L39.4 89.6M46.0 56.9L29.5 85.5M44.3 55.7L21.0 79.0M43.1 54.0L14.5 70.5M42.3 52.1L10.4 60.6M42.0 50.0L9.0 50.0M42.3 47.9L10.4 39.4M43.1 46.0L14.5 29.5M44.3 44.3L21.0 21.0M46.0 43.1L29.5 14.5M47.9 42.3L39.4 10.4' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3C/svg%3E"); } /* the 24-spoked wheel */
[data-cal="purnimanta"] { --accent: #DDA83A; --accent-on: #3B1409; --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40'/%3E%3C/svg%3E"); } /* the full Moon */
[data-cal="amanta"] { --accent: #29263F; --accent-on: #ECEAF7; --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='39' fill='none' stroke='%23000' stroke-width='3'/%3E%3Cpath d='M50 12A38 38 0 1 0 50 88A29 38 0 1 1 50 12Z'/%3E%3C/svg%3E"); } /* the new Moon */
[data-cal="tamil"] { --accent: #1E6B4A; --accent-on: #F0F8F1; --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23000' stroke-width='4'%3E%3Ccircle cx='30' cy='50' r='20'/%3E%3Ccircle cx='70' cy='50' r='20'/%3E%3Ccircle cx='50' cy='30' r='20'/%3E%3Ccircle cx='50' cy='70' r='20'/%3E%3C/g%3E%3Ccircle cx='30' cy='50' r='3.6'/%3E%3Ccircle cx='70' cy='50' r='3.6'/%3E%3Ccircle cx='50' cy='30' r='3.6'/%3E%3Ccircle cx='50' cy='70' r='3.6'/%3E%3Ccircle cx='50' cy='50' r='3.6'/%3E%3C/svg%3E"); } /* a kolam */
[data-cal="malayalam"] { --accent: #F6EDD3; --accent-on: #5A3B0A; --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 6C59 19 59 28 50 33C41 28 41 19 50 6Z'/%3E%3Cellipse cx='50' cy='41' rx='23' ry='6.5'/%3E%3Crect x='46' y='44' width='8' height='32'/%3E%3Cellipse cx='50' cy='59' rx='10' ry='4.5'/%3E%3Cpath d='M25 90Q50 66 75 90Z'/%3E%3Crect x='21' y='88' width='58' height='6' rx='2'/%3E%3C/svg%3E"); } /* a nilavilakku lamp */
[data-cal="bengali"] { --accent: #B3122D; --accent-on: #FFF1EE; --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23000' stroke-width='3.6'%3E%3Cellipse cx='50' cy='27' rx='9' ry='20' transform='rotate(0 50 50)'/%3E%3Cellipse cx='50' cy='27' rx='9' ry='20' transform='rotate(45 50 50)'/%3E%3Cellipse cx='50' cy='27' rx='9' ry='20' transform='rotate(90 50 50)'/%3E%3Cellipse cx='50' cy='27' rx='9' ry='20' transform='rotate(135 50 50)'/%3E%3Cellipse cx='50' cy='27' rx='9' ry='20' transform='rotate(180 50 50)'/%3E%3Cellipse cx='50' cy='27' rx='9' ry='20' transform='rotate(225 50 50)'/%3E%3Cellipse cx='50' cy='27' rx='9' ry='20' transform='rotate(270 50 50)'/%3E%3Cellipse cx='50' cy='27' rx='9' ry='20' transform='rotate(315 50 50)'/%3E%3C/g%3E%3Ccircle cx='50' cy='50' r='7.5'/%3E%3C/svg%3E"); } /* an alpona lotus */

.leaf[data-cal] .leaf-band, .cal-info[data-cal] .pad-band, .daypad[data-cal] .pad-band { background: var(--accent); color: var(--accent-on); }
/* Kerala's cream-and-gold cloth: the one light ink, so it is edged in gold to hold its shape on paper. */
[data-cal="malayalam"] .leaf-band, [data-cal="malayalam"] .pad-band, [data-cal="malayalam"] .sm-head { border-top: 4px double #C89B3C; border-bottom: 4px double #C89B3C; }
.daypad[data-cal] .daypad-clip { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 72%, #000)); }

/* The emblem, faint, behind the date on a leaf. */
.leaf[data-cal] .leaf-date { position: relative; }
.leaf[data-cal] .leaf-date::before {
  content: "";
  position: absolute;
  inset: 6% 16%;
  background: var(--accent);
  opacity: .1;
  -webkit-mask: var(--motif) center / contain no-repeat;
  mask: var(--motif) center / contain no-repeat;
}
.leaf[data-cal] .leaf-date > * { position: relative; }
[data-cal="malayalam"].leaf .leaf-date::before, [data-cal="purnimanta"].leaf .leaf-date::before { background: #C89B3C; opacity: .14; }
@media (prefers-color-scheme: dark) {
  .leaf[data-cal] .leaf-date::before { background: color-mix(in srgb, var(--accent) 45%, var(--cal-ink)); opacity: .14; }
}

/* The emblem as a seal beside a calendar's name, on its own page. */
.cal-emblem { display: none; }
.cal-info[data-cal]:not([data-cal="all"]) .cal-intro { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 20px; max-width: 920px; }
.cal-info[data-cal]:not([data-cal="all"]) .cal-emblem {
  position: relative;
  display: block;
  grid-row: span 2;
  align-self: start;
  width: 76px;
  height: 76px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px color-mix(in srgb, var(--gold) 75%, transparent), 0 10px 20px -8px rgba(70, 30, 10, .45);
}
.cal-emblem::after {
  content: "";
  position: absolute;
  inset: 17px;
  background: var(--accent-on);
  -webkit-mask: var(--motif) center / contain no-repeat;
  mask: var(--motif) center / contain no-repeat;
}
/* The full Moon is a bright disc in a night sky, not a dark one on gold. */
.cal-info[data-cal="purnimanta"] .cal-intro .cal-emblem { background: #29263F; }
.cal-info[data-cal="purnimanta"] .cal-intro .cal-emblem::after { background: #F2C55C; }
.cal-info[data-cal]:not([data-cal="all"]) .cal-lede { margin-top: 0; }
.cal-info[data-cal] .cal-facts { border-top: 4px solid var(--accent); }
.cal-info[data-cal] .cal-table .is-now > * { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.cal-info[data-cal] .cal-table .is-now th::after { background: var(--accent); color: var(--accent-on); }
.cal-info[data-cal] .cal-table thead th { border-bottom: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); }

/* ---------- the Hindu calendar on the hub: a wide card, as its own wall calendar looks ---------- */
.leaf-feature {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  max-width: 780px;
  margin-top: 30px;
  padding: 34px 30px 30px;
  overflow: hidden;
  border-radius: 6px 6px 12px 12px;
  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));
  box-shadow: 0 30px 44px -24px rgba(70, 30, 10, .55);
  color: var(--on-maroon);
  text-decoration: none;
  transition: transform .2s;
}
.leaf-feature:hover { transform: translateY(-3px); }
.leaf-feature .wallcal-binding { position: absolute; left: 14px; right: 14px; top: -14px; margin: 0; }
.feature-art { 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); }
.feature-art img { width: 168px; height: auto; border-radius: 5px; }
.feature-body { display: grid; gap: 4px; min-width: 0; }
.feature-name { color: #FBEFD9; font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 42px); line-height: 1.25; }
.feature-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.feature-date .leaf-big { padding: 0; color: var(--gold-on-maroon); font-size: 58px; line-height: 1.1; }
.feature-date .leaf-line { color: #FBEFD9; font-size: 24px; }
.feature-date .leaf-small { color: var(--on-maroon-muted); font-size: 14.5px; }
.feature-about { color: var(--on-maroon-muted); font-size: 15.5px; line-height: 1.55; }
.feature-go { justify-self: start; margin-top: 10px; padding: 9px 20px; border-radius: 999px; background: linear-gradient(180deg, #F0C062, #D99A2B); color: #3B2A1A; font-size: 15px; font-weight: 600; }

/* ---------- a month of a day-counted calendar, as a small wall-calendar sheet in its own ink ---------- */
.sheet-mini { overflow: hidden; border-radius: 4px 4px 10px 10px; background: var(--cal-paper); box-shadow: var(--cal-stack), 0 30px 44px -24px rgba(70, 30, 10, .45); }
.sm-head { position: relative; display: grid; gap: 0 14px; grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding: 20px 96px 16px 22px; overflow: hidden; background: var(--accent); color: var(--accent-on); }
.sm-head::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 78px;
  height: 78px;
  margin-top: -39px;
  background: var(--accent-on);
  opacity: .28;
  -webkit-mask: var(--motif) center / contain no-repeat;
  mask: var(--motif) center / contain no-repeat;
}
.sm-month { grid-column: 1 / -1; font-family: var(--font-display); font-size: clamp(30px, 4.6vw, 42px); line-height: 1.3; }
.sm-month span { margin-left: 8px; opacity: .85; font-size: .72em; }
.sm-year { font-size: 15px; font-weight: 600; }
.sm-span { opacity: .85; font-size: 14px; }
.sm-weekdays, .sm-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 12px; }
.sm-weekdays { margin-top: 12px; padding: 6px 0; border-bottom: 2px solid var(--accent); color: var(--muted); text-align: center; font-size: 13.5px; font-weight: 600; }
.sm-weekdays span:first-child { color: var(--cal-red); }
.sm-grid { margin-bottom: 14px; border: 1px solid var(--cal-line); border-top: 0; }
.sm-grid > * { min-height: 66px; border-right: 1px solid var(--cal-line); border-bottom: 1px solid var(--cal-line); }
.sm-grid > :nth-child(7n) { border-right: 0; }
.sm-grid > :nth-last-child(-n + 7) { border-bottom: 0; }
.sm-blank { background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--cal-line) 38%, transparent) 7px 8px); }
.sm-cell { display: grid; align-content: start; gap: 1px; padding: 5px 8px 6px; }
.sm-cell b { font-family: var(--font-display); font-size: 27px; font-weight: 400; line-height: 1.1; padding-top: 4px; font-variant-numeric: lining-nums; }
.sm-cell small { color: var(--muted); font-size: 11.5px; line-height: 1.3; white-space: nowrap; }
.sm-cell.is-sunday b { color: var(--cal-red); }
.sm-cell.is-today { background: color-mix(in srgb, var(--accent) 16%, var(--cal-paper)); box-shadow: inset 0 0 0 2px var(--accent); }
[data-cal="malayalam"] .sm-cell.is-today, [data-cal="purnimanta"] .sm-cell.is-today { box-shadow: inset 0 0 0 2px #C89B3C; }

@media (min-width: 900px) {
  .cal-top.has-sheet { grid-template-columns: minmax(0, 1.5fr) 390px; }
}
@media (max-width: 719px) {
  .cal-info[data-cal]:not([data-cal="all"]) .cal-intro { gap: 2px 14px; }
  .cal-info[data-cal]:not([data-cal="all"]) .cal-emblem { width: 56px; height: 56px; }
  .cal-emblem::after { inset: 12px; }
  .cal-info[data-cal]:not([data-cal="all"]) .cal-lede { grid-column: 1 / -1; margin-top: 8px; }
  .leaf-feature { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 30px 16px 20px; }
  .feature-art { padding: 4px; }
  .feature-art img { width: 88px; }
  .feature-date .leaf-big { font-size: 44px; }
  .feature-date .leaf-line { font-size: 19px; }
  .feature-about { grid-column: 1 / -1; }
  .cal-top.has-sheet .daypad { order: 0; }
  .sheet-mini { margin: 0 -12px; }
  .sm-head { grid-template-columns: minmax(0, 1fr); padding: 16px 78px 13px 16px; }
  .sm-head::after { width: 60px; height: 60px; margin-top: -30px; right: 10px; }
  .sm-weekdays, .sm-grid { margin-left: 8px; margin-right: 8px; }
  .sm-weekdays { font-size: 12px; }
  .sm-grid > * { min-height: 54px; }
  .sm-cell { padding: 3px 4px 5px; }
  .sm-cell b { font-size: 21px; }
  .sm-cell small { font-size: 9.5px; }
}
