/* Port of chpl-shop visual language — tokens only, not business logic.
   Palette: #444 / #666 / #ccc / dodgerblue / rgb(22,119,184)
   Fonts: Sigmar One, Exo 2, Ubuntu Condensed
*/

:root {
    --ws-ink: #636b6f;
    --ws-header: #444;
    --ws-muted: #bbb;
    --ws-chip: #444;
    --ws-chip-text: #ccc;
    --ws-grid: #f5f5f5;
    --ws-card-border: rgba(102, 102, 102, 0.51);
    --ws-title: #0066cc;
    --ws-title-sub: #3880ea;
    --ws-buy: rgba(22, 119, 184, 0.91);
    --ws-buy-border: dodgerblue;
    --font-display: 'Sigmar One', cursive;
    --font-card: 'Exo 2', sans-serif;
    --font-ui: 'Ubuntu Condensed', sans-serif;
}

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

html,
body {
    margin: 0;
    padding: 0;
    color: var(--ws-ink);
    background: #fff;
    font-family: Prompt, 'Exo 2', system-ui, sans-serif;
    font-weight: 300;
    line-height: 1.45;
}

a {
    color: dodgerblue;
    text-decoration: none;
}
a:hover {
    color: #71aaff;
}

.topnav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: #222;
    color: #ddd;
    font-family: var(--font-ui);
    font-size: 1rem;
}
.topnav a {
    color: #eee;
}
.topnav .sep {
    opacity: 0.4;
}

.un_flex {
    display: flex;
}
.un_flex_hs {
    flex-direction: row;
    align-items: stretch;
}
.un_flex_wrap {
    flex-wrap: wrap;
}
.un_flex_vt {
    flex-direction: column;
}

