/* Clarke's Africana & Rare Books — public site styles */

:root {
    --burgundy: #783037;
    --burgundy-dark: #5a2329;
    --stone: #d6d1c5;
    --cream: #f7f4ee;
    --paper: #fffdf9;
    --ink: #2a2321;
    --muted: #6e6560;
    --line: #e3ddd0;
    --serif: 'Cormorant Garamond', Garamond, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --measure: 68ch;
    --wrap: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--burgundy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--burgundy-dark); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-variant-numeric: lining-nums;
    font-weight: 500;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.measure { max-width: var(--measure); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
    font-family: var(--serif);
    font-size: .95rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--burgundy);
    margin: 0 0 .75rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: .7em 1.5em;
    border: 1px solid var(--burgundy);
    background: var(--burgundy);
    color: #fff;
    font: 500 .8rem/1.2 var(--sans);
    letter-spacing: .14em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn:hover { background: var(--burgundy-dark); border-color: var(--burgundy-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--burgundy); }
.btn-outline:hover { background: var(--burgundy); color: #fff; }
.btn-light { background: var(--cream); border-color: var(--cream); color: var(--burgundy); }
.btn-light:hover { background: #fff; border-color: #fff; color: var(--burgundy-dark); }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.brand-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.brand { display: block; width: min(320px, 70vw); margin: 0 auto; padding: 1.4rem 0 1rem; }
.brand img { display: block; width: 100%; }

.nav-toggle {
    display: none;
    margin: 0 auto .8rem;
    padding: .5em 1.2em;
    background: none;
    border: 1px solid var(--line);
    font: 500 .75rem var(--sans);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--burgundy);
    cursor: pointer;
}

.site-nav { border-top: 1px solid var(--line); }
.site-nav .wrap { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: .5rem 2rem; }
.site-nav ul { flex-shrink: 0; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.site-nav li a {
    display: block;
    padding: .95rem 1.1rem;
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}
.site-nav li a:hover, .site-nav li.active a { color: var(--burgundy); border-bottom-color: var(--burgundy); }

.order-link { justify-self: end; font-size: .85rem; letter-spacing: .06em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.order-link:hover { color: var(--burgundy); }

.search { display: flex; flex: 0 1 17rem; min-width: 9rem; margin-left: auto; }
.search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: .5rem .8rem;
    border: 1px solid var(--line);
    border-right: 0;
    background: #fff;
    font: .9rem var(--sans);
    color: var(--ink);
}
.search button {
    padding: 0 1rem;
    border: 1px solid var(--burgundy);
    background: var(--burgundy);
    color: #fff;
    font: 500 .75rem var(--sans);
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
}
.search button:hover { background: var(--burgundy-dark); }

@media (max-width: 1150px) and (min-width: 1001px) {
    .site-nav .wrap { gap: .5rem 1rem; }
    .site-nav li a { padding-left: .75rem; padding-right: .75rem; letter-spacing: .14em; }
}

@media (max-width: 1000px) {
    .nav-toggle { display: block; }
    .site-nav { display: none; }
    .site-nav.is-open { display: block; }
    .site-nav .wrap { flex-direction: column; flex-wrap: wrap; align-items: stretch; }
    .site-nav ul { flex-direction: column; }
    .site-nav li a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
    .brand-row { display: block; text-align: center; }
    .brand-spacer { display: none; }
    .brand { padding-bottom: .6rem; }
    .order-link { display: block; justify-self: center; padding: 0 0 .8rem; }
    .search { flex: none; padding-bottom: 1rem; }
    .search input { flex: 1; width: auto; }
}

/* ---------- Flash ---------- */
.flash {
    margin: -1rem 0 1.75rem;
    padding: .9rem 1.2rem;
    border: 1px solid var(--stone);
    border-left: 4px solid var(--burgundy);
    background: var(--paper);
}
.flash-success { border-left-color: #4a7a4f; }
.flash-danger { border-left-color: #b3261e; }

/* ---------- Main ---------- */
main { padding: 2.5rem 0 4rem; min-height: 50vh; }
.page-title { margin-bottom: 1.5rem; }
.page-title h1 { margin-bottom: .25rem; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* breadcrumbs */
.crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin: 0 0 1.5rem; padding: 0; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: '/'; margin-right: .6rem; color: var(--stone); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--burgundy); }

/* ---------- Hero ---------- */
.hero { background: var(--paper); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .wrap { display: grid; gap: 2rem; align-items: center; padding-top: 3rem; padding-bottom: 3rem; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 500; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.hero .art { position: relative; justify-self: center; width: min(420px, 80%); }
.hero .art::before {
    content: '';
    position: absolute;
    inset: 8% -8% -4% 8%;
    background: var(--stone);
    opacity: .45;
    z-index: 0;
}
.hero .art img { position: relative; z-index: 1; display: block; width: 100%; }
@media (min-width: 900px) {
    .hero .wrap { grid-template-columns: 1.15fr .85fr; padding-top: 4.5rem; padding-bottom: 4.5rem; }
}

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 1.75rem; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }

/* featured grid */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--stone); box-shadow: 0 6px 20px rgba(60, 30, 30, .08); color: var(--ink); }
.card .thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; padding: 1rem; background: #fff; border-bottom: 1px solid var(--line); }
.card .thumb img { max-height: 100%; object-fit: contain; }
.card .thumb .none { font-family: var(--serif); font-size: 1rem; letter-spacing: .15em; text-transform: uppercase; color: var(--stone); }
.card .body { padding: 1rem 1.1rem 1.25rem; }
.card .author { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .25rem; }
.card h3 { font-size: 1.25rem; margin: 0 0 .5rem; }
.card .price { font-weight: 500; color: var(--burgundy); margin: 0; }

/* catalogue band */
.band { background: var(--stone); color: var(--ink); border-top: 1px solid #c9c3b5; border-bottom: 1px solid #c9c3b5; }
.band .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; padding-top: 3rem; padding-bottom: 3rem; }
.band h2 { margin-bottom: .4rem; }
.band p { margin: 0; max-width: 50ch; }
.band .band-art { display: none; height: 150px; width: auto; margin-left: auto; }
@media (min-width: 760px) { .band .band-art { display: block; } }

/* intro + mailing list */
.two-col { display: grid; gap: 3rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.4fr 1fr; } }
.panel { background: var(--paper); border: 1px solid var(--line); padding: 1.75rem; }
.panel h3 { margin-bottom: .25rem; }

/* ---------- Forms ---------- */
label { display: block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], textarea, select {
    width: 100%;
    padding: .65rem .8rem;
    border: 1px solid #cfc8b8;
    background: #fff;
    color: var(--ink);
    font: 1rem var(--sans);
    border-radius: 0;
}
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 2px; }
textarea { resize: vertical; }
.field { margin-bottom: 1.1rem; }
.field-error { color: #b3261e; font-size: .85rem; margin: .3rem 0 0; }
.form-grid { display: grid; gap: 0 1.5rem; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.hp-field { position: absolute; left: -9999px; }

/* ---------- Browse ---------- */
.browse { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .browse { grid-template-columns: 250px 1fr; align-items: start; } }

.filters h3 { font-size: 1rem; letter-spacing: .2em; text-transform: uppercase; font-family: var(--sans); font-weight: 600; color: var(--muted); }
.filters ul { list-style: none; margin: 0; padding: 0; }
.filters li a { display: block; padding: .3rem 0 .3rem .75rem; border-left: 2px solid transparent; color: var(--ink); text-decoration: none; font-size: .95rem; }
.filters li a:hover { color: var(--burgundy); }
.filters li.active a { border-left-color: var(--burgundy); color: var(--burgundy); font-weight: 600; }
.filters-select { display: none; }
@media (max-width: 899px) {
    .filters ul, .filters h3 { display: none; }
    .filters-select { display: block; }
}
@media (min-width: 900px) { .filters { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; } }

.list { display: grid; gap: 1.25rem; }
.row { display: grid; grid-template-columns: 110px 1fr; gap: 1.25rem; padding: 1.1rem; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.row:hover { border-color: var(--stone); box-shadow: 0 6px 20px rgba(60, 30, 30, .08); color: var(--ink); }
.row .thumb { display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); aspect-ratio: 3 / 4; padding: .4rem; }
.row .thumb img { max-height: 100%; object-fit: contain; }
.row .thumb .none { font-family: var(--serif); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); }
.row .author { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .15rem; }
.row h3 { font-size: 1.4rem; margin: 0 0 .4rem; }
.row .excerpt { color: var(--muted); font-size: .92rem; margin: 0 0 .5rem; }
.row .price { font-weight: 500; color: var(--burgundy); margin: 0; }
@media (min-width: 700px) { .row { grid-template-columns: 150px 1fr; } }

.empty { padding: 2rem; background: var(--paper); border: 1px dashed var(--stone); text-align: center; color: var(--muted); }

.results-summary { color: var(--muted); margin: 0; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; }
.chips a { display: block; padding: .35rem .9rem; border: 1px solid var(--stone); background: var(--paper); color: var(--ink); text-decoration: none; font-size: .9rem; }
.chips a:hover { border-color: var(--burgundy); color: var(--burgundy); }
.empty .btn { margin: .25rem .25rem 0; }

/* pagination */
.pager { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 2rem; list-style: none; padding: 0; }
.pager a, .pager span { display: block; min-width: 2.4rem; padding: .45rem .75rem; border: 1px solid var(--line); background: var(--paper); text-align: center; text-decoration: none; font-size: .9rem; color: var(--ink); }
.pager a:hover { border-color: var(--burgundy); color: var(--burgundy); }
.pager .current span { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
.pager .disabled span { color: var(--stone); }

/* catalogue list */
.cat-list { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cat-card { position: relative; display: block; overflow: hidden; padding: 1.75rem; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.cat-card:hover { border-color: var(--stone); box-shadow: 0 6px 20px rgba(60, 30, 30, .08); color: var(--ink); }
.cat-card { padding-right: 7.5rem; min-height: 8.5rem; }
.cat-card::after { content: ''; position: absolute; right: 1.1rem; top: 50%; width: 80px; height: 83px; transform: translateY(-50%); background: url('/img/brand/lion-stone.webp') center / contain no-repeat; opacity: .55; }
.cat-card .eyebrow { margin-bottom: .25rem; }
.cat-card h3 { font-size: 1.6rem; margin-bottom: .25rem; }
.cat-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.tag { display: inline-block; padding: .15em .7em; background: var(--burgundy); color: #fff; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; vertical-align: middle; }

/* ---------- Book page ---------- */
.book { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .book { grid-template-columns: 5fr 6fr; align-items: start; } }

.gallery .main { display: flex; align-items: center; justify-content: center; min-height: 320px; padding: 1.25rem; background: #fff; border: 1px solid var(--line); }
.gallery .main button { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery .main img { display: block; max-height: 560px; margin: 0 auto; }
.gallery .noimg { font-family: var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--stone); }
.gallery .thumbs { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.gallery .thumbs button { width: 70px; height: 70px; padding: 4px; background: #fff; border: 1px solid var(--line); cursor: pointer; }
.gallery .thumbs button[aria-current=true] { border-color: var(--burgundy); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: contain; }

.book-details .author { font-family: var(--serif); font-size: 1.2rem; letter-spacing: .12em; text-transform: uppercase; color: var(--burgundy); margin-bottom: .3rem; }
.book-details h1 { margin-bottom: .3rem; }
.book-details .subtitle { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--muted); }
.facts { margin: 1.25rem 0; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: .35rem; font-size: .95rem; }
.facts dt { display: inline; color: var(--muted); }
.facts dd { display: inline; margin: 0; }
.price-box { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.25rem; margin: 1.25rem 0; }
.price-box .price { font-variant-numeric: lining-nums; font-family: var(--serif); font-size: 2.2rem; font-weight: 600; color: var(--burgundy); }
.price-box .approx { color: var(--muted); font-size: .9rem; }
.price-box select { width: auto; padding: .25rem .5rem; font-size: .9rem; display: inline-block; }
.buy { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.25rem 0 1.75rem; }
.sold { display: inline-block; padding: .4em 1.1em; border: 1px solid var(--stone); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; }
.description { max-width: var(--measure); }
.description p { margin-bottom: 1em; }

/* dialogs */
dialog { border: 0; padding: 0; background: var(--paper); max-width: min(560px, 94vw); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(42, 35, 33, .6); }
dialog .dialog-body { padding: 1.75rem; }
dialog .dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
dialog .dialog-head h3 { margin: 0; }
dialog .close { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); }
dialog.lightbox { max-width: 96vw; width: auto; background: #fff; }
dialog.lightbox img { display: block; max-width: 92vw; max-height: 86vh; margin: 0 auto; }
dialog.lightbox .dialog-body { padding: 1rem; }

/* ---------- Order list ---------- */
.order-table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); }
.order-table th { text-align: left; padding: .8rem 1rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.order-table td { padding: 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.order-table .num { text-align: right; white-space: nowrap; }
.order-table tfoot td { font-variant-numeric: lining-nums; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; border-bottom: 0; }
.order-table h4 { margin: 0; font-size: 1.2rem; }
.order-table small { color: var(--muted); }
.remove { font-size: .8rem; color: var(--muted); background: none; border: 0; padding: 0; font-family: inherit; text-decoration: underline; cursor: pointer; }
.remove:hover { color: var(--burgundy); }

/* ---------- Footer ---------- */
.site-footer { background: var(--burgundy); color: var(--stone); }
.site-footer .wrap { display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 2rem; }
@media (min-width: 800px) { .site-footer .wrap { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer img.logo { width: 240px; max-width: 100%; }
.site-footer h4 { color: #fff; font-size: 1.1rem; letter-spacing: .2em; text-transform: uppercase; margin-bottom: .6rem; }
.site-footer a { color: var(--stone); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer p { margin: 0 0 .4rem; font-size: .92rem; }
.site-footer .assoc { margin-top: 1rem; }
.site-footer .assoc img { display: block; width: 180px; height: auto; }
.site-footer .fine { grid-column: 1 / -1; border-top: 1px solid rgba(214, 209, 197, .25); padding-top: 1.25rem; font-size: .8rem; }

/* error pages */
.error-page { text-align: center; padding: 3rem 0; }
.error-page img { width: 200px; opacity: .85; }
