/* ==========================================================================
   Inner pages: banner, breadcrumbs, prose, tables, forms, book detail.
   ========================================================================== */

/* ----------------------------------------------------------- page banner -- */

.page-hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(26px, 3.4vw, 46px) clamp(34px, 4.4vw, 60px);
}

.page-hero--slate {
    background: var(--ink-soft);
    color: rgba(255, 253, 248, .86);
}

.page-hero--slate h1 { color: var(--white); }

.page-hero--slate::before {
    content: "";
    position: absolute;
    right: -40px; bottom: -70px;
    width: clamp(210px, 22vw, 330px);
    aspect-ratio: 1 / .99;
    background: url("../images/branding/typewriter-mark-white.png") no-repeat center/contain;
    opacity: .06;
}

.page-hero--cream {
    background: var(--cream-deep);
    color: var(--slate-mid);
}

.page-hero__body { position: relative; }
.page-hero h1 { max-width: 22ch; }

.page-hero__lede {
    max-width: 62ch;
    margin-top: 16px;
    font-size: clamp(1.04rem, 1.5vw, 1.2rem);
    line-height: 1.6;
}

.page-hero--slate .page-hero__lede { color: rgba(255, 253, 248, .86); }

.page-hero .btn-row { margin-top: 28px; }

/* ---------------------------------------------------------- breadcrumbs -- */

.crumbs { margin-bottom: clamp(18px, 2.4vw, 30px); }

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-family: var(--font-mono);
    font-size: .74rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.crumbs li + li::before {
    content: "/";
    margin-right: 10px;
    opacity: .5;
}

/* Padded so a breadcrumb is a real target on a phone without changing how the
   trail looks. Negative margin keeps the row visually tight. */
.crumbs li { margin-block: -9px; }

.crumbs a,
.crumbs [aria-current] {
    display: inline-block;
    padding-block: 9px;
}

.crumbs a { color: var(--gold-bright); text-decoration: none; }
.crumbs a:hover { color: var(--white); text-decoration: underline; }
.crumbs [aria-current] { color: rgba(255, 253, 248, .66); }

.page-hero--cream .crumbs a { color: var(--gold-deep); }
.page-hero--cream .crumbs a:hover { color: var(--ink); }
.page-hero--cream .crumbs [aria-current] { color: var(--slate-mid); }

/* ---------------------------------------------------------------- prose -- */

.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: clamp(34px, 4vw, 52px); }
.prose h3 { margin-top: clamp(24px, 3vw, 34px); }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }

.prose ul { margin-left: 0; }

.prose ul li {
    position: relative;
    padding: 6px 0 6px 26px;
}

.prose ul li::before {
    content: "";
    position: absolute;
    left: 2px; top: 17px;
    width: 8px; height: 2px;
    background: var(--gold);
}

.prose ol {
    counter-reset: prose;
}

.prose ol li {
    position: relative;
    counter-increment: prose;
    padding: 6px 0 6px 34px;
}

.prose ol li::before {
    content: counter(prose) ".";
    position: absolute;
    left: 0; top: 6px;
    font-family: var(--font-mono);
    font-size: .84em;
    color: var(--gold-deep);
}

/* Text links only. Without the guard this repaints button labels and turns a
   dark button into brass on near black. */
.prose a:not(.btn) { color: var(--gold-deep); }

.updated {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--slate-mid);
}

/* --------------------------------------------------------------- tables -- */

.table-wrap {
    overflow-x: auto;
    margin-top: clamp(22px, 3vw, 34px);
    border: 1px solid var(--rule);
    background-color: var(--paper);

    /*
     * Scroll shadows. The two "local" layers are painted with the content and
     * cover the shadows when the table is at either end; the two "scroll"
     * layers stay pinned to the box. The result is a shadow that appears only
     * on the side there is still table to reach.
     */
    background-image:
        linear-gradient(90deg, var(--paper) 40%, rgba(255, 253, 248, 0)),
        linear-gradient(90deg, rgba(255, 253, 248, 0), var(--paper) 60%),
        radial-gradient(farthest-side at 0 50%, rgba(20, 32, 42, .18), rgba(20, 32, 42, 0)),
        radial-gradient(farthest-side at 100% 50%, rgba(20, 32, 42, .18), rgba(20, 32, 42, 0));
    background-position: left center, right center, left center, right center;
    background-size: 44px 100%, 44px 100%, 15px 100%, 15px 100%;
    background-repeat: no-repeat;
    background-attachment: local, local, scroll, scroll;
    -webkit-overflow-scrolling: touch;
}

