/* =============================================================================
   site.css — Watercolors & Whimsy
   Visual direction adapted from the Claude Design "book-faithful" mockup:
   deep dark page, warm cream paper for art, watercolor accents pulled from the
   paintings, Inter for UI, EB Garamond for italic kicker text.
   ============================================================================= */

:root {
    --bg:           #0d0d0e;
    --bg-soft:      #18181a;
    --bg-page:      #1a1a1c;
    --paper:        #f5f1e8;        /* warm cream, used behind paintings */
    --ink:          #f3eee2;
    --ink-soft:     rgba(243, 238, 226, 0.72);
    --ink-dim:      rgba(243, 238, 226, 0.45);
    --line:         rgba(243, 238, 226, 0.14);
    --line-strong:  rgba(243, 238, 226, 0.30);

    /* Watercolor accents — the tweaks panel let users pick one; we settle on brick by default. */
    --brick: #b65a3e;
    --taxi:  #e3b23c;
    --sky:   #6ea3c4;
    --leaf:  #6f8c4d;
    --rose:  #c47a7a;
    --accent: var(--brick);

    --container-w: 1280px;
    --canvas-min:  80vh;            /* shared min-height for page-canvas (uniform navigation) */
    --canvas-min-mobile: 70vh;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
html { scroll-behavior: smooth; }
a { color: inherit; }

h1, h2, h3, h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.04;
    margin: 0;
}

.serif { font-family: 'EB Garamond', Georgia, serif; }
.kicker {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--ink-soft);
    font-size: 18px;
}

.display {
    font-family: 'Inter', sans-serif;
    font-weight: 200;
    letter-spacing: -0.025em;
    line-height: 0.96;
}
.display--xl { font-size: clamp(48px, 8vw, 96px); }
.display--lg { font-size: clamp(40px, 6vw, 72px); }
.display--md { font-size: clamp(28px, 4vw, 44px); }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-dim);
}

.limerick {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink);
}

/* ============ Layout primitives ================================== */

.section { padding: 120px 6vw; position: relative; }
.section--page { background: var(--bg-page); }
.section--tight { padding: 80px 6vw; }

.container { max-width: var(--container-w); margin: 0 auto; }

.rule { height: 1px; background: var(--line); border: 0; }
.dot {
    display: inline-block; width: 4px; height: 4px;
    background: var(--ink-dim); border-radius: 50%;
    vertical-align: middle; margin: 0 10px;
}

/* ============ Buttons ============================================ */

.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 26px;
    font-family: inherit; font-size: 14px; font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 999px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--bg);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--ink); background: rgba(243, 238, 226, 0.04); }

.btn--accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
}
.btn--accent:hover { filter: brightness(1.08); }

.btn--small { padding: 10px 18px; font-size: 13px; }

/* ============ Forms ============================================== */

input[type="email"],
input[type="text"],
input[type="password"],
input[type="search"],
textarea {
    font-family: inherit;
    font-size: 15px;
    padding: 14px 18px;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink);
    outline: none;
    width: 100%;
}
textarea {
    border-radius: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
}
input::placeholder, textarea::placeholder { color: var(--ink-dim); }
input:focus, textarea:focus { border-color: var(--ink); }

label {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.field { margin-bottom: 16px; }
.field-error { color: #d97a6c; font-size: 13px; margin-top: 6px; }

/* Password eye toggle (added by site.js) */
.pwd-wrap {
    position: relative;
    display: block;
    width: 100%;
}
.pwd-wrap input { padding-right: 50px; }
.pwd-eye {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--ink-dim);
    padding: 6px;
    line-height: 0;
    border-radius: 50%;
    transition: color 0.15s ease;
}
.pwd-eye:hover  { color: var(--ink); }
.pwd-eye:focus  { outline: none; color: var(--ink); }

/* ============ Art frames ========================================= */

.art-frame {
    background: var(--bg);      /* dark mat behind paintings (replaces former cream) */
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
}
.art-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;        /* paintings vary in aspect — keep them whole, don't crop */
    background: var(--bg);
}
.art-frame--cover img { object-fit: cover; }

/* Homepage hero variant — caps the cover at 75% of viewport height and lets
   the painting drive its own width so portrait covers don't dominate the row. */
.art-frame--hero-cover {
    max-height: 75vh;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
}
.art-frame--hero-cover img {
    width: auto;
    height: auto;
    max-height: 75vh;
    max-width: 100%;
}
.art-frame--soft::after {
    content: '';
    position: absolute; inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.06);
}

/* ============ Page canvas (uniform spread height) ================ */

