/* ==========================================================================
   Curated — a product-directory Ghost theme inspired by curated.supply
   Single stylesheet, no build step.

   Contents
   0.  Design tokens
   1.  Reset & base
   2.  Navigation (incl. mobile dropdown / body.nav-open)
   3.  Home hero + status pill
   4.  Subscribe form (Ghost members states)
   5.  Filter bar (pills + sort select)
   6.  Product card
   7.  Product grid, feed & Show More
   8.  Page head (tag / author / blog headers)
   9.  Blog list
   10. Product post (hero, CTA slot, about, related)
   11. Blog post & static page
   12. Prose / .gh-content + Koenig cards
   13. Footer
   14. Error page
   15. Media queries (1024 / 768 / 640)
   16. Reduced motion
   ========================================================================== */


/* 0. Design tokens
   ========================================================================== */

:root {
    /* Color — white canvas, light-gray tiles (flat, minimal) */
    --color-bg: #ffffff;               /* page background, also fixed nav bg */
    --color-surface: #f5f5f5;          /* tiles, rows, pills */
    --color-surface-hover: #efefef;    /* tile/pill hover state */
    --color-surface-alt: #ffffff;      /* badges & icon circles sitting ON tiles */
    --color-text: #141414;             /* primary text */
    --color-text-secondary: #737373;   /* meta text, inactive nav/pills */
    --color-text-body: #666666;        /* long-form prose */
    --color-border: rgba(0, 0, 0, 0.08);

    /* Type — Inter via Google Fonts */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

    /* Radii */
    --radius-card: 12px;
    --radius-img: 8px;
    --radius-pill: 48px;

    /* Layout */
    --container-max: 1280px;           /* outer, incl. 16px side padding */
    --content-max: 1248px;             /* grid width */
    --narrow-max: 680px;               /* post/prose column */
    --gap: 16px;
    --nav-height: 72px;

    /* Shadows — the flat gray-on-white scheme barely needs them */
    --shadow-pill: none;
    --shadow-pill-strong: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 2px 10px rgba(0, 0, 0, 0.05);
}


/* 1. Reset & base
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--nav-height);
}

body {
    /* --gh-font-body/--gh-font-heading are injected by Ghost when a font is
       picked in Admin → Design; Geist stays the default otherwise. */
    font-family: var(--gh-font-body, var(--font-sans));
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--gh-font-heading, var(--font-sans));
}

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

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

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

ul,
ol {
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

.gh-viewport {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.gh-main {
    flex-grow: 1;
    padding-top: var(--nav-height); /* clear the fixed nav */
}


/* 2. Navigation
   ========================================================================== */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    background-color: var(--color-bg);
}

.site-nav-inner {
    position: relative; /* anchor for centered list + mobile dropdown */
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max);
    height: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

.site-nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-nav-logo img,
.site-nav-logo svg {
    display: block;
    height: 28px;
    width: auto;
}

/* Text fallback when no publication logo is uploaded */
.site-nav-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
    white-space: nowrap;
}

/* Desktop: link row centered absolutely in the bar */
.site-nav-list {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.site-nav-list a {
    display: inline-block;
    padding: 6px 14px;
    font-size: 14px;
    color: var(--color-text-secondary);
    border-radius: var(--radius-pill);
    transition: color 0.15s ease;
}

.site-nav-list a:hover {
    color: var(--color-text);
}

.site-nav-list li.nav-current a {
    background-color: var(--color-surface);
    color: var(--color-text);
}

/* Search + mobile toggle share the icon-circle look */
.site-nav-search,
.site-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background-color: var(--color-surface);
    border-radius: 50%;
    transition: box-shadow 0.15s ease;
}

.site-nav-search:hover,
.site-nav-toggle:hover {
    box-shadow: var(--shadow-card-hover);
}

.site-nav-search svg,
.site-nav-toggle svg {
    display: block;
    width: 15px;
    height: 15px;
}

/* Toggle: menu icon first, close icon second; swapped via body.nav-open */
.site-nav-toggle {
    display: none; /* shown < 768px */
}

.site-nav-toggle svg:last-child {
    display: none;
}

body.nav-open .site-nav-toggle svg:first-child {
    display: none;
}

body.nav-open .site-nav-toggle svg:last-child {
    display: block;
}


/* 3. Home hero
   ========================================================================== */

.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 560px;
    margin: 0 auto;
    padding: 96px 16px 56px;
    text-align: center;
}