.table-hint {
    display: none;
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: .74rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--slate-mid);
}

@media (max-width: 719px) {
    .table-hint { display: block; }
}

table.data {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 1rem;
}

table.data caption {
    padding: 16px 20px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-deep);
    border-bottom: 1px solid var(--rule);
}

table.data th,
table.data td {
    padding: 14px 20px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--rule);
}

table.data thead th {
    background: var(--cream-deep);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .98rem;
}

table.data tbody th {
    font-family: var(--font-body);
    font-weight: 600;
    width: 34%;
}

table.data tr:last-child th,
table.data tr:last-child td { border-bottom: 0; }

.yes { color: var(--gold-deep); font-weight: 600; }
.no  { color: var(--slate-mid); }

/* ----------------------------------------------------- two column layout -- */

.split {
    display: grid;
    gap: clamp(28px, 4vw, 60px);
    grid-template-columns: 1fr;
    align-items: start;
}

@media (min-width: 960px) {
    .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .split--wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
    .split--wide-right { grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); }
}

.aside-card {
    padding: clamp(24px, 3vw, 34px);
    background: var(--ink-soft);
    color: rgba(255, 253, 248, .86);
    position: sticky;
    top: 130px;
}

.aside-card h3 { color: var(--white); margin-bottom: 14px; }
.aside-card p { font-size: .98rem; }
.aside-card .btn-row { margin-top: 22px; }

.aside-card__list { margin-top: 18px; }

.aside-card__list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-top: 1px solid var(--rule-light);
    font-size: .96rem;
}

.aside-card__list b {
    font-family: var(--font-mono);
    font-size: .76rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-bright);
    padding-top: 3px;
}

@media (max-width: 959px) {
    .aside-card { position: static; }
}

/* --------------------------------------------------------- process list -- */

.process { counter-reset: proc; }

.process__item {
    display: grid;
    gap: 8px 30px;
    grid-template-columns: 1fr;
    padding: clamp(24px, 3vw, 32px) 0;
    border-top: 1px solid var(--rule);
    counter-increment: proc;
}

.process__item:last-child { border-bottom: 1px solid var(--rule); }

@media (min-width: 820px) {
    .process__item { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr); }
}

.process__no {
    font-family: var(--font-mono);
    font-size: .82rem;
    letter-spacing: .16em;
    color: var(--gold-deep);
}

.process__no b {
    display: block;
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--ink);
    line-height: 1;
    margin-top: 4px;
}

.process__item h3 { font-size: 1.24rem; margin-bottom: 8px; }

.process__side b {
    display: block;
    font-family: var(--font-mono);
    font-size: .74rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-bottom: 6px;
}

.process__side p { font-size: .98rem; }
.process__side + .process__side { margin-top: 18px; }

@media (min-width: 820px) {
    .process__side + .process__side { margin-top: 0; }
}

/* ----------------------------------------------------------------- form -- */

.form-card {
    padding: clamp(24px, 3.4vw, 44px);
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    box-shadow: var(--shadow-card);
}

.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset + .fieldset { margin-top: clamp(30px, 4vw, 46px); }

.fieldset > legend {
    display: block;
    width: 100%;
    padding: 0 0 14px;
    margin-bottom: 22px;
    border-bottom: 2px solid var(--gold);
    font-family: var(--font-display);
    font-size: 1.24rem;
    font-weight: 600;
    color: var(--ink);
}

.field-grid {
    display: grid;
    gap: 20px 24px;
    grid-template-columns: 1fr;
}

@media (min-width: 660px) {
    .field-grid--2 { grid-template-columns: 1fr 1fr; }
    .field-grid--3 { grid-template-columns: 1.4fr 1fr 1fr; }
}

