/* ==========================================================================
   The Author's Digest — site theme
   Palette: forest green, warm paper, brass, with oxblood for emphasis/errors.
   ========================================================================== */

:root {
    color-scheme: light;

    /* Palette */
    --ink: #1b1f1d;
    --ink-soft: #4f5752;
    --forest-900: #12261f;
    --forest-800: #183229;
    --forest-700: #1e3d34;
    --forest-600: #2a5345;
    --forest-100: #e3ece6;
    --paper: #faf7f0;
    --paper-deep: #f2ecdf;
    --paper-bright: #fffdf9;
    --rule: #ded5c2;
    --rule-strong: #cfc5af;
    --brass-700: #8a6420;
    --brass-500: #b4862f;
    --brass-300: #d9b872;
    --oxblood: #8a2e25;
    --oxblood-dark: #6f231c;
    --slate: #2f4f5a;

    /* Type */
    --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-sans: "Source Sans 3", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

    /* Layout */
    --page-width: 73rem;
    --gutter: 1.5rem;
    --header-height: 4.5rem;

    /* Bootstrap theme overrides */
    --bs-body-font-family: var(--font-sans);
    --bs-body-font-size: 1.0625rem;
    --bs-body-line-height: 1.65;
    --bs-body-color: var(--ink);
    --bs-body-color-rgb: 27, 31, 29;
    --bs-body-bg: var(--paper);
    --bs-body-bg-rgb: 250, 247, 240;
    --bs-secondary-color: rgba(27, 31, 29, 0.7);
    --bs-heading-color: var(--forest-800);
    --bs-border-color: var(--rule);
    --bs-border-radius: 0.1875rem;
    --bs-border-radius-sm: 0.125rem;
    --bs-border-radius-lg: 0.25rem;

    --bs-primary: var(--forest-700);
    --bs-primary-rgb: 30, 61, 52;
    --bs-secondary: var(--ink-soft);
    --bs-secondary-rgb: 79, 87, 82;
    --bs-success: var(--forest-600);
    --bs-success-rgb: 42, 83, 69;
    --bs-info: var(--slate);
    --bs-info-rgb: 47, 79, 90;
    --bs-warning: var(--brass-500);
    --bs-warning-rgb: 180, 134, 47;
    --bs-danger: var(--oxblood);
    --bs-danger-rgb: 138, 46, 37;

    --bs-link-color: var(--forest-700);
    --bs-link-color-rgb: 30, 61, 52;
    --bs-link-hover-color: var(--brass-700);
    --bs-link-hover-color-rgb: 138, 100, 32;

    --bs-primary-text-emphasis: var(--forest-800);
    --bs-primary-bg-subtle: var(--forest-100);
    --bs-primary-border-subtle: #bcd3c4;
    --bs-success-text-emphasis: var(--forest-800);
    --bs-success-bg-subtle: var(--forest-100);
    --bs-success-border-subtle: #bcd3c4;
    --bs-info-text-emphasis: #223a43;
    --bs-info-bg-subtle: #e2eaec;
    --bs-info-border-subtle: #bccdd2;
    --bs-warning-text-emphasis: #5e4313;
    --bs-warning-bg-subtle: #f6ecd3;
    --bs-warning-border-subtle: #e3cf9c;
    --bs-danger-text-emphasis: var(--oxblood-dark);
    --bs-danger-bg-subtle: #f6e4e0;
    --bs-danger-border-subtle: #e5bdb6;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
}

html, body {
    font-family: var(--font-sans);
}

body {
    background-color: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--brass-300);
    color: var(--forest-900);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.012em;
    color: var(--forest-800);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--forest-700);
    text-decoration-color: var(--brass-500);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color 0.15s ease;
}

    a:hover, .btn-link:hover {
        color: var(--brass-700);
    }

hr {
    border-color: var(--rule-strong);
    opacity: 1;
}

code {
    color: var(--oxblood);
}

