/* ==========================================================================
   Law Optional Lectures (/law-optional-lectures) and Solved Papers
   (/upsc-law-optional-solved-papers) — page head, jump pills, click-to-play
   YouTube cards (lectures + playlists), product hero with a text-built book
   cover, next-step card, FAQ, contact strip.
   Requires tokens.css + base.css. Mobile-first (360), enhanced at 640 / 960.
   (.page-head, .crumbs, .pills, .faq, .checks, .contact-strip and .ytcard
   duplicate patterns of the other pages: see pages/lectures-solved/SHARED_REQUESTS.md)
   ========================================================================== */

/* Page head ------------------------------------------------------------ */
.page-head { padding-block: var(--s-3) var(--s-4); }
.page-head__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.page-head__text { display: grid; gap: var(--s-2); min-width: 0; }
.page-head__kicker {
  font-family: var(--ff-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-red-text);
}
.page-head__title { font-size: var(--fs-h1); }
.page-head__intro { max-width: 70ch; color: var(--c-text-muted); }
.page-head__actions { display: grid; gap: var(--s-1); min-width: 0; }
.page-head__note { color: var(--c-text-muted); font-size: var(--fs-sm); }
.page-head--product { border-bottom: 0; }

/* Breadcrumb */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 var(--s-1); font-size: var(--fs-sm); color: var(--c-text-muted); }
.crumbs li + li::before { content: "\203A"; margin-right: var(--s-1); color: var(--c-text-muted); }
.crumbs a { color: var(--c-link-text); text-decoration: none; display: inline-flex; align-items: center; min-height: 28px; }
.crumbs a:hover { text-decoration: underline; }

@media (min-width: 960px) {
  .page-head { padding-block: var(--s-4) var(--s-5); }
  .page-head__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "crumbs crumbs" "text actions";
    column-gap: var(--s-6);
    row-gap: var(--s-3);
  }
  .page-head__inner > .crumbs { grid-area: crumbs; }
  .page-head__text { grid-area: text; }
  .page-head__actions { grid-area: actions; align-self: start; justify-self: end; width: 280px; padding-top: var(--s-1); }
  .page-head__actions .btn-row { flex-direction: column; }
  .page-head__actions .btn { width: 100%; }
  .page-head--product .page-head__inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "crumbs" "text"; }
}

/* Jump pills: wrap onto two rows on phones, never scroll sideways ---------- */
.jump { padding-block: var(--s-2); border-block: 1px solid var(--c-line); background: var(--c-white); }
.pills { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--s-2);
  font-family: var(--ff-display);
  font-size: 1rem;
  color: var(--c-slate);
  background: var(--c-white);
  border: 1px solid var(--c-slate);
  border-radius: 999px;
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
}
.pill:hover { background: var(--c-slate); color: var(--c-white); }
.lectures-group, #playlists, #faq, #video-solutions { scroll-margin-top: var(--s-2); }

/* Subject groups ------------------------------------------------------------ */
.lectures-group { padding-block: var(--s-5); }
.lectures-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-2);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 3px solid var(--c-red);
}
.lectures-group__title { font-size: var(--fs-h2); }
.lectures-group__meta { color: var(--c-text-muted); font-size: var(--fs-sm); white-space: nowrap; }
.lectures-group__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 var(--s-4); margin-top: var(--s-3); }
@media (min-width: 960px) {
  .lectures-group { padding-block: var(--s-6); }
  .lectures-group__head { margin-bottom: var(--s-4); }
}

/* YouTube card: thumbnail link (click-to-play), body, pinned footer ---------- */
.ytcard { padding: 0; gap: 0; overflow: hidden; min-width: 0; }
.ytcard__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-charcoal);
}
.ytcard__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* crops the black bars YouTube adds to its 4:3 thumbnails */
  transition: transform var(--ease);
}
a.ytcard__thumb:hover img { transform: scale(1.03); }
.ytcard__thumb:focus-visible { outline-offset: -4px; }
.ytcard__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--c-white);
  background: var(--c-red-text);
  border-radius: 50%;
  box-shadow: var(--shadow-float);
  transition: transform var(--ease);
}
.ytcard__play svg { width: 26px; height: 26px; margin-left: 3px; }
a.ytcard__thumb:hover .ytcard__play { transform: scale(1.08); }
.ytcard__player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.ytcard__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ytcard__body { display: grid; gap: var(--s-1); padding: var(--s-2); }
.ytcard .card__foot { padding: 0 var(--s-2) var(--s-2); }

