/* Fit 2 Practise — resources: catalogue cards, resource landing pages, the
   owner document viewer and its A4 print layout. Loaded after site.css by
   /resources, /resource and /resources/<slug>. Tokens only. */

/* ---------- shared bits ---------- */
.doc-art { display: block; width: 100%; height: 100%; }
.res-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--em-d); }
.res-state svg { color: var(--em); }
.res-state.on-dark { color: #D9F5E8; }
.res-state.on-dark svg { color: var(--em-glow); }
.res-free { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 500; color: var(--em); line-height: 1.4; }
.res-free svg { flex: none; margin-top: 1px; }
.res-free:hover { color: var(--em-d); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- catalogue cards (/resources) ---------- */
.res-card { display: flex; flex-direction: column; overflow: hidden; }
.res-card .res-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16/10; padding: 16px 0 0; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-3); }
.res-card .res-thumb .doc-art { width: auto; height: 118%; margin-top: 24px; transition: transform .4s cubic-bezier(.16,1,.3,1); }
.res-card:hover .res-thumb .doc-art { transform: translateY(-6px); }
.res-card .res-thumb[data-c="navigating"], .res-card .res-thumb[data-c="rebuilding"] { background: var(--em-l); }
.res-card .res-thumb[data-c="conduct"], .res-card .res-thumb[data-c="dishonesty"] { background: var(--lilac); }
.res-card .res-thumb[data-c="reflection"] { background: var(--gold-l); }
.res-card .res-thumb[data-c="hearing"] { background: var(--bg-3); }
.res-card .rc-pages { position: absolute; top: 12px; left: 12px; background: #fff; color: var(--text); font: 500 12px/1 var(--mono); padding: 6px 8px; border-radius: var(--r-xs); box-shadow: var(--shadow-sm); }
.res-card .rc-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.res-card h3 { font-size: 17.5px; line-height: 1.3; }
.res-card h3 a:hover { color: var(--em); }
.res-card .rc-sum { font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.res-card .rc-course { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.res-card .rc-course a { color: var(--text); font-weight: 500; }
.res-card .rc-course a:hover { color: var(--em); }
.res-card .rc-actions { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.res-card .rc-actions .btn-primary, .res-card .rc-actions .btn-soft { width: 100%; }
.res-card .rc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- resource landing ---------- */
.res-hero .hero-split { align-items: center; }
.res-hero .hero-split > * { min-width: 0; }
.res-hero .actions > a, .res-hero .actions > button { white-space: normal; text-align: center; line-height: 1.3; height: auto; min-height: 50px; padding-top: 12px; padding-bottom: 12px; }
.res-hero .eyebrow { margin-top: 24px; }
.res-hero h1 { font-size: clamp(34px, 4.4vw, 52px); }
.res-hero [data-proof] { margin-top: 24px; }
.res-hero .actions .res-state { margin-left: 8px; }
.res-visual { display: grid; place-items: center; padding: 24px 0; }
.res-art { width: min(360px, 78%); aspect-ratio: 300/380; filter: drop-shadow(0 30px 40px rgba(0,0,0,.4)); transform: rotate(-2deg); }
.res-visual .fc-1 { left: 0; bottom: 40px; }
@media (max-width: 960px) { .res-visual { justify-self: center; width: 100%; } .res-visual .fc-1 { left: 16px; bottom: 16px; } }
@media (max-width: 720px) { .res-art { width: min(230px, 64%); } .res-visual { padding: 0; } }
@media (max-width: 560px) { .res-hero .actions > a, .res-hero .actions > button { width: 100%; } .res-hero .actions .res-state { margin-left: 0; } }

.res-landing { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 64px; align-items: start; }
.res-landing > * { min-width: 0; }
.res-col .h2 { margin: 12px 0 24px; }
.res-inside { margin-bottom: 40px; }
.res-sub { margin: 0 0 16px; }
.res-who { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 12px; }
.res-who li { display: flex; align-items: center; gap: 12px; line-height: 1.45; }
.res-aside { position: sticky; top: 96px; }
.res-box { display: flex; flex-direction: column; gap: 24px; box-shadow: var(--shadow); }
.res-price b { display: block; font-size: 40px; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.res-price span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }
.res-box-actions { gap: 12px; }
.res-box-actions .res-free { justify-content: center; text-align: center; }
.res-box-actions .res-state { justify-content: center; }
.res-login a { font-weight: 500; }
@media (max-width: 960px) { .res-landing { grid-template-columns: minmax(0,1fr); gap: 40px; } .res-aside { position: static; } }

/* locked preview sheet */
.res-sheet { position: relative; overflow: hidden; padding: 32px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
.res-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 2px solid var(--plum); }
.res-sheet-head b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.res-sheet > p { color: #3A3246; line-height: 1.7; }
.res-blur { margin-top: 24px; display: grid; gap: 12px; filter: blur(2.5px); opacity: .8; user-select: none; }
.res-blur i { display: block; height: 9px; border-radius: var(--r-xs); background: var(--line); }
.res-blur b { display: block; width: 45%; height: 14px; margin-top: 12px; border-radius: var(--r-xs); background: var(--lilac); }
.res-blur span { display: block; height: 28px; border-bottom: 1px solid var(--line); }
.res-lock { position: absolute; left: 0; right: 0; bottom: 0; padding: 96px 32px 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 42%); }
.res-lock [data-res-access] { max-width: 420px; }
.res-lock b { display: block; font-size: 17px; font-weight: 600; }
.res-lock p { margin-top: 8px; font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.res-lock .spinner { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; color: var(--em); }
.res-access-actions { justify-content: center; margin-top: 16px; }
@media (max-width: 720px) { .res-sheet { padding: 24px; } .res-lock { padding: 96px 16px 24px; } }

/* related */
.res-rel { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 32px; align-items: start; }
.res-course .cc-img { aspect-ratio: 16/8; }
.res-also { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.res-also .h4 { margin-bottom: 12px; }
.res-also .list-rows { border-top: 0; }
.res-also .list-row { padding: 12px 0; gap: 12px; }
.res-also .list-row:last-child { border-bottom: 0; }
.res-also .list-row h4 { font-size: 15px; font-weight: 600; }
.res-also .list-row:hover h4 { color: var(--em); }
.res-also .list-row > svg { color: var(--faint); }
.res-read { display: flex; align-items: center; gap: 16px; }
.res-read b { display: block; margin-top: 8px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.res-read > svg { margin-left: auto; color: var(--em); flex: none; }
.res-legal { margin-top: 24px; text-align: center; }
@media (max-width: 900px) { .res-rel { grid-template-columns: 1fr; } }

/* ---------- owner document viewer ---------- */
.res-doc-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 40px; align-items: start; }
.res-doc-layout > * { min-width: 0; }
.res-doc-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 24px; }
.res-tools { display: flex; flex-direction: column; gap: 12px; }
.res-toc { position: static; }
@media (max-width: 960px) {
  .res-doc-layout { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .res-doc-side { position: static; }
  .res-toc { display: none; }
}

.doc { max-width: 820px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 56px 64px; color: #3A3246; font-size: 15.5px; line-height: 1.65; }
.doc > * + * { margin-top: 16px; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--plum); }
.doc-head img { height: 40px; width: auto; display: block; }
.doc-kind { font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--em-d); background: var(--em-l); padding: 6px 8px; border-radius: var(--r-xs); }
.doc .doc-title { margin-top: 32px; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.03em; color: var(--text); }
.doc-namebar { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 24px; margin-bottom: 8px; }
.doc-namebar > div { display: flex; align-items: flex-end; gap: 12px; }
.doc-namebar span { font: 500 11.5px/32px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.doc-namebar .doc-lines { flex: 1; }
.doc .doc-h2 { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 21px; color: var(--text); scroll-margin-top: 96px; }
.doc .doc-h3 { margin-top: 32px; font-size: 17px; color: var(--text); }
.doc strong { color: var(--text); font-weight: 600; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li + li { margin-top: 8px; }
.doc-checks { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.doc-checks li + li { margin-top: 0; }
.doc-check { display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; transition: background .15s, border-color .15s; }
.doc-check:hover { border-color: var(--line); background: var(--bg-2); }
.doc-check input { flex: none; width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--em); }
.doc-check input:checked + span { color: var(--muted); }
.doc-field { break-inside: avoid; }
.doc-label { font-weight: 500; color: var(--text); }
.doc-lines { --lh: 32px; min-height: calc(var(--lines, 3) * var(--lh)); line-height: var(--lh); padding: 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--plum-2); background-image: linear-gradient(to bottom, transparent calc(var(--lh) - 1px), #D9D4E2 calc(var(--lh) - 1px)); background-size: 100% var(--lh); background-attachment: local; border-radius: var(--r-xs); cursor: text; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-lines:hover { background-color: var(--bg-2); }
.doc-lines:focus { outline: 0; background-color: var(--em-l); }
.doc-table { margin-top: 16px; }
.doc-table .table td, .doc-table .table th { white-space: normal; vertical-align: top; line-height: 1.5; }
.doc-table .table th { white-space: normal; }
.doc-table .doc-cell { min-width: 120px; height: 40px; white-space: pre-wrap; cursor: text; color: var(--plum-2); }
.doc-table .doc-cell:focus { outline: 0; background: var(--em-l); }
.doc-callout { display: flex; gap: 12px; align-items: flex-start; padding: 16px 24px; border-radius: var(--r); background: var(--em-l); color: var(--em-d); border-left: 3px solid var(--em); }
.doc-callout svg { flex: none; margin-top: 3px; }
.doc-note { display: flex; gap: 12px; align-items: flex-start; padding: 16px 24px; border-radius: var(--r); background: var(--bg-2); color: var(--muted); font-size: 13.5px; line-height: 1.6; margin-top: 40px !important; }
.doc-note svg { flex: none; margin-top: 2px; color: var(--violet); }
.doc-example { padding: 24px; border-radius: var(--r); background: var(--lilac); color: var(--plum-2); }
.doc-example p { margin-top: 12px; }
.doc-letter { padding: 24px; border: 1px dashed #CFC9D9; border-radius: var(--r); background: var(--bg-2); color: var(--text); }
.doc-letter p + p { margin-top: 12px; }
.doc-letter mark { background: var(--gold-l); color: var(--gold-d); padding: 0 2px; border-radius: var(--r-xs); }
.doc-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px !important; padding-top: 16px; border-top: 1px solid var(--line); font: 400 11.5px/1.5 var(--mono); color: var(--faint); }
@media (max-width: 720px) {
  .doc { padding: 32px 16px; font-size: 15px; }
  .doc-namebar { grid-template-columns: 1fr; gap: 8px; }
  .doc-callout, .doc-note { padding: 16px; }
  .doc-example, .doc-letter { padding: 16px; }
}

/* ---------- print: A4, document only ---------- */
@media print {
  @page { size: A4; margin: 16mm 15mm 16mm; }
  html, body { background: #fff !important; }
  body.res-owner-mode #site-header, body.res-owner-mode #site-footer, body.res-owner-mode .page-hero,
  body.res-owner-mode .no-print, body.res-owner-mode .toast, body.res-owner-mode .fly,
  body.res-owner-mode .res-doc-side { display: none !important; }
  body.res-owner-mode .section { padding: 0 !important; }
  body.res-owner-mode .wrap { max-width: none; padding: 0; }
  .res-doc-layout { display: block; }
  .doc { max-width: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; font-size: 10.5pt; line-height: 1.5; color: #222; }
  .doc .doc-title { font-size: 20pt; margin-top: 16pt; }
  .doc .doc-h2 { font-size: 14pt; margin-top: 18pt; padding-top: 10pt; break-after: avoid; page-break-after: avoid; }
  .doc .doc-h3 { font-size: 12pt; break-after: avoid; page-break-after: avoid; }
  .doc-label { break-after: avoid; page-break-after: avoid; }
  .doc-lines { --lh: 26px; background-color: transparent !important; }
  .doc-check { border: 0; padding: 2pt 0; }
  .doc-field, .doc-check, .doc-callout, .doc-note, .doc-example, .doc-letter, tr, .res-doc-layout .doc-namebar { break-inside: avoid; page-break-inside: avoid; }
  .table-wrap { overflow: visible; border-radius: 0; }
  .doc-table .doc-cell { height: 30px; min-width: 0; }
  .doc-callout, .doc-note, .doc-example, .doc-letter, .doc-kind, .doc-letter mark, .table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc a { color: inherit; text-decoration: none; }
}