:focus-visible {
    outline: 2px solid var(--brass-500);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-padding-x: 1.35rem;
    --bs-btn-padding-y: 0.6rem;
    --bs-btn-border-radius: 0.1875rem;
    letter-spacing: 0.01em;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn-lg {
    --bs-btn-padding-x: 1.6rem;
    --bs-btn-padding-y: 0.75rem;
    --bs-btn-font-size: 1.0625rem;
    --bs-btn-border-radius: 0.1875rem;
}

.btn-primary {
    --bs-btn-color: var(--paper-bright);
    --bs-btn-bg: var(--forest-700);
    --bs-btn-border-color: var(--forest-700);
    --bs-btn-hover-color: var(--paper-bright);
    --bs-btn-hover-bg: var(--forest-600);
    --bs-btn-hover-border-color: var(--forest-600);
    --bs-btn-active-color: var(--paper-bright);
    --bs-btn-active-bg: var(--forest-900);
    --bs-btn-active-border-color: var(--forest-900);
    --bs-btn-disabled-color: var(--paper-bright);
    --bs-btn-disabled-bg: var(--forest-600);
    --bs-btn-disabled-border-color: var(--forest-600);
    --bs-btn-focus-shadow-rgb: 30, 61, 52;
}

.btn-outline-primary {
    --bs-btn-color: var(--forest-700);
    --bs-btn-border-color: var(--forest-700);
    --bs-btn-hover-color: var(--paper-bright);
    --bs-btn-hover-bg: var(--forest-700);
    --bs-btn-hover-border-color: var(--forest-700);
    --bs-btn-active-color: var(--paper-bright);
    --bs-btn-active-bg: var(--forest-900);
    --bs-btn-active-border-color: var(--forest-900);
    --bs-btn-focus-shadow-rgb: 30, 61, 52;
}

.btn-danger {
    --bs-btn-color: var(--paper-bright);
    --bs-btn-bg: var(--oxblood);
    --bs-btn-border-color: var(--oxblood);
    --bs-btn-hover-color: var(--paper-bright);
    --bs-btn-hover-bg: var(--oxblood-dark);
    --bs-btn-hover-border-color: var(--oxblood-dark);
    --bs-btn-active-color: var(--paper-bright);
    --bs-btn-active-bg: var(--oxblood-dark);
    --bs-btn-active-border-color: var(--oxblood-dark);
    --bs-btn-focus-shadow-rgb: 138, 46, 37;
}

/* Brass call-to-action, used on dark (forest) backgrounds */
.btn-brass {
    --bs-btn-color: var(--forest-900);
    --bs-btn-bg: var(--brass-300);
    --bs-btn-border-color: var(--brass-300);
    --bs-btn-hover-color: var(--forest-900);
    --bs-btn-hover-bg: #e6cb8f;
    --bs-btn-hover-border-color: #e6cb8f;
    --bs-btn-active-color: var(--forest-900);
    --bs-btn-active-bg: var(--brass-500);
    --bs-btn-active-border-color: var(--brass-500);
    --bs-btn-focus-shadow-rgb: 217, 184, 114;
}

.btn-ghost-light {
    --bs-btn-color: var(--paper);
    --bs-btn-border-color: rgba(250, 247, 240, 0.45);
    --bs-btn-hover-color: var(--forest-900);
    --bs-btn-hover-bg: var(--paper);
    --bs-btn-hover-border-color: var(--paper);
    --bs-btn-active-color: var(--forest-900);
    --bs-btn-active-bg: var(--paper-deep);
    --bs-btn-active-border-color: var(--paper-deep);
    --bs-btn-focus-shadow-rgb: 250, 247, 240;
}

.btn:focus-visible,
.btn:active:focus-visible,
.btn-link.nav-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.125rem var(--paper), 0 0 0 0.3rem var(--brass-500);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-control, .form-select {
    background-color: var(--paper-bright);
    border-color: var(--rule-strong);
    color: var(--ink);
}

    .form-control:focus, .form-select:focus, .form-check-input:focus {
        background-color: var(--paper-bright);
        border-color: var(--forest-600);
        box-shadow: 0 0 0 0.2rem rgba(30, 61, 52, 0.16);
    }

.form-floating > label {
    color: var(--ink-soft);
}

.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after {
    background-color: transparent;
}

.form-check-input:checked {
    background-color: var(--forest-700);
    border-color: var(--forest-700);
}

.darker-border-checkbox.form-check-input {
    border-color: #8c8674;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--forest-600);
}

.invalid {
    outline: 1px solid var(--oxblood);
}

.validation-message {
    color: var(--oxblood);
}

/* --------------------------------------------------------------------------
   Bootstrap components used by the account pages
   -------------------------------------------------------------------------- */

.alert {
    --bs-alert-border-radius: 0.1875rem;
    border-left-width: 3px;
}

.nav-pills {
    --bs-nav-link-color: var(--ink);
    --bs-nav-link-hover-color: var(--brass-700);
    --bs-nav-pills-border-radius: 0.1875rem;
    --bs-nav-pills-link-active-color: var(--paper-bright);
    --bs-nav-pills-link-active-bg: var(--forest-700);
    gap: 0.15rem;
}

    .nav-pills .nav-link {
        font-weight: 500;
        text-decoration: none;
    }

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--rule);
    --bs-table-striped-bg: rgba(30, 61, 52, 0.04);
    --bs-table-hover-bg: rgba(30, 61, 52, 0.06);
}

    .table > thead th {
        font-size: 0.78rem;
        font-weight: 600;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--ink-soft);
        border-bottom: 2px solid var(--forest-700);
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--oxblood);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

#blazor-error-ui {
    color-scheme: light only;
    background: #f6ecd3;
    border-top: 1px solid #e3cf9c;
    color: #5e4313;
    bottom: 0;
    box-shadow: 0 -4px 16px rgba(18, 38, 31, 0.12);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.7rem 3rem 0.8rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 0.6rem;
    }

/* --------------------------------------------------------------------------
   Site shell
   -------------------------------------------------------------------------- */

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

/* Standard pages get a centred reading column; the landing page runs full-bleed. */
.content {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: clamp(2.25rem, 5vw, 3.75rem) var(--gutter) clamp(3.5rem, 7vw, 5.5rem);
}

    .content:has(> .landing) {
        max-width: none;
        padding: 0;
    }

    .content > h1 {
        position: relative;
        padding-bottom: 1.1rem;
        margin-bottom: 2rem;
        border-bottom: 1px solid var(--rule);
    }

        .content > h1::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: -1px;
            width: 4rem;
            height: 2px;
            background: var(--brass-500);
        }

