/*
 * The public blog (/blog). Storefront tokens only (site.css + storefront.css), so it follows the
 * brand kit: Forest for structure, Leaf for links and the accent, Sand for quiet bands, Montserrat.
 * Everything is scoped under .bl-* and never restyles a shared component.
 */

/* ---------- List page ---------- */
.bl-hero { padding-bottom: 2rem; }
.bl-hero h1 { max-width: 46rem; text-wrap: balance; }

.bl-topics { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.6rem; }
.bl-chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .9rem; border-radius: 999px;
    background: var(--sf-white); border: 1px solid var(--sf-border); color: var(--sf-ink);
    font-size: .84rem; font-weight: 600; text-decoration: none; transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.bl-chip:hover { border-color: var(--sf-brand-border); background: var(--sf-brand-soft); color: var(--sf-brand); }
.bl-chip.is-on { background: var(--sf-brand); border-color: var(--sf-brand); color: #fff; }
.bl-chip-n { font-size: .72rem; font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; }

.bl-section { padding-top: 1.5rem !important; }

.bl-topic {
    display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--aw-accent-deep, #276b2b);
}
.bl-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .8rem; color: var(--sf-muted); }
.bl-author { font-weight: 600; color: var(--sf-ink); }

/* Featured story: picture and words side by side, the whole block one link. */
.bl-feature { margin-bottom: 3rem; }
.bl-feature-link {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0; text-decoration: none; color: inherit;
    background: var(--sf-white); border: 1px solid var(--sf-border); border-radius: var(--sf-radius); overflow: hidden;
    box-shadow: var(--sf-shadow-sm); transition: box-shadow .2s ease, border-color .2s ease;
}
.bl-feature-link:hover { box-shadow: var(--sf-shadow); border-color: var(--sf-brand-border); color: inherit; }
.bl-feature-media { position: relative; min-height: 280px; background: var(--aw-sand-soft, #f5f0e8); }
.bl-feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bl-feature-body { padding: clamp(1.4rem, 3vw, 2.4rem); display: flex; flex-direction: column; gap: .65rem; justify-content: center; }
.bl-feature-label {
    align-self: flex-start; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    background: var(--sf-brand); color: #fff; border-radius: 999px; padding: .22rem .6rem;
}
.bl-feature-title { font-family: var(--sf-display); font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; line-height: 1.15; margin: 0; color: var(--sf-ink); text-wrap: balance; }
.bl-feature-excerpt { color: var(--sf-text); font-size: 1rem; line-height: 1.6; margin: 0; }
.bl-feature-cta { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--sf-brand); font-size: .9rem; margin-top: .4rem; }
.bl-feature-cta svg { width: 16px; height: 16px; transition: transform .2s ease; }
.bl-feature-link:hover .bl-feature-cta svg { transform: translateX(3px); }
@media (max-width: 767.98px) {
    .bl-feature-link { grid-template-columns: 1fr; }
    .bl-feature-media { min-height: 0; aspect-ratio: 16 / 9; }
}

.bl-grid-title { font-family: var(--sf-display); font-size: 1.3rem; font-weight: 800; margin: 0 0 1.1rem; color: var(--sf-ink); }
.bl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 991.98px) { .bl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .bl-grid { grid-template-columns: 1fr; } }

