/* QA Handbook hub and guide pages, using the portfolio's shared light/dark tokens. */
.qa-handbook { width: var(--home-content-width); max-width: 1600px; margin: 0 auto; padding: 32px 0 56px; color: var(--home-text); font: 14px/1.7 'Manrope', sans-serif; }
.qa-handbook * { box-sizing: border-box; }
.qa-handbook :is(h1,h2,h3,p,ul,dl) { margin-top: 0; }
.qa-handbook :is(h1,h2,h3) { color: var(--home-text); text-transform: none; font-family: 'Manrope', sans-serif; }
.qa-handbook a { color: var(--home-accent); }
.qa-handbook svg { width: 18px; height: 18px; flex: none; }
/* Override the legacy template's !important focus reset within this page only. */
.qa-handbook :is(a, [tabindex]):focus-visible { outline: 2px solid var(--home-accent) !important; outline-offset: 3px; }
.qah-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.qah-topline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 12px; }

.qah-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 48px; padding: 18px 0 28px; border-bottom: 1px solid var(--home-line); }
.qah-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 0; color: var(--home-accent); font: 500 12px/1.5 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: 1px; }
.qa-handbook h1 { font-size: clamp(30px, 3.5vw, 54px); font-weight: 800; line-height: 1.15; letter-spacing: -1.6px; margin: 12px 0 14px; max-width: 900px; }
.qah-lead { color: var(--home-muted); font-size: 15px; max-width: 820px; margin-bottom: 0; }
.qah-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 8px; margin: 0; }
.qah-stats div { min-width: 120px; padding: 12px 16px; border: 1px solid var(--home-line); border-radius: 10px; background: var(--home-surface); }
.qah-stats dt { color: var(--home-muted); font-size: 12px; font-weight: 600; }
.qah-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }

.qah-section { margin-top: 32px; }
.qah-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-bottom: 16px; }
.qah-section__head h2, .qah-widget h2 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; line-height: 1.4; margin-bottom: 0; }
.qah-section__head p { color: var(--home-muted); margin: 0; }

