/* =========================================================================
   NicheMerch shared theme for chat.nichemerch.shop
   Mirrors the Dawn-based nichemerch.shop theme: Archivo/Work Sans,
   #121212 on white, #f3f3f3 cards, square corners, magenta/cyan hover.
   Theme rem values are translated ×10 to px (Dawn uses html{font-size:62.5%}).
   ========================================================================= */

/* --- Fonts (self-hosted; CSP font-src 'self') --- */
@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/archivo-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Work Sans';
    font-style: normal;
    font-weight: 100 900; /* variable font */
    font-display: swap;
    src: url('../fonts/work-sans.woff2') format('woff2');
}

/* --- Design tokens --- */
:root {
    --color-foreground-solid: #121212;
    --color-foreground: rgba(18, 18, 18, 0.75);
    --color-background: #ffffff;
    --color-surface: #f3f3f3;          /* card / secondary surface (theme bg-2) */
    --color-hairline: rgba(18, 18, 18, 0.08);
    --color-border: rgba(18, 18, 18, 0.55);
    --color-muted: rgba(18, 18, 18, 0.55);
    --color-accent-2: #334fb4;         /* theme accent-2 */
    --nm-magenta: #ff00ff;
    --nm-cyan: #00ffff;
    --font-heading: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ease-lift: cubic-bezier(0, 0, 0.3, 1);

    /* Legacy aliases (pre-restyle variable names still referenced in page CSS) */
    --primary-accent: #121212;
    --secondary-accent: #334fb4;
    --background-color: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f3f3;
    --gray-200: rgba(18, 18, 18, 0.08);
    --gray-300: rgba(18, 18, 18, 0.55);
    --gray-400: rgba(18, 18, 18, 0.55);
    --gray-600: rgba(18, 18, 18, 0.75);
    --gray-800: #121212;
    --border-radius: 0;
    --shadow: none;
    --shadow-md: none;
}

/* --- Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-foreground);
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.3px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-foreground-solid);
    letter-spacing: 0.7px;
    line-height: 1.27;
}

strong, b {
    font-weight: 700;
}

::selection {
    background: var(--nm-magenta);
    color: #fff;
}

:focus-visible {
    outline: 2px solid rgba(18, 18, 18, 0.5);
    outline-offset: 2px;
}

/* --- Layout --- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 60vh;
}

.page-width {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Announcement bar --- */
.announcement-bar {
    background: var(--color-foreground-solid);
    color: #ffffff;
    text-align: center;
    font-size: 13px;
    letter-spacing: 1px;
    min-height: 38px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.announcement-bar__slide {
    display: none;
    animation: announcement-fade 300ms ease;
}

.announcement-bar__slide.active {
    display: block;
}

.announcement-bar__slide a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.announcement-bar__slide a:hover {
    text-decoration-color: var(--nm-magenta);
    text-decoration-thickness: 2px;
}

@keyframes announcement-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Header --- */
header.site-header {
    text-align: center;
    padding: 18px 0 14px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--color-hairline);
}

.header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.header-logo a {
    display: block;
    text-decoration: none;
}

.header-logo-img {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    display: block;
}

@media (prefers-reduced-motion: no-preference) {
    .header-logo-img {
        transition: filter 150ms ease;
    }
    .header-logo a:hover .header-logo-img {
        filter: drop-shadow(2px 0 0 var(--nm-magenta)) drop-shadow(-2px 0 0 var(--nm-cyan));
    }
}

@media (max-width: 480px) {
    .header-logo-img { max-height: 75px; }
}

@media (max-width: 360px) {
    .header-logo-img { max-height: 65px; }
}

/* --- Buttons --- */
.button,
.nm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-foreground-solid);
    color: #ffffff;
    border: 1px solid var(--color-foreground-solid);
    border-radius: 0;
    min-height: 45px;
    padding: 0 30px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.button:hover,
.nm-button:hover {
    box-shadow: 3px 0 0 -1px var(--nm-magenta), -3px 0 0 -1px var(--nm-cyan);
}