:where(.content) h1 {
    font-size: clamp(2.1rem, 4vw, 2.75rem);
}

:where(.content) h2 {
    font-size: 1.5rem;
}

:where(.content) h3 {
    font-size: 1.25rem;
}

/* Header ------------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 240, 0.94);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--rule);
}

.site-header__inner {
    max-width: calc(var(--page-width) + 2 * var(--gutter));
    min-height: var(--header-height);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--forest-800);
    text-decoration: none;
}

    .brand:hover {
        color: var(--forest-800);
    }

.brand__mark {
    flex: none;
    width: 2.15rem;
    height: 2.15rem;
}

.brand__name {
    font-family: var(--font-display);
    font-size: 1.42rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
}

    .brand__name em {
        font-weight: 400;
    }

nav-menu {
    display: contents;
}

.nav-toggle {
    display: none;
}

.site-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-nav__links,
.site-nav__account {
    display: flex;
    align-items: center;
    gap: 1.9rem;
}

    .site-nav__account form {
        display: contents;
    }

.site-nav__link {
    position: relative;
    padding: 0.4rem 0;
    border: 0;
    background: none;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

    .site-nav__link::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 2px;
        background: var(--brass-500);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.2s ease;
    }

    .site-nav__link:hover {
        color: var(--forest-700);
    }

        .site-nav__link:hover::after,
        .site-nav__link.active::after {
            transform: scaleX(1);
        }

.site-nav__account .btn {
    --bs-btn-padding-x: 1.1rem;
    --bs-btn-padding-y: 0.45rem;
    --bs-btn-font-size: 0.95rem;
    white-space: nowrap;
}

/* Signed-in authors get extra links, so close up the spacing before the menu has to collapse */
@media (min-width: 1041px) and (max-width: 1140px) {
    .site-header__inner {
        gap: 1.5rem;
    }

    .site-nav {
        gap: 1.5rem;
    }

    .site-nav__links,
    .site-nav__account {
        gap: 1.25rem;
    }
}

@media (max-width: 1040px) {
    .nav-toggle {
        display: block;
        appearance: none;
        flex: none;
        width: 2.75rem;
        height: 2.75rem;
        margin: 0 0 0 auto;
        border: 1px solid var(--rule-strong);
        border-radius: 0.1875rem;
        cursor: pointer;
        background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231e3d34' stroke-linecap='round' stroke-width='2' d='M5 9h20M5 15h20M5 21h20'/%3e%3c/svg%3e") no-repeat center / 1.5rem;
    }

        .nav-toggle:checked {
            background-color: var(--paper-deep);
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231e3d34' stroke-linecap='round' stroke-width='2' d='M8 8l14 14M22 8L8 22'/%3e%3c/svg%3e");
        }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        padding: 1rem var(--gutter) 1.5rem;
        background: var(--paper);
        border-bottom: 1px solid var(--rule);
        box-shadow: 0 18px 30px -18px rgba(18, 38, 31, 0.35);
    }

    .nav-toggle:checked ~ .site-nav {
        display: flex;
    }

    .site-nav__links,
    .site-nav__account {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .site-nav__link {
        padding: 0.8rem 0;
        border-bottom: 1px solid var(--rule);
        font-size: 1.05rem;
        text-align: left;
    }

        .site-nav__link::after {
            display: none;
        }

    .site-nav__account .btn {
        margin-top: 1.1rem;
        --bs-btn-padding-y: 0.65rem;
    }
}

@media (max-width: 420px) {
    .brand__name {
        font-size: 1.25rem;
    }
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
    background: var(--forest-900);
    color: rgba(250, 247, 240, 0.74);
    font-size: 0.98rem;
}

.site-footer__inner {
    max-width: calc(var(--page-width) + 2 * var(--gutter));
    margin: 0 auto;
    padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) 2.5rem;
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) repeat(2, minmax(0, 1fr));
    gap: 3rem;
}

.site-footer .brand,
.site-footer .brand:hover {
    color: var(--paper);
}

.site-footer__blurb {
    max-width: 26rem;
    margin: 1.1rem 0 0;
    line-height: 1.6;
}

.site-footer__heading {
    margin: 0.35rem 0 1.1rem;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brass-300);
}

.site-footer__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

    .site-footer__list a {
        color: rgba(250, 247, 240, 0.86);
        text-decoration: none;
    }

        .site-footer__list a:hover {
            color: var(--brass-300);
        }

.site-footer__legal {
    max-width: calc(var(--page-width) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 1.4rem var(--gutter) 1.8rem;
    border-top: 1px solid rgba(250, 247, 240, 0.14);
    font-size: 0.88rem;
    color: rgba(250, 247, 240, 0.6);
}

.site-footer__legal-links { display: block; margin-top: .35rem; }
.site-footer__legal-links a { color: rgba(250, 247, 240, 0.8); }

/* Terms of Service and Privacy Policy */
.legal-page { max-width: 46rem; margin: 0 auto; padding: 2.5rem var(--gutter, 1rem) 3rem; }
.legal-page h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal-page li { margin-bottom: .4rem; }

@media (max-width: 720px) {
    .site-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 2.25rem;
    }

    .site-footer__about {
        grid-column: 1 / -1;
    }
}

