/* A tirth's own page and the list of all tirths (made by tools/tirth_pages.py): pages on the
   site's colours and fonts (tokens.css, main.css), with no scene. The list's search: assets/js/tirths.js. */
.tp { background: radial-gradient(120% 60% at 50% 0%, rgba(var(--glow-rgb), 0.16), transparent 70%), var(--bg); }
.tp-main a { color: inherit; }
/* The top bar is the site's own (main.css .topbar), here in the page's flow: sticky on phones and tablets */
.tp .topbar { position: relative; }
/* Opened over the site while a bhajan plays (ui/tirthframe.js): room at the bottom for the mini player */
.has-mini .tp { padding-bottom: calc(max(10px, env(safe-area-inset-bottom)) + 54px); }
@media (max-width: 1024px) { .tp .topbar { position: sticky; } }
.tp-main { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gutter) 32px; }
.tp-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.tp-crumbs .chip { padding: 6px 13px; font-size: 0.88rem; text-decoration: none; }
.tp-crumbs .chip svg { width: 16px; height: 16px; color: var(--accent); }
.tp-card {
  padding: 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(var(--line-rgb), 0.06);
}
.tp-cover { display: block; width: calc(100% + 40px); height: auto; margin: -20px -20px 18px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.tp h1 { margin: 0; color: var(--title); font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 400; line-height: 1.25; overflow-wrap: anywhere; }
.tp-card p { margin: 8px 0 0; }
.tp-kind { color: var(--accent); font-weight: 700; }
.tp-place { display: flex; align-items: flex-start; gap: 6px; color: var(--text-muted); }
.tp-place svg { flex: none; width: 18px; height: 18px; margin-top: 4px; color: var(--accent); }
.tp-note { line-height: 1.6; }
.tp-note a { color: var(--accent); }
.tp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.tp-actions .chip { text-decoration: none; }
.tp-city { color: var(--text-muted); }
.tp-h2 { margin: 28px 0 12px; color: var(--title); font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; scroll-margin-top: 12px; }
.tp-near { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tp-near li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
}
.tp-near :is(a, .tp-near-text) { display: grid; flex: 1; min-width: 0; gap: 2px; text-decoration: none; }
.tp-near a:hover .tp-near-name { color: var(--accent); }
.tp-near-name { font-weight: 700; overflow-wrap: anywhere; }
.tp-near-meta { color: var(--text-faint); font-size: 0.86rem; overflow-wrap: anywhere; }
.tp-near strong { flex: none; color: var(--highlight); }
.tp-none { color: var(--text-muted); }

/* Photos of a tirth (Wikimedia Commons): side by side at the same height, stacked on phones */
.tp-photos { display: flex; gap: 3px; margin: -20px -20px 16px; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.tp-photo { position: relative; flex-basis: 0; min-width: 0; margin: 0; background: rgba(var(--ink-rgb), 0.6); }
.tp-photo img { display: block; width: 100%; height: auto; }
.tp-photo figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 28px 12px 9px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
@media (max-width: 559px) {
  .tp-photos { flex-direction: column; }
  .tp-photo { flex-basis: auto; }
  .tp-photo img { max-height: 80svh; object-fit: cover; object-position: top; } /* (a tall photo keeps its top: the Bhagwan's face, the spire) */
}

/* The list of all tirths: a picture of the chosen state's tirth, the states, then that state's tirths.
   The picture follows the chosen state (assets/js/tirths.js). */
.tx-hero { overflow: hidden; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: rgba(var(--line-rgb), 0.06); }
.tx-banner { position: relative; aspect-ratio: 16 / 7; overflow: hidden; background: var(--screen-bg); }
.tx-banner img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.45s ease; }
.tx-banner img.is-changing { opacity: 0; }
.tx-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(var(--shade-rgb), 0.92)); pointer-events: none; }
.tx-banner h1 { position: absolute; z-index: 1; inset: auto 20px 16px; color: var(--gold-300); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55); }
.tx-banner-place {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 24px);
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: rgba(var(--shade-rgb), 0.62);
  color: var(--cream-100) !important; /* (on the picture) */
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.tx-banner-place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-banner-place svg { flex: none; width: 15px; height: 15px; color: var(--saffron-400); }
.tx-banner-place:hover { background: rgba(var(--shade-rgb), 0.85); }
.tx-hero-body { padding: 18px 20px 20px; }
.tx-lead { max-width: 60ch; margin: 0; color: var(--highlight); font-family: var(--font-book); font-size: 1.12rem; line-height: 1.7; }
.tx-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 16px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.55);
}
.tx-search[hidden] { display: none; }
.tx-search:focus-within { box-shadow: var(--focus-ring); }
.tx-search svg { flex: none; width: 20px; height: 20px; color: var(--text-faint); }
.tx-search input { flex: 1; min-width: 0; padding: 12px 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 1rem; }
.tx-search input::placeholder { color: var(--text-faint); }

