/* The Bookies – colours and type taken from the Canva design */
:root {
    --cream: #ede9df;
    --paper: #fbf8ef;
    --ink: #1d2a24;
    --muted: #5f665f;
    --terracotta: #b5573a;
    --terracotta-dark: #9a4830;
    --night: #0a0f1e;
    --sage: #e6e9df;
    --forest: #24392f;
    --moss: #9cae8e;
    --gold: #e8b866;
    --line: #d9d4c5;
    --danger: #a3312a;
    --ok: #2f6b4a;
    --display: "Fraunces", Georgia, serif;
    --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--cream); line-height: 1.5; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1:focus { outline: none; }
a { color: var(--terracotta); }
img { max-width: 100%; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .78rem; color: var(--terracotta); margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.trap { position: absolute; left: -9999px; }

/* Buttons and form controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; font: 600 .95rem var(--body); padding: .7em 1.3em; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; background: var(--terracotta); color: #fff; }
.btn:hover { background: var(--terracotta-dark); }
.btn.light { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.light:hover { background: #fff; }
.btn.ghost { background: transparent; color: inherit; }
.btn.ghost:hover { text-decoration: underline; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.small { padding: .4em .8em; font-size: .85rem; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=file], select, textarea {
    width: 100%; font: inherit; padding: .65em .8em; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 6em; resize: vertical; }
.field { margin-bottom: 1rem; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.check { display: flex; gap: .6em; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .3em; }
.validation-message, .validation-errors { color: var(--danger); font-size: .88rem; }
.validation-errors { padding-left: 1.2em; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
.inline { display: inline; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Header */
.site-header { background: var(--cream); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; flex-wrap: wrap; }
.site-header .btn { white-space: nowrap; }
@media (max-width: 900px) { .site-nav { order: 5; flex-basis: 100%; overflow-x: auto; } }
.logo { font: 700 1.45rem var(--display); color: var(--ink); text-decoration: none; }
.logo span { color: var(--terracotta); }
.site-nav { display: flex; gap: 1rem; flex: 1; white-space: nowrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: var(--terracotta); }
.site-header form.search { flex: 0 1 190px; position: relative; }
.site-header form.search input { border-radius: 999px; padding-left: 1em; }

/* Flash messages */
.flash { margin: 1rem auto; padding: .8rem 1rem; border-radius: 10px; background: #e3efe6; color: var(--ok); border: 1px solid #bcd6c5; }
.flash.error { background: #f7e4e1; color: var(--danger); border-color: #e6bdb7; }

/* Night-sky sections */
.night { color: #fff; background-color: var(--night);
    background-image:
        radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 68% 12%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 34% 64%, #dfe8ff 50%, transparent 51%), radial-gradient(1px 1px at 86% 48%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 52% 86%, #cfdcff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 6% 78%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 92% 90%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 44% 34%, #b9c9f5 50%, transparent 51%),
        radial-gradient(ellipse 60% 50% at 62% 18%, rgba(70, 104, 170, .55), transparent 70%),
        radial-gradient(ellipse 45% 40% at 88% 30%, rgba(52, 80, 140, .45), transparent 70%),
        radial-gradient(ellipse 50% 45% at 20% 90%, rgba(36, 58, 110, .4), transparent 70%);
    background-size: 340px 340px, 420px 420px, 380px 380px, 300px 300px, 460px 460px, 520px 520px, 280px 280px, 360px 360px, 100% 100%, 100% 100%, 100% 100%;
}
.night .eyebrow { color: #d9825f; }
.hero { padding: 5rem 0 6rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); max-width: 9em; }
.hero p.lead { max-width: 30em; font-size: 1.05rem; }
.hero .actions { margin-top: 1.6rem; }
.section { padding: 3.5rem 0; }
.section h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

/* Category chips and book grid */
.chips { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.4rem 0; }
.chip { background: var(--paper); color: var(--ink); padding: .45em 1em; border-radius: 999px; text-decoration: none; font-size: .92rem; border: 1px solid transparent; }
.chip:hover, .chip.on { background: var(--gold); }
.panel { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 1.4rem; }
.panel.center { text-align: center; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1.2rem; }
.book-card { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.book-card h3 { font-size: 1.12rem; margin: .4rem 0 0; }
.book-card h3 a { color: inherit; text-decoration: none; }
.book-card .author { color: var(--muted); font-size: .9rem; margin: 0; }
.book-card .price { font-weight: 700; margin: 0; }
.book-card .actions { margin-top: auto; padding-top: .5rem; }
.tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; background: var(--sage); padding: .2em .6em; border-radius: 6px; }
.cover { aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem;
    background: linear-gradient(160deg, hsl(var(--h, 20) 38% 34%), hsl(var(--h, 20) 42% 20%)); color: #fff; font: 500 1.05rem var(--display); box-shadow: inset 6px 0 0 rgba(0, 0, 0, .18); }
.cover.image { padding: 0; background: var(--sage); box-shadow: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }

/* "Why The Bookies?" */
.sage { background: var(--sage); }
.reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.reasons > div { border-top: 1px solid #b9bfae; padding-top: 1.2rem; }
.reasons .icon { width: 42px; height: 42px; border-radius: 50%; background: #d3d9c2; display: grid; place-items: center; margin-bottom: 1rem; }
.reasons h3 { font-size: 1.15rem; }

/* Book club panel */
.club { display: grid; grid-template-columns: 1.4fr 1fr; border-radius: 22px; overflow: hidden; background: var(--forest); color: #fff; }
.club .text { padding: 2.6rem; }
.club .eyebrow { color: var(--gold); }
.club .art { background: var(--moss); display: grid; place-items: center; min-height: 220px; }
.club .art div { width: 150px; height: 150px; border-radius: 50%; background: #6f8a6c; position: relative; }
.club .art div::before, .club .art div::after { content: ""; position: absolute; width: 86px; height: 112px; background: #f3e7c6; border-radius: 10px; top: 20px; box-shadow: 0 6px 14px rgba(0, 0, 0, .2); }
.club .art div::before { left: 2px; transform: rotate(-16deg); }
.club .art div::after { right: 2px; transform: rotate(10deg); background: #efe0b6; }
@media (max-width: 700px) { .club { grid-template-columns: 1fr; } }

.riddle summary { cursor: pointer; font-weight: 700; margin-top: .6rem; }

/* Footer */
.site-footer { padding: 2rem 0; border-top: 1px solid rgba(255, 255, 255, .25); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.site-footer a { color: #fff; }
.site-footer .logo { color: #fff; font-size: 1.2rem; }

/* Inner pages */
.page { padding: 2.5rem 0 4rem; min-height: 60vh; }
.page h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.narrow { max-width: 620px; }
.two-col { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.qty { width: 4.5em !important; }
.status { display: inline-block; font-size: .78rem; font-weight: 700; padding: .25em .7em; border-radius: 999px; white-space: nowrap; }
.status.InProgress { background: #f6e3b4; color: #6b4a00; }
.status.ReadyForPickup { background: #cfe3f5; color: #154a75; }
.status.Completed { background: #d2e8d8; color: #1f5a37; }
.status.Cancelled { background: #e9e2e0; color: #6b5a57; }
.steps { list-style: none; padding: 0; margin: 1.2rem 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.steps li { flex: 1 1 140px; padding: .7rem; border-radius: 10px; background: var(--sage); color: var(--muted); font-size: .9rem; }
.steps li.done { background: var(--forest); color: #fff; }

/* Preview dialog */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(760px, 94vw); max-height: 90vh; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(8, 12, 24, .75); }
dialog header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); }
dialog header h2 { font-size: 1.2rem; margin: 0; }
.preview-pages { padding: 1.2rem; display: grid; gap: 1rem; justify-items: center; }
.preview-pages canvas { max-width: 100%; height: auto; box-shadow: 0 2px 12px rgba(0, 0, 0, .18); background: #fff; }

/* Staff workspace */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin aside { background: var(--forest); color: #fff; padding: 1.2rem 1rem; }
.admin aside .logo { color: #fff; display: block; margin-bottom: 1.4rem; }
.admin aside nav { display: grid; gap: .15rem; }
.admin aside nav a { color: #fff; text-decoration: none; padding: .5rem .7rem; border-radius: 8px; display: flex; justify-content: space-between; }
.admin aside nav a:hover, .admin aside nav a.active { background: rgba(255, 255, 255, .14); }
.admin aside .who { margin-top: 1.6rem; font-size: .88rem; border-top: 1px solid rgba(255, 255, 255, .25); padding-top: 1rem; }
.admin aside .who a, .admin aside .who button { color: #fff; }
.admin main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 4rem; min-width: 0; }
.admin h1 { font-size: 1.9rem; }
.admin .panel { border: 1px solid var(--line); margin-bottom: 1.2rem; }
.badge { background: var(--gold); color: var(--ink); border-radius: 999px; padding: 0 .55em; font-size: .8rem; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.cards .panel { margin: 0; }
.cards .big { font: 500 2.1rem var(--display); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--terracotta); text-decoration: underline; cursor: pointer; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.head h1 { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
@media (max-width: 760px) { .admin { grid-template-columns: 1fr; } .admin aside nav { grid-template-columns: repeat(2, 1fr); } }

/* Staff sign-in (keeps the design's "staff page" look) */
.staff-gate { min-height: 100vh; display: grid; place-items: center; padding: 2rem 0; }
.staff-gate .box { width: min(440px, 100% - 32px); }
.staff-gate .panel { margin-top: 1.2rem; }
.password-row { position: relative; }
.password-row button { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); }
.book-card > a { text-decoration: none; }
