/* =============================================================
   FIZ — Workout library (/workouts/ and its category pages)
   Loaded after editorial.css on every page in /workouts/ only.

   The library's job is to show WORKOUTS on the first screen: a
   compact dark header (with the featured art cards on the index),
   then light sections of plain workout cards that link to /w/<slug>.
   ⚠️ Every card is a live /w/ page, checked for a 200 when the
   pages were generated (2026-10-02). A 410'd workout must come out
   of the page, not stay as a dead link.
   Version with ?v= on every /workouts/ page when this changes.
   ⚠️ Prefix is lib-, NOT wl-: editorial.css owns .wl-card / .wl-lead for
   the waitlist modal, and borrowing them put an 80px modal shadow on
   every workout card.
   ============================================================= */

/* ====== HEADER (dark) ====== */
.lib-head { padding: clamp(36px, 5vw, 64px) 0 clamp(32px, 4vw, 48px); }
.lib-head .eyebrow { display: block; }
.lib-h1 {
  margin-top: 18px;
  font-family: 'Archivo Black', 'Inter', sans-serif;
  font-weight: 400;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: clamp(38px, 5.6vw, 68px);
  line-height: 0.94;
  color: #FFFFFF;
}
.lib-h1 .accent { color: var(--accent); }
.lib-lead {
  margin-top: 16px;
  max-width: 640px;
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.6;
  color: #D4D4D8;
}

