/* BQ Store — "Editorial Warm" (spec 2026-07-02-storefront-redesign-design).
   Modern DTC reskin: warm paper, Fraunces display + Inter UI, hairlines over shadows,
   one clay accent. Binding mobile requirements unchanged: usable at 375px, no
   horizontal scroll, 44px touch targets. */

:root {
    --paper: #FAF7F2;
    --panel: #FFFDF9;
    --ink: #1C1917;
    --muted: #78716C;
    --hairline: rgba(28, 25, 23, .12);
    --clay: #B4552D;
    --tint-junior: #F3E6DC;
    --tint-junior-hover: #EDDACB;
    --tint-senior: #E7EAE2;
    --tint-senior-hover: #DCE1D6;
    --gc-beginners-a: #4A7A5A; --gc-beginners-b: #2E5238;
    --gc-juniors-a: #B4552D;   --gc-juniors-b: #7D3B1F;
    --gc-intermediate-a: #6B5B8E; --gc-intermediate-b: #463A66;
    --gc-experienced-a: #3E5C76;  --gc-experienced-b: #27394A;
    --radius: 10px;
    --radius-sm: 8px;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

.store-boot { padding: 4rem 1rem; text-align: center; color: var(--muted); }

/* ---- Type + link primitives ---- */
.store-microlabel {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
}

a { color: var(--clay); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }

/* ---- Buttons (ink fill / hairline ghost; 44px touch) ---- */
.store-btn, .store-btn-ghost {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: .55rem 1.4rem;
    font-family: var(--font-ui); font-size: 14px; font-weight: 500;
    border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.store-btn { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.store-btn:hover { background: #33302B; color: #fff; text-decoration: none; }
.store-btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--hairline); }
.store-btn-ghost:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

/* ---- Header / footer ---- */
.store-header {
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
    position: sticky; top: 0; z-index: 100;
}
.store-header nav { min-height: 72px; }
.store-brand {
    font-family: var(--font-display); font-size: 1.35rem; font-weight: 600;
    color: var(--ink); letter-spacing: -.01em;
}
.store-brand:hover { text-decoration: none; color: var(--ink); }
.store-main { min-height: 70vh; padding-bottom: 4rem; }
.store-footer { border-top: 1px solid var(--hairline); }

/* ---- Hero ---- */
.store-hero { padding: 3rem 0 1.5rem; gap: 1rem; }
.store-hero-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(36px, 6vw, 56px); letter-spacing: -.02em; line-height: 1.05; margin: 0;
}
.store-hero-subtitle { color: var(--muted); font-size: 1.05rem; margin: .75rem 0 0; }
.store-seller-about { max-width: 640px; margin: .75rem 0 0; color: var(--muted); }

/* ---- Section sub-nav (quizmaster area) ---- */
.store-subnav { display: flex; flex-wrap: wrap; gap: .25rem; }
.store-subnav-link {
    font-family: var(--font-ui); font-size: 14px; font-weight: 500;
    color: var(--muted); padding: .4rem .75rem; border-radius: var(--radius-sm);
    text-decoration: none; white-space: nowrap;
}
.store-subnav-link:hover { color: var(--ink); text-decoration: none; }
.store-subnav-link.active { color: var(--ink); background: var(--hairline); }

/* ---- Filter toolbar (unboxed: hairlines on the paper) ---- */
.store-filters {
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: 1.1rem 0; margin-bottom: 1.5rem;
}
.store-filters .form-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .12em; color: var(--muted);
}
.store-filters .form-control, .store-filters .form-select {
    background: var(--panel); border: 1px solid var(--hairline);
    border-radius: var(--radius-sm); min-height: 44px;
    font-family: var(--font-ui); font-size: 14px; color: var(--ink);
}
.store-filters .form-control:focus, .store-filters .form-select:focus {
    border-color: var(--ink); box-shadow: none;
}
.store-filters .btn-link { color: var(--clay); font-size: 13px; min-height: 44px; }
@media (max-width: 767.98px) {
    .store-filters { display: none; }
    .store-filters.open { display: block; }
}

