/*
 * Aurora — a "magical sky" theme for NimbusCMS.
 *
 * One stylesheet, no build step, no external assets (system fonts, CSS-only
 * motifs) so it loads under the strict same-origin CSP. Deep-indigo night grounds
 * carry the chrome; content and products sit on light "moonlit parchment" for
 * readability. The accent is an aurora gradient (teal -> violet -> rose) used
 * sparingly — on the wordmark, link underlines, the hero glow, and card hovers.
 */

:root {
    /* Night grounds (chrome) */
    --night:      #0b1020;
    --night-2:    #141a33;
    --night-line: #26304f;

    /* Moonlit parchment (content) */
    --parchment:  #f7f5ef;
    --panel:      #fffefb;
    --ink:        #1a1d2e;
    --ink-soft:   #55596e;
    --hairline:   #e6e2d6;

    /* Aurora accent + starlight gold */
    --aurora-1:   #4fd1c5;  /* teal   */
    --aurora-2:   #8b7bf0;  /* violet */
    --aurora-3:   #f0709e;  /* rose   */
    --gold:       #d9b26a;
    --aurora:     linear-gradient(100deg, var(--aurora-1), var(--aurora-2) 55%, var(--aurora-3));

    /* Text on night */
    --on-night:      #eef0fb;
    --on-night-soft: #aab2d6;

    /* Semantic (availability) */
    --ok:   #2f9e7f;
    --warn: #c98a2b;
    --muted:#8b8fa3;

    --measure: 68ch;
    --radius:  14px;
    --shadow:  0 1px 2px rgba(11,16,32,.06), 0 8px 30px rgba(11,16,32,.08);

    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

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

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
p  { margin: 0 0 1rem; }

a { color: inherit; text-decoration: none; }

/* Links in prose get the aurora underline. */
.prose a, .entry-body a {
    background-image: var(--aurora);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 2px;
    padding-bottom: 1px;
}
.prose a:hover, .entry-body a:hover { background-size: 100% 100%; color: #fff; border-radius: 3px; padding: 0 .15em; }

:focus-visible { outline: 2px solid var(--aurora-2); outline-offset: 2px; border-radius: 4px; }

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

.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }
.measure { max-width: var(--measure); }

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 100;
    background: var(--night); color: var(--on-night); padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- night chrome */

.night {
    position: relative;
    background: var(--night);
    color: var(--on-night);
    overflow: hidden;
    isolation: isolate;
}
/* A faint starfield: two layers of tiny radial dots. */
.night::before {
    content: "";
    position: absolute; inset: 0; z-index: -2;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.5), transparent 50%),
        radial-gradient(1.5px 1.5px at 75% 20%, rgba(255,255,255,.35), transparent 50%),
        radial-gradient(1px 1px at 50% 70%, rgba(255,255,255,.5), transparent 50%),
        radial-gradient(1px 1px at 85% 65%, rgba(255,255,255,.3), transparent 50%),
        radial-gradient(1.5px 1.5px at 35% 85%, rgba(255,255,255,.4), transparent 50%);
    background-repeat: no-repeat;
}
/* The aurora: a soft luminous sweep low across the night. */
.night::after {
    content: "";
    position: absolute; left: -10%; right: -10%; bottom: -60%; height: 120%; z-index: -1;
    background:
        radial-gradient(60% 60% at 25% 40%, rgba(79,209,197,.30), transparent 70%),
        radial-gradient(55% 55% at 60% 55%, rgba(139,123,240,.32), transparent 70%),
        radial-gradient(50% 50% at 85% 45%, rgba(240,112,158,.24), transparent 70%);
    filter: blur(6px);
    pointer-events: none;
}

