/* ═══════════════════════════════════════════════════════════════════
   Chalky Goldfinch Press — Theme Stylesheet
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────────── */
:root {
    --c-bg:          #f5f2ea;
    --c-surface:     #ffffff;
    --c-green-dark:  #3a6644;
    --c-green-mid:   #4e8c5f;
    --c-green-light: #d4e8d0;
    --c-green-wash:  #eaf3e7;
    --c-green-deep:  #2d5a3d;
    --c-ink:         #1e2b1f;
    --c-muted:       #5c6b5d;
    --c-rule:        #b0c9b3;
    --c-rule-light:  #dde8dd;
    --c-amber:       #c07c2a;
    --c-amber-light: #f9f0e0;

    --font-head: 'Mate SC', Georgia, serif;
    --font-body: 'Poppins', system-ui, sans-serif;

    --wrap:       1100px;
    --wrap-text:  740px;
    --gap:        2rem;
    --radius:     4px;
    --radius-lg:  8px;
    --header-h:   72px;

    --shadow-sm:  0 2px 8px  rgba(30,43,31,.07);
    --shadow-md:  0 4px 20px rgba(30,43,31,.11);
    --shadow-lg:  0 8px 32px rgba(30,43,31,.14);
}

/* ─── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a   { color: var(--c-green-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-green-mid); }
ul, ol { list-style: none; }

/* ─── Admin bar offset ───────────────────────────────────────────── */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}

/* ─── Layout ─────────────────────────────────────────────────────── */
.wrap         { max-width: var(--wrap);      margin-inline: auto; padding-inline: 1.5rem; }
.wrap--text   { max-width: var(--wrap-text); margin-inline: auto; padding-inline: 1.5rem; }
.wrap--narrow { max-width: 880px;            margin-inline: auto; padding-inline: 1.5rem; }

/* ─── Typography ─────────────────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 400; line-height: 1.2; color: var(--c-ink); }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.4rem); }
h4 { font-size: 1rem; }
p  { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 500; }

/* ─── Site header ────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-h);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-rule-light);
    box-shadow: var(--shadow-sm);
}
.site-header__inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 1.5rem;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    flex-shrink: 0;
}
.site-logo__img { width: 38px; height: 38px; }
.site-logo__text {
    font-family: var(--font-head);
    font-size: 1rem;
    color: var(--c-ink);
    line-height: 1.15;
    letter-spacing: .02em;
}
.site-logo__text span { display: block; }

/* Primary nav */
.site-nav { margin-left: auto; }