.tx-states { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tx-state {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.tx-state:hover { border-color: rgba(var(--accent-rgb), 0.55); }
.tx-state[aria-current="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.16); box-shadow: inset 0 0 0 1px var(--accent); }
.tx-state-name { font-weight: 700; line-height: 1.25; }
.tx-state[aria-current="true"] .tx-state-name { color: var(--title); }
.tx-state-n { margin-top: 4px; color: var(--text-faint); font-size: 0.8rem; font-weight: 600; }
.tx-state[aria-current="true"] .tx-state-n { color: var(--accent); }
@media (max-width: 559px) {
  /* two rows that scroll sideways, so the tirths start near the top */
  .tx-states {
    grid-auto-flow: column;
    grid-template-rows: repeat(2, auto);
    grid-template-columns: none;
    grid-auto-columns: 42%;
    margin: 0 calc(-1 * var(--gutter));
    padding: 2px var(--gutter) 4px;
    overflow-x: auto;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .tx-states::-webkit-scrollbar { display: none; }
  .tx-state { scroll-snap-align: start; }
  .tx-banner { aspect-ratio: 16 / 10; }
  .tx-banner h1 { inset: auto 16px 12px; }
  .tx-hero-body { padding: 16px; }
  .tx-lead { font-size: 1.02rem; }
}

.tx-empty { margin: 24px 0 0; padding: 22px; border: 1px dashed var(--glass-border); border-radius: var(--radius-md); color: var(--text-muted); text-align: center; }
.tx-group { margin-top: 28px; scroll-margin-top: 12px; }
.tx-group[hidden] { display: none; }
.tx-group-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 12px; color: var(--title); font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; }
.tx-group-n { margin-left: auto; color: var(--text-faint); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; }
.tx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 560px) { .tx-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.tx-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.tx-card a:hover { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--accent-rgb), 0.07); }
.tx-card a:hover .tx-card-name { color: var(--accent); }
/* Back from a tirth's page: its card glows for a moment (keyframes in main.css, as the planner's cards) */
.tx-card.is-back a { animation: tirth-back 2.4s ease-out; }
.tx-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, rgba(var(--accent-rgb), 0.24), transparent 68%), rgba(var(--ink-rgb), 0.55);
}
.tx-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tx-thumb svg { width: 44%; height: 44%; fill: var(--accent); opacity: 0.6; }
.tx-card-body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.tx-card-name { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.tx-card-kind { margin-top: 2px; color: var(--accent); font-size: 0.8rem; font-weight: 700; }

/* The aarti, Jain calendar and granth pages (tools/content_pages.py): the same layout, a little more to read */
.tp-lead { max-width: 65ch; color: var(--text-muted); line-height: 1.7; }
.tp-card .cp-go { display: inline-flex; align-items: center; gap: var(--s2); margin-top: var(--s4); text-decoration: none; }
.cp-go svg { width: 20px; height: 20px; }
.cp-aarti { text-align: center; }
.cp-aarti .tp-lead, .cp-aarti .cp-go { margin-inline: auto; }
.cp-disc { --d: 96px; margin: var(--s2) auto var(--s4); }
.cp-facts { margin: var(--s4) 0 0; }
.tp-card:not(.cp-aarti) .cp-facts { justify-content: flex-start; }
.cp-aarti .aarti-text { margin-top: var(--s8); }
.cp-steps { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); margin: var(--s6) 0 0; }
.cp-steps .chip { min-height: 44px; text-decoration: none; }
.cp-steps .chip:only-child { margin-left: auto; }
.cp-steps svg { color: var(--accent); }
/* A month, day by day: the date on the left, its tithi and anything special on the right */
.cp-days { display: grid; gap: var(--s1); margin: 0; padding: 0; list-style: none; }
.cp-day { display: flex; align-items: flex-start; gap: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--radius-md); }
.cp-day:nth-child(odd) { background: rgba(var(--fg-rgb), 0.035); }
.cp-day.is-special { border: 1px solid rgba(var(--accent-rgb), 0.35); background: rgba(var(--accent-rgb), 0.08); }
.cp-date { display: grid; flex: none; width: 48px; color: var(--text-faint); font-size: 0.8rem; text-align: center; line-height: 1.2; }
.cp-date strong { color: var(--title); font-size: 1.35rem; }
.cp-tithi { display: grid; gap: var(--s1); padding-top: var(--s1); line-height: 1.5; }
.cp-mark { color: var(--accent); font-weight: 700; }
.cp-month .tp-h2 a { text-decoration: none; }
.cp-parvas { margin: 0 0 var(--s3); color: var(--text-muted); }
.cp-more { margin-top: var(--s3); min-height: 44px; text-decoration: none; }
.cp-more svg { color: var(--accent); }
/* The 24 (/tirthankar/): each with his medallion */
.tp-near.cp-tks a { display: flex; align-items: center; gap: var(--s3); }
.cp-tks .cp-disc { --d: 52px; flex: none; margin: 0; }
.cp-tk { display: grid; gap: 2px; min-width: 0; }
/* A puja's page (/puja/<id>): its text as the site's reader shows it (main.css .puja-*), fitted by assets/js/puja-page.js */
.cp-puja .puja-versions { margin-top: var(--s4); }
.cp-jump { margin-top: var(--s4); padding-inline: 0; }
.cp-jump .chip { text-decoration: none; }
.cp-credit { margin-top: var(--s6); color: var(--text-faint); font-size: 0.86rem; text-align: center; }