.ws_title {
    background: var(--ws-header);
    color: var(--ws-muted);
    letter-spacing: 0.8px;
    font-size: 1.4rem;
    padding: 0.8rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
}
.ws_brand {
    flex: 1 1 16rem;
    text-align: center;
}
.ws_title h1 {
    margin: 0.2rem auto 0.5rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    background: linear-gradient(180deg, #fff 0%, #9ecfff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 0 rgba(30, 144, 255, 0.35);
}
.ws_title h1 a {
    color: dodgerblue;
    text-shadow: none;
    -webkit-text-fill-color: dodgerblue;
    margin-right: 0.35rem;
}
.ws_title p {
    margin: 0.2rem;
    font-family: var(--font-ui);
    font-size: 90%;
}
/* Stack both lines in one grid cell so hover never changes header height. */
.ws_hoverswitch {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 2.6em;
    line-height: 1.3;
}
.ws_hoverswitch .normal,
.ws_hoverswitch .hover {
    grid-area: 1 / 1;
}
.ws_hoverswitch .hover {
    visibility: hidden;
    color: #fff;
}
.ws_hoverswitch:hover .normal {
    visibility: hidden;
}
.ws_hoverswitch:hover .hover {
    visibility: visible;
}

.ws_filters {
    flex: 2 1 20rem;
    text-align: center;
    align-content: center;
}

.ws_btn_filter_3 {
    display: inline-block;
    margin: 0.2rem !important;
    height: 2.9rem;
    min-height: 2.9rem;
    padding: 0.15rem 0.7rem !important;
    border-radius: 2px;
    box-shadow:
        inset 1px 1px 10px rgba(0, 0, 0, 0.859),
        1px 1px 3px #330;
    text-decoration: none;
    background: var(--ws-chip);
    color: var(--ws-chip-text) !important;
    font-family: var(--font-ui);
    font-size: 1.05rem;
    line-height: 2.5rem;
    vertical-align: middle;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}
.ws_btn_filter_3:hover,
.ws_btn_filter_3.is-active {
    background: #555;
    color: #fff !important;
    transform: translateY(-1px);
}

.ws_cart_wrap {
    flex: 0 1 12rem;
    position: relative;
    align-content: center;
    text-align: center;
}
.cart_total {
    display: inline-block;
    background: #999;
    padding: 0.45rem 1rem;
    border: 2px solid #666;
    border-radius: 5px;
    color: #fff !important;
    font-family: var(--font-ui);
    font-size: 1.25rem;
    cursor: pointer;
}
.cart_total:hover {
    background: #777;
    color: #ddd !important;
}
.cart_total.ws_shadow_0 {
    border-bottom: 2px solid red;
}
.cart_total.ws_shadow_1 {
    border-bottom: 2px solid darkorange;
}
.cart_total.ws_shadow_2 {
    border-bottom: 2px solid lawngreen;
}
.cart_drawer {
    /* Native CSS popover: light-dismiss on outside click / Escape */
    width: min(20rem, 90vw);
    margin: 0;
    inset: unset;
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    z-index: 40;
    background: #fff;
    color: #333;
    border: 2px solid #666;
    border-radius: 6px;
    padding: 0.8rem 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    text-align: left;
    font-family: var(--font-card);
}
.cart_drawer:popover-open {
    display: block;
}
.ws_cart_wrap.floating .cart_drawer {
    top: auto;
    bottom: 4.5rem;
    right: 1rem;
}
.cart_popover_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.cart_popover_head h3 {
    margin: 0;
}
.cart_popover_close {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
}
.cart_drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cart_drawer li {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}
.cart_drawer button {
    border: 0;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: #932;
}
.cart_alerts {
    margin: 0.6rem 0 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.cart_alert {
    margin: 0;
    padding: 0.55rem 0.65rem;
    background: #fff8e6;
    border-left: 4px solid #d4a017;
    color: #444;
    font-size: 0.88rem;
    line-height: 1.35;
}
.cart_alert[data-alert='mixed_media'] {
    background: #fff4e8;
    border-left-color: #c45c26;
}
.cart_alert[data-alert='patronite'] {
    background: #eef7ff;
    border-left-color: #2a6db0;
}
.cart_alert[data-alert='already_owned'] {
    background: #f3f7f3;
    border-left-color: #3a7a3a;
}
.cart_checkout {
    display: block;
    width: 100%;
    margin-top: 0.65rem;
    text-align: center;
    background: #2a6;
    color: #fff !important;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 1rem;
    cursor: pointer;
}
.cart_checkout:hover {
    background: #195;
    color: #fff !important;
}
.cart_checkout:disabled {
    opacity: 0.7;
    cursor: wait;
}
.ws_cart_wrap.floating {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
}

.ws_notice_micro {
    width: min(70%, 48rem);
    margin: 1.5rem auto;
    padding: 0.8rem 1rem;
    background: #eef6ff;
    border-left: 4px solid dodgerblue;
    font-family: var(--font-ui);
    color: #444;
}
.ws_notice_micro.info {
    background: #f0f7ff;
}

body > h2,
h2[id] {
    position: relative;
    background: #444;
    color: #fff;
    width: 100%;
    max-width: 100%;
    margin: 2rem auto;
    padding: 2.2rem 1rem;
    text-align: center;
    font-weight: 900;
    font-family: var(--font-card);
    text-wrap: balance;
}
h2 span {
    display: block;
    font-size: 60%;
    color: #aaa;
    font-weight: 400;
    margin-top: 0.5rem;
}
h2 span.next {
    position: absolute;
    bottom: 6px;
    right: 10px;
    margin: 0;
    font-size: 70%;
}
h2 span.next a {
    color: dodgerblue;
}
h2 span.next a:hover {
    color: #eee;
}

.segment_universal {
    background: var(--ws-grid);
    padding: 1rem;
    margin: 0 auto 1rem;
    justify-content: center;
    gap: 0.5rem;
}
.segment_universal.compact {
    background: transparent;
    gap: 0.75rem;
}

.mb_simplebox {
    margin: 1rem;
    background: #fff !important;
    border: 2px solid var(--ws-card-border);
    border-radius: 4px;
    width: 40%;
    max-width: 36rem !important;
    min-width: min(20rem, 92vw);
    box-shadow:
        1px 1px 10px rgba(0, 0, 0, 0.259),
        1px 1px 6px rgba(30, 30, 0, 0.259);
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.mb_simplebox:hover {
    transform: translateY(-3px);
    box-shadow: 2px 8px 18px rgba(0, 0, 0, 0.22);
}
.mb_cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem;
    min-width: 8rem;
}
.mb_thumb img {
    width: 7rem !important;
    height: 10rem !important;
    object-fit: cover;
    margin: 0.1rem auto;
    display: block;
}
.mb_body {
    flex: 1;
    padding: 0.6rem 0.8rem 0.8rem;
}
.mb_simplebox h3 {
    text-align: center;
    font: 700 1.2rem var(--font-card);
    color: var(--ws-title);
    margin: 0.3rem 0;
}
.mb_simplebox h3 a {
    color: inherit;
}
.mb_simplebox h3 span {
    display: block;
    font-size: 80%;
    color: var(--ws-title-sub);
    font-weight: 400;
}
.mb_simplebox p {
    font: 400 1rem var(--font-card);
    color: #555;
    text-align: justify;
    margin: 0.3rem 0;
}
.mb_simplebox .links {
    text-align: center;
}
.mb_simplebox .links a {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.5rem 1rem;
    color: #fff !important;
    border: 2px solid dodgerblue;
    background: var(--ws-buy);
    font-family: var(--font-ui);
}

.badge-presale {
    display: inline-block;
    background: #932;
    color: #fff !important;
    font-family: var(--font-ui);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-size: 0.85rem !important;
}

.edition-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin: 0.4rem 0;
}
.edition-badge {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    padding: 0.15rem 0.45rem;
    border: 1px solid #666;
    border-radius: 2px;
    background: #eee;
    color: #222;
    opacity: 1;
}
.edition-badge.edition-production,
.purchase_button.edition-production {
    opacity: 0.5;
}
.edition-badge.edition-hidden {
    display: none;
}

.view-toggle {
    display: inline-flex;
    gap: 0.15rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* List view: one compact line per book */
.catalog-list {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    background: #fff;
}
.catalog-list .mb_simplebox {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0.25rem 0;
    flex-direction: row !important;
    align-items: center;
    padding: 0.35rem 0.6rem;
    box-shadow: none;
    border-width: 1px;
}
.catalog-list .mb_cover {
    flex-direction: row;
    align-items: center;
    min-width: auto;
    padding: 0.2rem;
    gap: 0.5rem;
}
.catalog-list .mb_thumb img {
    width: 2.2rem !important;
    height: 3.1rem !important;
}
.catalog-list .purch_buttons {
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0;
    width: auto;
}
.catalog-list .take-label {
    display: none;
}
.catalog-list .medium-buttons {
    flex-direction: row;
    flex-wrap: wrap;
}
.catalog-list .purchase_button {
    width: auto;
    padding: 0.2rem 0.45rem;
    font-size: 0.9rem;
}
.catalog-list .mb_body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.2rem 0.5rem;
    flex: 1;
}
.catalog-list .mb_body p:not(.badge-presale),
.catalog-list .edition-badges,
.catalog-list .links {
    display: none;
}
.catalog-list .mb_body h3 {
    margin: 0;
    text-align: left;
    font-size: 1rem;
}
.catalog-list .mb_body h3 span {
    display: inline;
    font-size: 85%;
    margin-left: 0.35rem;
}

.purch_buttons {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    margin-top: 0.4rem;
}
.take-label {
    margin: 0.2rem 0 0;
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 700;
    color: #222;
    text-align: center;
}
.medium-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}
.purchase_button {
    display: block;
    width: 100%;
    border: 2px solid var(--ws-buy-border);
    border-radius: 3px;
    background: var(--ws-buy);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 1.05rem;
    padding: 0.45rem 0.4rem;
    cursor: pointer;
    text-align: center;
    transition:
        background 0.15s ease,
        transform 0.15s ease;
}
.purchase_button:hover {
    background: dodgerblue;
    transform: scale(1.02);
}
.purchase_button.cta-where {
    background: #636261;
    border-color: #4a4948;
}
.purchase_button.cta-speed {
    background: #6b3a5a;
    border-color: #4a2740;
}
.purchase_button.cta-notify {
    background: #1a4a6e;
    border-color: #0f2f47;
}
.purchase_button.cta-notify:hover {
    background: #245f8c;
}
.purchase_button.publisher {
    background: #855c9a !important;
    border-color: #6b457c;
}
.purchase_button .mediumtype,
.purchase_button .price {
    display: block;
    font-size: 75%;
    opacity: 0.95;
}