.site-nav__list {
    display: flex;
    align-items: center;
    gap: .15rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav__list li { position: relative; }

.site-nav__list a {
    display: block;
    font-size: .84rem;
    font-weight: 400;
    color: var(--c-ink);
    text-decoration: none;
    padding: .4em .75em;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.site-nav__list a:hover,
.site-nav__list li.current-menu-item > a,
.site-nav__list li.current_page_item > a,
.site-nav__list li.current-menu-ancestor > a {
    background: var(--c-green-wash);
    color: var(--c-green-dark);
}

/* Dropdown */
.site-nav__list .menu-item-has-children > a::after {
    content: ' ▾';
    font-size: .65em;
    opacity: .5;
    margin-left: .15em;
}
.site-nav__list .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    min-width: 175px;
    background: var(--c-surface);
    border: 1px solid var(--c-rule-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: .4rem 0;
    z-index: 10;
    list-style: none;
    margin: 0;
}
.site-nav__list .menu-item-has-children:hover > .sub-menu,
.site-nav__list .menu-item-has-children:focus-within > .sub-menu { display: block; }
.site-nav__list .sub-menu a {
    padding: .45em 1em;
    border-radius: 0;
    color: var(--c-muted);
    font-size: .82rem;
}
.site-nav__list .sub-menu a:hover { background: var(--c-green-wash); color: var(--c-green-dark); }

/* Hamburger (mobile) */
.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    color: var(--c-ink);
    line-height: 0;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* Mobile nav */
@media (max-width: 720px) {
    .site-nav {
        display: none;
        position: fixed;
        inset: var(--header-h) 0 0;
        background: var(--c-surface);
        overflow-y: auto;
        border-top: 1px solid var(--c-rule-light);
        z-index: 199;
        padding: 1rem 0;
    }
    .site-nav.is-open { display: block; }
    .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: .5rem 1.5rem;
    }
    .site-nav__list a { font-size: 1rem; padding: .65em .75em; }
    .nav-toggle { display: block; }
    .site-nav__list .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 1rem;
        display: block;
    }
    .site-nav__list .menu-item-has-children > a::after { display: none; }
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.site-footer {
    background: var(--c-green-deep);
    color: #c8ddc9;
    padding: 2.5rem 0 1.5rem;
    margin-top: auto;
}

/* Brand row: logo + tagline on left, nav links on right */
.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.site-footer__brand { display: flex; flex-direction: column; gap: .5rem; }
.site-footer__logo  {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
}
.site-footer__logo-img {
    width: 34px;
    height: 34px;
    filter: invert(1) brightness(1.4);
    opacity: .85;
}
.site-footer__logo-text {
    font-family: var(--font-head);
    font-size: .95rem;
    color: #fff;
    line-height: 1.2;
}
.site-footer__tagline {
    font-size: .8rem;
    color: #9ab89c;
    line-height: 1.55;
    max-width: 300px;
}

/* Single-row nav */
.site-footer__nav .footer-nav-list {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-footer__nav .footer-nav-list li a {
    font-size: .84rem;
    color: #c8ddc9;
    text-decoration: none;
    padding: .35em .7em;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
    white-space: nowrap;
    display: block;
}
.site-footer__nav .footer-nav-list li a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.site-footer__nav .footer-nav-list li.current-menu-item a,
.site-footer__nav .footer-nav-list li.current_page_item a {
    color: #fff;
}

.site-footer__bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 1rem;
    font-size: .75rem;
    color: #7a9e7c;
}

@media (max-width: 640px) {
    .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
}

/* ─── Ornament & section helpers ──────────────────────────────────── */
.ornament {
    display: flex;
    align-items: center;
    gap: .75rem;
    max-width: 280px;
    margin-inline: auto;
    color: var(--c-green-mid);
}
.ornament__line  { flex: 1; height: 1px; background: var(--c-rule); }
.ornament__glyph { font-size: 1rem; opacity: .7; }

.section { padding: 4.5rem 0; }
.section--lg   { padding: 6rem 0; }
.section--sm   { padding: 2.5rem 0; }
.section--green   { background: var(--c-green-wash); }
.section--surface { background: var(--c-surface); }
.section--dark {
    background: var(--c-green-deep);
    color: #e8f0e9;
}
.section--dark h1,
.section--dark h2,
.section--dark h3 { color: #fff; }

.section__head {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
}
.section__eyebrow {
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-green-mid);
}
.section--dark .section__eyebrow { color: #9ab89c; }
.section__sub {
    font-size: .95rem;
    color: var(--c-muted);
    max-width: 520px;
    line-height: 1.7;
}

/* ─── Page banner ────────────────────────────────────────────────── */
.page-banner {
    background: var(--c-green-deep);
    padding: 3.5rem 0 3rem;
    color: #e8f0e9;
    text-align: center;
}
.page-banner h1  { color: #fff; margin-bottom: .6rem; }
.page-banner p   { font-size: .95rem; color: #9ab89c; max-width: 480px; margin-inline: auto; }

/* ─── Breadcrumb ─────────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    font-size: .78rem;
    color: var(--c-muted);
    padding: .75rem 0;
    border-bottom: 1px solid var(--c-rule-light);
    margin-bottom: 2.5rem;
}
.breadcrumb a { color: var(--c-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-green-dark); }
.breadcrumb__sep     { color: var(--c-rule); font-size: .65rem; }
.breadcrumb__current { color: var(--c-ink); font-weight: 400; }

/* ─── Pill badges ────────────────────────────────────────────────── */
.pill {
    display: inline-block;
    padding: .25em .85em;
    border-radius: 2em;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
}
.pill--green       { background: var(--c-green-light); color: var(--c-green-dark); }
.pill--dark        { background: var(--c-green-dark);  color: #fff; }
.pill--amber       { background: var(--c-amber-light); color: var(--c-amber); }
.pill--available   { background: #d4ead4; color: #2a5e2a; }
.pill--coming-soon { background: var(--c-amber-light); color: var(--c-amber); }
.pill--out-of-print{ background: #ede8e8; color: #7a5858; }

.pill--poetry    { background: #d6ead8; color: #2d5a3d; }
.pill--childrens { background: #d6e8f2; color: #1a4a6a; }
.pill--ttrpg     { background: #e5d6f2; color: #3a1a5a; }

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: .65em 1.4em;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .2s, color .2s, border-color .2s, transform .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--c-green-dark); color: #fff; border-color: var(--c-green-dark); }
.btn--primary:hover { background: var(--c-green-mid); border-color: var(--c-green-mid); color: #fff; }
.btn--outline { background: transparent; color: var(--c-green-dark); border-color: var(--c-green-dark); }
.btn--outline:hover { background: var(--c-green-wash); color: var(--c-green-dark); }
.btn--ghost   { background: transparent; color: var(--c-muted); border-color: var(--c-rule); }
.btn--ghost:hover { border-color: var(--c-green-mid); color: var(--c-green-dark); background: var(--c-green-wash); }
.btn--sm  { padding: .45em 1em;   font-size: .78rem; }
.btn--lg  { padding: .8em  1.9em; font-size: .95rem; }

/* Amazon buy buttons */
.btn--amazon-print {
    background: var(--c-green-dark);
    color: #fff;
    border-color: var(--c-green-dark);
}
.btn--amazon-print:hover {
    background: var(--c-green-mid);
    border-color: var(--c-green-mid);
    color: #fff;
}
.btn--amazon-kindle {
    background: #232f3e;
    color: #ff9900;
    border-color: #232f3e;
}
.btn--amazon-kindle:hover {
    background: #2d3d50;
    border-color: #2d3d50;
    color: #ffad33;
}

/* Kindle Unlimited badge */
.badge--ku {
    display: inline-flex;
    align-items: center;
    padding: .3em .7em;
    background: #002f6c;
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    border-radius: var(--radius);
    text-transform: uppercase;
    border: 1.5px solid #002f6c;
    cursor: default;
}

.buy-buttons {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

/* ─── Book cover component ───────────────────────────────────────── */
.book-cover-wrap {
    position: relative;
    display: block;
    text-decoration: none;
}
.book-cover-wrap img {
    border-radius: 2px 4px 4px 2px;
    box-shadow: -3px 3px 0 rgba(0,0,0,.1), -6px 6px 14px rgba(0,0,0,.18);
    width: 100%;
    display: block;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

/* Placeholder (no cover set) */
.book-cover-placeholder {
    aspect-ratio: 2 / 3;
    background: linear-gradient(155deg, var(--c-green-dark) 0%, var(--c-green-deep) 100%);
    border-radius: 2px 4px 4px 2px;
    box-shadow: -3px 3px 0 rgba(0,0,0,.1), -6px 6px 14px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: .85rem;
    position: relative;
    overflow: hidden;
}
.book-cover-placeholder::before {
    content: '❧';
    position: absolute;
    top: .5rem;
    right: .75rem;
    font-size: 2.5rem;
    opacity: .1;
    color: #fff;
    line-height: 1;
}
.book-cover-placeholder__spine {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 7px;
    background: rgba(0,0,0,.25);
}
.book-cover-placeholder__title {
    font-family: var(--font-head);
    font-size: .75rem;
    color: rgba(255,255,255,.95);
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
    position: relative;
}
.book-cover-placeholder__author {
    font-size: .65rem;
    color: rgba(255,255,255,.65);
    margin-top: .2rem;
    font-weight: 300;
    position: relative;
}

/* ─── Book card ──────────────────────────────────────────────────── */
.book-card {
    background: var(--c-surface);
    border: 1px solid var(--c-rule-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.book-card__cover { padding: 1.5rem 1.75rem .5rem; }
.book-card__cover .book-cover-wrap { max-width: 130px; margin-inline: auto; }
.book-card__cover .book-cover-placeholder { max-width: 130px; margin-inline: auto; }

.book-card__body {
    padding: 1rem 1.4rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex: 1;
}
.book-card__meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.book-card__title {
    font-family: var(--font-head);
    font-size: 1rem;
    color: var(--c-ink);
    line-height: 1.25;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card__title:hover { color: var(--c-green-dark); text-decoration: none; }
.book-card__author { font-size: .78rem; color: var(--c-muted); font-style: italic; font-weight: 300; }
.book-card__excerpt {
    font-size: .8rem;
    color: var(--c-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card__actions {
    margin-top: auto;
    padding-top: .85rem;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Horizontal card layout (desktop) ───────────────────────────────
   When the grid column is wide enough the card switches to a
   side-by-side layout: cover on the left, details on the right.
   This gives a roughly square/landscape overall card shape. */
@media (min-width: 600px) {
    .book-card {
        flex-direction: row;
        align-items: stretch;
    }
    .book-card__cover {
        flex-shrink: 0;
        width: 150px;
        padding: 1.25rem 0 1.25rem 1.25rem;
        display: flex;
        align-items: flex-start;
    }
    .book-card__cover .book-cover-wrap,
    .book-card__cover .book-cover-placeholder {
        max-width: 100%;
        width: 100%;
        margin: 0;
    }
    .book-card__body {
        padding: 1.25rem;
        flex: 1;
        min-width: 0; /* prevent overflow */
    }
}

/* ── Narrow: full-width stacked cards ───────────────────────────────
   Below 600 px cards expand to fill the full container width and
   stack vertically. */
@media (max-width: 599px) {
    .books-grid > .book-card {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
}

/* ─── Books grid ─────────────────────────────────────────────────── */
.books-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    justify-content: center;
    align-items: flex-start;
}
/* Each card has a fixed ideal width; flex won't stretch it wider */
.books-grid > .book-card {
    flex: 0 0 420px;
    max-width: 420px;
    width: 420px;
}

/* ─── Filter tabs ────────────────────────────────────────────────── */
.filter-bar {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-rule-light);
    position: sticky;
    top: var(--header-h);
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.filter-bar__inner {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    scrollbar-width: none;
}
.filter-bar__inner::-webkit-scrollbar { display: none; }
.filter-tab {
    flex-shrink: 0;
    padding: .85em 1.25em;
    font-size: .82rem;
    color: var(--c-muted);
    text-decoration: none;
    border-bottom: 2.5px solid transparent;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: .35em;
}
.filter-tab:hover { color: var(--c-green-dark); }
.filter-tab.active,
.filter-tab[aria-current="page"] {
    color: var(--c-green-dark);
    font-weight: 500;
    border-bottom-color: var(--c-green-dark);
}
.filter-tab__count {
    font-size: .65rem;
    font-weight: 500;
    background: var(--c-green-light);
    color: var(--c-green-dark);
    border-radius: 2em;
    padding: .1em .45em;
    line-height: 1;
}
.filter-tab.active .filter-tab__count { background: var(--c-green-dark); color: #fff; }

/* ─── Archive meta bar ───────────────────────────────────────────── */
.archive-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.5rem 0 1.25rem;
    border-bottom: 1px solid var(--c-rule-light);
    margin-bottom: 2rem;
    font-size: .8rem;
    color: var(--c-muted);
}
.archive-meta strong { color: var(--c-ink); }

/* ─── Pagination ─────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding-top: 3rem;
    flex-wrap: wrap;
}
.pagination a,
.pagination .current,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .5em;
    border-radius: var(--radius);
    font-size: .82rem;
    font-weight: 400;
    text-decoration: none;
    color: var(--c-muted);
    border: 1.5px solid var(--c-rule-light);
    transition: all .15s;
}
.pagination a:hover   { border-color: var(--c-green-mid); color: var(--c-green-dark); }
.pagination .current  { background: var(--c-green-dark); color: #fff; border-color: var(--c-green-dark); }
.pagination .dots     { border-color: transparent; }

/* ─── Single book page ───────────────────────────────────────────── */
.single-book-hero {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-rule-light);
    padding: 3rem 0;
}
.single-book-hero__layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 3.5rem;
    align-items: start;
}
.single-book-hero__cover { position: sticky; top: calc(var(--header-h) + 2rem); }

.book-detail__meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.book-detail__title {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.15;
    margin-bottom: .4rem;
    letter-spacing: .01em;
}
.book-detail__author-line {
    font-size: .95rem;
    color: var(--c-muted);
    font-style: italic;
    font-weight: 300;
    margin-bottom: 1.5rem;
}
.book-detail__author-line a { color: var(--c-green-dark); }
.book-detail__divider {
    height: 1px;
    background: var(--c-rule-light);
    margin: 1.5rem 0;
}
.book-detail__blurb {
    font-size: .975rem;
    color: var(--c-muted);
    line-height: 1.8;
    max-width: 540px;
    margin-bottom: 1.75rem;
}
.buy-buttons__label {
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: .5rem;
    display: block;
}

/* Book meta table */
.book-meta-table {
    border-top: 1px solid var(--c-rule-light);
    padding-top: 1.25rem;
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .45rem 1.5rem;
    font-size: .82rem;
}
.book-meta-table dt { font-weight: 500; color: var(--c-ink); white-space: nowrap; }
.book-meta-table dd { color: var(--c-muted); }

/* Single book content area */
.single-book-content {
    padding: 4rem 0;
}
.single-book-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4rem;
    align-items: start;
}

/* Buy sidebar */
.book-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    background: var(--c-surface);
    border: 1px solid var(--c-rule-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.book-sidebar__head {
    background: var(--c-green-wash);
    padding: .85rem 1.25rem;
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c-green-dark);
    border-bottom: 1px solid var(--c-rule-light);
}
.book-sidebar__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; }
.book-sidebar__body .btn { justify-content: center; width: 100%; }

.book-sidebar__details {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--c-rule-light);
    margin-top: .25rem;
    padding-top: 1rem;
}
.book-sidebar__details .book-meta-table { border-top: none; padding-top: 0; margin-top: 0; font-size: .78rem; }

/* Author bio box */
.author-bio {
    background: var(--c-green-wash);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin-top: 2.5rem;
    border: 1px solid var(--c-rule-light);
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.author-bio__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--c-green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--c-green-dark);
    line-height: 1;
}
.author-bio__name {
    font-family: var(--font-head);
    font-size: 1rem;
    margin-bottom: .3rem;
}
.author-bio__name a { color: var(--c-green-dark); text-decoration: none; }
.author-bio__name a:hover { text-decoration: underline; }
.author-bio__text { font-size: .85rem; color: var(--c-muted); line-height: 1.65; }
.author-bio__text p { margin-bottom: .6em; }

/* Related books */
.related-books { padding: 3.5rem 0; background: var(--c-green-wash); }

/* ─── Entry content ──────────────────────────────────────────────── */
.entry-content {
    font-size: .975rem;
    line-height: 1.8;
    color: var(--c-ink);
}
.entry-content > * + * { margin-top: 1.25em; }
.entry-content h2 { margin-top: 2.2em; font-size: 1.5rem; }
.entry-content h3 { margin-top: 1.8em; font-size: 1.2rem; }
.entry-content p  { color: var(--c-muted); }
.entry-content ul,
.entry-content ol  { padding-left: 1.5em; color: var(--c-muted); font-size: .95em; }
.entry-content ul  { list-style: disc; }
.entry-content ol  { list-style: decimal; }
.entry-content li  { margin-bottom: .4em; }
.entry-content blockquote {
    border-left: 3px solid var(--c-green-mid);
    padding: 1em 1.5em;
    background: var(--c-green-wash);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--c-green-dark);
    margin: 1.5em 0;
}
.entry-content blockquote p { color: var(--c-green-dark); }
.entry-content hr { border: none; border-top: 1px solid var(--c-rule); margin: 2.5em 0; }
.entry-content img { border-radius: var(--radius); }
.entry-content a { color: var(--c-green-dark); }
.entry-content strong { font-weight: 500; color: var(--c-ink); }

/* ── Book description: poetry/verse line spacing ─────────────────
   Each line in the block editor is its own <p> block. We collapse
   all inter-paragraph margins so they stack like verse lines, while
   keeping normal spacing after headings. A small line-height tweak
   keeps the text readable but clearly distinct from prose. */
.single-book-content .entry-content p {
    margin-top: 0;
    margin-bottom: 0;
}
.single-book-content .entry-content > h2,
.single-book-content .entry-content > h3 {
    margin-top: 2em;
    margin-bottom: 0.4em;
}
/* Restore spacing after a heading so the first line beneath it
   doesn't butt directly against the heading text */
.single-book-content .entry-content > h2 + p,
.single-book-content .entry-content > h3 + p { margin-top: 0.4em; }

/* Blurb in hero: same treatment — each line tight, no gaps */
.book-detail__blurb {
    white-space: pre-line;  /* renders \n as a line break in plain text */
}

/* WP block alignment */
.entry-content .alignleft  { float: left;  margin: 0 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: 0 0 1em 1.5em; }
.entry-content .aligncenter { margin-inline: auto; text-align: center; }
.entry-content .alignwide  { margin-inline: -2rem; }
.entry-content .wp-block-image  { margin: 1.5em 0; }
.entry-content .wp-block-image img { width: 100%; height: auto; }
.entry-content .wp-block-image figcaption {
    font-size: .78rem;
    color: var(--c-muted);
    text-align: center;
    margin-top: .4rem;
    font-style: italic;
}

/* ─── Page template ──────────────────────────────────────────────── */
.page-content {
    padding: 4rem 0;
}
.page-content-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 4rem;
    align-items: start;
}
.page-toc {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    background: var(--c-surface);
    border: 1px solid var(--c-rule-light);
    border-left: 3px solid var(--c-green-mid);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-sm);
}
.page-toc__head {
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c-green-mid);
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--c-rule-light);
}

/* ─── Blog archive ───────────────────────────────────────────────── */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4rem;
    align-items: start;
    padding: 3.5rem 0;
}
.post-list { display: flex; flex-direction: column; gap: 2rem; }
.post-row {
    background: var(--c-surface);
    border: 1px solid var(--c-rule-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: 220px 1fr;
    transition: transform .2s, box-shadow .2s;
}
.post-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.post-row__thumb {
    background: var(--c-green-wash);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    overflow: hidden;
}
.post-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-row__thumb-placeholder { font-size: 3rem; color: var(--c-green-mid); opacity: .4; }
.post-row__body { padding: 1.5rem 1.75rem; display: flex; flex-direction: column; gap: .4rem; }
.post-row__date { font-size: .72rem; color: var(--c-muted); }
.post-row__title { font-family: var(--font-head); font-size: 1.2rem; line-height: 1.25; }
.post-row__title a { color: var(--c-ink); text-decoration: none; }
.post-row__title a:hover { color: var(--c-green-dark); }
.post-row__excerpt { font-size: .85rem; color: var(--c-muted); line-height: 1.65; }
.post-row__more { margin-top: auto; padding-top: .75rem; font-size: .8rem; font-weight: 500; }
.post-row__more a { color: var(--c-green-dark); text-decoration: none; }
.post-row__more a:hover { text-decoration: underline; }

/* ─── Sidebar widgets ────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar--sticky { position: sticky; top: calc(var(--header-h) + 2rem); }
.widget {
    background: var(--c-surface);
    border: 1px solid var(--c-rule-light);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}
.widget__head {
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c-green-mid);
    margin-bottom: .85rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--c-rule-light);
}
.widget__list { display: flex; flex-direction: column; gap: .35rem; }
.widget__list a {
    font-size: .82rem;
    color: var(--c-muted);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    padding: .2rem 0;
}
.widget__list a:hover { color: var(--c-green-dark); }
.widget__list__count {
    font-size: .7rem;
    background: var(--c-green-light);
    color: var(--c-green-dark);
    padding: .1em .45em;
    border-radius: 2em;
}

/* ─── Home: hero ─────────────────────────────────────────────────── */
.wp-block-cgp-about-section,
.acf-block-preview { /* block editor preview wrapper */ }

/* Taxonomy archive author intro */
.taxonomy-intro {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-rule-light);
    padding: 2.5rem 0;
}
.taxonomy-intro__layout {
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
}
.taxonomy-intro__icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    background: var(--c-green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--c-green-dark);
    line-height: 1;
}
.taxonomy-intro__name { font-size: 1.6rem; margin-bottom: .35rem; }
.taxonomy-intro__bio  { font-size: .9rem; color: var(--c-muted); line-height: 1.7; }

/* ─── Email obfuscation ──────────────────────────────────────────── */
.cgp-email-link {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    color: var(--c-green-dark);
    font-weight: 400;
}
/* icon is now an inline SVG rendered by cgp_icon_email() */

/* ─── About section block ────────────────────────────────────────── */
.about-layout {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 2.5rem;
    align-items: start;
    max-width: 760px;
}
.about-layout__deco {
    display: flex;
    justify-content: center;
    padding-top: .5rem;
}
.about-deco-glyph {
    font-size: 3.5rem;
    color: var(--c-green-mid);
    opacity: .25;
    line-height: 1;
    font-family: Georgia, serif;
}
.about-text p { color: var(--c-muted); }

.about-contact {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-top: 3rem;
    padding: 1.25rem 1.5rem;
    background: var(--c-green-wash);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-rule-light);
}
.about-contact__heading {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--c-green-dark);
    letter-spacing: .02em;
    margin: 0 0 .6rem;
}
.about-contact__email-row {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.about-contact__email-row svg {
    display: block;
    color: var(--c-green-dark);
    flex-shrink: 0;
}
.about-contact .cgp-email-link {
    font-size: 1rem;
    font-weight: 400;
}
.about-contact__note {
    font-size: .78rem;
    color: var(--c-muted);
    margin-top: .35rem;
}

@media (max-width: 600px) {
    .about-layout { grid-template-columns: 1fr; }
    .about-layout__deco { display: none; }
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .single-book-layout { grid-template-columns: 1fr; }
    .book-sidebar { position: static; }
    .page-content-layout { grid-template-columns: 1fr; }
    .page-toc { position: static; }
    .blog-layout { grid-template-columns: 1fr; }
    .sidebar--sticky { position: static; }
}
@media (max-width: 800px) {
    .single-book-hero__layout { grid-template-columns: 1fr; gap: 2rem; }
    .single-book-hero__cover { position: static; max-width: 200px; margin-inline: auto; }
    .book-detail__title { text-align: center; }
    .book-detail__meta { justify-content: center; }
    .book-detail__author-line { text-align: center; }
    .book-detail__blurb { max-width: 100%; }
    .buy-buttons { justify-content: center; }
    .buy-buttons__label { text-align: center; }
    .book-meta-table { font-size: .78rem; }
}
@media (max-width: 680px) {
    .post-row { grid-template-columns: 1fr; }
    .post-row__thumb { min-height: 120px; }
    .section { padding: 3rem 0; }
    .author-bio { flex-direction: column; gap: .85rem; }
}

/* ─── WP block editor: match front-end styles ────────────────────── */
.editor-styles-wrapper {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--c-ink);
    line-height: 1.75;
    background: var(--c-bg);
}
.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4 {
    font-family: var(--font-head);
    font-weight: 400;
    color: var(--c-ink);
}
