/* KromeWeb — theme-agnostic base layer.
   Per-theme colour tokens, hero/collection/story/testimonial/CTA patterns, and the
   article-page opaque-header coupling live in per-theme sheets:
     - css/theme-fotokrome.css
     - css/theme-motion.css
   Which one applies is gated by the `.theme-{key}` class `WebLayout.razor` puts on `.kw-site`.

   Note on `.fk-*` names: `.fk-container`, `.fk-btn*`, `.fk-section*`, `.fk-section-title*`,
   and the `.fk-product*` grid primitives are SHARED across themes (MotionHeader + every
   CMS block component depend on them). The legacy `fk-` prefix is kept to avoid rippling
   a rename into seeded HTML + Blocks + Motion; treat them as design-system primitives,
   not Fotokrome-only. */

:root {
    --kw-dark: #131313;
    --kw-light: #FFFFFF;
    --kw-accent: #2F4044;          /* default accent; per-theme sheets may override */
    --kw-accent-deep: #213B47;
    --kw-accent-soft: #586C76;
    --kw-text: #131313;
    --kw-text-muted: #868C8D;
    --kw-border-strong: #BCC6C9;
    --kw-border: rgba(19,19,19,0.12);
    --kw-font: 'Roboto', system-ui, -apple-system, sans-serif;
    --kw-max-width: 1280px;
    --kw-transition: 0.3s ease;
}

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

body {
    font-family: var(--kw-font);
    color: var(--kw-text);
    background: var(--kw-light);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

.kw-site { min-height: 100vh; display: flex; flex-direction: column; }
.kw-content { flex: 1; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--kw-font);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--kw-text);
}
h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p { line-height: 1.7; color: var(--kw-text); }

a { color: inherit; text-decoration: none; transition: color var(--kw-transition); }
a:hover { color: var(--kw-accent); }

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

/* Shared primitives (used by Motion + every CMS block) */
.fk-container { max-width: var(--kw-max-width); margin: 0 auto; padding: 0 2rem; }

.fk-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 1rem 2rem; border: none; border-radius: 0;
    font-family: var(--kw-font); font-size: 0.875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    cursor: pointer; transition: all var(--kw-transition);
    text-decoration: none;
}
.fk-btn-accent { background: var(--kw-accent); color: var(--kw-light); }
.fk-btn-accent:hover { background: var(--kw-accent-deep); color: var(--kw-light); }
.fk-btn-dark { background: var(--kw-dark); color: var(--kw-light); }
.fk-btn-dark:hover { background: #333; color: var(--kw-light); }
.fk-btn-outline { background: transparent; border: 2px solid var(--kw-light); color: var(--kw-light); }
.fk-btn-outline:hover { background: var(--kw-light); color: var(--kw-dark); }

.fk-section { padding: 5rem 0; }
.fk-section-dark { background: var(--kw-dark); color: var(--kw-light); }
.fk-section-dark h2, .fk-section-dark h3, .fk-section-dark p { color: var(--kw-light); }
.fk-section-title {
    font-size: 0.875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.15em;
    margin-bottom: 3rem; color: var(--kw-text-muted);
}
.fk-section-title-light { color: rgba(255,255,255,0.6); }

/* Products grid primitives (used by ProductGridBlock / FeaturedProductsBlock etc.) */
.fk-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.fk-product-card { cursor: pointer; }
.fk-product-image {
    aspect-ratio: 4/3; overflow: hidden;
    background: #f5f5f5; margin-bottom: 1rem;
}
.fk-product-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--kw-transition);
}
.fk-product-card:hover .fk-product-image img { transform: scale(1.03); }
.fk-product-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
}
.fk-product-info h3 {
    font-size: 1rem; font-weight: 600;
    margin-bottom: 0.25rem; letter-spacing: 0;
}
.fk-product-category {
    display: block; font-size: 0.75rem;
    color: var(--kw-text-muted);
    text-transform: uppercase; letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}
.fk-product-price {
    display: block; font-size: 1rem; font-weight: 600;
    color: var(--kw-accent);
}
.fk-section-dark .fk-product-info h3 { color: var(--kw-light); }
.fk-section-dark .fk-product-placeholder { background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%); }

/* 404 */
.not-found { text-align: center; padding: 6rem 2rem; }
.not-found h1 { font-size: 8rem; color: var(--kw-text-muted); font-weight: 800; }
.not-found p { font-size: 1.25rem; color: var(--kw-text-muted); }

/* CMS article pages (policies, legal, long-form text).
   Editorial column: Fraunces display serif for titles + headings against Roboto body,
   eyebrow label + accent rule instead of a plain border, diamond list markers,
   and a highlighter-style link treatment for inline references.
   Generous top padding clears the fixed header. The header-opaque-lock pattern
   is theme-specific (it depends on the active theme's header class) and lives
   in each theme's sheet. */
/* ── Responsive visibility utilities ──────────────────────────────────────
   Set on a .kw-block by the page renderer when the editor's per-block
   ResponsiveVisibility is non-zero. Single-breakpoint logic at 768px. */