/* ====== CHIPS ====== */
.lib-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.lib-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: #FFFFFF;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.lib-chip:hover { border-color: #FFFFFF; background: rgba(255, 255, 255, 0.06); }
.lib-chip small { font-size: 12px; font-weight: 500; color: #A1A1AA; }
[data-theme="light"] .lib-chip { border-color: #D4D4D8; color: #0A0A0A; }
[data-theme="light"] .lib-chip:hover { border-color: #0A0A0A; background: transparent; }
[data-theme="light"] .lib-chip small { color: #71717A; }

/* ====== FEATURED ART CARDS (index header) ====== */
.lib-feat {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 62vw);
  gap: 12px;
  margin: 32px -16px 0;
  padding: 0 16px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.lib-feat::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .lib-feat { grid-auto-columns: minmax(200px, 30%); } }
@media (min-width: 1100px) {
  .lib-feat { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-columns: auto; margin: 32px 0 0; padding: 0; overflow: visible; }
}
.lib-fcard {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: #18181B;
  scroll-snap-align: start;
  isolation: isolate;
}
.lib-fcard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.lib-fcard::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.55) 62%, rgba(0, 0, 0, 0.92) 100%);
}
.lib-fcard:hover img { transform: scale(1.04); }
.lib-fcard__body { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.lib-fcard__k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #E4E4E7; }
.lib-fcard__t {
  font-family: 'Archivo Black', 'Inter', sans-serif;
  font-style: italic;
  text-transform: uppercase;
  font-size: 22px;
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}
.lib-fcard__d { font-size: 12.5px; line-height: 1.4; color: #D4D4D8; }

/* ====== SECTIONS (light) ====== */
.lib-sec { padding: clamp(40px, 5vw, 64px) 0; }
.lib-sec + .lib-sec { padding-top: 0; }
.lib-sec__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 28px;
  margin-bottom: 20px;
  border-top: 1px solid var(--hairline, #E5E5E5);
}
.lib-head + .lib-sec .lib-sec__head { border-top: 0; padding-top: 0; }
/* The FAQ follows another light section, so `.lib-sec + .lib-sec` zeroed its
   top padding and the heading sat on the section's top rule. It always gets
   its own breathing room. */
.lib-sec + .lib-sec.lib-faq { padding-top: clamp(48px, 6vw, 80px); }
.lib-h2 {
  font-family: 'Archivo Black', 'Inter', sans-serif;
  font-weight: 400;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1;
}
.lib-h2 small {
  margin-left: 10px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted, #71717A);
}
.lib-sec__intro { flex-basis: 100%; max-width: 680px; font-size: 15px; line-height: 1.6; color: var(--text-muted, #525252); }
.lib-more { font-size: 14px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.lib-more:hover { color: var(--accent); }

/* ====== WORKOUT CARD ====== */
.lib-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .lib-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lib-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  border: 1px solid #E5E5E5;
  border-radius: 14px;
  background: #FFFFFF;
  color: #0A0A0A;
  transition: border-color 0.2s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}
.lib-card:hover { border-color: #0A0A0A; transform: translateY(-2px); box-shadow: 0 14px 30px -22px rgba(0, 0, 0, 0.45); }
.lib-card__top { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; line-height: 1.3; }
.lib-card__f { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.lib-card__c { color: #71717A; white-space: nowrap; }
.lib-card__t {
  font-family: 'Archivo Black', 'Inter', sans-serif;
  font-style: italic;
  text-transform: uppercase;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.lib-card__d { font-size: 14px; line-height: 1.45; color: #52525B; }

/* ====== HOW IT WORKS ====== */
.lib-how { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--hairline, #E5E5E5); }
@media (min-width: 820px) { .lib-how { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.lib-how > div { padding: 22px 0; border-bottom: 1px solid var(--hairline, #E5E5E5); }
@media (min-width: 820px) { .lib-how > div { border-bottom: 0; } }
.lib-how h3 { font-size: 17px; font-weight: 700; line-height: 1.35; }
.lib-how p { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--text-muted, #525252); }
.lib-prose { max-width: 720px; }
.lib-prose p { font-size: 16px; line-height: 1.7; color: var(--text-muted, #3F3F46); }
.lib-prose p + p { margin-top: 14px; }
.lib-prose a, .lib-how a, .lib-sec__intro a { border-bottom: 1px solid currentColor; }
.lib-prose ul { margin-top: 14px; display: grid; gap: 8px; }
.lib-prose li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.6; color: var(--text-muted, #3F3F46); }
.lib-prose li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--accent); }

/* ====== SPEC CARD (single-workout guide pages) ====== */
.lib-headgrid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: end; }
@media (min-width: 960px) { .lib-headgrid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 56px; } }
.lib-spec { border: 1px solid #27272A; border-radius: 16px; padding: 22px 24px; background: #0F0F11; }
.lib-spec__k { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #A1A1AA; }
.lib-spec ol { margin-top: 12px; }
.lib-spec li { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid #1F1F22; font-size: 15px; color: #FFFFFF; }
.lib-spec li:last-child { border-bottom: 0; }
.lib-spec li b { min-width: 64px; font-weight: 700; color: #FFFFFF; }
.lib-spec li span { color: #D4D4D8; }
.lib-spec__foot { margin-top: 14px; font-size: 13px; line-height: 1.5; color: #A1A1AA; }
.lib-spec__foot a { color: #FFFFFF; border-bottom: 1px solid currentColor; }

/* ====== CLOSING BAND (dark) ====== */
.lib-end { padding: clamp(44px, 6vw, 72px) 0; }
.lib-end__grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
@media (min-width: 900px) { .lib-end__grid { grid-template-columns: minmax(0, 1fr) auto; gap: 48px; } }
.lib-end h2 {
  font-family: 'Archivo Black', 'Inter', sans-serif;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -0.015em;
  color: #FFFFFF;
}
.lib-end p { margin-top: 12px; max-width: 560px; font-size: 15px; line-height: 1.6; color: #A1A1AA; }
.lib-end .lib-chips { margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  .lib-card, .lib-fcard img { transition: none; }
}

/* A card that is information, not a link (the snatch complexes). */
.lib-card--static:hover { border-color: #E5E5E5; transform: none; box-shadow: none; }

/* Index cards: title and one line (format and cap). The category pages carry
   the descriptions, so the index doesn't repeat their text. */
.lib-card--compact { gap: 6px; padding: 16px 20px 18px; }
.lib-card--compact .lib-card__t { font-size: 19px; }
.lib-card--compact .lib-card__d { font-size: 13px; color: #71717A; }
.lib-prose ul + p { margin-top: 18px; }
