/* ═══════════════════════════════════════════════════════════════
   oak-browse.css  –  Oakleafbooks browse page ([oak_browse])
   All rules scoped under .ob-browse. Tokens only (oak-tokens.css).
   Brick red: buttons and hover only. Checkboxes: olive.
   ═══════════════════════════════════════════════════════════════ */

/* ── Container ───────────────────────────────────────────────── */

.ob-browse {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--ff-body);
}

.ob-browse .ob-browse__inner {
    max-width: var(--ob-max);
    margin: 0 auto;
    padding-inline: var(--ob-pad);
}

.ob-browse .ob-browse__eyebrow {
    display: flex;
    align-items: center;
    margin: 0 0 1rem;
}

.ob-browse .ob-browse__eyebrow span {
    position: relative;
    display: inline-block;
    padding-left: 40px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--walnut);
}

.ob-browse .ob-browse__eyebrow span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 24px;
    height: 1px;
    background: currentColor;
}

.ob-browse .ob-browse__eyebrow--light {
    color: var(--paper);
}

/* ── Buttons (same look as .ob-btn on the homepage) ──────────── */

.ob-browse .ob-btn {
    display: inline-block;
    background: var(--brand);
    color: var(--paper);
    font-family: var(--ff-body);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.625rem 1.375rem;
    border: none;
    border-radius: 2px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s;
}
.ob-browse .ob-btn:hover {
    background: var(--brand-dark);
}

/* ── Intro band ──────────────────────────────────────────────── */

.ob-browse .ob-browse__intro {
    background: linear-gradient(180deg, var(--paper) 0%, var(--oat) 100%);
}

.ob-browse .ob-browse__intro .ob-browse__inner {
    padding-top: 4rem;
    padding-bottom: 3rem;
}

.ob-browse .ob-browse__title {
    font-family: var(--ff-head);
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 600;
    line-height: 1.05;
    margin: 0 0 1rem;
    max-width: 20ch;
}
.ob-browse .ob-browse__lede {
    font-size: 1rem;
    line-height: 1.65;
    max-width: 46ch;
    margin: 0;
}

/* ── Layout ──────────────────────────────────────────────────── */

.ob-browse .ob-browse__layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
    padding-top: 3rem;
    padding-bottom: 4rem;
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.ob-browse .ob-browse__sidebar {
    position: sticky;
    top: 1rem;
}

.ob-browse .ob-browse__sidebar-summary {
    display: none;
}

.ob-browse .ob-browse__group {
    border-bottom: 1px solid var(--oat);
    padding: 0.25rem 0 1rem;
    margin-bottom: 0.75rem;
}

.ob-browse .ob-browse__group > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--walnut);
    padding: 0.5rem 0;
}
.ob-browse .ob-browse__group > summary::-webkit-details-marker { display: none; }
.ob-browse .ob-browse__group > summary::after {
    content: "–";
    color: var(--walnut);
    font-size: 1rem;
    line-height: 1;
}
.ob-browse .ob-browse__group:not([open]) > summary::after {
    content: "+";
}

.ob-browse .ob-browse__group-body {
    padding-top: 0.5rem;
}

.ob-browse .ob-browse__search input {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--ff-body);
    font-size: 0.875rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--oat);
    border-radius: 2px;
    padding: 0.5rem 0.75rem;
}
.ob-browse .ob-browse__search input:focus {
    outline: none;
    border-color: var(--olive);
}

/* Checkbox rows */
.ob-browse .ob-browse__check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0;
    font-size: 0.875rem;
    color: var(--ink);
    cursor: pointer;
}

.ob-browse .ob-browse__check input {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    border: 1.5px solid var(--olive);
    border-radius: 2px;
    background: var(--paper);
    position: relative;
    cursor: pointer;
}
.ob-browse .ob-browse__check input:checked {
    background: var(--olive);
}
.ob-browse .ob-browse__check input:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--paper);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ob-browse .ob-browse__check-label {
    flex: 1;
}

.ob-browse .ob-browse__check-count {
    color: var(--walnut);
    font-size: 0.8rem;
}

/* Show more */
.ob-browse .ob-browse__more > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--walnut);
    padding: 0.4rem 0;
    text-decoration: underline;
}
.ob-browse .ob-browse__more > summary::-webkit-details-marker { display: none; }
.ob-browse .ob-browse__more[open] > summary {
    margin-bottom: 0.25rem;
}

/* Actions */
.ob-browse .ob-browse__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.25rem;
}

.ob-browse .ob-browse__clear {
    font-size: 0.85rem;
    color: var(--walnut);
    text-decoration: none;
}
.ob-browse .ob-browse__clear:hover {
    text-decoration: underline;
}