.home-hero-title {
    margin-top: 20px;
    font-size: 40px;
    line-height: 44px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.home-hero-subtitle {
    max-width: 480px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.home-hero-form {
    width: 100%;
    max-width: 400px;
    margin-top: 24px;
}


/* 4. Subscribe form (Ghost members form)
   ========================================================================== */

.subscribe-form {
    position: relative; /* anchor for the error line */
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 16px;
    background-color: var(--color-surface);
    border-radius: var(--radius-pill);
}

.subscribe-form-input {
    flex-grow: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--color-text);
    outline: none;
}

.subscribe-form-input::placeholder {
    color: var(--color-text-secondary);
}

.subscribe-form-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 8px 16px;
    background-color: var(--color-text);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    transition: background-color 0.15s ease;
}

.subscribe-form-button:hover {
    background-color: #000000;
}

/* Button states — Ghost toggles .loading / .success / .error on the form */
.subscribe-form-button .loading,
.subscribe-form-button .success {
    display: none;
}

.subscribe-form.loading .subscribe-form-button .default,
.subscribe-form.success .subscribe-form-button .default {
    display: none;
}

.subscribe-form.loading .subscribe-form-button .loading {
    display: inline-flex;
}

.subscribe-form.success .subscribe-form-button .success {
    display: inline-flex;
}

.subscribe-form-button .loading svg {
    display: block;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
}

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

.subscribe-form-error {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 16px;
    font-size: 12px;
    color: #d14343;
}

.subscribe-form.error .subscribe-form-error {
    display: block;
}

.subscribe-form.success .subscribe-form-error {
    display: none;
}


/* 5. Filter bar
   ========================================================================== */

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin: 8px 0 24px;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    padding: 4px 2px; /* breathing room so pill shadows aren't clipped */
    /* hide scrollbars on the horizontally scrolling row */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 7px 14px 7px 10px;
    background-color: var(--color-surface);
    font-size: 14px;
    color: var(--color-text);
    white-space: nowrap;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-pill);
    transition: box-shadow 0.15s ease;
}

.filter-pill:hover {
    background-color: var(--color-surface-hover);
}

.filter-pill svg {
    display: block;
    width: 15px;
    height: 15px;
    color: var(--color-text-secondary);
}

.filter-pill-active,
.filter-pill-active:hover {
    background-color: var(--color-text);
    color: #ffffff;
}

.filter-pill-active svg {
    color: #ffffff;
}

.filter-sort {
    position: relative; /* anchor for chevron over the select */
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 14px;
}

.filter-sort label {
    color: var(--color-text-secondary);
}

.filter-sort-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    padding-right: 20px; /* room for the chevron */
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
}

.filter-sort > svg {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--color-text-secondary);
    pointer-events: none;
}


/* 6. Product card
   ========================================================================== */

/* PlatSupply-style card: gray image tile, info below on the white page */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 28px;
    background-color: var(--color-surface);
    border-radius: var(--radius-card);
    transition: background-color 0.2s ease;
}

.product-card-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-img);
}

.product-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.product-card-placeholder svg {
    width: 40px;
    height: 40px;
    color: #dcdcdc;
}

.product-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text-secondary);
    background-color: var(--color-surface-alt);
    border-radius: var(--radius-pill);
}

.product-card-arrow {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--color-surface-alt);
    border-radius: 50%;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.product-card-arrow svg {
    display: block;
    width: 15px;
    height: 15px;
    color: var(--color-text-secondary);
}

.product-card:hover .product-card-arrow {
    opacity: 1;
    transform: translateY(0);
}

/* Touch devices have no hover — keep the arrow visible */
@media (hover: none) {
    .product-card-arrow {
        opacity: 1;
        transform: none;
    }
}

.product-card-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 4px 0;
}

.product-card-meta {
    margin-bottom: 2px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.product-card-meta a {
    color: var(--color-text-secondary);
    transition: color 0.15s ease;
}

.product-card-meta a:hover {
    color: var(--color-text);
}

.product-card-meta .dot {
    margin: 0 4px;
}

.product-card-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text);
}

.product-card-price {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
}


/* 7. Product grid, feed & Show More
   ========================================================================== */

.product-feed {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px 72px;
}

/* Feeds with no hero/page-head above them (index.hbs, paged home) */
.product-feed-compact {
    padding-top: 24px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px var(--gap); /* extra row gap — card text hangs below the tile */
}

.show-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 32px;
}

.show-more-button,
.show-more-fallback {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--color-surface);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-pill);
    transition: box-shadow 0.15s ease;
}

.show-more-button:hover,
.show-more-fallback:hover {
    background-color: var(--color-surface-hover);
}


/* 8. Page head (tag / author / blog headers)
   ========================================================================== */

.page-head {
    padding: 64px 16px 40px;
    text-align: center;
}

