/*
 * BredaBeds blog: "Murphy bed materials & construction" (2026). Loaded by the post content itself
 * (<link> at the top of the post), everything scoped to .bbmat. It lives with the post's images in
 * media/breda/blog/material2, not in the theme: blog content is not scanned by the Tailwind build, and a
 * <style> block in the content would be counted as words by the blog's reading-time estimate.
 * Bump the ?v= query on the <link> after editing this file (media URLs are cached for a year).
 * Full width of the post card. Container queries on .bbmat set the columns; the <img sizes> in the post
 * match the image widths below (charts 18rem beside their text, 16rem two-up; the formaldehyde graphic 20rem).
 * Inside a container query, keep each rule AFTER its base rule, or the base rule wins.
 */

/* phones: less card padding, so text and images get the width */
@media (max-width: 39.98rem) {
    .bmx\:card:has(.bbmat) { padding: 1rem; }
}

.bbmat {
    --bbmat-ink: #111827;
    --bbmat-text: #374151;
    --bbmat-muted: #4b5563;
    --bbmat-line: #e5e7eb;
    --bbmat-panel: #f9fafb;
    --bbmat-accent: #c2410c;
    --bbmat-accent-dark: #9a3412;
    --bbmat-accent-bright: #ea580c;
    --bbmat-tint: #fff7ed;
    container: bbmat / inline-size;
    color: var(--bbmat-text);
    font-size: 1rem;
    line-height: 1.7;
    overflow-wrap: break-word;
}
.bbmat p { margin-block: 0 1rem; }
.bbmat strong { color: var(--bbmat-ink); font-weight: 700; }
.bbmat img { margin: 0; }
.bbmat ul, .bbmat ol { margin: 0; padding: 0; }
.bbmat li { margin: 0; }

.bbmat .bbmat-lede {
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    line-height: 1.6;
    color: var(--bbmat-ink);
}

/* headings */
.bbmat h2 {
    margin-block: 2.5rem 0.75rem;
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--bbmat-ink);
    scroll-margin-top: 7rem;
}
.bbmat h2::before {
    content: "";
    display: block;
    width: 2rem;
    height: 0.25rem;
    margin-bottom: 0.625rem;
    border-radius: 1rem;
    background: var(--bbmat-accent-bright);
}
.bbmat h3 {
    margin-block: 0 0.375rem;
    font-size: 1.125rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--bbmat-ink);
}

/* links: the theme's global link rule is skipped with .no-style-anchor on every link here */
.bbmat a {
    color: var(--bbmat-accent);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}
.bbmat a:hover { color: var(--bbmat-accent-dark); text-decoration-thickness: 2px; }
.bbmat a:focus-visible {
    outline: 3px solid var(--bbmat-accent-bright);
    outline-offset: 3px;
    border-radius: 0.375rem;
}

.bbmat .bbmat-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* at a glance: icon beside each title, jump links along the bottom */
.bbmat .bbmat-facts {
    margin-block: 1.75rem 0;
    padding: 1.25rem clamp(1rem, 0.75rem + 1vw, 1.5rem);
    border: 1px solid var(--bbmat-line);
    border-radius: 1.25rem;
    background: var(--bbmat-panel);
}
.bbmat .bbmat-facts h2 {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bbmat-accent);
}
.bbmat .bbmat-facts h2::before { display: none; }
.bbmat .bbmat-facts ul {
    display: grid;
    gap: 1rem 1.5rem;
    grid-template-columns: minmax(0, 1fr);
    list-style: none;
}
.bbmat .bbmat-facts li p { margin: 0; font-size: 0.9375rem; line-height: 1.5; }
.bbmat .bbmat-facts .bbmat-fact-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
    font-size: 1rem;
    line-height: 1.3;
}
.bbmat .bbmat-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    background: var(--bbmat-tint);
    color: var(--bbmat-accent);
}
.bbmat .bbmat-icon svg { width: 1.125rem; height: 1.125rem; }
@container bbmat (min-width: 36rem) {
    .bbmat .bbmat-facts ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container bbmat (min-width: 50rem) {
    .bbmat .bbmat-facts ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container bbmat (min-width: 72rem) {
    .bbmat .bbmat-facts ul { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.bbmat .bbmat-jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 1.125rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--bbmat-line);
    font-size: 0.875rem;
    line-height: 1.5;
}
.bbmat .bbmat-jump-label { font-weight: 700; color: var(--bbmat-ink); }
.bbmat .bbmat-jump ul { display: flex; flex-wrap: wrap; gap: 0.375rem; list-style: none; }
.bbmat .bbmat-jump a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--bbmat-line);
    border-radius: 999px;
    background: #fff;
    color: var(--bbmat-ink);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}
.bbmat .bbmat-jump a:hover { border-color: var(--bbmat-accent); color: var(--bbmat-accent); }