/* --------------------------------------------------------------------------
   Shared content pieces
   -------------------------------------------------------------------------- */

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0 1.1rem;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--brass-700);
}

    .eyebrow::before {
        content: "";
        flex: none;
        width: 2rem;
        height: 1px;
        background: currentColor;
    }

.section {
    padding: clamp(3.75rem, 8vw, 6.5rem) var(--gutter);
    scroll-margin-top: var(--header-height);
}

.section--tint {
    background: var(--paper-deep);
    border-block: 1px solid var(--rule);
}

.section__inner {
    max-width: var(--page-width);
    margin: 0 auto;
}

.section-head {
    max-width: 40rem;
    margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.section-title {
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 2.9rem);
    line-height: 1.08;
    letter-spacing: -0.018em;
}

.section-lead {
    margin: 1rem 0 0;
    font-size: 1.15rem;
    color: var(--ink-soft);
}

/* Book covers (drawn in CSS so the catalog works without artwork) ---------- */

.cover {
    --cover-bg: var(--forest-700);
    --cover-fg: var(--brass-300);
    container-type: inline-size;
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 2px 5px 5px 2px;
    background: var(--cover-bg);
    color: var(--cover-fg);
    box-shadow: 0 1px 2px rgba(18, 38, 31, 0.25), 0 18px 30px -14px rgba(18, 38, 31, 0.5);
    isolation: isolate;
}

    /* Spine shading */
    .cover::before {
        content: "";
        position: absolute;
        z-index: 3;
        inset: 0 auto 0 0;
        width: 7%;
        background: linear-gradient(90deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.06) 55%, rgba(255, 255, 255, 0.14) 78%, rgba(255, 255, 255, 0));
    }

    /* Inner frame */
    .cover::after {
        content: "";
        position: absolute;
        z-index: 1;
        inset: 6% 6% 6% 12%;
        border: 1px solid currentColor;
        opacity: 0.4;
        pointer-events: none;
    }

.cover__face {
    position: absolute;
    z-index: 2;
    inset: 6% 6% 6% 12%;
    padding: 11cqi 9cqi 9cqi;
    display: flex;
    flex-direction: column;
}