.page-head-title {
    font-size: 36px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.page-head-subtitle {
    max-width: 480px;
    margin: 8px auto 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Author profile image (author.hbs) */
.page-head-image {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    object-fit: cover;
}


/* 9. Blog list
   ========================================================================== */

.blog-feed {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px 72px;
}

.blog-item {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 8px;
    padding: 16px;
    background-color: var(--color-surface);
    border-radius: var(--radius-card);
    transition: background-color 0.2s ease;
}

.blog-item:hover {
    background-color: var(--color-surface-hover);
}

.blog-item-date {
    flex: 0 0 110px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.blog-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}


/* 10. Product post
   ========================================================================== */

.product-post {
    max-width: var(--narrow-max);
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.product-hero {
    position: relative;
    overflow: hidden;
    background-color: var(--color-surface);
    border-radius: var(--radius-card);
}

.product-hero-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    padding: 32px;
}

.product-hero-media img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-img);
}

/* Purchase CTA slot — main.js hoists the first .kg-button-card's link here */
.product-hero-cta {
    position: absolute;
    top: 16px;
    right: 16px;
}

.product-hero-cta .kg-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--color-text);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.product-hero-cta .kg-btn:hover {
    background-color: #000000;
}

.product-post-head {
    padding: 24px 4px 8px;
}

.product-post-meta {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.product-post-meta a {
    color: var(--color-text-secondary);
    transition: color 0.15s ease;
}

.product-post-meta a:hover {
    color: var(--color-text);
}

.product-post-meta .dot {
    margin: 0 4px;
}

.product-post-title {
    margin-top: 4px;
    font-size: 36px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.product-post-price {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 500;
}

.product-post-about {
    padding: 0 4px;
}

.product-post-about-label {
    margin: 24px 0 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* Related products */
.related-products {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px 72px;
}

.related-products-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.related-products-head h2 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.related-products-head h2 a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.related-products-all {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--color-text-secondary);
    transition: color 0.15s ease;
}

.related-products-all:hover {
    color: var(--color-text);
}


/* 11. Blog post & static page
   ========================================================================== */

.blog-post,
.page-post {
    max-width: var(--narrow-max);
    margin: 0 auto;
    padding: 40px 16px 64px;
}

.blog-post-meta {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.blog-post-meta .dot {
    margin: 0 4px;
}

.blog-post-title {
    margin: 12px 0;
    font-size: 36px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.blog-post-author {
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.blog-post-image,
.page-post-image {
    margin-bottom: 32px;
}

.blog-post-image img,
.page-post-image img {
    display: block;
    width: 100%;
    border-radius: var(--radius-card);
}

.page-post-title {
    margin-bottom: 24px;
    font-size: 36px;
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: -0.02em;
}


/* 12. Prose / .gh-content + Koenig cards
   ========================================================================== */

.prose {
    font-size: 16px;
    line-height: 24px;
    color: var(--color-text-body);
}

.prose p {
    margin-bottom: 20px;
}

.prose h2 {
    margin: 32px 0 12px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 500;
    color: var(--color-text);
}

.prose h3 {
    margin: 32px 0 12px;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 500;
    color: var(--color-text);
}

.prose h4,
.prose h5,
.prose h6 {
    margin: 24px 0 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
}

.prose a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0, 0, 0, 0.25);
    transition: text-decoration-color 0.15s ease;
}

.prose a:hover {
    text-decoration-color: currentColor;
}

.prose strong {
    font-weight: 600;
    color: var(--color-text);
}

.prose ul,
.prose ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li {
    margin-bottom: 8px;
}

.prose li::marker {
    color: var(--color-text-secondary);
}

.prose img {
    border-radius: var(--radius-img);
}

.prose blockquote {
    margin: 24px 0;
    padding-left: 16px;
    border-left: 2px solid #dddddd;
}

.prose hr {
    margin: 32px 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

.prose figure {
    margin: 24px 0;
}

.prose figcaption,
.blog-post-image figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 14px;
    background-color: var(--color-surface);
    padding: 2px 6px;
    border-radius: 4px;
}

.prose pre {
    margin: 24px 0;
    padding: 16px;
    background-color: #1a1a1a;
    color: #eeeeee;
    border-radius: var(--radius-img);
    overflow-x: auto;
}

.prose pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.prose table {
    width: 100%;
    margin: 24px 0;
    border-collapse: collapse;
    font-size: 14px;
}

.prose th,
.prose td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.prose th {
    font-weight: 500;
    color: var(--color-text);
}

/* --- Koenig cards --- */

.prose .kg-card {
    margin: 24px 0;
}

/* Wide/full cards are capped to the prose column — no bleed */
.prose .kg-width-wide,
.prose .kg-width-full {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.prose .kg-width-wide img,
.prose .kg-width-full img {
    width: 100%;
}

/* Image card */
.kg-image-card img,
.kg-image {
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-img);
}

/* Gallery card */
.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kg-gallery-row {
    display: flex;
    gap: 8px;
}

.kg-gallery-image {
    flex: 1;
}

.kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-img);
}

/* Embed card */
.kg-embed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kg-embed-card iframe {
    max-width: 100%;
    border-radius: var(--radius-img);
}

/* Button card */
.kg-button-card {
    display: flex;
    justify-content: flex-start;
}

.kg-button-card.kg-align-center {
    justify-content: center;
}

.kg-btn,
a.kg-btn-accent {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--color-text);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.kg-btn:hover,
a.kg-btn-accent:hover {
    background-color: #000000;
    text-decoration: none;
}

/* Callout card */
.kg-callout-card {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.kg-callout-card .kg-callout-emoji {
    font-size: 20px;
    line-height: 1.25;
}

.kg-callout-card .kg-callout-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-body);
}

