/* Image-led material catalog and bounded manuscript reading surface. */
.recitation-poem-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 0 8px;
}

.recitation-poem-link {
  position: relative;
  isolation: isolate;
  min-width: 0;
  aspect-ratio: 1;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(121, 89, 52, .16);
  border-radius: 12px;
  background: radial-gradient(circle at 36% 30%, #fffaf0 0 12%, #eee2cb 66%, #dfceb0 100%);
  box-shadow: 0 8px 20px rgba(83, 63, 38, .1);
  text-align: left;
  text-decoration: none;
  content-visibility: auto;
  contain-intrinsic-size: 174px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.recitation-poem-cover {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: inherit;
  color: rgba(158, 59, 44, .38);
  font-family: var(--font-wen);
  font-size: 48px;
}

.recitation-poem-cover > span {
  display: block;
  margin: 0;
  color: inherit;
  font-size: 48px;
  line-height: 1;
}

.recitation-poem-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity .28s ease, transform .35s ease;
}

.recitation-poem-cover.is-loaded img {
  opacity: 1;
  transform: scale(1);
}

.recitation-poem-link .recitation-poem-copy {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 11px;
  left: 12px;
  min-width: 0;
  display: block;
  margin: 0;
  color: #211d18;
  text-align: left;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 1), 0 0 4px rgba(255, 255, 255, 1), 0 0 9px rgba(255, 255, 255, .96);
}

.recitation-poem-copy strong {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #211d18;
  font-family: var(--font-wen);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: .035em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.recitation-poem-copy small {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #fffaf0;
  font-size: 11px;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .96), 0 0 5px rgba(0, 0, 0, .82);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recitation-poem-list > .recitation-state {
  grid-column: 1 / -1;
}

.recitation-detail .recitation-manuscript {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 0;
  margin: 0 -20px;
  padding: 0;
  overflow: hidden;
  background: var(--paper-light);
}

.recitation-manuscript-scroll {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 26px 30px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 250, 240, .58) transparent;
  text-align: center;
}

.recitation-manuscript-scroll::-webkit-scrollbar { width: 4px; }
.recitation-manuscript-scroll::-webkit-scrollbar-track { background: transparent; }
.recitation-manuscript-scroll::-webkit-scrollbar-thumb { border-radius: 4px; background: rgba(255, 250, 240, .58); }

.recitation-detail .recitation-manuscript::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: var(--recitation-background-image);
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity .4s ease, transform .55s ease;
}

.recitation-detail .recitation-manuscript::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: rgba(253, 250, 242, .1);
}

.recitation-detail .recitation-manuscript.has-background-image::before {
  opacity: .9;
  transform: scale(1);
}

.recitation-detail .recitation-manuscript h2,
.recitation-detail .recitation-manuscript .poem-byline,
.recitation-detail .recitation-manuscript .poem-line {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .98), 0 0 6px rgba(255, 255, 255, .96), 0 0 12px rgba(255, 255, 255, .82);
}

