/* Resource pages -- the delivery surface for a downloadable instrument.
   Layout per Claude Design's "Resource Page Review" (2026-09-10). Tokens, shell
   and member-form mechanics come from screen.css; this adds the page's own
   structure. Sharp corners, one restrained accent, no shadows anywhere --
   including on Ghost's File card, which ships rounded and shadowed. */

/* ------------------------------------------------------------------ head */

.resource-head {
    padding-top: 76px;
}

.resource .resource-kicker-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 24px;
}

.resource .resource-kicker-row .eyebrow {
    margin: 0;
}

.resource .resource-kicker {
    color: var(--vermilion);
}

.resource .resource-series {
    color: var(--grey);
    font-weight: 500;
}

/* Balanced wrapping, never a three-letter orphan. 820px rather than the
   design's 620px: at 620 "AI Content Accountability Card" could only break
   into three lines ending on "Card"; at 820 every name in the series balances
   into two ("AI Content / Accountability Card", "AI Decision / Rights Map"). */
.resource-title {
    margin: 34px 0 0;
    max-width: 820px;
    font: 900 clamp(40px, 5.3vw, 76px)/0.96 var(--gh-font-heading, Archivo), Arial, sans-serif;
    letter-spacing: -0.042em;
    text-wrap: balance;
}

/* ------------------------------------------------------------------ grid */

/* One grid for everything below the title. The page content is
   display: contents, so its blocks are grid items too and each lands in a
   named area -- that is how the File card sits full width under the preview
   while the public copy sits beside it. */
.resource-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
    grid-template-areas:
        "rule    rule"
        "lede    spec"
        "preview decides"
        "preview source"
        "file    file"
        "gate    gate";
    column-gap: 64px;
    margin-top: 34px;
    padding-bottom: 96px;
}

.resource .resource-content {
    display: contents;
}

/* Anything in the content that is not one of the known blocks still renders,
   full width, after the placed ones -- never silently dropped. */
.resource .resource-content > * {
    grid-column: 1 / -1;
    min-width: 0;
    margin: 0;
}

.resource-rule {
    grid-area: rule;
    height: 2px;
    background: var(--ink);
}

/* ------------------------------------------------------- lede and spec */

.resource .resource-content > .resource-lede {
    grid-area: lede;
    margin-top: 26px;
}

.resource .resource-lede h2 {
    margin: 0;
    max-width: 22ch;
    font: 800 30px/1.16 var(--gh-font-heading, Archivo), Arial, sans-serif;
    letter-spacing: -0.028em;
}

.resource .resource-lede p {
    margin: 18px 0 0;
    max-width: 54ch;
    color: #4A4A46;
    font-size: 17px;
    line-height: 1.5;
}

.resource .resource-content > .resource-spec {
    grid-area: spec;
    justify-self: end;
    width: 92%;
    margin-top: 26px;
    align-self: start;
}

.resource-spec > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--rule);
}

.resource-spec dt,
.resource-spec dd {
    margin: 0;
    font: 500 10px/1.4 'IBM Plex Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.resource-spec dt {
    color: var(--grey);
    letter-spacing: 0.14em;
}

.resource-spec dd {
    text-align: right;
}

.resource-spec .is-price dd,
.resource-spec .is-access dd {
    color: var(--vermilion);
}

/* The content carries both rows; the member state picks one. */
.resource-member .resource-spec .is-price,
.resource:not(.resource-member) .resource-spec .is-access {
    display: none;
}

/* ------------------------------------------------------------ preview */

/* About half the container, beside the reasons. Large enough to read the
   rail, the header band and the rows -- all a preview has to prove. */
.resource-preview {
    grid-area: preview;
    margin: 56px 0 0;
}

/* Capped by height as well as width: a portrait instrument (the Content
   Accountability Card) at full column width would stand ~1000px tall, the
   exact "preview too large" problem the design review called out. Landscape
   previews never reach the cap, so they are unchanged. */
.resource-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 640px;
    height: auto;
    border: 1px solid var(--ink);
    background: var(--paper-deep);
}

/* Shrink-wrapped to the image so the cue sits on the image's own corner. */
.resource-preview-link {
    display: inline-block;
    max-width: 100%;
    position: relative;
    line-height: 0;
    text-decoration: none;
    vertical-align: top;
}