.box_product {
    display: inline-block;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 0.7rem 1rem;
    margin: 0.3rem;
    font-family: var(--font-card);
    font-weight: 700;
    color: #0066cc !important;
    box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease;
}
.box_product:hover {
    transform: translateY(-2px);
}
.box_product.publisher {
    color: #855c9a !important;
}

.ws_info_bottom {
    max-width: 48rem;
    margin: 3rem auto;
    padding: 1.5rem;
    background: #efefef;
    font-family: var(--font-card);
}
.ws_info_bottom h3 {
    font-family: var(--font-display);
    color: #222;
    text-align: center;
}

.tip_page {
    max-width: 28rem;
    margin: 2.5rem auto;
    padding: 0 1rem 3rem;
    font-family: var(--font-card);
}
.tip_page h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin: 0 0 0.75rem;
}
.tip_lead {
    color: #444;
    line-height: 1.45;
    margin: 0 0 1.5rem;
}
.tip_form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.tip_form fieldset {
    border: 1px solid #ddd;
    padding: 1rem;
    margin: 0;
}
.tip_form legend {
    font-family: var(--font-ui);
    font-weight: 700;
    padding: 0 0.35rem;
}
.tip_presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}
.tip_preset {
    font-family: var(--font-ui);
    border: 1px solid #333;
    background: #fff;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
}
.tip_preset.is-active {
    background: #222;
    color: #fff;
}
.tip_form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
}
.tip_form input {
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid #bbb;
}
.tip_error {
    color: #a00;
    margin: 0;
}
.tip_note {
    margin-top: 1.25rem;
    font-size: 0.9rem;
}
.tip_submit {
    width: 100%;
}

