/* Prompt library, generator intro and 404. Shared tokens live in style.css. */

/* Page intro (library, generator, 404) */
.page-intro { padding-top: clamp(24px, 4vw, 48px); }
.page-intro h1 { max-width: 18ch; margin-top: 28px; font-size: clamp(38px, 5.2vw, 76px); }
.page-intro h1 span { display: block; margin-top: 0.12em; color: var(--muted); }
.page-intro-copy { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px 48px; max-width: 980px; margin-top: 24px; font-size: 18px; }
.page-intro-copy p { text-wrap: pretty; }
.page-note { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* Library layout */
.library-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px 64px; align-items: start; padding-top: var(--section); }
.library-contents { position: sticky; top: 24px; padding-top: 10px; border-top: var(--line); }
.contents-title { font-weight: 700; font-size: 15px; }
.library-contents ol { margin-top: 12px; border-top: var(--divider); }
.library-contents ol a { display: flex; gap: 12px; align-items: baseline; min-height: 44px; padding: 10px 0; border-bottom: var(--divider); font-weight: 700; text-decoration: none; }
.library-contents ol a span { font-stretch: var(--expanded); font-weight: 900; }
.library-contents ol a:hover { text-decoration: underline; }
.contents-note { margin-top: 16px; font-size: 14px; color: var(--muted); }
.contents-link { display: block; margin-top: 16px; padding: 14px; border: var(--line); background: var(--sheet); font-size: 14px; text-decoration: none; }
.contents-link strong { display: block; text-decoration: underline; text-underline-offset: 3px; }
.library-reading { min-width: 0; max-width: 820px; }

/* Chapters and steps */
.prompt-chapter { scroll-margin-top: 24px; }
.prompt-chapter + .prompt-chapter { margin-top: 72px; }
.chapter-heading { margin: 20px 0 24px; }
.chapter-heading h2 { font-weight: 800; font-stretch: var(--expanded); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.02; letter-spacing: -0.03em; }
.chapter-heading p { margin-top: 8px; color: var(--muted); }
.library-prompt { border-top: var(--line); scroll-margin-top: 24px; }
.library-prompt:last-child { border-bottom: var(--line); }
.library-prompt > summary { display: flex; align-items: center; gap: 18px; min-height: 88px; padding: 18px 0; }
.prompt-index { flex: none; width: 1.6em; font-weight: 900; font-stretch: var(--expanded); font-size: 40px; line-height: 1; }
.prompt-summary { flex: 1; min-width: 0; }
.prompt-summary strong { display: block; font-size: 20px; font-weight: 800; line-height: 1.25; }
.prompt-summary span { display: block; margin-top: 4px; color: var(--muted); }
.library-prompt > summary:hover strong { text-decoration: underline; }
.prompt-content { padding: 0 0 32px; min-width: 0; }
.prompt-intro { max-width: 62ch; font-size: 17px; text-wrap: pretty; }
.prompt-content .step-adds { margin-top: 16px; }
.prompt-requirements { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 2px; margin: 24px 0; border: var(--line); background: var(--ink); }
.prompt-requirements > div { padding: 14px 16px; background: var(--sheet); }
.prompt-requirements dt { margin-bottom: 4px; font-weight: 700; }
.prompt-requirements dd { margin: 0; font-size: 15px; }
.static-prompt { border: var(--line); background: var(--sheet); }
.static-prompt-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; min-height: 60px; padding: 8px 8px 8px 16px; background: var(--ink); color: var(--sheet); }
.static-prompt h3 { font-size: 14px; font-weight: 600; }
.static-prompt pre { max-height: 360px; margin: 0; padding: 20px; overflow: auto; font-family: var(--font-prompt); font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.static-prompt pre:focus-visible { outline-offset: -4px; }
.copy-status { font-size: 14px; font-weight: 600; }
.copy-status:not(:empty) { padding: 10px 16px; border-top: var(--divider); }
.prompt-content > h3 { margin: 28px 0 10px; font-size: 18px; font-weight: 800; }
.prompt-references { margin-top: 14px; font-size: 14px; color: var(--muted); }
.prompt-references a { color: var(--ink); }
.prompt-content .text-link { margin-top: 12px; }

/* 404 */
.not-found-main { padding-bottom: 24px; }
.recovery-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 2px; margin-top: 40px; border: var(--line); background: var(--ink); }
.recovery-links a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px 20px; background: var(--sheet); text-decoration: none; }
.recovery-links strong { font-size: 18px; text-decoration: underline; text-underline-offset: 3px; }
.recovery-links span { font-size: 15px; color: var(--muted); }

@media (max-width: 860px) {
  .library-layout { grid-template-columns: minmax(0, 1fr); }
  .library-contents { position: static; }
  .library-contents ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); column-gap: 24px; }
}
@media (max-width: 480px) {
  .prompt-index { font-size: 32px; }
  .library-prompt > summary { gap: 12px; }
}