.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }

.field > label,
.field > .field__label {
    margin-bottom: 7px;
    font-weight: 600;
    font-size: .98rem;
}

.field__hint {
    margin-bottom: 8px;
    font-size: .88rem;
    color: var(--slate-mid);
}

.req { color: var(--gold-deep); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
    width: 100%;
    padding: 13px 14px;
    background: var(--white);
    border: 1px solid var(--rule-strong);
    border-radius: 0;
    font-size: 1rem;
    min-height: 52px;
}

.field textarea { min-height: 140px; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 3px solid var(--gold);
    outline-offset: 1px;
    border-color: var(--ink);
}

.field__error {
    display: block;
    margin-top: 7px;
    font-size: .92rem;
    font-weight: 600;
    color: #9a2b1e;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #9a2b1e; border-width: 2px; }

.choice-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}

@media (min-width: 560px) {
    .choice-grid--2 { grid-template-columns: 1fr 1fr; }
    .choice-grid--grades { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 860px) {
    .choice-grid--grades { grid-template-columns: repeat(6, 1fr); }
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-height: 52px;
    padding: 13px 15px;
    background: var(--white);
    border: 1px solid var(--rule-strong);
    cursor: pointer;
    font-size: .98rem;
    line-height: 1.4;
}

.choice input { margin-top: 2px; width: 19px; height: 19px; accent-color: var(--gold-deep); flex: 0 0 auto; }
.choice:has(input:checked) { border-color: var(--gold-deep); border-width: 2px; background: #fdf8ec; }
.choice:hover { border-color: var(--ink); }

.choice--wide { grid-column: 1 / -1; }

.form-alert {
    margin-bottom: 26px;
    padding: 18px 20px;
    border-left: 4px solid #9a2b1e;
    background: #fbeeec;
    font-weight: 600;
    color: #7d2318;
}

.form-note {
    margin-top: 26px;
    padding: 20px;
    background: var(--cream-deep);
    border-left: 4px solid var(--gold);
    font-size: .98rem;
    color: var(--slate-mid);
}

.form-note p { font-size: inherit; color: inherit; }
.form-note p + p { margin-top: 10px; }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 24px;
    margin-top: clamp(28px, 3.4vw, 40px);
    padding-top: clamp(24px, 3vw, 32px);
    border-top: 1px solid var(--rule);
}

.form-actions p { font-size: .94rem; color: var(--slate-mid); margin: 0; }

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------------------------------------------------------- book detail -- */

.book-detail {
    display: grid;
    gap: clamp(28px, 4vw, 56px);
    grid-template-columns: 1fr;
    align-items: start;
}

@media (min-width: 860px) {
    .book-detail { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
}

.book-detail__cover img {
    width: 100%;
    box-shadow: var(--shadow-cover);
}

.book-detail__cover .book-row__placeholder { max-width: none; }

.book-detail__actions { margin-top: 22px; display: grid; gap: 12px; }

.book-detail h2 { margin-top: clamp(30px, 3.4vw, 42px); }
.book-detail p + p { margin-top: 14px; }

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.badge {
    padding: 6px 12px;
    background: var(--cream-deep);
    border: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--slate-mid);
}

/* Brass on the pale brass ground fell just under AA, so this one uses ink. */
.badge--gold { background: var(--gold-pale); border-color: var(--gold); color: var(--ink); }

/* --------------------------------------------------------- confirmation -- */

.confirm {
    max-width: 620px;
    margin-inline: auto;
    text-align: center;
}

.confirm__ref {
    display: inline-block;
    margin: 24px 0 8px;
    padding: 14px 26px;
    background: var(--ink);
    color: var(--gold-bright);
    font-family: var(--font-mono);
    font-size: 1.06rem;
    letter-spacing: .14em;
}

.confirm .btn-row { justify-content: center; margin-top: 30px; }

.next-steps {
    margin-top: clamp(32px, 4vw, 48px);
    text-align: left;
}

.next-steps li {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--rule);
}

.next-steps b {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .12em;
    color: var(--gold-deep);
    padding-top: 4px;
    min-width: 58px;
}