@media (max-width: 767.98px) {
    .kw-block.kw-hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
    .kw-block.kw-hide-desktop { display: none !important; }
}

.kw-page--article {
    background: var(--kw-light);
    padding: 9rem 1.5rem 5rem;
    --kw-font-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
}
.kw-article {
    max-width: 720px;
    margin: 0 auto;
    color: var(--kw-text);
}
.kw-article .kw-block + .kw-block { margin-top: 1.5rem; }

.kw-article .kw-block-heading {
    font-family: var(--kw-font-display);
    font-size: clamp(2.25rem, 3.8vw, 3.25rem);
    font-weight: 500;
    font-optical-sizing: auto;
    font-variation-settings: "opsz" 144, "SOFT" 50;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin: 0;
    color: var(--kw-text);
}
.kw-article h1.kw-block-heading {
    position: relative;
    padding-bottom: 2rem;
    margin-bottom: 2.25rem;
    border: none;
}
.kw-article h1.kw-block-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 3.5rem;
    height: 2px;
    background: var(--kw-accent);
}

/* Optional eyebrow text emitted by HeadingBlock when the block config sets `eyebrow`.
   Appears above the main heading in small-caps accent — signals document type
   (e.g. "POLICIES", "JOURNAL", "GUIDES") without imposing a label on every article. */
.kw-article .kw-heading-eyebrow {
    display: block;
    font-family: var(--kw-font);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    color: var(--kw-accent);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
}

.kw-article .kw-block-richtext {
    font-size: 1.0625rem;
    line-height: 1.78;
    color: var(--kw-text);
}
.kw-article .kw-block-richtext > div {
    max-width: none !important;
    margin: 0 !important;
}
.kw-article .kw-block-richtext h2 {
    font-family: var(--kw-font-display);
    font-size: 1.625rem;
    font-weight: 500;
    font-optical-sizing: auto;
    font-variation-settings: "opsz" 60;
    letter-spacing: -0.005em;
    line-height: 1.25;
    margin: 2.75rem 0 0.75rem;
    color: var(--kw-text);
}
.kw-article .kw-block-richtext h3 {
    font-family: var(--kw-font-display);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.003em;
    margin: 1.75rem 0 0.5rem;
}
.kw-article .kw-block-richtext p {
    margin-bottom: 1.15rem;
    color: var(--kw-text);
}

/* "Last updated …" lead line — the seed places it in the first paragraph's <em>.
   Treat it as a dateline: uppercase small-caps, accent rule on the left. */
.kw-article .kw-block-richtext > div > p:first-child {
    margin-bottom: 2rem;
}
.kw-article .kw-block-richtext > div > p:first-child > em:first-child {
    display: inline-block;
    font-style: normal;
    font-family: var(--kw-font);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--kw-text-muted);
    border-left: 2px solid var(--kw-accent);
    padding: 0.05rem 0 0.05rem 0.8rem;
}

/* Lists with diamond markers in accent colour. */
.kw-article .kw-block-richtext ul,
.kw-article .kw-block-richtext ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}
.kw-article .kw-block-richtext ul { list-style: none; padding-left: 1.75rem; }
.kw-article .kw-block-richtext ul > li {
    position: relative;
    margin-bottom: 0.6rem;
    line-height: 1.7;
}
.kw-article .kw-block-richtext ul > li::before {
    content: "";
    position: absolute;
    left: -1.25rem;
    top: 0.72em;
    width: 6px;
    height: 6px;
    background: var(--kw-accent);
    transform: rotate(45deg);
}
.kw-article .kw-block-richtext ol > li { margin-bottom: 0.6rem; }

/* Highlighter-style inline links — a thick low underline that fills on hover.
   Feels curated without looking like a raw <u>. */
.kw-article .kw-block-richtext a {
    color: var(--kw-text);
    text-decoration: none;
    background-image: linear-gradient(
        transparent 65%,
        color-mix(in srgb, var(--kw-accent) 22%, transparent) 65%
    );
    background-size: 100% 100%;
    padding: 0 2px;
    transition: background-image var(--kw-transition), color var(--kw-transition);
}
.kw-article .kw-block-richtext a:hover {
    color: var(--kw-accent-deep);
    background-image: linear-gradient(
        transparent 0%,
        color-mix(in srgb, var(--kw-accent) 28%, transparent) 0%
    );
}
.kw-article .kw-block-richtext em { font-style: italic; color: var(--kw-text); }
.kw-article .kw-block-richtext strong { font-weight: 700; }

@media (max-width: 640px) {
    .kw-page--article { padding: 7rem 1.25rem 3rem; }
    .kw-article .kw-block-heading { font-size: 1.75rem; }
    .kw-article .kw-block-richtext { font-size: 1rem; }
    .kw-article .kw-block-richtext h2 { font-size: 1.25rem; }
}

/* Responsive — shared primitives only */
@media (max-width: 768px) {
    .fk-container { padding: 0 1.25rem; }
    .fk-section { padding: 3rem 0; }
    .fk-products-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