/* ---- Cards ("book covers") ---- */
.store-card {
    position: relative;
    background: var(--panel); border: 1px solid var(--hairline);
    border-radius: var(--radius); overflow: hidden; cursor: pointer;
    display: flex; flex-direction: column;
    transition: border-color .15s ease;
}
.store-card:hover { border-color: rgba(28, 25, 23, .28); }
.store-card:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; }
.store-cover {
    height: 140px; display: flex; align-items: center; justify-content: center;
    transition: background-color .15s ease;
}
/* Uploaded cover photos fill the tile edge-to-edge. */
.store-cover-photo { padding: 0; }
.store-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Generated "designed" covers — set-keyed gradient + dot pattern + title. */
.store-gencover { position: relative; overflow: hidden; flex-direction: column; }
.store-gencover::before {
    content: ""; position: absolute; inset: 0; opacity: .12; pointer-events: none;
    background-image: radial-gradient(circle at 20% 30%, #fff 2px, transparent 2px),
        radial-gradient(circle at 70% 60%, #fff 2px, transparent 2px),
        radial-gradient(circle at 45% 85%, #fff 2px, transparent 2px);
    background-size: 60px 60px;
}
.store-gencover-beginners { background: linear-gradient(135deg, var(--gc-beginners-a), var(--gc-beginners-b)); }
.store-gencover-juniors { background: linear-gradient(135deg, var(--gc-juniors-a), var(--gc-juniors-b)); }
.store-gencover-intermediate { background: linear-gradient(135deg, var(--gc-intermediate-a), var(--gc-intermediate-b)); }
.store-gencover-experienced { background: linear-gradient(135deg, var(--gc-experienced-a), var(--gc-experienced-b)); }
.store-gencover-badge {
    position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .92);
    color: var(--ink); font-family: var(--font-ui); font-size: .6rem; font-weight: 700;
    letter-spacing: .08em; padding: 2px 10px; border-radius: 999px;
}
.store-gencover-center { text-align: center; padding: 0 18px; z-index: 1; }
.store-gencover-title {
    font-family: var(--font-display); font-weight: 600; font-size: 1.25rem;
    line-height: 1.2; color: #fff;
}
.store-gencover-meta {
    font-family: var(--font-ui); font-size: .6rem; letter-spacing: .14em;
    color: rgba(255, 255, 255, .75); margin-top: 6px;
}
.store-card-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .4rem; flex-grow: 1; }
.store-card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.25; margin: 0; }
.store-card:hover .store-card-title {
    text-decoration: underline; text-decoration-color: var(--clay); text-underline-offset: 3px;
}
.store-card-seller { font-size: .85rem; color: var(--muted); }
.store-price { font-family: var(--font-ui); font-weight: 600; font-size: 1rem; margin-top: auto; padding-top: .35rem; }

/* ---- States ---- */
.store-empty { padding: 4rem 0; text-align: center; }
.store-empty-title { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; margin-bottom: .5rem; }
.store-alert {
    display: flex; align-items: center; gap: 1rem;
    border: 1px solid var(--hairline); border-left: 3px solid var(--clay);
    background: var(--panel); border-radius: var(--radius-sm); padding: 1rem 1.25rem;
}

/* ---- Visitor intro (signed-out landing) ---- */
.store-hero-lede { max-width: 720px; }
.store-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: .5rem 0 1rem; }
@media (max-width: 767.98px) { .store-how { grid-template-columns: 1fr; } }
.store-how-card {
    background: var(--panel); border: 1px solid var(--hairline);
    border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.store-how-step {
    font-family: var(--font-ui); font-weight: 600; font-size: .8rem;
    color: var(--clay); margin-bottom: .35rem;
}
.store-how-title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin: 0 0 .3rem; }
.store-how-text { color: var(--muted); font-size: .95rem; margin: 0; }
.store-how-paths { color: var(--muted); margin: 0 0 1.5rem; }