/* Bookmark card */
.kg-bookmark-card a.kg-bookmark-container {
    display: flex;
    overflow: hidden;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s ease;
}

.kg-bookmark-card a.kg-bookmark-container:hover {
    box-shadow: var(--shadow-card-hover);
    text-decoration: none;
}

.kg-bookmark-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-start;
    padding: 16px;
    min-width: 0;
}

.kg-bookmark-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.kg-bookmark-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.kg-bookmark-thumbnail {
    position: relative;
    flex-shrink: 0;
    min-width: 33%;
    max-height: 120px;
}

.kg-bookmark-thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Product card (Koenig) */
.kg-product-card .kg-product-card-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 16px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

.kg-product-card-image {
    border-radius: var(--radius-img);
    margin-bottom: 12px;
}

.kg-product-card-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
}

.kg-product-card-description {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-body);
}

.kg-product-card a.kg-product-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 8px 16px;
    background-color: var(--color-text);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.kg-product-card a.kg-product-card-button:hover {
    background-color: #000000;
}


/* 13. Footer
   ========================================================================== */

.site-footer-inner {
    max-width: var(--container-max);
    margin: 40px auto 0;
    padding: 40px 16px 32px;
    border-top: 1px solid var(--color-border);
}

.site-footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
}

.site-footer-form {
    width: 100%;
    max-width: 360px;
    flex-shrink: 0;
}

.site-footer-disclaimer {
    max-width: 420px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    text-align: right;
}

.site-footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 24px;
}

.site-footer-col h4 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.site-footer-col li {
    margin-bottom: 8px;
}

.site-footer-col a {
    font-size: 14px;
    color: var(--color-text-secondary);
    transition: color 0.15s ease;
}

.site-footer-col a:hover {
    color: var(--color-text);
}

.site-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-text-secondary);
}

.site-footer-bottom a {
    color: var(--color-text-secondary);
    transition: color 0.15s ease;
}

.site-footer-bottom a:hover {
    color: var(--color-text);
}


/* 15. Media queries
   ========================================================================== */

@media (max-width: 1024px) {

    /* Product grid: 2 columns */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Navigation: hide desktop list, show toggle; dropdown when body.nav-open */
    .site-nav-toggle {
        display: flex;
        order: 2; /* toggle sits next to the search button */
    }

    .site-nav-menu {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
        margin-right: 8px;
    }

    .site-nav-list {
        display: none;
    }

    body.nav-open .site-nav-list {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: var(--nav-height);
        left: 16px;
        right: 16px;
        transform: none;
        padding: 8px;
        background-color: var(--color-surface);
        border-radius: var(--radius-card);
        box-shadow: var(--shadow-card-hover);
    }

    body.nav-open .site-nav-list a {
        display: block;
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 10px;
    }

    body.nav-open .site-nav-list li.nav-current a {
        background-color: var(--color-bg);
        box-shadow: none;
    }

    /* Home hero */
    .home-hero {
        padding-top: 64px;
    }

    /* Filter bar: pills row takes the full width, sort drops below */
    .filter-pills {
        flex-basis: 100%;
    }

    /* Footer: stack subscribe + disclaimer */
    .site-footer-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer-disclaimer {
        text-align: left;
    }
}

@media (max-width: 640px) {

    /* Product grid: 1 column */
    .product-grid {
        grid-template-columns: 1fr;
    }

    /* Hero + page/post titles scale down */
    .home-hero-title {
        font-size: 32px;
        line-height: 38px;
    }

    .page-head {
        padding: 48px 16px 32px;
    }

    .page-head-title,
    .product-post-title,
    .blog-post-title,
    .page-post-title {
        font-size: 28px;
    }

    /* Blog list rows stack */
    .blog-item {
        flex-direction: column;
        gap: 4px;
    }

    .blog-item-date {
        flex-basis: auto;
    }

    /* Product post hero */
    .product-hero-media {
        padding: 24px;
    }

    /* Footer bottom stacks */
    .site-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}


/* 16. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}