/* ── Main column ─────────────────────────────────────────────── */

.ob-browse .ob-browse__grid-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ob-browse .ob-browse__grid-title {
    font-family: var(--ff-head);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 600;
    margin: 0;
}

.ob-browse .ob-browse__grid-tools {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.ob-browse .ob-browse__count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--walnut);
    white-space: nowrap;
}

.ob-browse .ob-browse__sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ob-browse .ob-browse__sort select {
    font-family: var(--ff-body);
    font-size: 0.85rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--oat);
    border-radius: 2px;
    padding: 0.5rem 0.6rem;
}

/* Active filter chips */
.ob-browse .ob-browse__chips {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.ob-browse .ob-browse__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--ink);
    background: var(--oat);
    border-radius: 2px;
    padding: 0.3rem 0.6rem;
    text-decoration: none;
}
.ob-browse .ob-browse__chip:hover {
    color: var(--brand);
}

/* ── Product grid ────────────────────────────────────────────── */

.ob-browse .ob-browse__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem 1.5rem;
    align-items: start;
}

.ob-browse .ob-browse__main {
    min-width: 0;
}

.ob-browse .ob-browse__card {
    display: flex;
    flex-direction: column;
    color: var(--ink);
    text-decoration: none;
}

.ob-browse .ob-browse__card .ob-feat-thumb {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 2px;
    box-shadow:
        0 1px 2px rgba(41, 37, 31, 0.12),
        0 10px 22px rgba(41, 37, 31, 0.12);
}

.ob-browse .ob-browse__card:hover .ob-feat-title {
    color: var(--brand);
}

/* ── Empty ───────────────────────────────────────────────────── */

.ob-browse .ob-browse__empty {
    font-size: 1rem;
    color: var(--walnut);
}

/* ── No-cover tile (require_cover="0") ───────────────────────── */

.ob-browse .ob-browse__card--nocover {
    position: relative;
}

.ob-browse .ob-browse__nocover {
    width: 100%;
    aspect-ratio: 3 / 4;
    box-sizing: border-box;
    background: var(--oat);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--walnut);
}
.ob-browse .ob-browse__card--nocover .ob-feat-title {
    display: none;
}

/* ── Pagination ──────────────────────────────────────────────── */

.ob-browse .ob-browse__pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
}

.ob-browse .ob-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.6rem;
    box-sizing: border-box;
    font-size: 0.85rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--oat);
    border-radius: 2px;
}
.ob-browse .ob-page:hover {
    border-color: var(--olive);
}
.ob-browse .ob-page.is-current {
    background: var(--olive);
    border-color: var(--olive);
    color: var(--paper);
}
.ob-browse .ob-page--gap {
    border: none;
    color: var(--walnut);
}

/* ── African books banner ────────────────────────────────────── */

.ob-browse .ob-browse__banner {
    background: var(--olive-dark);
    color: var(--paper);
}

.ob-browse .ob-browse__banner-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}

.ob-browse .ob-browse__banner-text h2 {
    font-family: var(--ff-head);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 600;
    color: var(--paper);
    margin: 0 0 1rem;
}

.ob-browse .ob-browse__banner-text p {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--oat);
    max-width: 46ch;
    margin: 0 0 1.5rem;
}

.ob-browse .ob-browse__banner .ob-btn {
    background: var(--paper);
    color: var(--ink);
}
.ob-browse .ob-browse__banner .ob-btn:hover {
    background: var(--oat);
}

.ob-browse .ob-browse__banner-covers .ob-hero-covers {
    justify-content: center;
    margin-right: 0;
}
.ob-browse .ob-browse__banner-covers .ob-hero-cover {
    width: clamp(120px, 12vw, 170px);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .ob-browse .ob-browse__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    /* Sidebar collapses into a single "Filters" details above the grid */
    .ob-browse .ob-browse__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .ob-browse .ob-browse__sidebar {
        position: static;
        border: 1px solid var(--oat);
        border-radius: 3px;
        padding: 0 1rem;
    }

    .ob-browse .ob-browse__sidebar-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        list-style: none;
        font-size: 0.8rem;
        font-weight: 500;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--walnut);
        padding: 1rem 0;
    }
    .ob-browse .ob-browse__sidebar-summary::-webkit-details-marker { display: none; }
    .ob-browse .ob-browse__sidebar-summary::after {
        content: "–";
        font-size: 1.1rem;
    }
    .ob-browse .ob-browse__sidebar:not([open]) .ob-browse__sidebar-summary::after {
        content: "+";
    }

    .ob-browse .ob-browse__banner-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .ob-browse .ob-browse__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ob-browse .ob-browse__grid-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .ob-browse .ob-browse__grid-tools {
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-between;
    }
}