.page-canvas {
    min-height: var(--canvas-min);
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 6vh 4vw;
    display: grid;
    gap: 4vw;
    align-items: center;
}
.page-canvas--image-left,
.page-canvas--image-right { grid-template-columns: 1fr 1fr; }
.page-canvas--image-right .pc-art   { order: 2; }
.page-canvas--image-right .pc-text  { order: 1; }
.page-canvas--image-top,
.page-canvas--image-bottom { grid-template-rows: 55% auto; }
.page-canvas--image-bottom .pc-art  { order: 2; }
.page-canvas--image-bottom .pc-text { order: 1; }

.page-canvas--image-full {
    position: relative;
    grid-template-columns: 1fr;
    padding: 0;
    min-height: var(--canvas-min);
}
.page-canvas--image-full .pc-art { position: absolute; inset: 0; }
.page-canvas--image-full .pc-art img { object-fit: cover; }
.page-canvas--image-full .pc-text {
    position: relative; z-index: 2;
    align-self: end;
    margin: 6vh 4vw;
    background: rgba(13, 13, 14, 0.78);
    padding: 26px 28px;
    max-width: 520px;
    backdrop-filter: blur(6px);
}

.pc-art    { display: flex; align-items: center; justify-content: center; min-height: 0; }
.pc-art .art-frame {
    width: 100%;
    max-height: 88vh;
    aspect-ratio: auto;         /* let the painting drive its own size — no fixed 4:3 box */
    background: var(--bg);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.85);
}
.pc-art .art-frame img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 88vh;
    margin: 0 auto;
}
.pc-text   { display: flex; flex-direction: column; gap: 18px; }

/* ============ Cards ============================================== */

.card {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 18px;
    transition: border-color 0.2s ease, transform 0.25s ease;
}
.card:hover { border-color: var(--line-strong); }

.meet-card {
    display: flex;
    gap: 22px;
    align-items: center;
}
.meet-card__text { flex: 1 1 auto; min-width: 0; }
.meet-card__photo {
    flex: 0 0 auto;
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
@media (max-width: 540px) {
    .meet-card { flex-direction: column-reverse; align-items: stretch; gap: 16px; }
    .meet-card__photo { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

.product-card .art-frame {
    aspect-ratio: 4 / 5;
    transition: transform 0.3s ease;
}
.product-card:hover .art-frame { transform: translateY(-4px); }
.product-card .pc-meta { margin-top: 14px; }
.product-card .pc-meta .name { font-size: 16px; font-weight: 500; color: var(--ink); }
.product-card .pc-meta .meta { font-size: 13px; color: var(--ink-dim); margin-top: 4px; }
.product-card .pc-meta .price { font-size: 14px; color: var(--ink-soft); margin-top: 8px; }

/* ============ Page grid (the spread index) ======================= */

.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}
.page-tile {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.page-tile .art-frame { aspect-ratio: 4 / 3; }
.page-tile .num {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 15px;
    color: var(--ink-dim);
}
.page-tile .title { font-size: 17px; font-weight: 400; color: var(--ink); }
.page-tile:hover .art-frame { transform: translateY(-3px); transition: transform 0.25s ease; }

/* ============ Env banner (staging / local) ======================= */
.env-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    color: var(--bg);
    pointer-events: none;
}
.env-banner--local   { background: #b65a3e; }
.env-banner--staging { background: #e3b23c; color: #1a1a1c; }
body.has-env-banner  { padding-top: 28px; }
body.has-env-banner .site-nav { top: 28px; }

/* ============ Site nav =========================================== */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(13, 13, 14, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-nav__inner {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 18px 4vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.site-nav__brand {
    text-decoration: none;
    color: var(--ink);
    font-weight: 500;
    letter-spacing: -0.01em;
    font-size: 17px;
}
.site-nav__brand small {
    display: block;
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 13px;
    color: var(--ink-dim);
    letter-spacing: 0;
}
.site-nav__links {
    display: flex;
    gap: 28px;
    align-items: center;
}
.site-nav__links a {
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 14px;
    transition: color 0.2s ease;
}
.site-nav__links a:hover { color: var(--ink); }
.site-nav__actions { display: flex; gap: 10px; align-items: center; }

/* Hamburger toggle — hidden on desktop, shown on mobile in the breakpoint block */
.nav-hamburger {
    display: none;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    gap: 4px;
}
.nav-hamburger span {
    display: block;
    width: 18px; height: 1.5px;
    background: var(--ink-soft);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Legacy pill (kept for any other callers); icon buttons replace it in nav. */
.cart-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}
.cart-pill .count {
    display: inline-grid; place-items: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--paper);
    font-size: 11px;
    font-weight: 500;
}

/* Icon-only nav action (sign in / cart / account avatar) */
.nav-icon {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: transparent;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.nav-icon:hover { color: var(--ink); border-color: var(--ink); }
.nav-icon__badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    display: inline-grid; place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: var(--paper);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}
.nav-icon__badge--empty { display: none; }
.nav-icon--avatar {
    background: var(--bg-soft, #18181a);
    color: var(--ink);
}
.nav-icon--avatar .avatar-initials {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink);
}

/* ============ Footer ============================================= */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 60px 6vw 40px;
    background: var(--bg-soft);
}
.site-footer__inner {
    max-width: var(--container-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}
.site-footer h4 {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-dim);
    margin-bottom: 14px;
}
.site-footer a {
    color: var(--ink-soft);
    text-decoration: none;
    display: block;
    padding: 4px 0;
    font-size: 14px;
}
.site-footer a:hover { color: var(--ink); }
.site-footer__legal {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--ink-dim);
    font-size: 12px;
    letter-spacing: 0.02em;
    display: flex;
    justify-content: space-between;
}

/* ============ Flash messages ===================================== */

.flash {
    max-width: var(--container-w);
    margin: 16px auto;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--line-strong);
}
.flash--success { border-color: rgba(111, 140, 77, 0.5); color: #c8d8a3; }
.flash--error   { border-color: rgba(217, 122, 108, 0.5); color: #f0b8b1; }
.flash--info    { border-color: var(--line-strong); color: var(--ink-soft); }

/* ============ Toast (transient confirmation) ===================== */

.toast {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--bg);
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0.02em;
    z-index: 200;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    animation: fade 0.3s;
}

/* ============ Like button ======================================== */

.like-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: color 0.2s, border-color 0.2s;
}
.like-btn:hover { color: var(--ink); border-color: var(--ink); }
.like-btn--liked { color: var(--accent); border-color: var(--accent); }
.like-btn[disabled] { cursor: default; opacity: 0.85; }

/* ============ Inline page nav (prev / like / scene-anchor / next) === */
.page-nav-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 12px 4vw 28px;
    max-width: var(--container-w);
    margin: 0 auto;
}
.page-nav-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 44px; height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.page-nav-btn:hover { color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.page-nav-btn--ghost { opacity: 0.25; pointer-events: none; }
.page-nav-btn.like-btn { padding: 0 16px; }

/* ============ Back-to-top floating button ========================= */
.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(13, 13, 14, 0.78);
    color: var(--ink-soft);
    backdrop-filter: blur(6px);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    z-index: 150;
}
.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.back-to-top:hover {
    color: var(--ink);
    border-color: var(--ink);
}
@media (max-width: 720px) {
    .back-to-top { right: 14px; bottom: 14px; }
}

/* ============ Scene section (map + photo upload, side by side) ==== */
.scene-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}
.scene-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px 24px;
}
.scene-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
@media (max-width: 720px) {
    .scene-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ============ Paper grain (atmosphere) =========================== */

body.grain::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    z-index: 1;
    mix-blend-mode: overlay;
}

