/* The calendar pages (ADR 0038): the new moon and first crescent
   (/crescent), today in four calendars (/calendars), each calendar's year,
   the holiday pages (/ramadan, /passover, ...) and prayer times. The (i)
   source popovers come from eclipses.css. Dark theme: calendars-dark.css. */

.cl-page { display: flex; flex-direction: column; gap: 22px; }
/* Links take the page's accent; :where() keeps this below every other rule. */
:where(.cl-page) a { color: var(--accent-moon); text-underline-offset: 3px; }
:where(.cl-page) :is(td, th) a { color: var(--text); }
.cl-eyebrow a { color: inherit; text-decoration: none; }
/* The (i)s sit in the text here, and their popovers are spans (phrasing content). */
:where(.cl-page) :is(p, td, dd, li) > .ec-info { display: inline-grid; vertical-align: -5px; margin-left: 2px; }
span.ec-pop .ec-pop-h { display: block; color: var(--accent-moon); }
span.ec-pop .ec-pop-note { display: block; margin-top: 6px; }
span.ec-pop .ec-pop-list { display: block; margin-top: 8px; color: var(--text); }
span.ec-pop .ec-pop-item { display: grid; grid-template-columns: 1.6em 1fr; color: var(--text); }
span.ec-pop .ec-pop-item + .ec-pop-item { margin-top: 6px; }
span.ec-pop .ec-pop-item > span:last-child { grid-column: 2; color: var(--muted); }
span.ec-pop .ec-pop-n { grid-column: 1; grid-row: 1 / span 2; color: var(--muted); }
span.ec-pop .ec-pop-also { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.cl-eyebrow a:hover { text-decoration: underline; }
/* The (i)s sit in the text here, and their popovers are spans (phrasing content). */
:where(.cl-page) :is(p, td, dd, li) > .ec-info { display: inline-grid; vertical-align: -5px; margin-left: 2px; }
span.ec-pop .ec-pop-h { display: block; color: var(--accent-moon); }
span.ec-pop .ec-pop-note { display: block; margin-top: 6px; }
span.ec-pop .ec-pop-list { display: block; margin-top: 8px; color: var(--text); }
span.ec-pop .ec-pop-item { display: grid; grid-template-columns: 1.6em 1fr; color: var(--text); }
span.ec-pop .ec-pop-item + .ec-pop-item { margin-top: 6px; }
span.ec-pop .ec-pop-item > span:last-child { grid-column: 2; color: var(--muted); }
span.ec-pop .ec-pop-n { grid-column: 1; grid-row: 1 / span 2; color: var(--muted); }
span.ec-pop .ec-pop-also { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.cl-page > .place { margin-bottom: -6px; }
.cl-eyebrow { color: var(--accent-moon); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 4px !important; }
.cl-section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 12px; }
.cl-section-title { font-size: clamp(1.2rem, 3vw, 1.45rem); line-height: 1.2; letter-spacing: -0.01em; }
.cl-card-title { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-moon); }
.cl-lede { color: var(--muted); max-width: 70ch; }
.cl-note { color: var(--muted); font-size: 0.85rem; }
.cl-note a, .cl-begin a, .cl-links a { color: var(--accent-moon); text-underline-offset: 3px; }
.cl-explain p { max-width: 72ch; }
.cl-explain p + p { margin-top: 4px; }
.cl-explain h3 { margin-top: 10px; font-size: 1.02rem; }

/* A heading with its (i) beside it. */
.cl-with-info { display: flex; align-items: center; gap: 8px; }
th .ec-info, dt .ec-info, .cl-begin .ec-info { display: inline-grid; width: 20px; height: 20px; font-size: 0.8rem; vertical-align: middle; margin-left: 2px; }

/* ---- The verdict for the visitor's place ------------------------------- */
.cl-verdict { gap: 12px; }
.cl-verdict h2 { font-size: clamp(1.3rem, 3.6vw, 1.75rem); line-height: 1.2; letter-spacing: -0.015em; }
.cl-verdict > p { max-width: 70ch; }

