/* Free resources: the catalog (/resources) and 1 resource with its form (/resources/<slug>). Layout only: tokens, type roles,
   the button and the input come from system.css; the nav, closing, footer and review marks from chrome.css. */

/* Catalog hero: the heading in display-1, centred like the home page's, with the sub in body-l */
.res-hero { padding: var(--space-9) 0 0; text-align: center; }
.res-hero h1 { font: var(--type-display-1); letter-spacing: var(--track-display-1); }
.res-hero .sub { margin: 30px auto 0; max-width: 30em; font: var(--type-body-l); letter-spacing: var(--track-body); color: var(--ink-2); text-wrap: pretty; }

/* Cards: the cover in a hairline frame, then the title, 3 lines of the description and the link. No box around them.
   2 to a row, all alike: no resource is featured (Tim, 2026-12-03). */
.res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 88px var(--space-7); margin-top: var(--space-9); }
.res-card { display: grid; align-content: start; gap: var(--space-5); color: inherit; text-decoration: none; }
.res-card .cover { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.res-card .cover img { width: 100%; height: auto; aspect-ratio: 16 / 9; transition: transform var(--dur-base) var(--ease); }
.res-card .body { display: grid; align-content: start; gap: var(--space-2); }
.res-card .h { font: var(--type-title); letter-spacing: var(--track-title); text-wrap: balance; }
.res-card .d { color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.res-card .more { justify-self: start; margin-top: var(--space-2); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; text-decoration-thickness: 1px; transition: text-decoration-color var(--dur-fast); }
.res-card:hover .more { text-decoration-color: var(--forest); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .res-card:hover .cover img { transform: scale(1.015); } }

/* 1 resource: on the left the back link, the title in display-2, the description and the form; the cover on the right,
   staying in view while the form is filled. On a phone the form comes first, then the cover. */
.res-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: var(--space-8); align-items: start; padding: var(--space-9) 0 var(--section); }
.back { display: inline-flex; align-items: center; gap: 4px; padding: 12px 0; margin: -12px 0; font: var(--type-small); color: var(--muted); text-decoration: none; }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--ink); }
.draft-note { margin-top: var(--space-5); display: inline-block; padding: 6px 12px; border-radius: var(--r-tile); background: var(--sage); color: var(--forest); font: var(--type-small); }
.res-copy h1 { margin-top: var(--space-6); font: var(--type-display-2); letter-spacing: var(--track-display-2); }
.res-copy .sub { margin-top: var(--space-5); font: var(--type-body-l); letter-spacing: var(--track-body); color: var(--ink-2); text-wrap: pretty; }
.res-cover { position: sticky; top: 104px; margin: 0; }
.res-cover img { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 24px 48px -32px rgb(var(--shade) / 28%); }

/* The form: no card, a hairline above it. Inputs and the button share their edges. */
.res-form { display: grid; gap: var(--space-4); max-width: 520px; margin-top: var(--space-7); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.res-form h2 { font: var(--type-title); letter-spacing: var(--track-title); }
.res-form .intro { margin-top: calc(var(--space-3) * -1); color: var(--muted); }
.res-form .names { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.fld { display: grid; gap: 6px; }
.fld > span { font: var(--type-small); color: var(--ink-2); }
.res-form .notice { font: var(--type-small); color: var(--muted); }
.res-form .notice a { padding: 14px 4px; margin: -14px -4px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.res-form .notice a:hover { color: var(--ink); }
.res-form .error { font: var(--type-small); color: var(--alert); }
.res-form .error[hidden] { display: none; }
.res-form .btn { width: 100%; }
/* The honeypot: off screen, out of the tab order, read by bots only */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 900px) {
  .res-detail { grid-template-columns: 1fr; gap: var(--space-8); }
  .res-cover { position: static; }
}
@media (max-width: 720px) {
  .res-grid { grid-template-columns: 1fr; gap: var(--space-8); margin-top: var(--space-8); }
}
@media (max-width: 560px) {
  .res-form .names { grid-template-columns: 1fr; }
  .res-card .cover, .res-cover img { border-radius: var(--r-tile); }
}