/* measurements: each chart sits beside the text about it */
.bbmat .bbmat-metrics { margin-block: 1.25rem; border-top: 1px solid var(--bbmat-line); }
.bbmat .bbmat-metric {
    display: grid;
    gap: 0.875rem 2rem;
    grid-template-columns: minmax(0, 1fr);
    padding-block: 1.25rem;
    border-bottom: 1px solid var(--bbmat-line);
}
.bbmat .bbmat-metric p { margin-bottom: 0.625rem; }
.bbmat .bbmat-stat {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.625rem;
    font-size: 0.9375rem;
    color: var(--bbmat-muted);
}
.bbmat .bbmat-metric .bbmat-stat { margin: 0; }
.bbmat .bbmat-stat strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.bbmat .bbmat-gain {
    display: inline-block;
    padding: 0.0625rem 0.5rem;
    border-radius: 999px;
    background: var(--bbmat-tint);
    color: var(--bbmat-accent-dark);
    font-size: 0.8125rem;
    font-weight: 700;
}
@container bbmat (min-width: 40rem) {
    .bbmat .bbmat-metric { grid-template-columns: minmax(0, 1fr) 18rem; align-items: center; }
}
/* wide: two measurements per row, the chart narrows to 16rem */
@container bbmat (min-width: 72rem) {
    .bbmat .bbmat-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
    .bbmat .bbmat-metric { grid-template-columns: minmax(0, 1fr) 16rem; column-gap: 1.5rem; }
}

/* images */
.bbmat .bbmat-chart, .bbmat .bbmat-figure { max-width: 22rem; margin: 0; }
.bbmat .bbmat-chart a, .bbmat .bbmat-figure a { display: block; border-radius: 0.75rem; text-decoration: none; }
.bbmat .bbmat-chart img, .bbmat .bbmat-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--bbmat-line);
    border-radius: 0.75rem;
    background: #fff;
}
.bbmat .bbmat-figure figcaption { margin-top: 0.5rem; font-size: 0.8125rem; line-height: 1.5; color: var(--bbmat-muted); }
@container bbmat (min-width: 40rem) {
    .bbmat .bbmat-metric .bbmat-chart { max-width: none; }
}

/* text beside a figure once there is room (the formaldehyde graphic); stacked, the figure follows the text */
.bbmat .bbmat-split { display: grid; gap: 0.25rem 2rem; grid-template-columns: minmax(0, 1fr); }
.bbmat .bbmat-split > .bbmat-figure { margin-bottom: 1rem; }
@container bbmat (min-width: 56rem) {
    .bbmat .bbmat-split { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
    .bbmat .bbmat-split > .bbmat-figure { max-width: none; margin-top: 0.25rem; }
}

/* two short sections side by side */
.bbmat .bbmat-pair { display: grid; gap: 0 2.5rem; grid-template-columns: minmax(0, 1fr); }
@container bbmat (min-width: 56rem) {
    .bbmat .bbmat-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* callouts */
.bbmat .bbmat-note {
    margin-block: 1.25rem 0;
    padding: 0.875rem 1.125rem;
    border-left: 4px solid var(--bbmat-accent-bright);
    border-radius: 0.5rem 1rem 1rem 0.5rem;
    background: var(--bbmat-tint);
    font-size: 0.875rem;
    line-height: 1.6;
    color: #431407;
}
.bbmat .bbmat-note p { margin: 0; }
.bbmat .bbmat-note strong { color: #7c2d12; }
.bbmat .bbmat-pull {
    margin-block: 1rem 1.25rem;
    padding-block: 1rem;
    border-block: 1px solid var(--bbmat-line);
    font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--bbmat-ink);
}
.bbmat .bbmat-pull span { display: block; margin-top: 0.125rem; color: var(--bbmat-accent); }

/* closing panel */
.bbmat .bbmat-close {
    position: relative;
    overflow: hidden;
    margin-block: 2.75rem 0;
    padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
    border-radius: 1.25rem;
    background: #111827;
    color: #d1d5db;
}
.bbmat .bbmat-close::after {
    content: "";
    position: absolute;
    right: -5rem;
    bottom: -5rem;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgb(234 88 12 / 0.35), transparent);
    pointer-events: none;
}
.bbmat .bbmat-close h2 { margin-top: 0; color: #fff; }
.bbmat .bbmat-close h2::before { background: #fb923c; }
.bbmat .bbmat-close p { position: relative; color: #d1d5db; }
.bbmat .bbmat-close .bbmat-statement { margin-bottom: 0.5rem; font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); font-weight: 700; line-height: 1.45; color: #fff; }
.bbmat .bbmat-actions { position: relative; display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; list-style: none; }
.bbmat .bbmat-btn {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.625rem 1.125rem;
    border: 2px solid #c2410c;
    border-radius: 0.75rem;
    background: #c2410c;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}
.bbmat .bbmat-btn:hover { border-color: #9a3412; background: #9a3412; color: #fff; }
.bbmat .bbmat-btn--ghost { border-color: rgb(255 255 255 / 0.4); background: transparent; }
.bbmat .bbmat-btn--ghost:hover { border-color: #fff; background: rgb(255 255 255 / 0.08); }
.bbmat .bbmat-close a:focus-visible { outline-color: #fb923c; }

.bbmat .bbmat-footnote {
    margin-block: 1.75rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--bbmat-line);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--bbmat-muted);
}

@media (prefers-reduced-motion: no-preference) {
    .bbmat .bbmat-btn, .bbmat img, .bbmat a { transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s; }
    .bbmat .bbmat-chart a:hover img, .bbmat .bbmat-figure a:hover img { opacity: 0.9; }
}

@media print {
    .bbmat .bbmat-jump, .bbmat .bbmat-actions { display: none; }
    .bbmat .bbmat-close { background: none; color: #000; padding: 0; }
    .bbmat .bbmat-close h2, .bbmat .bbmat-close p, .bbmat .bbmat-close .bbmat-statement { color: #000; }
    .bbmat .bbmat-metric, .bbmat .bbmat-figure { break-inside: avoid; }
}
