/*
 * Lost Soul Searching — book site
 *
 * No external resources: no Google Fonts, no analytics, no cookies, no JS.
 * Fonts use the operating-system fallback stack so nothing is fetched
 * from the network.
 */

:root {
    --bg: #faf7f1;
    --bg-soft: #f1ece1;
    --ink: #1d1d1d;
    --ink-soft: #4b4b4b;
    --rule: #d8d2c4;
    --accent: #6b3a2a;
    --accent-soft: #8a4f3a;
    --max-width: 110rem;
    --content-width: 54rem;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

a:hover,
a:focus {
    color: var(--accent-soft);
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.25rem 4rem;
}

header.site {
    text-align: center;
    padding: 2.5rem 1.25rem 0;
    max-width: var(--max-width);
    margin: 0 auto;
}

header.site .title {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
    font-weight: 600;
}

header.site .author {
    font-size: 1.0625rem;
    color: var(--ink-soft);
    font-style: italic;
    margin: 0;
    letter-spacing: 0.02em;
}

/* Cover image, centered, with a soft shadow */
.cover {
    text-align: center;
    margin: 2.5rem auto 3rem;
}

.cover img {
    display: block;
    margin: 0 auto;
    /* `width: 100%` makes the image grow to fill its container so the
       max-width below actually controls the rendered size; without it
       the image would render at its HTML width attribute and ignore CSS. */
    width: 100%;
    max-width: min(64rem, 92vw);
    height: auto;
    border-radius: 2px;
    box-shadow:
        0 1px 2px rgba(29, 29, 29, 0.08),
        0 18px 40px -10px rgba(29, 29, 29, 0.25);
}

/* Dedication line, sitting between the cover and the description.
   Quiet italicised tribute that doesn't compete with the cover or the
   aphorism block beneath it. */
.dedication {
    max-width: var(--content-width);
    margin: 0 auto 2.5rem;
    padding: 0 1rem;
    text-align: center;
    font-style: italic;
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.5;
}

/* Description block */
.description {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 0.5rem;
}

.description .aphorism {
    margin: 1.75rem 0;
    padding: 0 0 0 1.25rem;
    border-left: 2px solid var(--rule);
}

.description .aphorism p {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--ink);
    font-style: italic;
}

/*
 * Entry heading rendered the way the book does it (e.g. "#1 Envyium",
 * "#001 Authoriteillance"): a roman-weight serif line above the italic
 * stanza, with the # marker and title sharing one typographic colour.
 */
.description .aphorism p.entry-id {
    margin: 0 0 0.5rem;
    font-style: normal;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.description .summary {
    margin: 1.5rem 0;
    color: var(--ink);
}

.description .closing {
    margin: 2.25rem 0 0.75rem;
    text-align: center;
    color: var(--ink-soft);
    font-style: italic;
    font-size: 1rem;
}

.description .advisory {
    margin: 2rem 0 0;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
}

/* Section divider */
.divider {
    border: 0;
    border-top: 1px solid var(--rule);
    max-width: 6rem;
    margin: 3rem auto;
}

/* Stores section */
.stores {
    max-width: var(--content-width);
    margin: 0 auto;
    text-align: center;
}

.stores h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0 0 1.5rem;
}

.stores ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    /* `min(16rem, 100%)` lets three buttons sit in parallel on desktop
       (3 × 16rem + 2 gaps fits comfortably in --content-width) while
       collapsing to one-per-row on viewports narrower than 16rem. */
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
    gap: 0.75rem;
}

.stores li {
    margin: 0;
}

.stores a {
    display: block;
    padding: 0.95rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    background: var(--bg-soft);
    border: 1px solid var(--rule);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.35;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.stores a:hover,
.stores a:focus {
    background: #e9e2d2;
    border-color: var(--accent);
    color: var(--accent);
}

.store-label {
    display: inline-block;
    /* Keep the main button label on a single line so "Apple · Kobo · B&N
       · Tolino & more" doesn't wrap; the .stores-hint below it goes on
       its own line by design. */
    white-space: nowrap;
}

.stores-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--ink-soft);
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stores a:hover .stores-hint,
.stores a:focus .stores-hint {
    color: var(--accent-soft);
}

/* Footer */
footer.site {
    border-top: 1px solid var(--rule);
    margin-top: 4rem;
    padding: 2rem 1.25rem 3rem;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

footer.site a {
    color: var(--ink-soft);
    text-decoration-thickness: 1px;
}

footer.site .nav-links a {
    margin: 0 0.5rem;
}

/* Impressum-specific layout */
.impressum {
    max-width: var(--content-width);
    margin: 0 auto;
}

.impressum h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin: 0 0 0.5rem;
    line-height: 1.15;
    font-weight: 600;
}

.impressum .lang-note {
    margin: 0 0 2rem;
    color: var(--ink-soft);
    font-style: italic;
    font-size: 0.9375rem;
}

.impressum h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 2rem 0 0.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.impressum h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.25rem;
    color: var(--ink-soft);
}

.impressum address {
    font-style: normal;
    margin: 0 0 1rem;
}

.impressum p {
    margin: 0.5rem 0;
}

.impressum .small {
    color: var(--ink-soft);
    font-size: 0.9375rem;
}

.back-link {
    display: inline-block;
    margin-top: 2.5rem;
}

@media print {
    .stores,
    footer.site,
    .back-link {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}
