/* ============================================================
   Public Blog (/blogs and /blogs/{slug})
   Colours follow the brand colour: the page sets --bg-primary / --bg-soft / --bg-deep inline (BrandIdentity);
   the values below are only the template-pink fallbacks.
   ============================================================ */
.bg-page {
    --bg-primary: var(--primary-color);
    --bg-soft: color-mix(in srgb, var(--primary-color) 14%, #fff);
    --bg-deep: #a8366f;
    --bg-ink: #25101b;
    --bg-muted: #6b7280;
    --bg-line: #f3d3e4;
    --bg-plum: #2a1020;
    --bg-plum-2: #16101a;
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    color: var(--bg-ink);
    background: #fff;
    overflow-x: clip;
}

.bg-page *,
.bg-page *::before,
.bg-page *::after {
    box-sizing: border-box;
}

.bg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bg-narrow {
    max-width: 760px;
}

.bg-narrow-wide {
    max-width: 980px;
}

/* ---------- Hero ---------- */
.bg-hero {
    background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%);
    padding: clamp(104px, 11vw, 132px) 0 clamp(28px, 4vw, 48px);
}

.bg-breadcrumbs {
    margin-bottom: 20px;
    font-size: .85rem;
    color: var(--bg-muted);
}

.bg-breadcrumbs a {
    color: var(--bg-muted);
    text-decoration: none;
}

.bg-breadcrumbs a:hover {
    color: var(--bg-primary);
}

.bg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 7px 14px;
    background: #fff;
    border: 1.5px solid var(--bg-line);
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--bg-deep);
}

.bg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.bg-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.03em;
    overflow-wrap: anywhere;
}

.bg-lead {
    max-width: 580px;
    margin: 0 0 26px;
    font-size: 1.08rem;
    line-height: 1.6;
    color: var(--bg-muted);
}

.bg-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bg-cats a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #fff;
    border: 1.5px solid var(--bg-line);
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 700;
    color: var(--bg-ink);
    text-decoration: none;
    transition: background .2s, border-color .2s;
}

.bg-cats a span {
    padding: 1px 8px;
    background: var(--bg-soft);
    border-radius: 999px;
    font-size: .75rem;
    color: var(--bg-deep);
}

.bg-cats a:hover {
    border-color: var(--bg-primary);
}

.bg-cats a.is-active {
    background: var(--bg-primary);
    border-color: var(--bg-primary);
}

.bg-cats a.is-active span {
    background: rgba(255, 255, 255, .6);
    color: var(--bg-ink);
}

.bg-cats a:focus-visible,
.bg-btn:focus-visible,
.bg-more:focus-visible,
.bg-card h3 a:focus-visible {
    outline: 3px solid var(--bg-ink);
    outline-offset: 3px;
}

/* ---------- Buttons ---------- */
.bg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    padding: 0 26px;
    background: var(--bg-primary);
    border: 2px solid var(--bg-primary);
    border-radius: 14px;
    font: inherit;
    font-weight: 800;
    color: var(--bg-ink);
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}

.bg-btn:hover {
    background: var(--bg-deep);
    border-color: var(--bg-deep);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -14px var(--bg-primary);
}

.bg-btn-ghost {
    background: #fff;
    border-color: var(--bg-line);
    color: var(--bg-ink);
}

.bg-btn-sm {
    height: 42px;
    padding: 0 18px;
    font-size: .9rem;
}

.bg-btn-light {
    background: #fff;
    border-color: #fff;
    color: var(--bg-ink);
}

.bg-btn-light:hover {
    background: var(--bg-primary);
    border-color: var(--bg-primary);
    color: var(--bg-ink);
}

.bg-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* ---------- Sections ---------- */
.bg-section {
    padding: clamp(36px, 5vw, 64px) 0;
}

.bg-h {
    margin: 0 0 28px;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

/* ---------- Cards ---------- */
.bg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: .8rem;
    color: var(--bg-muted);
}

.bg-cat {
    padding: 3px 11px;
    background: var(--bg-soft);
    border-radius: 999px;
    font-weight: 800;
    color: var(--bg-deep);
    text-decoration: none;
}

a.bg-cat:hover {
    background: var(--bg-primary);
    color: var(--bg-ink);
}

.bg-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-soft), #fff 60%, var(--bg-soft));
    font-size: 2.6rem;
    color: var(--bg-primary);
}

.bg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.bg-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--bg-line);
    border-radius: 22px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.bg-card:hover {
    border-color: var(--bg-primary);
    box-shadow: 0 22px 44px -30px rgba(37, 16, 27, .5);
    transform: translateY(-3px);
}

.bg-card-cover {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-soft);
}

.bg-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.bg-card:hover .bg-card-cover img {
    transform: scale(1.04);
}

.bg-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 22px 22px 24px;
}

.bg-card h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.bg-card h3 a {
    color: inherit;
    text-decoration: none;
}

.bg-card p {
    margin: 0;
    font-size: .93rem;
    line-height: 1.6;
    color: var(--bg-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-more {
    margin-top: auto;
    padding-top: 4px;
    font-weight: 800;
    color: var(--bg-deep);
    text-decoration: none;
}

.bg-more:hover {
    color: var(--bg-primary);
}

/* ---------- Featured ---------- */
.bg-featured {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    overflow: hidden;
    margin-bottom: 36px;
    background: #fff;
    border: 1px solid var(--bg-line);
    border-radius: 28px;
    box-shadow: 0 30px 60px -44px rgba(37, 16, 27, .5);
}

.bg-featured-cover {
    display: block;
    min-height: 320px;
    background: var(--bg-soft);
}

.bg-featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-featured-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    padding: clamp(24px, 4vw, 44px);
}

.bg-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-primary);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bg-ink);
}