/* ============ Animations ========================================= */

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }
.fade-up { animation: fadeUp 0.7s cubic-bezier(.2, .7, .2, 1) both; }

/* ============ Modal / drawer (cart, account) ===================== */

.scrim {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(440px, 92vw);
    background: var(--bg-soft);
    border-left: 1px solid var(--line);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(.2, .7, .2, 1);
    display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head {
    padding: 22px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
}
.drawer__body { padding: 22px; flex: 1; overflow-y: auto; }
.drawer__foot { padding: 22px; border-top: 1px solid var(--line); }

.modal {
    position: fixed; inset: 0;
    z-index: 110;
    display: none;
    align-items: center; justify-content: center;
    padding: 4vw;
}
.modal.is-open { display: flex; }
.modal__panel {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    width: min(440px, 100%);
    padding: 32px;
}

/* ============ Admin ============================================== */

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.admin-side {
    background: var(--bg-soft);
    border-right: 1px solid var(--line);
    padding: 24px 18px;
}
.admin-side h1 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 24px;
}
.admin-side a {
    display: block;
    padding: 10px 14px;
    color: var(--ink-soft);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 4px;
}
.admin-side a:hover { background: rgba(243, 238, 226, 0.04); color: var(--ink); }
.admin-side a.is-active { background: rgba(243, 238, 226, 0.08); color: var(--ink); }
.admin-main { padding: 32px 5vw; }