/* ---- Tables ----------------------------------------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cl-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.cl-table th, .cl-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cl-table thead th { color: var(--muted); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.cl-table tbody th { font-weight: 600; white-space: nowrap; }
.cl-table tr.is-none td, .cl-table tr.is-none th { color: var(--muted); }
.cl-table tr.is-today th, .cl-table tr.is-today td { background: var(--accent-moon-soft); }
.cl-table tr.is-past th, .cl-table tr.is-past td { color: var(--muted); }
.cl-table td.num, .cl-table th.num { text-align: right; }
.cl-table .cl-sub { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 400; }

/* Class and zone badges, in the maps' colors. */
.cl-class {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 750;
  color: #1d1f24;
}
.cl-class-text { color: var(--muted); font-size: 0.85rem; }
.cl-odeh-A, .cl-yallop-A, .cm-sw-odeh-A, .cm-sw-yallop-A { background: #3aa864; }
.cl-yallop-B, .cm-sw-yallop-B { background: #9bd15a; }
.cl-odeh-B, .cm-sw-odeh-B { background: #c9d94a; }
.cl-odeh-C, .cl-yallop-C, .cm-sw-odeh-C, .cm-sw-yallop-C { background: #f2c037; }
.cl-yallop-D, .cm-sw-yallop-D { background: #f08b35; }
.cl-yallop-E, .cm-sw-yallop-E { background: #d9625b; }
.cl-odeh-D, .cl-yallop-F { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.cm-sw-up { background: rgb(74 90 140 / 0.22); }

/* ---- Crescent maps: a criterion and an evening, picked with radios (no script) */
.cm { display: flex; flex-direction: column; gap: 10px; }
.cm-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.cm-controls fieldset { margin: 0; padding: 2px; min-inline-size: 0; }
.cm-controls .segmented label { padding: 5px 12px; font-size: 0.9rem; }
.cm-map { display: none; }
.cm:has([name="cm-crit"][value="odeh"]:checked):has([name="cm-eve"][value="0"]:checked) .cm-map[data-crit="odeh"][data-eve="0"],
.cm:has([name="cm-crit"][value="odeh"]:checked):has([name="cm-eve"][value="1"]:checked) .cm-map[data-crit="odeh"][data-eve="1"],
.cm:has([name="cm-crit"][value="odeh"]:checked):has([name="cm-eve"][value="2"]:checked) .cm-map[data-crit="odeh"][data-eve="2"],
.cm:has([name="cm-crit"][value="yallop"]:checked):has([name="cm-eve"][value="0"]:checked) .cm-map[data-crit="yallop"][data-eve="0"],
.cm:has([name="cm-crit"][value="yallop"]:checked):has([name="cm-eve"][value="1"]:checked) .cm-map[data-crit="yallop"][data-eve="1"],
.cm:has([name="cm-crit"][value="yallop"]:checked):has([name="cm-eve"][value="2"]:checked) .cm-map[data-crit="yallop"][data-eve="2"] { display: block; }
.cm-up { fill: #4a5a8c; fill-opacity: 0.16; }
.cm-band { fill-opacity: 0.62; stroke-width: 0.6px; stroke-opacity: 0.7; }
.cm-odeh-A, .cm-yallop-A { fill: #3aa864; stroke: #23703f; }
.cm-yallop-B { fill: #9bd15a; stroke: #5f8f2a; }
.cm-odeh-B { fill: #c9d94a; stroke: #7f8a1d; }
.cm-odeh-C, .cm-yallop-C { fill: #f2c037; stroke: #a87d0a; }
.cm-yallop-D { fill: #f08b35; stroke: #a8540f; }
.cm-yallop-E { fill: #d9625b; stroke: #8f2c26; }
.cm-limit { fill: #0b1130; fill-opacity: 0.1; }

/* ---- The months a new moon begins -------------------------------------- */
.cl-begins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px 24px; }
.cl-begin { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cl-begin h3 { font-size: 1.08rem; }
.cl-methods { margin: 0; display: grid; gap: 6px; }
.cl-methods dt { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.cl-methods dd { margin: 0 0 4px; display: flex; flex-direction: column; gap: 2px; }
.cl-methods dd .muted { font-size: 0.85rem; }

/* ---- Navigation between years and new moons ------------------------- */
.cl-lunations, .cl-years { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.cl-lunations a, .cl-years a { color: var(--accent-moon); text-underline-offset: 3px; }
.cl-next { margin-left: auto; }
.cl-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---- Today in four calendars ------------------------------------------- */
.cl-today { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cl-today .card { gap: 8px; padding: 16px 18px; }
.cl-today h2 { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-moon); }
.cl-date { font-size: 1.35rem; font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
.cl-date-sub { color: var(--muted); font-size: 0.88rem; }
.cl-today dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 0.88rem; }
.cl-today dt { color: var(--muted); }
.cl-today dd { margin: 0; }

/* ---- Holidays ------------------------------------------------------------ */
.cl-hero { gap: 10px; }
.cl-hero .cl-hero-date { font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.cl-hero .cl-hero-when { color: var(--muted); }
.cl-hero-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; }
.cl-hero-methods div { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.cl-hero-methods span { color: var(--muted); font-size: 0.85rem; }
.cl-agree { color: var(--muted); font-size: 0.85rem; }
.cl-diff { color: var(--warn-text); font-weight: 600; }

/* ---- Prayer times ------------------------------------------------------- */
.pt-form { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.pt-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.pt-form select, .pt-form button {
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
}
.pt-form button { cursor: pointer; background: var(--accent-moon-soft); font-weight: 600; }
.pt-today { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .pt-today { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pt-time { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pt-time span { color: var(--muted); font-size: 0.8rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
.pt-time strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pt-time.is-next { border-color: var(--accent-moon); box-shadow: 0 0 0 1px var(--accent-moon) inset; }
.pt-time small { color: var(--muted); font-size: 0.75rem; }
.pt-params { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.9rem; }
.pt-params dt { color: var(--muted); }
.pt-params dd { margin: 0; }

/* The sources list. */
.cl-ref-list { margin: 10px 0 0; padding-left: 1.8em; display: grid; gap: 6px; font-size: 0.9rem; }
.cl-ref-list span { display: block; color: var(--muted); }
.cl-ref-list a { color: var(--text); }
.cl-method { color: var(--muted); font-size: 0.9rem; max-width: 72ch; margin-top: 8px !important; }

@media print {
  .cm-controls, .cl-lunations, .cl-years, .pt-form { display: none; }
  .cm-map { display: block; break-inside: avoid; }
}

/* ---- Full moons (ADR 0039) --------------------------------------------- */
.fm-name { font-size: 1.15rem; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.fm-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 1px; border: 1px solid transparent; }
.fm-name .fm-badge { margin-left: 0; }
.fm-super { background: #fde7c4; color: #7a4300; border-color: #f3c98a; }
.fm-micro { background: #e3e7f2; color: #3b4a6b; border-color: #c7cfe2; }
.fm-blue { background: #dbe8ff; color: #1c4fa8; border-color: #b6ccf5; }
.fm-facts, .fm-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 10px 20px; margin: 0; }
.fm-facts dt, .fm-summary dt { color: var(--muted); font-size: 0.8rem; }
.fm-facts dd, .fm-summary dd { margin: 2px 0 0; font-weight: 600; }
.fm-summary { margin-top: 14px; }
.fm-names th { width: 34%; }
/* Phones: each tradition above its name. */
@media (max-width: 600px) {
  .fm-names tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 10px; }
  .fm-names tr:last-child { border-bottom: 0; }
  .fm-names th, .fm-names td { display: block; width: auto; padding: 0; border: 0; white-space: normal; }
  .fm-names th { color: var(--muted); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 2px; }
}