.resource-preview-cue {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 12px 18px;
    background: var(--ink);
    color: var(--paper);
    font: 600 10px/1 'IBM Plex Mono', monospace;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.resource-cue-short { display: none; }

.resource-preview-link:hover .resource-preview-cue,
.resource-preview-link:focus-visible .resource-preview-cue {
    background: var(--vermilion);
}

.resource-preview figcaption {
    margin-top: 12px;
    color: var(--grey);
    font: 500 9.5px/1.5 'IBM Plex Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ------------------------------------------------- what this decides */

.resource .resource-content > .resource-decides {
    grid-area: decides;
    margin-top: 56px;
    padding-top: 2px;
}

.resource .resource-decides h2 {
    margin: 0;
    font: 900 30px/1.06 var(--gh-font-heading, Archivo), Arial, sans-serif;
    letter-spacing: -0.03em;
}

.resource .resource-decides ul {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.resource .resource-decides li {
    position: relative;
    margin: 16px 0 0;
    padding-left: 26px;
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.5;
}

.resource .resource-decides li:first-child { margin-top: 0; }

.resource .resource-decides li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 11px;
    width: 12px;
    height: 2px;
    background: var(--vermilion);
}

/* ------------------------------------------------------------- source */

/* Bottom of the right column, level with the preview's lower edge. */
.resource-source {
    grid-area: source;
    align-self: end;
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
}

.resource .resource-source .eyebrow {
    margin: 0;
    color: var(--grey);
}

.resource-source-title {
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.4;
}

.resource .resource-source .text-link {
    margin-top: 10px;
    color: var(--vermilion);
}

/* ----------------------------------------------------------- File card */

/* The payload, and the one object Ghost ships rounded, shadowed and grey.
   Squared, on a 2px ink rule, with the action as a vermilion block. The
   "Resource unlocked" label is generated here because the card lives inside
   the page content, where the theme cannot place a sibling. */
.resource .resource-content > .kg-file-card {
    grid-area: file;
    position: relative;
    display: block;
    margin-top: 66px;
    /* screen.css frames every File card with a 2px border and 22px padding.
       Here the container below carries the frame, so the wrapper must not:
       left on, it drew a box around the box. */
    padding: 0;
    border: 0;
}

.resource .kg-file-card::before {
    content: "Resource unlocked";
    position: absolute;
    left: 0;
    top: -24px;
    color: var(--vermilion);
    font: 600 10px/1 'IBM Plex Mono', monospace;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.resource .kg-file-card a.kg-file-card-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    min-height: 0;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: 0;
    background: #FFFFFF;
    color: var(--ink);
    font-family: var(--gh-font-body, Archivo), Arial, sans-serif;
    text-decoration: none;
    transition: none;
}

.resource .kg-file-card a.kg-file-card-container:hover {
    border: 2px solid var(--ink);
}

.resource .kg-file-card-contents {
    gap: 9px;
    justify-content: flex-start;
    width: auto;
    margin: 0;
    padding: 26px 28px;
}

.resource .kg-file-card-title {
    font: 900 26px/1.1 var(--gh-font-heading, Archivo), Arial, sans-serif;
    letter-spacing: -0.028em;
}

.resource .kg-file-card-caption {
    flex-grow: 0;
    margin: 0;
    color: #4A4A46;
    font-size: 15px;
    line-height: 1.45;
    opacity: 1;
}

.resource .kg-file-card-metadata,
.resource .kg-file-card-filename,
.resource .kg-file-card-filesize {
    margin: 0;
    color: var(--grey);
    font: 500 10px/1.5 'IBM Plex Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 1;
}

.resource .kg-file-card-filesize::before {
    content: "\00B7";
    margin: 0 6px;
}

.resource .kg-file-card-icon {
    flex-direction: column;
    gap: 10px;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 56px;
    background: var(--vermilion);
    color: var(--paper);
}

.resource .kg-file-card-icon svg { display: none; }

.resource .kg-file-card-icon::before {
    content: "\2193";
    position: static;
    inset: auto;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding-bottom: 2px;
    border: 2px solid currentColor;
    border-radius: 0;
    background: none;
    opacity: 1;
    font: 700 15px/1 var(--gh-font-heading, Archivo), Arial, sans-serif;
}

.resource .kg-file-card-icon::after {
    content: "Download PDF";
    font: 600 11px/1 'IBM Plex Mono', monospace;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.resource .kg-file-card a.kg-file-card-container:hover .kg-file-card-icon,
.resource .kg-file-card a.kg-file-card-container:focus-visible .kg-file-card-icon {
    background: var(--ink);
}

.resource .kg-file-card a.kg-file-card-container:hover .kg-file-card-icon::before {
    opacity: 1;
}

/* Ghost's generic "This page is for subscribers only" block. The page has a
   purpose-built signup band; the spec rejects repeating the call to action. */
.resource .gh-post-upgrade-cta,
.resource .kg-card-paywall {
    display: none;
}

/* --------------------------------------------------------------- gate */

.resource-gate {
    grid-area: gate;
    margin-top: 60px;
    scroll-margin-top: 96px;
}

#signup { scroll-margin-top: 96px; }

/* Member: the account link belongs to the File card above it. */
.resource-member .resource-gate {
    margin-top: 14px;
}

.resource-account {
    margin: 0;
}

.resource .resource-account .text-link {
    margin: 0;
    color: var(--grey);
}

/* Signup band: the same Ghost-native form, full container width on ink, copy
   left and control right. The control is the loudest thing on the page. */
.resource-signup {
    padding: 40px 48px;
    background: var(--ink);
}

.resource-signup .member-form-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 480px;
    align-items: center;
    gap: 72px;
}

.resource-signup .member-form .eyebrow,
.resource-signup .member-state .eyebrow {
    margin-bottom: 14px;
}

.resource-signup .member-form h3 {
    margin: 0;
    max-width: 20ch;
    font-size: 34px;
    letter-spacing: -0.032em;
}

.resource-signup .member-lede {
    margin: 14px 0 0;
    max-width: 58ch;
    color: #A8A8A2;
    font-size: 13.5px;
    line-height: 1.5;
}

/* Flattened so the error can sit between the field and the button. */
.resource-signup .member-form-control {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.resource-signup .member-input-row {
    display: contents;
}

.resource-signup .member-field-label { order: 1; }
.resource-signup .member-input-row input { order: 2; }
.resource-signup .member-error { order: 3; }
.resource-signup .member-input-row button { order: 4; }
.resource-signup .member-consequence { order: 5; }

.resource-signup .member-field-label {
    color: #A8A8A2;
    font: 600 10px/1 'IBM Plex Mono', monospace;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.resource-signup .member-input-row input {
    padding: 14px 0;
    border: 0;
    border-bottom: 1.5px solid var(--paper);
    border-radius: 0;
    color: var(--paper);
    font-size: 16px;
}

.resource-signup .member-input-row input::placeholder {
    color: #8E8E88;
}

.resource-signup .member-input-row input:focus {
    box-shadow: inset 0 -1px 0 var(--paper);
}

.resource-signup .member-input-row button {
    min-height: 56px;
    padding: 0 20px;
    background: var(--vermilion);
    color: var(--paper);
    font: 600 11px/1.3 'IBM Plex Mono', monospace;
    letter-spacing: 0.16em;
    text-align: center;
}

.resource-signup .member-input-row button:hover,
.resource-signup .member-input-row button:focus-visible {
    background: var(--vermilion-on-ink);
    color: var(--ink);
}

.resource-signup .member-form.loading .member-input-row button {
    background: #8E3324;
    color: #E4C9C3;
}

.resource-signup .member-error:empty {
    display: none;
}

/* Status never relies on colour alone: the message carries a mark and words. */
.resource-signup .member-error {
    margin: 0;
    color: var(--vermilion-on-ink);
    font: 500 9.5px/1.5 'IBM Plex Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.resource-signup .member-error::before {
    content: "\2715  ";
}

.resource-signup .member-form.error .member-input-row input {
    border-bottom-color: var(--vermilion-on-ink);
    color: var(--paper);
}

.resource-signup .member-consequence {
    margin: 0;
    color: #7A7A76;
    font: 500 9.5px/1.5 'IBM Plex Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Submitted: the band's copy is replaced in place. */
.resource-signup .member-state-success h3 {
    margin: 0;
    max-width: 22ch;
    font-size: 28px;
}

.resource-signup .member-state-success > p:not(.eyebrow) {
    max-width: 60ch;
    color: #A8A8A2;
    font-size: 13.5px;
}

.resource-signup .member-state-actions {
    gap: 12px 22px;
    padding-top: 16px;
    border-top: 1px solid #3A3A36;
}

.resource-signup .member-state-actions .text-button {
    order: -1;
    padding: 0 0 3px;
    border-bottom: 1.5px solid currentColor;
    color: var(--vermilion-on-ink);
    font: 600 10px/1.4 'IBM Plex Mono', monospace;
    letter-spacing: 0.14em;
}

.resource-signup .member-state-actions .text-link {
    margin: 0;
    padding-bottom: 3px;
    border-bottom: 1.5px solid #7A7A76;
    color: #A8A8A2;
}

.resource-signup :focus-visible {
    outline-color: var(--paper);
}

/* --------------------------------------------------------- small screens */

@media (max-width: 960px) {
    .resource-head { padding-top: 48px; }

    .resource .resource-kicker-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .resource-title { margin-top: 26px; }

    .resource-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "rule"
            "lede"
            "preview"
            "decides"
            "spec"
            "file"
            "gate"
            "source";
        margin-top: 26px;
        padding-bottom: 72px;
    }

    .resource .resource-content > .resource-lede { margin-top: 22px; }
    .resource .resource-lede h2 { font-size: 23px; }
    .resource .resource-lede p { font-size: 16px; }

    .resource-preview { margin-top: 32px; }
    .resource-preview img { max-height: 520px; }
    .resource-cue-long { display: none; }
    .resource-cue-short { display: inline; }

    .resource .resource-content > .resource-decides { margin-top: 44px; }
    .resource .resource-decides h2 { font-size: 26px; }

    .resource .resource-content > .resource-spec {
        justify-self: stretch;
        width: auto;
        margin-top: 36px;
        border-top: 2px solid var(--ink);
    }

    .resource .resource-content > .kg-file-card { margin-top: 64px; }

    .resource .kg-file-card a.kg-file-card-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .resource .kg-file-card-contents { padding: 22px 20px; }
    .resource .kg-file-card-title { font-size: 22px; }

    .resource .kg-file-card-icon {
        flex-direction: row;
        min-height: 56px;
    }

    .resource .kg-file-card-icon::before {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }

    .resource-gate { margin-top: 44px; }

    .resource-signup { padding: 22px; }

    .resource-signup .member-form-fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .resource-signup .member-form h3 { font-size: 26px; }
    .resource-signup .member-state-success h3 { font-size: 24px; }

    .resource-source {
        align-self: start;
        margin-top: 40px;
    }
}