/* ============ Account dashboard cards ============================ */
.account-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.account-card {
    display: block;
    text-decoration: none;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px 24px;
    transition: border-color 0.2s ease, transform 0.15s ease;
}
.account-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.account-card__primary {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.account-card__unit {
    font-size: 13px;
    color: var(--ink-dim);
    font-weight: 400;
    letter-spacing: 0;
}
.account-card__meta {
    margin: 0 0 14px;
    color: var(--ink-soft);
    font-size: 13px;
}
.account-card__cta {
    margin: 0;
    color: var(--ink-dim);
    font-size: 13px;
}
.account-card:hover .account-card__cta { color: var(--ink); }
@media (max-width: 540px) {
    .account-cards { grid-template-columns: 1fr; gap: 12px; }
}

/* Status pills (account dashboards, my-limericks/photos/orders pages) */
.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    background: transparent;
}
.status-pill--approved   { color: #c8d8a3; border-color: rgba(111, 140, 77, 0.5); }
.status-pill--pending    { color: var(--accent); border-color: var(--accent); }
.status-pill--rejected   { color: #f0b8b1; border-color: rgba(217, 122, 108, 0.5); }
.status-pill--paid,
.status-pill--fulfilled  { color: #c8d8a3; border-color: rgba(111, 140, 77, 0.5); }
.status-pill--cancelled,
.status-pill--refunded   { color: var(--ink-dim); border-color: var(--line); }

/* ============ Page-level layout helpers (responsive) ============= */

.home-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6vw;
    align-items: center;
}
.home-book {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6vw;
    align-items: center;
}
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6vw;
    align-items: start;
}
.product-detail__hero { aspect-ratio: 4 / 5; }
.product-buy-row { display: flex; gap: 12px; align-items: end; }
.product-buy-row__qty { flex: 0 0 100px; }

.cart-list { border-top: 1px solid var(--line); }
.cart-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 120px 80px;
    gap: 18px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.cart-row__img { aspect-ratio: 1 / 1; }
.cart-row__price  { text-align: right; color: var(--ink-soft); }
.cart-row__remove { text-align: right; }

/* ============ Mobile breakpoint ================================== */

@media (max-width: 900px) {
    .section { padding: 80px 5vw; }
    .page-canvas {
        min-height: var(--canvas-min-mobile);
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
    }
    .page-canvas .pc-art { order: 1 !important; }
    .page-canvas .pc-text { order: 2 !important; }
    .pc-art .art-frame { aspect-ratio: auto; max-height: 60vh; }
    .pc-art .art-frame img { max-height: 60vh; }

    .site-footer__inner { grid-template-columns: 1fr; }
    .site-footer__legal { flex-direction: column; gap: 8px; text-align: center; }

    .admin-shell { grid-template-columns: 1fr; }
    .admin-side {
        position: sticky; top: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 14px 4vw;
    }
    .admin-side a { display: inline-block; margin-right: 6px; }

    /* --- Mobile nav: hamburger + slide-down panel --- */
    .nav-hamburger { display: inline-flex; }
    .site-nav__inner { position: relative; flex-wrap: wrap; }
    .site-nav__actions { order: 2; margin-left: auto; }
    .nav-hamburger { order: 3; margin-left: 8px; }
    .site-nav__links {
        order: 4;
        position: absolute;
        top: 100%; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg-soft);
        border-top: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.25s ease, opacity 0.2s ease;
    }
    .site-nav__links.is-open {
        max-height: 60vh;
        opacity: 1;
    }
    .site-nav__links a {
        padding: 16px 6vw;
        border-bottom: 1px solid var(--line);
        font-size: 15px;
    }
    .site-nav__links a:last-child { border-bottom: 0; }

    /* --- Two-column page layouts collapse --- */
    .home-hero,
    .home-book,
    .product-detail { grid-template-columns: 1fr; gap: 32px; }
}

/* ============ Narrow-phone breakpoint ============================ */

@media (max-width: 540px) {
    .section { padding: 60px 5vw; }

    /* Page-tile grid: shrink the minimum so cards don't overflow */
    .page-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }

    /* Product page buy row: stack qty above the add-to-cart button */
    .product-buy-row { flex-direction: column; align-items: stretch; }
    .product-buy-row__qty { flex: 0 0 auto; width: 100%; }
    .product-buy-row .btn { width: 100%; }
    .product-detail__hero { aspect-ratio: 4 / 5; max-height: 70vh; }

    /* Cart row: stack into a card layout */
    .cart-row {
        grid-template-columns: 60px 1fr;
        grid-template-areas:
            "img name"
            "img qty"
            "price price"
            "remove remove";
        column-gap: 14px;
        row-gap: 8px;
    }
    .cart-row__img    { grid-area: img; align-self: start; }
    .cart-row__name   { grid-area: name; }
    .cart-row__qty    { grid-area: qty; justify-self: start; width: 80px; }
    .cart-row__price  { grid-area: price; text-align: left; }
    .cart-row__remove { grid-area: remove; text-align: left; }

    /* Reader limericks card grid: tighten so cards don't overflow at 360px */
    .card { padding: 14px 16px; }

    /* Inline page nav: tighter spacing and slightly smaller buttons */
    .page-nav-inline { gap: 8px; padding: 10px 4vw 22px; }
    .page-nav-btn { min-width: 40px; height: 40px; padding: 0 10px; }

    /* Back-to-top: keep clear of the bottom of the screen */
    .back-to-top { right: 12px; bottom: 16px; }
}