.cover__title {
    font-family: var(--font-display);
    font-size: 13.5cqi;
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.cover__rule {
    width: 18cqi;
    height: 1px;
    margin: 8cqi 0;
    background: currentColor;
    opacity: 0.7;
}

.cover__author {
    margin-top: auto;
    font-size: 5.4cqi;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.92;
}

.cover--forest {
    --cover-bg: var(--forest-700);
    --cover-fg: var(--brass-300);
}

.cover--ochre {
    --cover-bg: #c99a3f;
    --cover-fg: var(--forest-900);
}

.cover--oxblood {
    --cover-bg: var(--oxblood);
    --cover-fg: #f3dfc8;
}

.cover--slate {
    --cover-bg: var(--slate);
    --cover-fg: #ebe3d0;
}

.cover--cream {
    --cover-bg: #efe6d2;
    --cover-fg: var(--oxblood);
}

.cover--clay {
    --cover-bg: #b5573a;
    --cover-fg: #fbeedd;
}

/* A finished cover image from the cover editor */
.cover--image {
    background: var(--paper-deep);
}

    .cover--image::after {
        display: none;
    }

    .cover--image img,
    .cover__photo {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Photo covers: a stock photo with the title set over it... */
.cover--photo-full {
    --cover-fg: #fffdf9;
}

    /* The inner frame becomes a scrim that keeps the title readable */
    .cover--photo-full::after {
        inset: 0;
        border: 0;
        opacity: 1;
        background: linear-gradient(180deg, rgba(12, 20, 17, 0.1) 0%, rgba(12, 20, 17, 0) 28%, rgba(12, 20, 17, 0.5) 60%, rgba(12, 20, 17, 0.9) 100%);
    }

    .cover--photo-full .cover__face {
        inset: 0 0 0 7%;
        padding: 9cqi;
        justify-content: flex-end;
        text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
    }

    .cover--photo-full .cover__rule {
        margin: 6cqi 0;
    }

    .cover--photo-full .cover__author {
        margin-top: 0;
    }

/* ...or a photo across the top with the title on a coloured band beneath */
.cover--photo-band::after {
    display: none;
}

.cover--photo-band .cover__photo {
    height: 58%;
}

.cover--photo-band .cover__face {
    inset: 58% 0 0 7%;
    padding: 7cqi 8cqi;
}

.cover--photo-band .cover__title {
    font-size: 11cqi;
}

.cover--photo-band .cover__rule {
    margin: 4.5cqi 0;
}

/* --------------------------------------------------------------------------
   Landing page
   -------------------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(4rem, 9vw, 7.5rem) var(--gutter);
    background: radial-gradient(110% 95% at 88% 8%, var(--forest-600) 0%, var(--forest-700) 42%, var(--forest-900) 100%);
    color: var(--paper);
}

.hero__inner {
    max-width: var(--page-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.hero .eyebrow {
    color: var(--brass-300);
}

.hero__title {
    margin: 0;
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 400;
    line-height: 1.03;
    letter-spacing: -0.024em;
    color: var(--paper);
    text-wrap: balance;
}

    .hero__title em {
        color: var(--brass-300);
    }

.hero__lead {
    max-width: 33rem;
    margin: 1.6rem 0 0;
    font-size: clamp(1.1rem, 1.6vw, 1.25rem);
    line-height: 1.6;
    color: rgba(250, 247, 240, 0.82);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2.25rem;
}

.hero__shelf {
    position: relative;
    height: 27rem;
    max-width: 30rem;
    width: 100%;
    margin-left: auto;
}

    .hero__shelf .cover {
        position: absolute;
        width: 44%;
        box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3), 0 30px 45px -18px rgba(0, 0, 0, 0.65);
    }

    /* A forest cover would disappear against the hero, so show it in cream there */
    .hero__shelf .cover--forest {
        --cover-bg: #efe6d2;
        --cover-fg: var(--forest-700);
    }

        .hero__shelf .cover:nth-child(1) {
            left: 0;
            top: 3.25rem;
            transform: rotate(-7deg);
        }

        .hero__shelf .cover:nth-child(2) {
            left: 26%;
            top: 0;
            width: 48%;
            z-index: 2;
        }

        .hero__shelf .cover:nth-child(3) {
            right: 0;
            top: 3.75rem;
            transform: rotate(6deg);
        }

@media (max-width: 900px) {
    .hero__inner {
        grid-template-columns: 1fr;
    }

    .hero__shelf {
        display: none;
    }
}

/* Catalog */

.catalog {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1.5rem, 3.5vw, 3rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.book .cover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book:hover .cover {
    transform: translateY(-6px);
    box-shadow: 0 1px 2px rgba(18, 38, 31, 0.25), 0 28px 36px -16px rgba(18, 38, 31, 0.55);
}

.book__genre {
    margin: 1.5rem 0 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brass-700);
}

.book__title {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.15;
}

.book__author {
    margin: 0.25rem 0 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.08rem;
    color: var(--ink-soft);
}

.book__blurb {
    margin: 0.7rem 0 0;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

@media (max-width: 900px) {
    .catalog {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 3rem;
    }
}

.section-more {
    margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
}

/* Catalog page */

.page-head {
    max-width: 42rem;
}

.page-head__title {
    margin: 0;
    font-size: clamp(2.5rem, 5.5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: clamp(1.75rem, 4vw, 2.5rem);
    padding-bottom: clamp(1.5rem, 3vw, 2rem);
    border-bottom: 1px solid var(--rule);
}

.filter {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--rule-strong);
    border-radius: 0.1875rem;
    background: var(--paper-bright);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .filter:hover {
        border-color: var(--forest-700);
        color: var(--forest-700);
    }

    .filter.is-active,
    .filter.is-active:hover {
        background: var(--forest-700);
        border-color: var(--forest-700);
        color: var(--paper-bright);
    }

.filter__count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.filter.is-active .filter__count {
    color: rgba(250, 247, 240, 0.72);
}

.catalog-page__count {
    margin: clamp(1.5rem, 3vw, 2rem) 0 clamp(1.75rem, 4vw, 2.5rem);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.catalog--full {
    row-gap: clamp(2.75rem, 5vw, 4rem);
}

.catalog-empty {
    max-width: 34rem;
    margin-top: clamp(2rem, 5vw, 3rem);
    padding: 2rem;
    border: 1px solid var(--rule);
    border-left: 3px solid var(--brass-500);
    background: var(--paper-bright);
}

    .catalog-empty p {
        color: var(--ink-soft);
    }

@media (min-width: 901px) and (max-width: 1100px) {
    .catalog--full {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Catalog cards link to the book's page; the link stretches over the whole card */

.book {
    position: relative;
}

.book__link {
    color: inherit;
    text-decoration: none;
}

    .book__link::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
    }

    .book__link:focus-visible {
        outline: none;
    }

.book:hover .book__link {
    color: var(--forest-600);
    text-decoration: underline;
    text-decoration-color: var(--brass-500);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

.book:has(.book__link:focus-visible) .cover {
    outline: 2px solid var(--brass-500);
    outline-offset: 4px;
}

/* Book detail page */

.book-detail__back {
    display: inline-block;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
}

    .book-detail__back:hover {
        color: var(--forest-700);
    }

.book-detail__main {
    display: grid;
    grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.book-detail__cover {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

.book-detail__info {
    max-width: 40rem;
}

.book-detail__title {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.book-detail__subtitle {
    margin: 0.6rem 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.4vw, 1.55rem);
    line-height: 1.25;
    color: var(--ink-soft);
}

.book-detail__author {
    margin: 0.9rem 0 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--ink);
}

.book-detail__tagline {
    margin: clamp(1.75rem, 4vw, 2.5rem) 0 0;
    padding-left: 1.25rem;
    border-left: 2px solid var(--brass-500);
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.4vw, 1.5rem);
    line-height: 1.35;
    color: var(--forest-800);
}

.book-detail__description {
    margin-top: 1.75rem;
    font-size: 1.12rem;
    color: var(--ink);
}

    .book-detail__description p {
        margin: 0 0 1.1rem;
    }

.book-detail__about {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    margin-top: clamp(1.75rem, 4vw, 2.5rem);
    padding: 1.25rem 1.5rem;
    background: var(--paper-deep);
    border-left: 2px solid var(--forest-700);
}

    .book-detail__about p {
        margin: 0;
        color: var(--ink-soft);
    }

.book-detail__about-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass-700);
}

.book-detail__about-photo {
    flex: none;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    object-fit: cover;
}

/* Author profile editor (signed-in) */

.author-profile__photo-row {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.author-profile__photo {
    flex: none;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-profile__photo--empty {
    display: grid;
    place-items: center;
    border: 1px dashed var(--rule-strong);
    background: var(--paper-deep);
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.author-profile__photo-controls {
    flex: 1;
    min-width: 0;
}

@media (max-width: 520px) {
    .author-profile__photo-row {
        flex-direction: column;
    }
}

.author-profile__intro {
    max-width: 42rem;
    color: var(--ink-soft);
}

.author-profile {
    max-width: 46rem;
}

.book-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    margin: clamp(2rem, 4vw, 2.75rem) 0 0;
    border-top: 1px solid var(--rule-strong);
}

    .book-facts dt,
    .book-facts dd {
        margin: 0;
        padding: 0.7rem 0;
        border-bottom: 1px solid var(--rule);
    }

    .book-facts dt {
        padding-right: 2.5rem;
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1.75rem;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: var(--ink-soft);
    }

.book-detail__more {
    margin-top: clamp(4rem, 9vw, 6.5rem);
    padding-top: clamp(2.5rem, 6vw, 4rem);
    border-top: 1px solid var(--rule);
}

@media (max-width: 760px) {
    .book-detail__main {
        grid-template-columns: 1fr;
    }

    .book-detail__cover {
        position: static;
        width: min(100%, 15rem);
    }
}

/* Authors page */

.authors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 clamp(2rem, 5vw, 4.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.author {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: clamp(1.75rem, 3.5vw, 2.5rem) 0;
    border-top: 1px solid var(--rule);
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.author__mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    background: var(--cover-bg, var(--forest-700));
    color: var(--cover-fg, var(--brass-300));
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.author__mark--photo {
    object-fit: cover;
}

.author__body {
    min-width: 0;
    flex: 1;
}

.author__name {
    margin: 0.15rem 0 0;
    font-size: 1.7rem;
    line-height: 1.1;
}

.author__meta {
    display: flex;
    flex-wrap: wrap;
    margin: 0.5rem 0 0;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass-700);
}

    .author__meta span + span::before {
        content: "·";
        margin: 0 0.6em;
        color: var(--rule-strong);
    }

.author__bio {
    margin: 0.85rem 0 0;
    color: var(--ink-soft);
}

.author__books {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.75rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.author-book {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    max-width: 100%;
}

    .author-book .cover {
        flex: none;
        width: 3.25rem;
        box-shadow: 0 1px 2px rgba(18, 38, 31, 0.25), 0 8px 14px -8px rgba(18, 38, 31, 0.5);
        transition: transform 0.2s ease;
    }

    .author-book:hover .cover {
        transform: translateY(-3px);
    }

.author-book__link {
    font-family: var(--font-display);
    font-size: 1.12rem;
    line-height: 1.25;
    color: var(--forest-800);
    text-decoration: none;
}

    /* Stretch the link over the cover so both are clickable */
    .author-book__link::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
    }

.author-book:hover .author-book__link {
    color: var(--forest-600);
    text-decoration: underline;
    text-decoration-color: var(--brass-500);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

@media (max-width: 800px) {
    .authors {
        grid-template-columns: 1fr;
    }
}

/* Services */

.services {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.75rem, 4vw, 3.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: service;
}

.service {
    counter-increment: service;
    padding-top: 1.5rem;
    border-top: 2px solid var(--forest-700);
}

    .service::before {
        content: counter(service, decimal-leading-zero);
        display: block;
        margin-bottom: 1.1rem;
        font-family: var(--font-display);
        font-style: italic;
        font-size: 1.5rem;
        line-height: 1;
        color: var(--brass-700);
    }

.service__title {
    margin: 0 0 0.6rem;
    font-size: 1.55rem;
}

.service__text {
    margin: 0;
    color: var(--ink-soft);
}

@media (max-width: 800px) {
    .services {
        grid-template-columns: 1fr;
    }
}

/* The cover design add-on, under the services */

.addon {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 3rem;
    margin-top: clamp(2.5rem, 5vw, 4rem);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--rule-strong);
    border-radius: 0.5rem;
    background: var(--paper-bright);
}

.addon > div:first-child {
    flex: 1 1 24rem;
}

.addon__title {
    margin: 0 0 0.5rem;
    font-size: 1.55rem;
}

.addon__text {
    margin: 0;
    max-width: 40rem;
    color: var(--ink-soft);
}

.addon__buy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.addon__price {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.1rem;
    line-height: 1;
    color: var(--forest-800);
}

    .addon__price span {
        font-family: var(--font-sans);
        font-size: 0.95rem;
        color: var(--ink-soft);
    }

/* About */

.about {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 6vw, 5.5rem);
    align-items: start;
}

.about__statement {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.2vw, 2.35rem);
    font-style: italic;
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: -0.012em;
    color: var(--forest-800);
    text-wrap: balance;
}

.about__body p {
    margin: 0 0 1.15rem;
    font-size: 1.12rem;
    color: var(--ink-soft);
}

    .about__body p:first-child::first-letter {
        float: left;
        margin: 0.32rem 0.3rem 0 0;
        font-family: var(--font-display);
        font-size: 3.7rem;
        font-weight: 500;
        line-height: 0.74;
        color: var(--oxblood);
    }

    .about__body p:last-child {
        margin-bottom: 0;
    }

@media (max-width: 800px) {
    .about {
        grid-template-columns: 1fr;
    }
}

/* Call to action */

.cta {
    padding: clamp(3.5rem, 7vw, 5.5rem) var(--gutter);
    background: var(--forest-700);
    color: var(--paper);
}

.cta__inner {
    max-width: var(--page-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2rem 3rem;
}

.cta__title {
    margin: 0;
    font-size: clamp(1.9rem, 3.8vw, 2.6rem);
    font-weight: 400;
    color: var(--paper);
}

.cta__text {
    max-width: 34rem;
    margin: 0.7rem 0 0;
    font-size: 1.12rem;
    color: rgba(250, 247, 240, 0.8);
}

.cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

/* Not found */

.not-found {
    max-width: 34rem;
    padding: clamp(1rem, 5vw, 3.5rem) 0;
}

.not-found .not-found__code {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(4.5rem, 12vw, 7rem);
    line-height: 1;
    color: var(--brass-500);
}

.not-found p {
    color: var(--ink-soft);
    font-size: 1.12rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition-duration: 0.01ms !important;
    }
}

/* Book link pages (/buy/{slug}) */
.buy-page {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    align-items: flex-start;
    justify-content: center;
    max-width: 52rem;
    margin: 3rem auto;
    padding: 0 1rem;
}

.buy-page__cover {
    width: min(16rem, 70vw);
    height: auto;
    border-radius: 4px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.buy-page__info {
    flex: 1 1 18rem;
    max-width: 28rem;
}

.buy-page__title {
    margin-bottom: 0.25rem;
}

.buy-page__subtitle {
    font-style: italic;
    margin-bottom: 0.5rem;
}

.buy-page__author {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.buy-page__tagline {
    color: var(--bs-secondary-color, #5b6660);
    margin-bottom: 1.5rem;
}

.buy-page__stores {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 22rem;
}

.buy-page__stores .btn {
    width: 100%;
}

.buy-page__description {
    margin-top: 1.75rem;
    line-height: 1.6;
}

.buy-page__signup {
    margin-top: 1.75rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--paper-bright);
}

/* Author websites (/a/{slug}) */
.author-site { max-width: 56rem; margin: 2.5rem auto 4rem; padding: 0 1rem; }
.author-site__head { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-bottom: 2.5rem; }
.author-site__photo { width: 8.5rem; height: 8.5rem; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.author-site__name { font-size: clamp(2rem, 5vw, 3rem); margin: 0; }
.author-site__tagline { font-size: 1.15rem; color: var(--bs-secondary-color, #5b6660); margin: .25rem 0 .5rem; }
.author-site__links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.author-site__links a { text-decoration: none; border-bottom: 1px solid currentColor; }
.author-site__featured { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; padding: 1.75rem; margin-bottom: 2.5rem;
    border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-bright); }
.author-site__featured-cover img { width: min(14rem, 60vw); height: auto; border-radius: 4px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.author-site__featured > div { flex: 1 1 18rem; line-height: 1.6; }
.author-site__featured-title { margin: 0 0 .25rem; }
.author-site__subtitle { font-style: italic; margin-bottom: .5rem; }
.author-site__featured-tagline { font-weight: 600; }
.author-site__section-title { font-size: 1.4rem; margin: 0 0 1rem; }
.author-site__books { list-style: none; padding: 0; margin: 0 0 2.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 1.5rem 1.25rem; }
.author-site__books a { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: inherit; }
.author-site__books img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.author-site__nocover { display: flex; align-items: center; justify-content: center; text-align: center; aspect-ratio: 2 / 3; padding: .75rem; border-radius: 3px;
    background: var(--paper-bright); border: 1px solid var(--rule); font-family: Georgia, serif; }
.author-site__book-title { font-weight: 600; line-height: 1.3; }
.author-site__price { display: block; font-size: .875rem; color: var(--bs-secondary-color, #5b6660); }
.buy-direct__note { font-size: .875rem; color: var(--bs-secondary-color, #5b6660); margin: .4rem 0 0; max-width: 32rem; }
.author-site__about { max-width: 40rem; margin-bottom: 2rem; line-height: 1.7; }
.author-site__signup { max-width: 40rem; }

/* Notifications */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notification-bell__count {
    position: absolute;
    top: -0.1rem;
    right: -0.35rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 0.55rem;
    background: #b4472e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.notification-dot {
    flex: none;
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.45rem;
    border-radius: 50%;
    background: #b4472e;
}

.notification-unread {
    background: #fbf7ee;
}

/* AI credits */
.credit-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    white-space: nowrap;
}

.credit-badge__count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.credit-badge__label {
    font-size: 0.85em;
    opacity: 0.8;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.price-card {
    position: relative;
    border: 1px solid var(--td-line, #ddd);
    border-radius: .75rem;
    padding: 1.25rem;
    background: var(--bs-body-bg, #fff);
    display: flex;
    flex-direction: column;
}

.price-card.featured { border-color: var(--bs-primary, #1b6ec2); box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.price-card h2 { font-size: 1.25rem; margin-bottom: .25rem; }
.price-card .price { font-size: 2rem; font-weight: 600; margin: 0; line-height: 1.2; }
.price-card .price span { font-size: .9rem; font-weight: 400; color: var(--bs-secondary-color, #6c757d); }
.price-card .price-note { font-size: .85rem; color: var(--bs-secondary-color, #6c757d); margin-bottom: .75rem; }
.price-card ul { padding-left: 1.1rem; font-size: .875rem; flex: 1; }
.price-card li.no { color: var(--bs-secondary-color, #6c757d); }
.price-flag { position: absolute; top: -.6rem; right: 1rem; }

.pricing-addons { margin-top: 2.5rem; }
.addon-card { flex-direction: row; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; }
.addon-card h3 { font-size: 1.25rem; margin-bottom: .25rem; }
.addon-card__about { flex: 1 1 22rem; }
.addon-card__about ul { margin-bottom: 0; }
.addon-card__buy { flex: 0 1 15rem; display: flex; flex-direction: column; gap: .75rem; }

.cover-design-page { max-width: 46rem; }
.cover-design-brief dt { font-weight: 600; }
.cover-design-brief dd { margin: 0 0 .6rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Done-for-you services */

.services-page { max-width: var(--page-width); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter); }
.studio-promise {
    display: inline-block; margin: 1.25rem 0 0; padding: .45rem .9rem; border-left: 3px solid var(--brass-500);
    background: var(--paper-deep); font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--forest-800);
}
.studio-list { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
.studio-card {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1.25rem 3rem;
    padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--rule-strong); border-radius: .5rem; background: var(--paper-bright);
    scroll-margin-top: calc(var(--header-height) + 1rem);
}
.studio-card__about { flex: 1 1 26rem; }
.studio-card__name { margin: 0 0 .4rem; font-size: 1.6rem; }
.studio-card__summary { margin: 0 0 .75rem; color: var(--ink-soft); max-width: 42rem; }
.studio-card__includes { margin: 0; padding-left: 1.1rem; font-size: .95rem; }
.studio-card__buy { flex: 0 1 16rem; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.studio-card__price { margin: 0; font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; color: var(--forest-800); }
.studio-card__price span { margin-left: .2rem; font-family: var(--font-sans); font-size: .95rem; color: var(--ink-soft); }
.studio-card__note { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.studio-notes { margin-top: 2.5rem; max-width: 46rem; }
.studio-notes ul { padding-left: 1.1rem; }
.studio-notes li { margin-bottom: .5rem; }
.studio-prices th { font-weight: 600; white-space: nowrap; }
.studio-prices td { color: var(--ink-soft); }
.studio-quote { margin-top: .5rem; padding: .85rem 1rem; border: 1px solid var(--rule-strong); border-radius: .5rem; background: var(--paper-deep); }
.studio-quote__price { margin: 0 0 .35rem; font-size: 1.1rem; }
.studio-request__details { margin: .35rem 0 .75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.addon__list { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.75rem; font-size: .95rem; }
.addon__list span { color: var(--ink-soft); }

.signup-plan {
    font-size: .875rem;
    line-height: 1.5;
    padding: .85rem 1rem;
    border-radius: .5rem;
    border: 1px solid var(--td-line, #ddd);
    background: var(--td-soft, #f7f4ee);
}

.credits-balance {
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.plan-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .plan-list li {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.25rem 1rem;
        padding: 0.45rem 0;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        font-size: 0.9rem;
    }

    .plan-list li span {
        color: var(--bs-secondary-color, #6c757d);
    }

/* Admin */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem;
}

.admin-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    background: #fff;
}

.admin-stat__value {
    font-size: 1.6rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.admin-stat__label {
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #6c757d);
}

.admin-failures {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .admin-failures li {
        padding: 0.5rem 0;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

.pack-list {
    display: grid;
    gap: 0.6rem;
}

.pack {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
}

.admin-stat--alert {
    border-color: #c0392b;
    background: #fdf1ef;
}

/* Admin: social posts */
.social-progress { height: 1.6rem; }
.social-progress .progress-bar { min-width: 8.5rem; background: var(--forest-600); font-weight: 600; }
.social-post__body { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.social-post__picture img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: .375rem; }
.social-post__text { margin: 0 0 .75rem; padding: .75rem .9rem; border: 1px solid var(--rule); border-radius: .375rem; background: var(--paper-bright); font-family: var(--font-sans); font-size: .95rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.social-copy.is-copied::after { content: " ¹3"; }
.social-post--done { background: var(--paper-deep); }
.social-post--done .social-post__picture img { opacity: .7; }
@media (max-width: 767.98px) {
    .social-post__body { grid-template-columns: 1fr; }
    .social-post__picture { max-width: 20rem; }
}
.tool-tile { background: var(--paper-bright); transition: background-color .15s, border-color .15s; }
.tool-tile:hover, .tool-tile:focus-visible { background: var(--paper-deep); border-color: var(--rule-strong) !important; }
