/* Lyric pages and hub pages (#318): the home page's world, made for reading.
   Loaded after home.css, whose tokens, top bar, buttons and footer they share.
   By day a short band of the day sky holds the heading and fades into paper,
   the words stand on paper, and the footer's dusk closes the page; by night it
   is night throughout. */

/* Urdu in the device's own Nastaliq: the site's Jameel Noori Nastaleeq holds
   the footer's motto only, and the whole face is megabytes. */
@font-face { font-family: "Kanz Urdu"; src: local("Jameel Noori Nastaleeq"), local("JameelNooriNastaleeq-Regular"); }

:root {
  --urdu: "Kanz Urdu", "Noto Nastaliq Urdu", "Urdu Typesetting", serif;
  --find-placeholder: #666d7a;
  --head-bg:
    radial-gradient(ellipse 50% 60% at 50% 62%, rgb(252 206 150 / .42), transparent 74%),
    linear-gradient(to bottom, #fcf6e9, #fdf1dc 34%, #fde8c6 62%, #fbeadb 84%, var(--paper));
}
:root[data-theme="dark"] { --head-bg: none; --find-placeholder: var(--sky-placeholder); }

/* The heading band. */

.page-head {
  position: relative;
  isolation: isolate;
  padding: clamp(112px, 12vw, 176px) var(--gutter) clamp(36px, 4.4vw, 64px);
  background: var(--sky-bg);
  color: var(--sky-ink);
  text-align: center;
}
.page-head::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: var(--head-bg);
}
.page-head .field { z-index: -1; color: var(--sky-ink); }

.page-title {
  max-width: 24ch;
  margin: 0 auto;
  font: 600 clamp(2.1rem, 3.9vw, 3.6rem)/1.08 var(--serif);
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.page-title[lang="ur"] { font: 400 clamp(2.3rem, 4.2vw, 3.8rem)/1.7 var(--urdu); letter-spacing: 0; }

.page-lede {
  max-width: 58ch;
  margin: 0.8em auto 0;
  font-size: clamp(1.05rem, 1.35vw, 1.28rem);
  line-height: 1.5;
  color: var(--sky-ink-2);
  text-wrap: pretty;
}
.page-lede a, .prose-link {
  color: var(--sky-ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold-deep) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s;
}
.page-lede a:hover, .prose-link:hover { text-decoration-color: var(--gold-deep); }

.page-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: clamp(20px, 2.2vw, 28px);
}
.button-quiet {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 16px;
  border: 1px solid var(--sky-field-line); border-radius: 5px;
  background: none; color: var(--sky-ink);
  font: 500 0.98rem/1 var(--sans);
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.button-quiet:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: var(--gold); }
.button-quiet svg { width: 18px; height: 18px; }
.button-quiet[hidden] { display: none; }

/* The lyric: a page from a majlis booklet, each line centred, a gold point of
   light between stanzas. */

.lyric { padding: clamp(28px, 3.6vw, 52px) var(--gutter) var(--space); }
.lyric__text {
  width: min(100%, 40rem);
  margin: 0 auto;
  font: 400 clamp(1.2rem, 1.45vw, 1.4rem)/1.42 var(--serif-text);
  text-align: center;
  font-variant-ligatures: common-ligatures;
}
.lyric__text p { margin: 0; text-wrap: balance; }
/* Lines stand apart; a line that wraps holds together. */
.lyric__text p + p { margin-top: 0.62em; }
.lyric__text em { font-style: italic; }
.lyric__text[lang="ur"] {
  width: min(100%, 44rem);
  font: 400 clamp(1.55rem, 2vw, 1.9rem)/1.9 var(--urdu);
}
.lyric__text[lang="ur"] p + p { margin-top: 0.3em; }
.lyric__gap { height: 0.55em; }
/* A full divider is a point of gold light, a mini divider a short gold
   hairline. */
.lyric__star, .lyric__mote { display: block; margin: 1.5em auto; border: 0; }
.lyric__star {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-hi) 0 2.5px, var(--gold) 3.5px, var(--gold-lo) 4.5px, color-mix(in srgb, var(--gold) 26%, transparent) 5.5px, transparent 11px);
}
.lyric__mote {
  width: 36px; height: 1px;
  margin-block: 1em;
  background: color-mix(in srgb, var(--gold-lo) 70%, transparent);
}

/* Related lyrics and the hub's index share one list: a serif title over its
   metadata line, hairlines between. */