.site-header { border-bottom: 1px solid var(--night-line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.05rem; flex-wrap: wrap; }

.wordmark { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; color: var(--on-night); display: inline-flex; align-items: center; gap: .5rem; }
.wordmark .spark { background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }

.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a { color: var(--on-night-soft); padding: .5rem .7rem; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { color: var(--on-night); background: rgba(255,255,255,.06); }

.announcement { background: var(--night-2); color: var(--on-night); text-align: center; padding: .55rem 1rem; font-size: .92rem; border-bottom: 1px solid var(--night-line); }

/* Hero band (home + shop). */
.hero { padding-block: clamp(3rem, 2rem + 6vw, 6rem); }
.hero .kicker { color: var(--gold); text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700; margin: 0 0 .8rem; }
.hero h1 { color: var(--on-night); max-width: 18ch; }
.hero p { color: var(--on-night-soft); max-width: 46ch; font-size: 1.1rem; }
.hero .actions { margin-top: 1.5rem; display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 44px; padding: .6rem 1.15rem; border-radius: 999px;
    font: inherit; font-weight: 600; cursor: pointer; border: 1px solid transparent;
    text-decoration: none; transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary { background: var(--aurora); color: #0b1020; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(139,123,240,.4); }
.btn-ghost { background: transparent; color: var(--on-night); border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { border-color: var(--on-night); }
.btn-quiet { background: var(--panel); color: var(--ink); border-color: var(--hairline); }
.btn-quiet:hover { border-color: var(--gold); }

/* ---------------------------------------------------------------- content */

main { display: block; }
.section { padding-block: clamp(2.5rem, 1.8rem + 3vw, 4rem); }

.entry-body { font-size: 1.06rem; }
.entry-body > * { max-width: var(--measure); }
.entry-body img { max-width: 100%; border-radius: var(--radius); }
.kicker { color: var(--ink-soft); text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 700; margin: 0 0 .5rem; }
.hero-image { border-radius: var(--radius); width: 100%; }
.meta { color: var(--ink-soft); font-size: .9rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1.5rem; }
.card {
    background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); position: relative;
    transition: transform .14s ease, box-shadow .14s ease;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--aurora); opacity: 0; transition: opacity .14s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 34px rgba(11,16,32,.14); }
.card:hover::before { opacity: 1; }
.card-body { padding: 1rem 1.1rem 1.15rem; }
.card h3 { margin: 0 0 .35rem; font-size: 1.15rem; }
.card p { color: var(--ink-soft); margin: 0; font-size: .95rem; }

/* ---------------------------------------------------------------- storefront */

.shop-hero { padding-block: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); }
.shop-hero h1 { color: var(--on-night); margin: 0; }
.shop-hero p { color: var(--on-night-soft); margin: .4rem 0 0; }

.filters {
    display: flex; gap: .85rem; flex-wrap: wrap; align-items: flex-end;
    background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius);
    padding: 1rem; margin: -2.2rem auto 2rem; position: relative; box-shadow: var(--shadow);
}
.filters .field { flex: 1 1 12rem; display: flex; flex-direction: column; gap: .3rem; }
.filters label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.filters input, .filters select {
    font: inherit; padding: .6rem .7rem; min-height: 44px; border: 1px solid var(--hairline);
    border-radius: 10px; background: #fff; color: var(--ink);
}
.filters input:focus, .filters select:focus { border-color: var(--aurora-2); outline: none; box-shadow: 0 0 0 3px rgba(139,123,240,.18); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1.35rem; }
.product { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; transition: transform .14s ease, box-shadow .14s ease; }
.product::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--aurora); opacity: 0; transition: opacity .14s ease; }
.product:hover { transform: translateY(-3px); box-shadow: 0 10px 34px rgba(11,16,32,.14); }
.product:hover::before { opacity: 1; }
.product .thumb { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; background: linear-gradient(135deg, #eceaf1, #f4f1e8); }
.product .thumb-empty { display: grid; place-items: center; color: #c4c0d4; font-family: var(--serif); font-size: 2rem; }
.product-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.product-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.price .unit { color: var(--ink-soft); font-weight: 400; font-size: .9em; }

.pill { align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .12rem .5rem; border-radius: 999px; }
.pill.in_stock { color: var(--ok);   background: rgba(47,158,127,.12); }
.pill.low      { color: var(--warn); background: rgba(201,138,43,.14); }
.pill.out      { color: var(--muted);background: rgba(139,143,163,.14); }

.pager { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-top: 2.5rem; color: var(--ink-soft); }

.empty { text-align: center; color: var(--ink-soft); padding: 3.5rem 1rem; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
@media (min-width: 46rem) { .product-detail { grid-template-columns: 1fr 1fr; } }
.product-detail .media img, .product-detail .media .thumb-empty { width: 100%; border-radius: var(--radius); aspect-ratio: 1/1; object-fit: cover; }
.product-detail .thumb-empty { display: grid; place-items: center; background: linear-gradient(135deg, #eceaf1, #f4f1e8); color: #c4c0d4; font-family: var(--serif); font-size: 3rem; }
.product-detail .price { font-size: 1.6rem; }
.product-detail .desc { white-space: pre-line; color: var(--ink); max-width: 46ch; }
.back { display: inline-block; color: var(--ink-soft); margin-bottom: 1rem; }
.back:hover { color: var(--ink); }

/* ---------------------------------------------------------------- cart + checkout */

.nav-cart { color: var(--on-night) !important; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; }
.nav-cart:hover { border-color: var(--gold); background: rgba(255,255,255,.06); }

.add { margin-top: .5rem; display: flex; gap: .5rem; align-items: center; }
.add input[type=number] { width: 4.5rem; padding: .5rem; min-height: 44px; border: 1px solid var(--hairline); border-radius: 10px; font: inherit; }
.link-danger { background: none; border: 0; color: #c0392b; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.link-danger:hover { color: #e05545; }

.cart { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cart-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--hairline); }
.cart-row:last-child { border-bottom: 0; }
.cart-name { font-weight: 600; }
.cart-unit { color: var(--ink-soft); font-weight: 400; }
.cart-qty { display: flex; gap: .4rem; align-items: center; }
.cart-qty input { width: 4.5rem; padding: .5rem; min-height: 44px; border: 1px solid var(--hairline); border-radius: 10px; font: inherit; }
@media (max-width: 34rem) { .cart-row { grid-template-columns: 1fr auto; gap: .5rem 1rem; } .cart-qty { grid-column: 1 / -1; } }
.cart-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.cart-total { font-size: 1.2rem; margin: 0; }

.checkout-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 46rem) { .checkout-grid { grid-template-columns: 1fr 1fr; } }
.summary { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.25rem; }
.summary h2 { margin-top: 0; font-size: 1.15rem; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.summary-total { border-top: 1px solid var(--hairline); margin-top: .5rem; padding-top: .75rem; font-size: 1.05rem; }
.checkout-form .field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.checkout-form label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.checkout-form input { font: inherit; padding: .65rem .7rem; min-height: 44px; border: 1px solid var(--hairline); border-radius: 10px; background: #fff; }
.checkout-form input:focus { border-color: var(--aurora-2); outline: none; box-shadow: 0 0 0 3px rgba(139,123,240,.18); }

/* ---------------------------------------------------------------- flash + cart pill */

.flash { margin: 0 0 1.5rem; padding: .8rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--panel); box-shadow: var(--shadow); }
.flash a { text-decoration: underline; }
.flash-ok   { border-color: rgba(47,158,127,.4);  background: rgba(47,158,127,.08); }
.flash-warn { border-color: rgba(201,138,43,.45); background: rgba(201,138,43,.10); }

.nav-cart { display: inline-flex; align-items: center; gap: .45rem; padding-inline: .9rem; }
.nav-cart .count {
    display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem;
    border-radius: 999px; background: var(--gold); color: var(--night);
    font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
/* The badge starts hidden on cached content pages until the fetch fills it — the
   .count display rule above would otherwise beat the [hidden] user-agent default. */
.nav-cart .count[hidden] { display: none; }

.btn-sm { min-height: 38px; padding: .4rem .85rem; font-size: .9rem; }

/* The card you just added — a gold ring + a revealed aurora edge. */
.product.is-added { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.product.is-added::before { opacity: 1; }

/* ---------------------------------------------------------------- home landing */

.promise { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 40rem) { .promise { grid-template-columns: repeat(3, 1fr); } }
.promise-item { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.promise-label { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin: 0 0 .25rem; }
.promise-detail { color: var(--ink-soft); margin: 0; font-size: .95rem; }

.aisle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; margin-top: 1.5rem; }
.aisle {
    display: flex; flex-direction: column; gap: .2rem; position: relative;
    background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius);
    padding: 1.1rem 2.4rem 1.1rem 1.2rem; box-shadow: var(--shadow);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
a.aisle:hover { transform: translateY(-3px); box-shadow: 0 10px 34px rgba(11,16,32,.14); border-color: var(--gold); }
.aisle-label { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.aisle-detail { color: var(--ink-soft); font-size: .92rem; }
.aisle-go { position: absolute; top: 1.1rem; right: 1.2rem; color: var(--gold); font-weight: 700; }

/* Featured products row (ADR 0027 view-data) — live cards on the home. */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1rem; margin-top: 1.5rem; }
.featured-card {
    display: flex; flex-direction: column; gap: .35rem; position: relative;
    background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); padding-bottom: .9rem;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.featured-card:hover { transform: translateY(-3px); box-shadow: 0 10px 34px rgba(11,16,32,.14); border-color: var(--gold); }
.featured-card .thumb { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; background: linear-gradient(135deg, #eceaf1, #f4f1e8); margin-bottom: .5rem; }
.featured-card .thumb-empty { display: grid; place-items: center; color: #c4c0d4; font-family: var(--serif); font-size: 2rem; }
.featured-card .featured-name { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; padding-inline: .9rem; }
.featured-card .price, .featured-card .pill { margin-inline: .9rem; }
.featured-card .pill { align-self: flex-start; }

.home-about { background: var(--panel); border-block: 1px solid var(--hairline); }

.cta-band { text-align: center; }
.cta-band h2 { color: var(--on-night); }
.cta-band p { color: var(--on-night-soft); max-width: 50ch; margin-inline: auto; }
.cta-band .actions { display: flex; justify-content: center; margin-top: 1.5rem; }

/* ---------------------------------------------------------------- prose headings + lists */

.prose h2, .entry-body h2 { margin: 1.8rem 0 .6rem; }
.prose ul, .prose ol, .entry-body ul, .entry-body ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.prose li, .entry-body li { margin: .2rem 0; }

/* ---------------------------------------------------------------- cart extras */

/* Order confirmation receipt (ADR 0026 itemised order). */
.receipt { max-width: 34rem; background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); }
.receipt h2 { margin: 0 0 .75rem; font-size: 1.1rem; }
.receipt-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--hairline); }
.receipt-row:last-child { border-bottom: 0; }
.receipt-name { flex: 1; }
.receipt-qty { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.receipt-total { margin-top: .35rem; border-top: 1px solid var(--hairline); border-bottom: 0; padding-top: .75rem; font-size: 1.1rem; }

.cart-empty { text-align: center; padding: 3rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.cart-empty-mark { font-size: 2.6rem; margin: 0; }
.cart-each { display: block; color: var(--ink-soft); font-size: .82rem; font-weight: 400; }

/* ---------------------------------------------------------------- footer */

.site-footer { margin-top: 4rem; border-top: 2px solid transparent; border-image: var(--aurora) 1; }
.site-footer .inner { background: var(--night); color: var(--on-night-soft); }
.site-footer .foot-grid {
    padding-block: 2.5rem 1.5rem; display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1.5rem; flex-wrap: wrap;
}
.site-footer .foot-legal { padding-block: 0 2.2rem; border-top: 1px solid var(--night-line); padding-top: 1.2rem; }
.site-footer .foot-legal p { margin: 0; font-size: .9rem; }
.site-footer a { color: var(--on-night-soft); }
.site-footer a:hover { color: var(--on-night); }
.site-footer .foot-brand .wordmark { color: var(--on-night); }
.site-footer .foot-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
    .card, .product { transition: none; }
}