.bl-card { min-width: 0; }
.bl-card-link {
    display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit;
    background: var(--sf-white); border: 1px solid var(--sf-border); border-radius: var(--sf-radius); overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.bl-card-link:hover { transform: translateY(-3px); box-shadow: var(--sf-shadow); border-color: var(--sf-brand-border); color: inherit; }
.bl-card-media { aspect-ratio: 16 / 10; background: var(--aw-sand-soft, #f5f0e8); position: relative; overflow: hidden; }
.bl-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.bl-card-link:hover .bl-card-media img { transform: scale(1.03); }
.bl-card-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--aw-sand-deep, #d9ccb6); }
.bl-card-ph svg { width: 42px; height: 42px; }
.bl-card-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.bl-card-title { font-family: var(--sf-display); font-size: 1.08rem; font-weight: 800; line-height: 1.3; margin: 0; color: var(--sf-ink); text-wrap: balance; }
.bl-card-excerpt {
    color: var(--sf-muted); font-size: .9rem; line-height: 1.55; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bl-card-body .bl-meta { margin-top: auto; padding-top: .4rem; }

.bl-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
.bl-pager-at { color: var(--sf-muted); font-size: .88rem; font-variant-numeric: tabular-nums; }

.bl-empty { max-width: 34rem; margin: 1rem auto 0; text-align: center; display: grid; justify-items: center; gap: .6rem; }
.bl-empty-mark { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--sf-brand-soft); color: var(--sf-brand); }
.bl-empty-mark svg { width: 30px; height: 30px; }
.bl-empty h2 { font-family: var(--sf-display); font-size: 1.4rem; font-weight: 800; margin: .3rem 0 0; }
.bl-empty p { color: var(--sf-muted); margin: 0 0 .6rem; }

/* ---------- Article ---------- */
.bl-preview-bar { background: var(--aw-warning-soft, #fdf3e7); border-bottom: 1px solid var(--aw-sand-border, #e7ddcc); position: relative; z-index: 3; }
.bl-preview-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .6rem; flex-wrap: wrap; font-size: .9rem; }

.bl-article-hero { padding-bottom: 2rem; }
.bl-article-hero .container { max-width: 52rem; }
.bl-crumbs { display: flex; align-items: center; gap: .45rem; font-size: .82rem; margin-bottom: 1rem; color: var(--sf-muted); }
.bl-crumbs a { color: var(--aw-accent-deep, #276b2b); font-weight: 600; text-decoration: none; }
.bl-crumbs a:hover { text-decoration: underline; }
.theme-storefront .sf-hero h1.bl-article-title { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.1; margin-bottom: .9rem; text-wrap: balance; }
.bl-article-dek { font-size: clamp(1.02rem, 1.6vw, 1.18rem); line-height: 1.6; color: var(--sf-muted); margin: 0 0 1.4rem; max-width: 44rem; }
.bl-byline { display: flex; align-items: center; gap: .75rem; }
.bl-byline > span:last-child { display: flex; flex-direction: column; gap: .1rem; font-size: .9rem; color: var(--sf-ink); }
.bl-byline-mark { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--sf-white); border: 1px solid var(--sf-border); }
.bl-byline-mark .bp-logo { --bp-logo-h: 24px; }

.bl-cover { margin: 0 auto 2.5rem; max-width: 64rem; border-radius: var(--sf-radius); overflow: hidden; background: var(--aw-sand-soft, #f5f0e8); }
.bl-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

/* Contents | text | share on a wide screen; the text alone, centred, everywhere else. */
.bl-layout { display: grid; grid-template-columns: minmax(0, 44rem); justify-content: center; gap: 2.5rem; padding-bottom: 3rem; }
.bl-layout.has-toc { grid-template-columns: 13rem minmax(0, 44rem) 13rem; }
@media (max-width: 1199.98px) {
    .bl-layout.has-toc { grid-template-columns: minmax(0, 44rem); }
    .bl-toc { display: none; }
}
.bl-toc, .bl-share { position: sticky; top: 6rem; align-self: start; font-size: .86rem; }
.bl-toc-title { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sf-muted); margin-bottom: .6rem; }
.bl-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; border-inline-start: 2px solid var(--sf-border); }
.bl-toc a { display: block; padding: .3rem .8rem; margin-inline-start: -2px; border-inline-start: 2px solid transparent; color: var(--sf-muted); text-decoration: none; line-height: 1.35; }
.bl-toc a:hover { color: var(--sf-brand); border-inline-start-color: var(--sf-brand); }
@media (max-width: 1199.98px) { .bl-share { position: static; border-top: 1px solid var(--sf-border); padding-top: 1.25rem; } }
.bl-share-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.bl-share-row a, .bl-copy {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0;
    border: 1px solid var(--sf-border); background: var(--sf-white); color: var(--sf-brand); cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.bl-share-row a:hover, .bl-copy:hover { background: var(--sf-brand); border-color: var(--sf-brand); color: #fff; }
.bl-share-row svg { width: 18px; height: 18px; }
.bl-copy.is-done { background: var(--aw-accent); border-color: var(--aw-accent); color: #fff; }

/* The article text. Comfortable measure, generous rhythm, brand marks for quotes and key points. */
.bl-prose { font-size: 1.06rem; line-height: 1.78; color: var(--sf-text); min-width: 0; overflow-wrap: anywhere; }
/* One rhythm for every block: space ABOVE each one, nothing below (Bootstrap's bottom margins
   are zeroed so the two never add up). A heading pulls its own text a little closer. */
.bl-prose > :where(p, ul, ol, blockquote, figure, aside, hr, h2, h3) { margin-bottom: 0; }
.bl-prose > * + * { margin-top: 1.15rem; }
.bl-prose > :is(h2, h3) + * { margin-top: .7rem; }
.bl-prose blockquote p, .bl-prose .bp-callout p { margin: 0; }
.bl-prose h2, .bl-prose h3 { font-family: var(--sf-display); color: var(--sf-ink); font-weight: 800; scroll-margin-top: 6rem; text-wrap: balance; }
.bl-prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.2; margin: 2.4rem 0 0; }
.bl-prose h3 { font-size: 1.2rem; line-height: 1.3; margin: 1.8rem 0 0; }
.bl-prose > :first-child { margin-top: 0; }
.bl-prose a { color: var(--aw-accent-deep, #276b2b); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.bl-prose a:hover { color: var(--sf-brand); }
.bl-prose ul, .bl-prose ol { padding-inline-start: 1.3rem; margin-bottom: 0; }
.bl-prose li + li { margin-top: .45rem; }
.bl-prose li::marker { color: var(--aw-accent); font-weight: 700; }
.bl-prose strong { color: var(--sf-ink); }
.bl-prose blockquote {
    margin-inline: 0; padding: .2rem 0 .2rem 1.3rem; border-inline-start: 4px solid var(--aw-accent);
    font-size: 1.14rem; font-style: italic; color: var(--sf-ink);
}
.bl-prose blockquote p + p, .bl-prose .bp-callout p + p { margin-top: .7rem; }
.bl-prose .bp-callout {
    background: var(--aw-sand-soft, #f5f0e8); border: 1px solid var(--aw-sand-border, #e7ddcc); border-radius: var(--sf-radius-sm, 12px);
    padding: 1.1rem 1.25rem 1.1rem 3.1rem; position: relative; color: var(--sf-ink);
}
.bl-prose .bp-callout::before {
    content: "!"; position: absolute; left: 1.05rem; top: 1.1rem; width: 1.45rem; height: 1.45rem; border-radius: 50%;
    background: var(--sf-brand); color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center; line-height: 1;
}
.bl-prose hr { border: 0; height: 1px; background: var(--sf-border); margin: 2.2rem 0; opacity: 1; }
.bl-prose .bp-figure { margin-inline: 0; }
.bl-prose .bp-figure img { display: block; width: 100%; height: auto; border-radius: var(--sf-radius-sm, 12px); }
.bl-prose figcaption { font-size: .85rem; color: var(--sf-muted); margin-top: .55rem; text-align: center; }

.bl-related { background: var(--aw-sand-soft, #f5f0e8); padding: 3.25rem 0 !important; }

@media (prefers-reduced-motion: reduce) {
    .bl-card-link, .bl-card-media img, .bl-feature-cta svg { transition: none; }
    .bl-card-link:hover { transform: none; }
    .bl-card-link:hover .bl-card-media img { transform: none; }
}

/* Home page "From the blog": three across on a wide screen; a swipeable row on a phone, like the
   home page's product rails, instead of three tall cards stacked. */
@media (max-width: 575.98px) {
    .swipe-rail-blog {
        grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%;
        overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: .25rem;
    }
    .swipe-rail-blog::-webkit-scrollbar { display: none; }
    .swipe-rail-blog > .bl-card { scroll-snap-align: start; }
}