/* ---- Detail (editorial article) ---- */
.store-page-narrow { max-width: 860px; }
.store-backlink { color: var(--muted); font-size: .9rem; }
.store-backlink:hover { color: var(--ink); }
.store-article { padding: 1rem 0 2rem; }
.store-article-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(30px, 5vw, 42px); letter-spacing: -.02em; line-height: 1.1;
    margin: .4rem 0 .6rem;
}
.store-byline { color: var(--muted); font-size: .95rem; }
.store-byline-meta { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; margin-left: .5rem; }
.store-article-price { font-family: var(--font-ui); font-weight: 600; font-size: 1.75rem; margin: 1rem 0; }
.store-article-desc { max-width: 65ch; font-size: 1.02rem; }
.store-statband {
    display: flex; flex-wrap: wrap;
    border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
    margin: 1.75rem 0 1rem;
}
.store-stat { flex: 1 1 120px; min-width: 110px; padding: 1rem 1.25rem; border-right: 1px solid var(--hairline); }
.store-stat:last-child { border-right: none; }
.store-stat-value { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; line-height: 1.1; }
.store-coverage { color: var(--muted); margin-bottom: 1.5rem; }
.store-section-title { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 1.5rem 0 .5rem; }
.store-section-count { color: var(--muted); font-family: var(--font-ui); font-size: .9rem; font-weight: 400; }
.store-quiz-list { list-style: none; margin: 0; padding: 0; }
.store-quiz-list li {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .7rem 0; border-bottom: 1px solid var(--hairline);
}
.store-quiz-count { color: var(--muted); font-size: .9rem; white-space: nowrap; }

/* ---- Help drawer ---- */
.store-help-trigger {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--hairline); background: var(--panel);
    color: var(--muted); font-family: var(--font-ui); font-weight: 600; font-size: 1.05rem;
    cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.store-help-trigger:hover { border-color: var(--ink); color: var(--ink); }
.store-help-backdrop { position: fixed; inset: 0; background: rgba(28, 25, 23, .4); z-index: 1040; }
.store-help-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(420px, 100vw); background: var(--paper); z-index: 1050;
    display: flex; flex-direction: column; border-left: 1px solid var(--hairline);
}
.store-help-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--hairline);
}
.store-help-title { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin: 0; }
.store-help-body { padding: 1.1rem 1.4rem; overflow-y: auto; font-size: .95rem; }
.store-help-body h1, .store-help-body h2, .store-help-body h3 { font-family: var(--font-display); font-weight: 600; }

/* ---- Auth / commerce forms ---- */
.store-form { max-width: 420px; padding: 1rem 0 3rem; }
.store-form .form-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .12em; color: var(--muted);
}
.store-form .form-control {
    background: var(--panel); border: 1px solid var(--hairline);
    border-radius: var(--radius-sm); min-height: 44px;
    font-family: var(--font-ui); font-size: 14px; color: var(--ink);
}
.store-form .form-control:focus { border-color: var(--ink); box-shadow: none; }
.store-nav-link { color: var(--ink); font-size: .95rem; }

.store-cart-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; margin-left: .35rem; padding: 0 5px;
    border-radius: 999px; background: var(--clay); color: #fff;
    font-size: 11px; font-weight: 600; vertical-align: text-top;
}

.store-nav-signout { background: none; border: none; padding: 0; color: var(--muted); font-size: .95rem; cursor: pointer; }
.store-nav-signout:hover { color: var(--ink); text-decoration: underline; }

.store-purchase-ended { opacity: .55; }
.store-list-selected { background: #f2ede4; border-radius: 4px; }
.store-owned-chip {
    position: absolute; top: .5rem; right: .5rem;
    background: #1a1a1a; color: #fff; font-size: .7rem; letter-spacing: .05em;
    text-transform: uppercase; padding: .15rem .5rem; border-radius: 3px; z-index: 1;
}

/* Owned-pack consumption (3b) */
.store-owned-link { color: var(--ink); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--hairline); }
.store-owned-link:hover { color: var(--clay); border-bottom-color: var(--clay); }
.store-update-chip { display: inline-block; padding: 1px 8px; border: 1px solid var(--clay); border-radius: 999px; color: var(--clay); font-size: .78rem; }
.store-update-panel { border: 1px solid var(--hairline); background: var(--panel); padding: 12px 16px; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.store-owned-question { border-bottom: 1px solid var(--hairline); padding: 12px 0; }
.store-owned-q { margin: 0 0 4px; }
.store-owned-a { margin: 0 0 4px; color: var(--muted); }
.store-owned-verse { margin: 0 0 2px; font-size: .85rem; color: var(--muted); }
.store-error { color: var(--clay); margin-top: 8px; }

/* ---- Blazor unhandled-error banner (hidden until the runtime shows it) ---- */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0; bottom: 0; width: 100%;
    z-index: 1000;
    background: var(--panel);
    border-top: 1px solid var(--hairline);
    padding: .6rem 1.25rem .7rem;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem; top: .5rem;
}