.site_footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem 2rem;
    justify-content: space-around;
    background: #333;
    color: #ccc;
    padding: 2rem 1.25rem 2.5rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    line-height: 1.45;
}
.site_footer > div {
    flex: 1 1 14rem;
    max-width: 22rem;
}
.site_footer a {
    color: #9ecfff;
}
.site_footer strong {
    color: #fff;
    display: block;
    margin: 0.85rem 0 0.35rem;
}
.site_footer strong:first-child {
    margin-top: 0;
}
.site_footer_brand p {
    margin: 0.35rem 0;
}
.site_footer .muted,
.site_footer .muted a {
    color: #999;
    font-size: 0.85rem;
}

.product_page {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 56rem;
    margin: 2rem auto;
    padding: 1rem;
    font-family: var(--font-card);
}
.product_cover {
    width: 14rem;
    height: 20rem;
    object-fit: cover;
    border: 2px solid #ccc;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.2);
}
.product_page h1 {
    font-family: var(--font-display);
    color: #222;
    margin-top: 0;
}
.price_big {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0066cc;
}
.muted,
.empty {
    color: #888;
    font-family: var(--font-ui);
    padding: 1rem;
}

@media (max-width: 720px) {
    .mb_simplebox {
        width: 100%;
        max-width: 100% !important;
        flex-direction: column !important;
    }
    .ws_title {
        flex-direction: column;
    }
    body > h2,
    h2[id] {
        padding: 1.4rem 0.6rem 2rem;
        font-size: 1.25rem;
    }
    h2 span.next {
        position: static;
        display: block;
        margin-top: 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