.bg-featured h2 {
    margin: 0;
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    overflow-wrap: anywhere;
}

.bg-featured h2 a {
    color: inherit;
    text-decoration: none;
}

.bg-featured p {
    margin: 0;
    line-height: 1.65;
    color: var(--bg-muted);
}

/* ---------- Pager ---------- */
.bg-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 40px;
}

.bg-pager a,
.bg-pager .is-disabled {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 1.5px solid var(--bg-line);
    border-radius: 999px;
    font-weight: 800;
    color: var(--bg-ink);
    text-decoration: none;
}

.bg-pager a:hover {
    border-color: var(--bg-primary);
    background: var(--bg-soft);
}

.bg-pager .is-disabled {
    opacity: .45;
}

.bg-pager-count {
    font-size: .9rem;
    color: var(--bg-muted);
}

/* ---------- Empty ---------- */
.bg-empty {
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 28px;
    text-align: center;
    background: var(--bg-soft);
    border: 1.5px dashed var(--bg-primary);
    border-radius: 26px;
}

.bg-empty i {
    font-size: 2.6rem;
    color: var(--bg-primary);
}

.bg-empty h2 {
    margin: 10px 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
}

.bg-empty p {
    margin: 0 0 22px;
    line-height: 1.6;
    color: var(--bg-muted);
}

/* ---------- Single article ---------- */
.bg-post-hero {
    padding-bottom: 28px;
}

.bg-post-hero h1 {
    margin: 14px 0 20px;
}

.bg-byline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bg-byline span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.bg-byline small {
    color: var(--bg-muted);
}

.bg-avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-deep));
    border-radius: 50%;
    font-weight: 800;
    color: #fff;
}

.bg-post-cover {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    margin-bottom: 40px;
    border-radius: 28px;
    box-shadow: 0 30px 60px -40px rgba(37, 16, 27, .5);
}

.bg-body {
    font-size: 1.08rem;
    line-height: 1.8;
    color: #3b2a33;
    overflow-wrap: anywhere;
}

.bg-body > :first-child {
    margin-top: 0;
}

.bg-body h2,
.bg-body h3,
.bg-body h4 {
    margin: 1.8em 0 .6em;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--bg-ink);
}

.bg-body h2 { font-size: 1.7rem; }
.bg-body h3 { font-size: 1.35rem; }
.bg-body h4 { font-size: 1.1rem; }

.bg-body p,
.bg-body ul,
.bg-body ol {
    margin: 0 0 1.2em;
}

.bg-body ul,
.bg-body ol {
    padding-left: 1.4em;
}

.bg-body li {
    margin-bottom: .4em;
}

.bg-body a {
    color: var(--bg-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bg-body a:hover {
    color: var(--bg-primary);
}

.bg-body blockquote {
    margin: 1.6em 0;
    padding: 6px 0 6px 22px;
    border-left: 4px solid var(--bg-primary);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--bg-ink);
}

.bg-body img {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
}

.bg-body hr {
    margin: 2.2em 0;
    border: 0;
    border-top: 1px solid var(--bg-line);
}

.bg-body code {
    padding: 2px 6px;
    background: var(--bg-soft);
    border-radius: 6px;
    font-size: .92em;
}

.bg-body pre {
    margin: 1.4em 0;
    padding: 16px 18px;
    overflow-x: auto;
    background: var(--bg-plum-2);
    border-radius: 14px;
    color: #fff;
}

.bg-body pre code {
    padding: 0;
    background: none;
    color: inherit;
}

.bg-body table {
    display: block;
    width: 100%;
    margin: 1.4em 0;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: .95rem;
}

.bg-body th,
.bg-body td {
    padding: 10px 14px;
    border: 1px solid var(--bg-line);
    text-align: left;
}

.bg-body th {
    background: var(--bg-soft);
}

.bg-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 44px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--bg-line);
}

.bg-back {
    margin-left: auto;
    font-weight: 800;
    color: var(--bg-deep);
    text-decoration: none;
}

.bg-back:hover {
    color: var(--bg-primary);
}

.bg-related {
    margin-top: clamp(40px, 5vw, 72px);
    background: var(--bg-soft);
    border-top: 1px solid var(--bg-line);
    border-bottom: 1px solid var(--bg-line);
}

/* ---------- CTA banner ---------- */
.bg-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: clamp(28px, 5vw, 48px);
    color: #fff;
    background: linear-gradient(135deg, var(--bg-plum) 0%, var(--bg-plum-2) 100%);
    border-radius: 28px;
}

.bg-banner::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -8%;
    width: 46%;
    height: 180%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--primary-color) 28%, transparent), transparent 70%);
    pointer-events: none;
}

.bg-banner > * {
    position: relative;
}

.bg-banner h2 {
    margin: 0 0 6px;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

.bg-banner p {
    margin: 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, .72);
}

@media (prefers-reduced-motion: reduce) {
    .bg-card,
    .bg-btn,
    .bg-card-cover img {
        transition: none;
    }
}

/* ---------- Tablet ---------- */
@media (max-width: 991.98px) {
    .bg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bg-featured {
        grid-template-columns: minmax(0, 1fr);
    }

    .bg-featured-cover {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .bg-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- Phone ---------- */
@media (max-width: 575.98px) {
    .bg-container {
        padding: 0 16px;
    }

    .bg-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .bg-body {
        font-size: 1.02rem;
    }

    .bg-post-cover {
        margin-bottom: 28px;
        border-radius: 20px;
    }

    .bg-pager {
        gap: 10px;
    }

    .bg-pager a,
    .bg-pager .is-disabled {
        padding: 9px 14px;
    }

    .bg-back {
        margin-left: 0;
        width: 100%;
    }

    .bg-actions .bg-btn {
        flex: 1 1 100%;
    }
}