.qah-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.qah-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid var(--home-line); border-radius: 12px; background: var(--home-surface); box-shadow: var(--qa-btn-shadow); transition: var(--qa-btn-transition); }
.qah-card--live { border-color: var(--home-accent); box-shadow: inset 0 3px var(--home-accent), var(--qa-btn-shadow); }
.qah-card:hover { transform: translateY(var(--qa-btn-lift)); border-color: var(--home-accent); background: var(--home-accent); color: var(--home-bg); box-shadow: var(--qa-btn-shadow-hover); }
.qah-card:hover :is(h3, .qah-card__summary, .qah-card__index, .qah-card__label, .qah-card__learn, .qah-card__link, .qah-status) { color: inherit; }
.qah-card:hover :is(.qah-card__icon, .qah-card__facts li, .qah-status) { color: inherit; border-color: currentColor; background: rgb(255 255 255 / .2); }
.qah-card:hover .qah-card__link { border-top-color: rgb(255 255 255 / .35); }
.qah-card__link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.qah-card:focus-within { outline: 2px solid var(--home-accent); outline-offset: 3px; }
.qah-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.qah-card__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--home-tint); color: var(--home-accent); }
.qah-card__icon svg { width: 22px; height: 22px; }
.qah-card__index { color: var(--home-muted); font: 500 12px/1 'IBM Plex Mono', monospace; }
.qah-status { margin-left: auto; padding: 3px 10px; border: 1px solid var(--home-line); border-radius: 999px; color: var(--home-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.qah-status--live { color: var(--home-accent); border-color: var(--home-accent); background: var(--home-tint); }
.qah-card h3 { font-size: 17px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.qah-card__summary { color: var(--home-muted); font-size: 13px; margin-bottom: 16px; }
.qah-card__label { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.qah-card__learn { padding-left: 18px; font-size: 13px; margin-bottom: 16px; }
.qah-card__learn li + li { margin-top: 4px; }
.qah-card__facts { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: auto 0 16px; }
.qah-card__facts li { padding: 2px 8px; border-radius: 6px; background: var(--home-tint); font: 500 11px/1.6 'IBM Plex Mono', monospace; color: var(--home-text); }
.qah-card__link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding-top: 12px; border-top: 1px solid var(--home-line); font-weight: 700; font-size: 13px; text-decoration: none; }
.qah-card__link--soon { color: var(--home-muted); font-weight: 600; }

.qah-widget { min-width: 0; padding: 22px; border: 1px solid var(--home-line); border-radius: 12px; background: var(--home-surface); }
.qah-widget h2 { margin-bottom: 16px; }

.qah-links { list-style: none; padding: 0; margin: 0; }
.qah-links li + li { border-top: 1px solid var(--home-line); }
.qah-links a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; min-height: 44px; padding: 12px 0; text-decoration: none; }
.qah-links strong { color: var(--home-text); font-size: 14px; }
.qah-links span { grid-row: 2; color: var(--home-muted); font-size: 13px; }
.qah-links svg { grid-row: 1 / 3; grid-column: 2; transition: transform .2s; }
.qah-links a:hover svg { transform: translateX(3px); }

/* Guide navigation shared by every guide page, including the SDLC guide. */
.qah-guide-shell { padding: 24px 0 0; }
.qah-guide-shell + #section-qa-workflow .sdlc-guide { padding-top: 16px; }
#section-qa-workflow + .qah-guide-shell { padding: 0 0 56px; }
.qah-guide-nav { display: grid; gap: 14px; }
.qah-breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; font-size: 12px; color: var(--home-muted); }
.qah-breadcrumb li + li::before { content: '/'; margin-right: 4px; color: var(--home-line); }
.qah-breadcrumb [aria-current] { color: var(--home-text); font-weight: 700; }
.qah-switcher { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 4px; margin: 0; }
.qah-switcher li { display: flex; min-width: 0; }
.qah-switcher .qa-step-tab { flex: 1; min-height: 84px; text-decoration: none; }

/* Guide pages with initial notes or a planned outline. */
.qah-guide .qah-hero { padding-top: 28px; }
.qah-hero__status { max-width: 300px; padding: 14px 16px; border: 1px dashed var(--home-line); border-radius: 10px; background: var(--home-surface); }
.qah-hero__status p { margin: 10px 0 0; color: var(--home-muted); font-size: 13px; line-height: 1.6; }
.qah-hero__status .qah-status { margin-left: 0; }
.qah-guide-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 32px; align-items: start; }
.qah-guide-body--full { grid-template-columns: minmax(0, 1fr); }
.qah-guide-aside { display: grid; gap: 16px; }
.qah-notes { display: grid; gap: 16px; min-width: 0; }
.qah-note { font-size: 15px; overflow-wrap: anywhere; }
.qah-note h3 { font-size: 16px; line-height: 1.5; margin: 22px 0 10px; }
.qah-note :is(ul, ol) { padding-left: 22px; }
.qah-note li + li { margin-top: 8px; }
.qah-note > :last-child { margin-bottom: 0; }
.qah-definitions { margin-bottom: 20px; }
.qah-definitions > div { padding: 14px 0; border-top: 1px solid var(--home-line); }
.qah-definitions > div:first-child { padding-top: 0; border-top: 0; }
.qah-definitions dt { color: var(--home-text); font-weight: 800; }
.qah-definitions dd { margin: 4px 0 0; color: var(--home-muted); }
.qah-note-result { padding: 14px 16px; border-left: 3px solid var(--home-accent); border-radius: 4px; background: var(--home-tint); }
.qah-glossary [hidden] { display: none !important; }
.qah-glossary-search label { display: block; margin-bottom: 6px; color: var(--home-text); font-weight: 700; }
.qah-glossary-search input { display: block; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--home-line); border-radius: 6px; background: var(--home-surface); color: var(--home-text); font: inherit; }
.qah-glossary-search input::placeholder { color: var(--home-muted); opacity: 1; }
.qah-glossary-search input:focus-visible { outline: 2px solid var(--home-accent) !important; outline-offset: 3px; }
.qah-letter-filter { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; padding: 6px 4px 10px; margin: 16px 0 4px; }
.qah-letter-filter button { flex: 1 0 24px; min-width: 24px; min-height: 34px; padding: 4px 2px; border: 1px solid var(--home-line); border-radius: 6px; background: var(--home-surface); color: var(--home-text); font: 700 12px/1.5 'Manrope', sans-serif; cursor: pointer; box-shadow: var(--qa-btn-shadow); transition: var(--qa-btn-transition); }
.qah-letter-filter button[data-glossary-letter="ALL"] { flex-basis: 30px; }
.qah-letter-filter button:enabled:hover { border-color: var(--home-accent); color: var(--home-accent); transform: translateY(var(--qa-btn-lift)); box-shadow: var(--qa-btn-shadow-hover); }
.qah-letter-filter button:enabled:active { transform: none; box-shadow: var(--qa-btn-shadow); }
.qah-letter-filter button:disabled { box-shadow: none; }
.qah-letter-filter button:disabled { opacity: .3; cursor: default; }
.qah-letter-filter button[aria-pressed="true"] { color: var(--home-bg); border-color: var(--home-accent); background: var(--home-accent); }
.qah-letter-filter button[aria-pressed="true"]:hover { color: var(--home-bg); }
.qah-letter-filter button:focus-visible { outline: 2px solid var(--home-accent) !important; outline-offset: 3px; }
.qah-glossary-status, .qah-glossary-empty { color: var(--home-muted); font-size: 13px; }
.qah-glossary-controls { scroll-margin-top: calc(var(--home-header-height, 100px) + 20px); }
.qah-glossary-pagination { padding-top: 16px; border-top: 1px solid var(--home-line); }
.qah-glossary-page-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.qah-glossary-page-numbers { display: contents; }
.qah-glossary-pagination button { min-width: 40px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--home-line); border-radius: 12px; background: var(--home-surface); color: var(--home-text); font: 700 12px/1.5 'Manrope', sans-serif; cursor: pointer; }
.qah-glossary-pagination button[aria-current="page"] { border-color: var(--home-accent); background: var(--home-accent); color: var(--home-bg); }
.qah-glossary-pagination button:enabled:hover { border-color: var(--home-accent); }
.qah-glossary-pagination button:disabled { opacity: .3; cursor: default; }
.qah-glossary-pagination button:focus-visible { outline: 2px solid var(--home-accent) !important; outline-offset: 3px; }
.qah-glossary-page-label { display: block; margin-bottom: 10px; color: var(--home-muted); font-size: 12px; }
.qah-outline ol { list-style: none; counter-reset: outline; padding: 0; margin: 0; }
.qah-outline li { counter-increment: outline; display: flex; gap: 14px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--home-line); font-weight: 600; }
.qah-outline li:first-child { border-top: 0; padding-top: 0; }
.qah-outline li::before { content: counter(outline, decimal-leading-zero); color: var(--home-accent); font: 500 12px/1 'IBM Plex Mono', monospace; }
.qah-guide-aside .qah-card__facts { margin: 0; }
.qah-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.qah-pager a { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--home-line); border-radius: 10px; background: var(--home-surface); color: var(--home-text); font-weight: 700; text-decoration: none; transition: border-color .2s; }
.qah-pager a:hover { border-color: var(--home-accent); }
.qah-pager small { color: var(--home-muted); font-size: 12px; font-weight: 600; }
.qah-pager__prev small::before { content: '← '; }
.qah-pager__next { text-align: right; }
.qah-pager__next small::after { content: ' →'; }