/* Dark band follows the brand (olive in the walnut theme) */
.ob-browse .ob-browse__banner { background: var(--brand-dark); }
[data-theme="walnut"] .ob-browse .ob-browse__banner { background: var(--olive-dark); }

/* Aurum sets the document root to 62.5% and places shortcode output inside
   its fixed-width .container. Restore the preview's 16px scale and full-bleed
   Browse canvas only on pages that render this component. */
html:has(body .ob-browse) { font-size: 16px; }
body:has(.ob-browse) {
    background: var(--paper) !important;
    font-size: 16px;
    line-height: normal;
    overflow-x: clip;
}
.ob-browse {
    width: 100vw;
    max-width: none;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    background: var(--paper);
}
.ob-browse,
.ob-browse * {
    font-family: var(--ff-body);
}
.ob-browse .ob-browse__title,
.ob-browse .ob-browse__grid-title,
.ob-browse .ob-browse__banner-text h2 {
    font-family: var(--ff-head);
}
.ob-browse .ob-browse__inner {
    box-sizing: content-box;
}
.ob-browse .ob-browse__herosearch input[type="search"],
.ob-browse .ob-browse__herosearch .ob-btn {
    box-sizing: border-box;
    height: 52.2px;
    min-height: 52.2px;
    line-height: normal;
}

/* ── Version 2: no filter sidebar. Search bar, sort and a single column ── */
.ob-browse .ob-browse__layout--single { display: block; padding-top: 2.25rem; }

.ob-browse .ob-browse__bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin: 0 0 1.5rem;
}
.ob-browse .ob-browse__search--bar { flex: 1 1 320px; display: block; }
.ob-browse .ob-browse__search--bar input {
    padding: .7rem .95rem;
    font-size: .95rem;
    background: #fff;
    border: 1px solid #cfc8bd;
}
.ob-browse .ob-browse__search--bar input:focus { border-color: var(--brand); }
.ob-browse .ob-browse__bar .ob-btn { padding: .7rem 1.5rem; }
.ob-browse .ob-browse__sort select { padding: .7rem .8rem; background: #fff; border: 1px solid #cfc8bd; }
.ob-browse .ob-browse__empty a { color: var(--brand); }
.ob-browse .ob-browse__grid-head { align-items: baseline; }
@media (max-width: 700px) {
    .ob-browse .ob-browse__bar { gap: .5rem; }
    .ob-browse .ob-browse__search--bar { flex-basis: 100%; }
    .ob-browse .ob-browse__bar .ob-btn { flex: 1; }
    .ob-browse .ob-browse__sort { flex: 1; }
    .ob-browse .ob-browse__sort select { width: 100%; }
    .ob-browse .ob-browse__grid-head { flex-direction: row; align-items: baseline; }
}

/* v3: subcategory row under the chips (subject-heading tree) */
.ob-browse__subcats { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; }
.ob-browse__subcats[hidden] { display: none; }
.ob-browse__sub { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .85rem; border: 1px solid var(--oat, #e6dfd2); border-radius: 999px;
  background: #fff; color: var(--ink, #222); font-size: .85rem; text-decoration: none; transition: border-color .15s, color .15s, background .15s; }
.ob-browse__sub span { font-size: .72rem; color: var(--walnut, #6b5a45); opacity: .85; }
.ob-browse__sub:hover { border-color: var(--brand, #8b1e1e); color: var(--brand, #8b1e1e); }
.ob-browse__sub.is-current { background: var(--brand, #8b1e1e); border-color: var(--brand, #8b1e1e); color: #fff; }
.ob-browse__sub.is-current span { color: #fff; }

/* v4: search field sits under "Books", above the heading text */
.ob-browse .ob-browse__herosearch { display: flex; max-width: 620px; margin: 0 0 1.6rem; }
.ob-browse .ob-browse__herosearch .ob-browse__search { flex: 1; display: block; margin: 0; }
.ob-browse .ob-browse__herosearch input { width: 100%; box-sizing: border-box; padding: .85rem 1.1rem; font: inherit; font-size: 1rem; background: #fff; color: var(--ink);
    border: 2px solid var(--brand); border-right: 0; border-radius: 2px 0 0 2px; }
.ob-browse .ob-browse__herosearch input:focus { outline: 0; box-shadow: 0 0 0 3px rgba(139,30,30,.18); }
.ob-browse .ob-browse__herosearch .ob-btn { border-radius: 0 2px 2px 0; padding: .85rem 1.6rem; }
.ob-browse .ob-browse__bar { justify-content: flex-end; }
@media (max-width: 700px) { .ob-browse .ob-browse__bar { justify-content: stretch; } .ob-browse .ob-browse__herosearch { max-width: none; } }