.button--secondary,
.nm-button--secondary {
    background: var(--color-background);
    color: var(--color-foreground-solid);
    border: 1px solid var(--color-border);
}

.button:disabled,
.nm-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .button:hover:not(:disabled),
    .nm-button:hover:not(:disabled) {
        transform: translateY(-2px);
    }
}

/* --- Inputs --- */
.nm-input,
input.nm-input,
textarea.nm-input {
    border: 1px solid var(--color-border);
    border-radius: 0;
    background: var(--color-background);
    color: var(--color-foreground-solid);
    font-family: var(--font-body);
    font-size: 16px;
    padding: 12px 16px;
    outline: none;
}

.nm-input::placeholder {
    color: var(--color-muted);
}

.nm-input:focus {
    border-color: var(--color-foreground-solid);
    box-shadow: 0 0 0 1px var(--color-foreground-solid);
}

/* --- Links --- */
.nm-link,
.footer-links a {
    color: var(--color-foreground);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: text-decoration-thickness 100ms ease, color 100ms ease;
}

.nm-link:hover,
.footer-links a:hover {
    color: var(--color-foreground-solid);
    text-decoration-color: var(--nm-magenta);
    text-decoration-thickness: 2px;
}

/* --- Cards (the theme's signature product-card treatment) --- */
.nm-card {
    background: var(--color-surface);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.nm-card img,
.nm-card .nm-card__media img {
    mix-blend-mode: multiply;
    border-radius: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .nm-card--lift {
        transition: transform 300ms var(--ease-lift);
    }
    .nm-card--lift:hover {
        transform: translateY(-7px);
    }
}

/* --- Section headers --- */
.section-header {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 26px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--color-foreground-solid);
    letter-spacing: 0.7px;
    line-height: 1.27;
}

@media (max-width: 640px) {
    .section-header {
        font-size: 22px;
        margin-bottom: 20px;
    }
}

/* --- FAQ accordion --- */
.faq-section-container {
    margin-bottom: 40px;
    margin-top: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    border-top: 1px solid var(--color-hairline);
    padding-top: 40px;
}

.faq-section {
    margin-bottom: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.faq-item {
    border-bottom: 1px solid var(--color-hairline);
    padding: 15px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    color: var(--color-foreground-solid);
    padding: 5px 0;
}

.faq-question:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--nm-magenta);
}

.faq-item-toggle {
    font-size: 22px;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-foreground-solid);
    margin-left: 10px;
    user-select: none;
    min-width: 25px;
    text-align: center;
}

.faq-answer {
    margin-top: 10px;
    padding: 5px 0 10px;
    color: var(--color-foreground);
    font-size: 15px;
    line-height: 1.6;
    animation: slideDown 0.3s ease-out;
}

.faq-answer a {
    color: var(--color-foreground);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.faq-answer a:hover {
    color: var(--color-foreground-solid);
    text-decoration-color: var(--nm-magenta);
    text-decoration-thickness: 2px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

@media (max-width: 640px) {
    .faq-section-container {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
    .faq-answer {
        font-size: 14px;
    }
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--color-hairline);
    padding: 30px 0;
    text-align: center;
    font-size: 13px;
    color: var(--color-foreground);
    background-color: var(--color-background);
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    margin: 0 10px;
    padding: 5px 0;
    display: inline-block;
}

.footer-copy {
    margin-top: 15px;
    color: var(--color-muted);
}

/* --- Sale badge + prices (mirrors the store's $35 compare-at → $29.99) --- */
.sale-badge {
    display: inline-block;
    background: var(--color-accent-2);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 40px;
    text-transform: none;
}

.nm-card__badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1;
}

.price-compare {
    text-decoration: line-through;
    color: var(--color-muted);
    font-weight: 400;
}

/* --- Spinner --- */
.nm-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-hairline);
    border-top-color: var(--color-foreground-solid);
    border-radius: 50%;
    animation: nm-spin 0.8s linear infinite;
}

@keyframes nm-spin {
    to { transform: rotate(360deg); }
}