.recitation-detail .recitation-manuscript h2 { font-size: 31px; }
.recitation-detail .recitation-manuscript .poem-byline { color: #544b42; font-size: 14px; }
.recitation-detail .recitation-manuscript .poem-line {
  font-size: 26px;
  line-height: 1.95;
  letter-spacing: .07em;
}

@media (hover: hover) {
  .recitation-poem-link:hover {
    padding-left: 0;
    background: radial-gradient(circle at 36% 30%, #fffaf0 0 12%, #eee2cb 66%, #dfceb0 100%);
    box-shadow: 0 13px 28px rgba(83, 63, 38, .17);
    transform: translateY(-3px);
  }
}

@media (max-width: 359px) {
  .recitation-poem-list { gap: 9px; }
  .recitation-poem-link { border-radius: 10px; }
  .recitation-poem-copy { right: 10px; bottom: 9px; left: 10px; }
  .recitation-poem-copy strong { font-size: 19px; }
  .recitation-poem-copy small { font-size: 10px; }
  .recitation-detail .recitation-manuscript .poem-line { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .recitation-poem-link,
  .recitation-poem-cover img,
  .recitation-detail .recitation-manuscript::before { transition: none !important; }
  .recitation-poem-link:hover { transform: none; }
  .recitation-manuscript-scroll { scroll-behavior: auto; }
}

/* Catalog carousel, centered image cards and incremental loading. */
.recitation-index .recitation-intro {
  min-height: 200px;
  padding: 27px 24px 24px;
  background: linear-gradient(145deg, #33483c, #26382f);
  transition: background .5s ease;
}

.recitation-index .recitation-intro[data-slide="1"] {
  background: linear-gradient(145deg, #8d4637, #6f3028);
}

.recitation-index .recitation-intro[data-slide="2"] {
  background: linear-gradient(145deg, #5a4934, #3f3528);
}

.recitation-index .recitation-intro::after { content: none; }

.recitation-intro-topline {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(132px, 38vw, 168px);
  align-items: center;
  gap: 10px;
}

.recitation-index .recitation-intro-topline .recitation-kicker {
  position: relative;
  min-width: 0;
  max-width: none;
  margin: 0;
  overflow: hidden;
  color: #ead8b8;
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recitation-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  min-width: 0;
  height: 38px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 10px;
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  backdrop-filter: blur(5px);
}

.recitation-search:focus-within {
  border-color: rgba(255, 255, 255, .76);
  background: rgba(255, 255, 255, .19);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .1);
}

.recitation-search input {
  min-width: 0;
  width: 100%;
  padding: 0 0 0 12px;
  border: 0;
  outline: 0;
  color: #fffaf0;
  background: transparent;
  font: inherit;
  font-size: 12px;
}

.recitation-search input::placeholder { color: rgba(255, 250, 240, .86); opacity: 1; }
.recitation-search input::-webkit-search-cancel-button { filter: invert(1); opacity: .72; }

.recitation-search button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  color: #fffaf0;
  background: transparent;
  cursor: pointer;
}

.recitation-search button svg {
  width: 20px;
  height: 20px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.recitation-search button:focus-visible {
  outline: 2px solid #fffaf0;
  outline-offset: -4px;
}

.recitation-intro-copy {
  position: relative;
  z-index: 2;
  height: 104px;
  margin-top: 7px;
  pointer-events: none;
}

.recitation-intro-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transform: translateY(9px);
}

.recitation-intro-slide::after {
  content: attr(data-mark);
  position: absolute;
  right: -7px;
  bottom: -25px;
  color: rgba(255, 250, 240, .095);
  font-family: var(--font-wen);
  font-size: 104px;
  line-height: 1;
}

.recitation-intro-slide.is-active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  animation: recitation-intro-slide-in .42s ease-out both;
}

.recitation-intro-slide h2 {
  z-index: 1;
  margin: 0 0 8px;
  font-size: 27px;
  line-height: 1.35;
}

.recitation-intro-slide p {
  z-index: 1;
  max-width: 294px;
  margin: 0;
  color: rgba(255, 248, 233, .82);
  font-size: 13px;
  line-height: 1.75;
}

.recitation-index .recitation-usage {
  z-index: 4;
  margin-top: 5px;
  pointer-events: auto;
}

.recitation-login-link,
.recitation-vip-link {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fffaf0;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.recitation-vip-link { margin-left: 3px; }

.recitation-poem-link {
  border-radius: 13px;
  text-align: center;
}

.recitation-poem-cover {
  inset: -1px;
  border-radius: inherit;
}

.recitation-poem-cover > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.recitation-poem-cover img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.recitation-poem-link .recitation-poem-copy {
  inset: 50% 10px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translateY(-50%);
}

.recitation-poem-copy strong {
  max-width: 100%;
  text-align: center;
}

.recitation-poem-copy small {
  max-width: 100%;
  text-align: center;
}

.recitation-catalog-loader {
  grid-column: 1 / -1;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
}

.recitation-catalog-loader[data-state="idle"] { min-height: 2px; }

.recitation-catalog-loader i {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(158, 59, 44, .2);
  border-top-color: var(--cinnabar);
  border-radius: 50%;
  animation: recitation-catalog-spin .7s linear infinite;
}

.recitation-catalog-loader button {
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  color: var(--cinnabar);
  background: var(--paper-light);
  font: inherit;
}

@keyframes recitation-catalog-spin { to { transform: rotate(360deg); } }
@keyframes recitation-intro-slide-in {
  from { opacity: 0; transform: translateY(9px); }
}

@media (prefers-reduced-motion: reduce) {
  .recitation-index .recitation-intro,
  .recitation-intro-slide,
  .recitation-search { transition: none; }
  .recitation-intro-slide.is-active { animation: none; }
  .recitation-catalog-loader i { animation-duration: 1.5s; }
}

@media (max-width: 350px) {
  .recitation-intro-topline { grid-template-columns: minmax(0, 1fr) 128px; gap: 8px; }
  .recitation-index .recitation-intro-topline .recitation-kicker { letter-spacing: .08em; }
  .recitation-search { grid-template-columns: minmax(0, 1fr) 36px; }
  .recitation-search button { width: 36px; }
  .recitation-search input { padding-left: 9px; font-size: 11px; }
}