@media (max-width: 1200px) { .qah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .qah-hero { grid-template-columns: minmax(0, 1fr); }
  .qah-guide-body { grid-template-columns: minmax(0, 1fr); }
  .qah-hero__status { max-width: none; }
  .qah-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .qa-handbook { padding-top: 24px; }
  .qah-grid { grid-template-columns: minmax(0, 1fr); }
  .qah-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qah-stats div { min-width: 0; padding: 10px 12px; }
  .qah-stats dd { font-size: 16px; }
  .qah-card, .qah-widget { padding: 16px; }
  .qah-pager { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .qa-handbook * { transition: none !important; } }

/* Shared button look for every guide: SDLC, STLC and Agile & Scrum step cards and Glossary letters.
   Raised at rest, lifts on hover, filled when selected. Change it here to update all guides. */
:root {
  --qa-btn-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 2px 8px rgb(0 0 0 / .06);
  --qa-btn-shadow-hover: 0 6px 16px rgb(0 0 0 / .16);
  --qa-btn-lift: -2px;
  --qa-btn-transition: transform .15s, box-shadow .15s, border-color .15s, background-color .15s, color .15s;
}
.qa-step-tabs .qa-step-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; min-height: 96px; padding: 12px; border: 1px solid var(--home-line); border-radius: 10px; background: var(--home-surface); color: var(--home-text); font: 700 14px/1.4 'Manrope', sans-serif; text-align: left; cursor: pointer; box-shadow: var(--qa-btn-shadow); transition: var(--qa-btn-transition); }
.qa-step-tab .qa-step-tab__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; align-self: stretch; color: var(--home-muted); font: 500 11px/1.4 'IBM Plex Mono', monospace; text-align: right; }
.qa-step-tab .qa-step-tab__icon, .qa-step-badge { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; color: var(--home-accent); background: var(--home-tint); }
.qa-step-tab .qa-step-tab__label { display: flex; align-items: center; justify-content: space-between; gap: 6px; align-self: stretch; margin-top: auto; }
.qa-step-tab .qa-step-tab__chevron { width: 16px; height: 16px; flex: none; color: var(--home-muted); transition: transform .15s; }
:is(.qa-step-tab, .qa-step-badge) .qa-step-icon { width: 22px; height: 22px; flex: none; }
.qa-step-badge { width: 38px; height: 38px; align-self: center; }
.qa-step-tabs .qa-step-tab:hover { border-color: var(--home-accent); transform: translateY(var(--qa-btn-lift)); box-shadow: var(--qa-btn-shadow-hover); }
.qa-step-tabs .qa-step-tab:hover .qa-step-tab__chevron { color: var(--home-accent); transform: translateX(3px); }
.qa-step-tabs .qa-step-tab:active { transform: none; box-shadow: var(--qa-btn-shadow); }
.qa-step-tabs .qa-step-tab:is([aria-selected="true"], [aria-current="page"]) { color: var(--home-bg); border-color: var(--home-accent); background: var(--home-accent); }
.qa-step-tabs .qa-step-tab:is([aria-selected="true"], [aria-current="page"]) :is(.qa-step-tab__meta, .qa-step-tab__chevron) { color: inherit; }
.qa-step-tabs .qa-step-tab:is([aria-selected="true"], [aria-current="page"]) .qa-step-tab__icon { color: inherit; background: rgb(255 255 255 / .2); }
@media (max-width: 600px) { .qa-step-tabs .qa-step-tab { min-height: 88px; } }
@media (prefers-reduced-motion: reduce) {
  :root { --qa-btn-lift: 0px; }
  .qa-step-tabs .qa-step-tab, .qa-step-tab .qa-step-tab__chevron, .qah-letter-filter button { transition: none; }
  .qa-step-tabs .qa-step-tab:hover .qa-step-tab__chevron { transform: none; }
}