.related { padding: 0 var(--gutter) clamp(48px, 6vw, 88px); }
.related__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 88px);
  width: min(100%, 1100px);
  margin: 0 auto;
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--rule);
}
.list-title {
  margin: 0 0 6px;
  font: 600 clamp(1.45rem, 2vw, 1.9rem)/1.15 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.titles { margin: 0; padding: 0; list-style: none; }
.titles li + li { border-top: 1px solid var(--rule); }
.titles a {
  display: block;
  padding: 13px 0 12px;
  text-decoration: none;
}
.titles b {
  display: block;
  font: 400 1.1rem/1.3 var(--serif-text);
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.titles b[lang="ur"] { font: 400 1.4rem/1.7 var(--urdu); }
.titles span {
  display: block;
  margin-top: 3px;
  font-size: 0.92rem; line-height: 1.4;
  color: var(--text-2);
}
.titles a:hover b { text-decoration-line: underline; text-decoration-color: var(--gold-deep); }

.more-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  font-weight: 500;
  /* The desk button's gold: deep gold alone is just short of 4.5:1 on paper. */
  color: var(--sky-desk);
  text-decoration: none;
}
.more-link svg { width: 18px; transition: translate .2s; }
.more-link:hover svg { translate: 3px 0; }

/* The way back up, above the footer. */

.trail {
  width: min(100% - 2 * var(--gutter), 1100px);
  margin: 0 auto;
  font-size: 0.92rem;
  color: var(--text-2);
}
.trail ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.trail li + li::before { content: "/"; padding: 0 0.6em; color: var(--rule); }
.trail a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.trail a:hover { color: var(--text); text-decoration-color: var(--gold-deep); }

/* Hub pages: a field of points over the heading, one per lyric, then the
   index. */

.hub-tools {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 16px;
  margin-top: clamp(22px, 2.6vw, 32px);
}
.hub-find { position: relative; width: min(100%, 26rem); }
.hub-find svg { position: absolute; left: 15px; top: 50%; width: 19px; translate: 0 -50%; color: var(--sky-ink); pointer-events: none; }
.hub-find input {
  width: 100%; height: 50px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--sky-field-line); border-radius: 5px;
  background: var(--sky-field); color: var(--sky-ink);
  font: 400 max(16px, 1rem) var(--sans);
  caret-color: var(--gold-deep);
  transition: border-color .2s, background-color .2s;
}
.hub-find input::placeholder { color: var(--find-placeholder); opacity: 1; }
.hub-find input:hover { border-color: var(--sky-field-hover); }
.hub-find input:focus { outline: none; border-color: var(--gold); background: var(--sky-field-focus); }
.hub-find input::-webkit-search-cancel-button { filter: var(--sky-cancel); }

.hub-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.hub-cats a { font-weight: 500; text-decoration: none; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.hub-cats a:hover { text-decoration-line: underline; text-decoration-color: var(--gold-deep); }
.hub-cats span { font: 400 0.98rem var(--serif-text); font-variant-numeric: tabular-nums; color: var(--sky-ink-2); margin-left: 0.35em; }

.az {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px;
  padding: 10px var(--gutter);
  background: var(--page);
  border-bottom: 1px solid var(--rule);
}
.az a, .az span {
  display: grid; place-items: center;
  min-width: 34px; height: 34px;
  border-radius: 5px;
  font: 400 1.05rem/1 var(--serif);
  text-decoration: none;
}
.az a:hover { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold-deep); }
.az span { color: color-mix(in srgb, var(--text) 30%, transparent); }

.index { padding: clamp(32px, 4vw, 56px) var(--gutter) clamp(48px, 6vw, 88px); }
.index__group {
  display: grid; grid-template-columns: clamp(56px, 7vw, 96px) minmax(0, 1fr); gap: 0 clamp(16px, 2vw, 32px);
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(18px, 2vw, 28px) 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 64px;
}
.index__group:first-child { border-top: 0; }
/* Long hubs (every noha) draw only the letters in view. */
.index__group { content-visibility: auto; contain-intrinsic-size: auto 640px; }
.index > .titles--grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(20px, 2.4vw, 40px); width: min(100%, 1180px); margin: 0 auto; }
.index > .titles--grid li { border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.index > .titles--grid li + li { border-top: 0; }
.index__letter {
  margin: 0;
  font: 400 clamp(2.4rem, 3.6vw, 3.4rem)/1 var(--serif);
  color: var(--gold-deep);
}
.index .titles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(20px, 2.4vw, 40px); }
.index .titles li + li { border-top: 0; }
.index .titles li { border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.index__none { width: min(100%, 1180px); margin: 0 auto; color: var(--text-2); }
.index__none[hidden] { display: none; }

.hub-more {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--rule);
}
.hub-more .catalog__titles { margin-top: 18px; }

@media (max-width: 899px) {
  .index .titles, .index > .titles--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 759px) {
  .page-head { padding: 92px var(--gutter) 28px; }
  .page-title { font-size: clamp(1.85rem, 8.4vw, 2.5rem); }
  .page-title[lang="ur"] { font-size: clamp(2rem, 9vw, 2.7rem); }
  .page-lede { font-size: 1.02rem; }
  .button-quiet { height: 42px; }
  .lyric { padding-top: 28px; }
  .lyric__text { font-size: 1.1rem; }
  .lyric__text[lang="ur"] { font-size: 1.5rem; }
  .related__grid { grid-template-columns: 1fr; gap: 40px; }
  .index__group { grid-template-columns: 1fr; }
  .index__letter { font-size: 2.2rem; margin-bottom: 4px; }
  .index .titles, .index > .titles--grid { grid-template-columns: 1fr; }
  .az { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