/* Text poster (no request to YouTube): playlists and lectures without a confirmed video */
.ytcard__thumb--poster { background: linear-gradient(135deg, var(--c-charcoal), var(--c-navy)); }
.ytcard__poster {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: var(--s-2) var(--s-3) var(--s-6);
  text-align: center;
  color: var(--c-white);
}
.ytcard__poster-brand { font-family: var(--ff-serif); font-style: italic; font-size: 1rem; color: var(--c-gold); }
.ytcard__poster-word { font-family: var(--ff-display); font-size: 1.25rem; line-height: 1.2; text-wrap: balance; }
.ytcard__poster-sub { font-family: var(--ff-display); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #D9DCD6; }
.ytcard__thumb--playlist .ytcard__play { top: auto; bottom: var(--s-2); right: var(--s-2); left: auto; margin: 0; }
/* lecture without a video: same poster, no play button, no sideways padding for the button */
div.ytcard__thumb--poster .ytcard__poster { padding-bottom: var(--s-2); }
div.ytcard__thumb--poster .ytcard__poster-word { font-size: 1.5rem; }

/* Lecture card specifics */
.lecture__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
.lecture__part { font-family: var(--ff-display); font-size: var(--fs-sm); color: var(--c-text-muted); }
.lecture__title { font-size: 1.125rem; }
.lecture__actions { justify-content: flex-start; gap: var(--s-1); }
.lecture__btn { min-height: var(--tap-min); }
@media (max-width: 639px) {
  .lecture__btn { flex: 1 1 100%; }
}
.btn__icon { width: 18px; height: 18px; flex: 0 0 auto; }
.playlist__title { font-size: var(--fs-h3); }
.playlist-grid--2 { max-width: 760px; margin-inline: auto; }
@media (min-width: 640px) {
  .playlist-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Product hero: cover + text ----------------------------------------------- */
.product-section { padding-block: var(--s-4); }
.product { display: grid; gap: var(--s-4); align-items: start; }
.product__cover { display: flex; justify-content: center; }
.book-cover {
  position: relative;
  display: block;
  width: min(100%, 300px);
  aspect-ratio: 1414 / 2000;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
  transition: transform var(--ease), box-shadow var(--ease);
}
.book-cover:hover { transform: translateY(-2px); }
/* text-built cover: the words printed on the real cover, in the site's blue/white */
.book-cover__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8%;
  background: linear-gradient(170deg, var(--c-blue) 0%, var(--c-blue-deep) 100%);
  color: var(--c-white);
  text-align: center;
}
.book-cover__text::before,
.book-cover__text::after {
  content: "";
  position: absolute;
  left: 8%; right: 8%;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
}
.book-cover__text::before { top: 16%; }
.book-cover__text::after { bottom: 22%; }
.book-cover__brand { font-family: var(--ff-serif); font-style: italic; font-size: 1rem; }
.book-cover__kicker,
.book-cover__title,
.book-cover__years { display: block; font-family: var(--ff-display); line-height: 1.15; }
.book-cover__kicker { margin-top: auto; font-size: 1.125rem; letter-spacing: 0.04em; text-transform: uppercase; }
.book-cover__title { font-size: 1.75rem; margin-top: 0.25em; }
.book-cover__years { font-size: 2rem; margin-top: 0.3em; margin-bottom: auto; white-space: nowrap; }
@media (min-width: 960px) { .book-cover__years { font-size: 2.5rem; } }
.book-cover__credit { font-size: 0.8125rem; line-height: 1.35; color: #EAF3FA; }
/* real cover sits on top; a missing file is hidden (onerror) and the text cover stays */
.book-cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-cover__img[hidden] { display: none; }

.product__text { display: grid; gap: var(--s-2); min-width: 0; }
.product__kicker {
  font-family: var(--ff-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-red-text);
}
.product__title { font-size: var(--fs-h2); color: var(--c-charcoal); }
.product__by { color: var(--c-text-muted); }
.product__points { margin-top: var(--s-1); }
.checks { display: grid; gap: var(--s-1); }
.checks li { display: flex; align-items: flex-start; gap: var(--s-1); }
.checks__icon { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px; color: var(--c-red-text); }
.product__actions { margin-top: var(--s-2); }
.product__buy { font-size: 1.0625rem; }
.product__note { color: var(--c-text-muted); font-size: var(--fs-sm); }
@media (min-width: 640px) {
  .product { grid-template-columns: 260px minmax(0, 1fr); gap: var(--s-5); align-items: center; }
  .book-cover { width: 100%; }
  .product__actions .btn { min-width: 180px; }
}
@media (min-width: 960px) {
  .product-section { padding-block: var(--s-6); }
  .product { grid-template-columns: 320px minmax(0, 1fr); gap: var(--s-8); }
  .product__title { font-size: 2rem; }
}

/* Next step card ----------------------------------------------------------- */
.next { max-width: 860px; margin-inline: auto; gap: var(--s-3); }
.next__text { display: grid; gap: var(--s-2); }
.next__title { font-size: var(--fs-h3); line-height: var(--lh-snug); }
.next__actions { padding-top: 0; }
@media (min-width: 640px) {
  .next { padding: var(--s-4); }
  .next__actions .btn { min-width: 180px; }
}

/* FAQ accordion (native details) ------------------------------------------ */
.faq { display: grid; gap: var(--s-1); max-width: 860px; margin-inline: auto; }
.faq__item {
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  transition: border-color var(--ease);
}
.faq__item[open] { border-color: var(--c-slate); }
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: var(--tap-min);
  padding: var(--s-2) var(--s-3);
  font-family: var(--ff-display);
  font-size: 1.0625rem;
  line-height: var(--lh-snug);
  color: var(--c-slate);
  cursor: pointer;
  list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "+";
  flex: 0 0 auto;
  width: 24px;
  font-size: 1.5rem;
  line-height: 1;
  text-align: center;
  color: var(--c-red-text);
}
.faq__item[open] .faq__q::after { content: "\2212"; }
.faq__q:hover { color: var(--c-charcoal); }
.faq__a { padding: 0 var(--s-3) var(--s-3); color: var(--c-text-muted); }

/* Contact strip ----------------------------------------------------------- */
.contact-strip {
  padding-block: var(--s-5);
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
}
.contact-strip__inner { display: grid; gap: var(--s-3); }
.contact-strip__title { font-size: var(--fs-h3); color: var(--c-charcoal); }
.contact-strip__sub { color: var(--c-text-muted); margin-top: var(--s-1); }
.btn--whatsapp { background: #15803D; border-color: #15803D; color: var(--c-white); } /* #1DA851 was 3.1:1 with white; this is 5.0:1 (AA) */
.btn--whatsapp:hover { background: #116A33; border-color: #116A33; color: var(--c-white); }
@media (min-width: 960px) {
  .contact-strip { padding-block: var(--s-6); }
  .contact-strip__inner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-6); }
  .contact-strip__actions { justify-content: flex-end; }
}
