/*
 * blog.css
 * Blog index, archives and single posts (home.php, archive.php, single.php).
 *
 * Scoped with .blog-page on <main>. Enqueued after the Tailwind CDN reset, so
 * article typography is declared explicitly under .blog-content.
 * Reuses from style.css: design tokens, .page-hero, .cta-banner, .btn
 */

.blog-page {
    --blog-accent: #7a94ff;
    --blog-accent-soft: rgba(122, 148, 255, 0.12);
    --blog-card-border: rgba(0, 0, 0, 0.08);
    --blog-card-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --blog-header-offset: 110px;
    /* style.css's subtle grey is 4.3:1 on the page background; darken it here. */
    --color-text-subtle: #5f5f6e;
    background-color: var(--color-bg);
}

/* style.css renders <em> as a dark highlight chip; inside the blog it is plain emphasis. */
.blog-page em {
    padding: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font-style: italic;
}

/* Same 1280px column as the site header and .container, with a safe gutter. */
.blog-container {
    width: min(var(--page-width), calc(100% - 48px));
    margin-inline: auto;
}

.blog-article__hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 64px;
    align-items: center;
}

.blog-article__intro {
    min-width: 0;
}

.blog-page a:focus-visible,
.blog-page button:focus-visible {
    outline: 2px solid var(--color-dark);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ====================================================================
   SHARED: chips, meta
   ==================================================================== */

.blog-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-white);
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    line-height: 1;
    color: var(--color-text-muted);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.blog-chip:hover,
.blog-chip.is-active {
    background: var(--color-dark);
    border-color: var(--color-dark);
    color: var(--color-white);
}

.blog-chip--sm {
    align-self: flex-start;
    padding: 6px 12px;
    border-color: transparent;
    background: var(--blog-accent-soft);
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #3d55c4;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--color-text-subtle);
}

/* ====================================================================
   LISTING (index + archives)
   ==================================================================== */

.blog-hero {
    position: relative;
    overflow: hidden;
    padding-top: 150px;
    background-color: var(--color-bg);
}

.blog-hero__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(760px 480px at 12% 18%, rgba(184, 171, 255, 0.38) 0%, transparent 70%),
        radial-gradient(640px 420px at 88% 30%, rgba(112, 177, 241, 0.26) 0%, transparent 70%),
        radial-gradient(520px 360px at 55% 95%, rgba(255, 185, 130, 0.2) 0%, transparent 70%);
}

/* Faint grid that fades out towards the edges. */
.blog-hero__glow::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(17, 17, 17, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 17, 17, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

.blog-hero__inner {
    position: relative;
    z-index: 1;
    padding-bottom: var(--sp-3xl);
}

.blog-hero--split .blog-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: 72px;
    align-items: center;
}

.blog-hero__copy {
    max-width: 640px;
}

.blog-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--sp-lg);
    padding: 8px 16px;
    border: 1px solid rgba(17, 17, 17, 0.1);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: var(--fw-bold);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--color-dark);
}

.blog-hero__dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
}

.blog-hero__dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(22, 163, 74, 0.35);
    animation: blog-pulse 2s ease-out infinite;
}

@keyframes blog-pulse {
    from { transform: scale(0.6); opacity: 1; }
    to { transform: scale(1.8); opacity: 0; }
}

.blog-hero__title {
    font-size: clamp(40px, 5.4vw, 72px);
    font-weight: var(--fw-semibold);
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: var(--color-dark);
    overflow-wrap: anywhere;
}

.blog-hero__accent {
    display: block;
    background: linear-gradient(90deg, #5b6cff 0%, #9b7bff 45%, #ff8a5c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #5b6cff;
}

.blog-hero__sub {
    max-width: 520px;
    margin-top: var(--sp-lg);
    font-size: var(--fs-md);
    line-height: 1.6;
    color: var(--color-text-muted);
}

.blog-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: var(--sp-xl);
}

.blog-hero__feature-label {
    margin-bottom: 12px;
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

.blog-hero__feature .blog-card {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 60px -24px rgba(44, 20, 72, 0.35), var(--shadow-sm);
}

/* -- 22-language ticker -- */
.blog-ticker {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(17, 17, 17, 0.08);
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.blog-ticker__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-xl);
    min-height: 68px;
}

.blog-ticker__label {
    flex-shrink: 0;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

.blog-ticker__label strong {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    color: var(--color-dark);
}

.blog-ticker__track {
    display: flex;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.blog-ticker__list {
    display: flex;
    flex-shrink: 0;
    gap: 40px;
    padding-right: 40px;
    list-style: none;
    animation: blog-ticker 60s linear infinite;
}

.blog-ticker__list li {
    display: flex;
    align-items: center;
    gap: 40px;
    font-size: var(--fs-lg);
    white-space: nowrap;
    color: rgba(17, 17, 17, 0.72);
}

.blog-ticker__list li::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--blog-accent);
}

.blog-ticker__track:hover .blog-ticker__list {
    animation-play-state: paused;
}

@keyframes blog-ticker {
    to { transform: translateX(-100%); }
}

/* -- Grid section -- */
.blog-listing {
    padding: var(--sp-3xl) 0 var(--sp-5xl);
}

.blog-listing__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-md);
    margin-bottom: var(--sp-xl);
}

.blog-listing__heading {
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.02em;
}

.blog-listing__count {
    font-size: var(--fs-sm);
    color: var(--color-text-subtle);
}

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

.blog-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-white);
    border: 1px solid var(--blog-card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--blog-card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.blog-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e9e9f5;
}

.blog-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card__placeholder {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding: 20px;
    background:
        radial-gradient(420px 260px at 20% 20%, rgba(184, 171, 255, 0.55) 0%, transparent 70%),
        radial-gradient(380px 240px at 85% 80%, rgba(112, 177, 241, 0.45) 0%, transparent 70%),
        radial-gradient(300px 200px at 60% 30%, rgba(255, 185, 130, 0.3) 0%, transparent 70%),
        #f1f0fa;
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    color: rgba(17, 17, 17, 0.55);
}

.blog-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
}

.blog-card__title {
    /* Two lines, always reserved, so every card in a row lines up. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: calc(2em * 1.3);
    overflow-wrap: anywhere;
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.blog-card__title a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.blog-card__excerpt {
    /* Three lines, always reserved; the meta row stays pinned below. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    min-height: calc(3em * 1.6);
    margin-bottom: auto;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.blog-card--featured .blog-card__media {
    aspect-ratio: 16 / 9;
}

.blog-card--featured .blog-card__body {
    gap: 14px;
    padding: 28px;
}

.blog-card--featured .blog-card__title {
    min-height: calc(2em * 1.22);
    font-size: clamp(22px, 2.2vw, 28px);
    line-height: 1.22;
}

.blog-card--featured .blog-card__excerpt {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: calc(2em * 1.6);
    font-size: var(--fs-base);
}

.blog-pagination {
    margin-top: var(--sp-2xl);
}

.blog-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-white);
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

.blog-pagination a.page-numbers:hover,
.blog-pagination .page-numbers.current {
    background: var(--color-dark);
    border-color: var(--color-dark);
    color: var(--color-white);
}

.blog-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: var(--sp-3xl) var(--sp-lg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    text-align: center;
    color: var(--color-text-muted);
}

.blog-empty__title {
    font-size: var(--fs-xl);
}

/* ====================================================================
   SINGLE: progress, header
   ==================================================================== */

.blog-progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 103;
    height: 3px;
    pointer-events: none;
}

.blog-progress__bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #b8abff, var(--blog-accent));
    transform: scaleX(0);
    transform-origin: left;
}

.blog-article__header {
    position: relative;
    overflow: hidden;
    margin-bottom: var(--sp-xl);
    padding: 150px 0 var(--sp-2xl);
}

.blog-article__header > .blog-container {
    position: relative;
    z-index: 1;
}

/* Same glow as the index hero, minus the warm bottom spot the header would cut off. */
.blog-article__header .blog-hero__glow {
    background:
        radial-gradient(760px 480px at 12% 10%, rgba(184, 171, 255, 0.38) 0%, transparent 70%),
        radial-gradient(640px 420px at 88% 25%, rgba(112, 177, 241, 0.26) 0%, transparent 70%);
}

.blog-article__header .blog-hero__eyebrow {
    margin-bottom: var(--sp-md);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.blog-article__header .blog-hero__eyebrow:hover {
    border-color: var(--color-dark);
    background: var(--color-white);
}

.blog-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--sp-lg);
    font-size: var(--fs-sm);
    color: var(--color-text-subtle);
}

.blog-breadcrumb a:hover {
    color: var(--color-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-article__title {
    overflow-wrap: anywhere;
    margin-bottom: var(--sp-md);
    font-size: clamp(32px, 4.2vw, 54px);
    font-weight: var(--fw-semibold);
    line-height: 1.06;
    letter-spacing: -0.03em;
    color: var(--color-dark);
}

.blog-article__lead {
    max-width: 720px;
    margin-bottom: var(--sp-lg);
    font-size: var(--fs-lg);
    line-height: 1.55;
    color: var(--color-text-muted);
}

.blog-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: var(--sp-xl);
}

.blog-byline__avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b6cff, #9b7bff 55%, #ff8a5c);
    box-shadow: 0 0 0 3px var(--color-white);
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    color: var(--color-white);
}

.blog-byline__name {
    font-family: var(--font-heading);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--color-dark);
}

.blog-byline__name:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-byline .blog-meta {
    margin-top: 2px;
}

.blog-article__cover {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 70px -30px rgba(44, 20, 72, 0.4), var(--shadow-sm);
}

.blog-article__cover img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* -- Branded cover for posts without a featured image -- */
.blog-post-art {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    aspect-ratio: 4 / 3;
    padding: 28px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(360px 260px at 15% 15%, rgba(122, 148, 255, 0.55) 0%, transparent 70%),
        radial-gradient(340px 260px at 90% 90%, rgba(255, 138, 92, 0.38) 0%, transparent 70%),
        var(--color-dark);
    box-shadow: 0 30px 70px -30px rgba(44, 20, 72, 0.45), var(--shadow-sm);
    color: var(--color-white);
}

.blog-post-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
}

.blog-post-art > * {
    position: relative;
}


.blog-post-art__glyph {
    align-self: center;
    font-size: clamp(56px, 7vw, 104px);
    line-height: 1.2;
    background: linear-gradient(120deg, #ffffff 30%, #b8c4ff 60%, #ffb48f);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


.blog-post-art__brand {
    position: absolute !important;
    bottom: 24px;
    left: 28px;
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
}


/* ====================================================================
   SINGLE: layout + table of contents
   ==================================================================== */

.blog-article__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 80px;
    align-items: start;
    padding-bottom: var(--sp-3xl);
}

/* No TOC: the article keeps the container's left edge, like every other post. */
.blog-article__layout--no-toc {
    grid-template-columns: minmax(0, 1fr);
}

.blog-article__main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: 820px;
}

.blog-toc {
    position: sticky;
    top: var(--blog-header-offset);
    grid-column: 2;
    grid-row: 1;
    padding: var(--sp-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.blog-toc__toggle:disabled {
    opacity: 1;
}

.blog-toc__percent {
    margin-left: auto;
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    color: var(--blog-accent);
}

.blog-toc__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-subtle);
    cursor: default;
}

.blog-toc__chevron {
    display: none;
    transition: transform 0.2s ease;
}

.blog-toc__body {
    max-height: calc(100vh - var(--blog-header-offset) - 110px);
    margin-top: var(--sp-md);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.blog-toc__list,
.blog-toc__sublist {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
}

.blog-toc__sublist {
    margin: 2px 0 4px 12px;
}

.blog-toc__link {
    display: block;
    padding: 7px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: var(--fs-sm);
    line-height: 1.4;
    color: var(--color-text-muted);
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.blog-toc__sublist .blog-toc__link {
    font-size: 13px;
    color: var(--color-text-subtle);
}

.blog-toc__link:hover {
    background: var(--color-bg);
    color: var(--color-dark);
}

.blog-toc__link.is-active {
    border-left-color: var(--blog-accent);
    background: var(--blog-accent-soft);
    color: var(--color-dark);
}

/* ====================================================================
   SINGLE: article typography (explicit — Tailwind resets the defaults)
   ==================================================================== */

.blog-content {
    font-size: 18px;
    line-height: 1.75;
    color: #2b2b2b;
    overflow-wrap: break-word;
}

.blog-content > * + * {
    margin-top: 1.4em;
}

.blog-content h2,
.blog-content h3,
.blog-content h4 {
    scroll-margin-top: var(--blog-header-offset);
    font-weight: var(--fw-semibold);
    letter-spacing: -0.01em;
    color: var(--color-dark);
}

.blog-content h2 {
    margin-top: 2.2em;
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.25;
}

.blog-content h3 {
    margin-top: 1.8em;
    font-size: clamp(20px, 2.4vw, 23px);
    line-height: 1.3;
}

.blog-content h4 {
    margin-top: 1.6em;
    font-size: var(--fs-md);
}

.blog-content h2 + *,
.blog-content h3 + *,
.blog-content h4 + * {
    margin-top: 0.7em;
}

.blog-content a {
    color: #3d55c4;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.blog-content a:hover {
    color: var(--color-dark);
}

.blog-content strong {
    font-weight: var(--fw-semibold);
    color: var(--color-dark);
}

.blog-content ul,
.blog-content ol {
    padding-left: 1.4em;
}

.blog-content ul {
    list-style: disc;
}

.blog-content ol {
    list-style: decimal;
}

.blog-content li + li,
.blog-content li > ul,
.blog-content li > ol {
    margin-top: 0.5em;
}

.blog-content li::marker {
    color: var(--blog-accent);
}

.blog-content blockquote {
    padding: 20px 24px;
    border-left: 3px solid var(--blog-accent);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    background: var(--color-white);
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    line-height: 1.5;
    color: var(--color-dark);
}

.blog-content blockquote cite {
    display: block;
    margin-top: 10px;
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-style: normal;
    color: var(--color-text-subtle);
}

.blog-content img,
.blog-content video,
.blog-content iframe {
    max-width: 100%;
    border-radius: var(--radius-lg);
}

.blog-content figcaption {
    margin-top: 10px;
    font-size: var(--fs-sm);
    text-align: center;
    color: var(--color-text-subtle);
}

.blog-content hr {
    margin-block: 2.4em;
    border: 0;
    border-top: 1px solid var(--color-border);
}

.blog-content code {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(17, 17, 17, 0.07);
    font-size: 0.88em;
}

.blog-content pre {
    padding: 20px;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background: var(--color-dark);
    font-size: 15px;
    line-height: 1.6;
    color: #f3f4f1;
}

.blog-content pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}

.blog-content .wp-block-table,
.blog-content > table {
    overflow-x: auto;
}

.blog-content > table {
    display: block;
    width: max-content;
    max-width: 100%;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-base);
}

.blog-content td {
    background: var(--color-white);
}

.blog-content th,
.blog-content td {
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    text-align: left;
}

.blog-content th {
    background: var(--color-bg);
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
}

/* ====================================================================
   SINGLE: core blocks and classic markup inside articles
   Editors can use any core block; these rules bring each one onto the
   theme's tokens (buttons, radii, borders) instead of WordPress defaults.
   ==================================================================== */

/* -- Alignment (block editor and classic editor) -- */
.blog-content::after {
    content: "";
    display: table;
    clear: both;
}

.blog-content h2,
.blog-content h3 {
    clear: both;
}

.blog-content .alignleft {
    float: left;
    max-width: min(50%, 360px);
    margin: 0.35em 1.6em 1em 0;
}

.blog-content .alignright {
    float: right;
    max-width: min(50%, 360px);
    margin: 0.35em 0 1em 1.6em;
}

.blog-content figure.aligncenter,
.blog-content .wp-caption.aligncenter {
    display: table;
    margin-inline: auto;
}

.blog-content img.aligncenter {
    display: block;
    margin-inline: auto;
}

.blog-content .wp-caption {
    max-width: 100%;
}

.blog-content .wp-caption-text {
    margin-top: 10px;
    font-size: var(--fs-sm);
    text-align: center;
    color: var(--color-text-subtle);
}

/* Wide/full alignments stay in the reading column: the TOC sits beside it. */
.blog-content .alignwide,
.blog-content .alignfull {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
}

/* -- Text -- */
.blog-content .has-drop-cap:not(:focus)::first-letter {
    margin: 0.08em 0.12em 0 0;
    font-family: var(--font-heading);
    font-size: 4.2em;
    font-weight: var(--fw-semibold);
    line-height: 0.85;
    color: var(--color-dark);
}

.blog-content h5 {
    margin-top: 1.6em;
    font-size: var(--fs-base);
}

.blog-content h6 {
    margin-top: 1.6em;
    font-size: var(--fs-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

.blog-content p.has-background,
.blog-content .wp-block-group.has-background,
.blog-content .wp-block-columns.has-background {
    padding: 20px 24px;
    border-radius: var(--radius-lg);
}

.blog-content mark {
    padding: 0 0.15em;
    border-radius: 3px;
}

.blog-content kbd {
    padding: 1px 6px;
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    background: var(--color-white);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82em;
    color: var(--color-dark);
}

.blog-content abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

.blog-content dt {
    font-weight: var(--fw-semibold);
    color: var(--color-dark);
}

.blog-content dd {
    margin: 0.25em 0 0.8em;
    color: var(--color-text-muted);
}

/* -- Quotes -- */
.blog-content .wp-block-quote.is-style-plain {
    padding: 0;
    border: 0;
    background: none;
}

.blog-content .wp-block-quote > * + * {
    margin-top: 0.6em;
}

.blog-content .wp-block-pullquote {
    padding: 36px 0;
    border-top: 2px solid var(--color-dark);
    border-bottom: 2px solid var(--color-dark);
    text-align: center;
}

.blog-content .wp-block-pullquote blockquote {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.35;
}

.blog-content .wp-block-pullquote cite {
    margin-top: 14px;
}

/* -- Media -- */
.blog-content video,
.blog-content audio {
    width: 100%;
}

.blog-content video {
    height: auto;
    background: var(--color-dark);
}

.blog-content iframe,
.blog-content embed,
.blog-content object {
    max-width: 100%;
}

/* Video embeds (block or pasted iframe) fill the column at 16:9. */
.blog-content .wp-block-embed.is-type-video iframe,
.blog-content iframe[src*="youtube.com"],
.blog-content iframe[src*="youtube-nocookie.com"],
.blog-content iframe[src*="vimeo.com"],
.blog-content iframe[src*="loom.com"] {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}

.blog-content .wp-block-embed__wrapper {
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.blog-content .wp-block-gallery {
    gap: 12px;
}

.blog-content .wp-block-cover,
.blog-content .wp-block-media-text {
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.blog-content .wp-block-cover img,
.blog-content .wp-block-media-text img {
    border-radius: 0;
}

.blog-content .wp-block-media-text {
    background: var(--color-white);
}

.blog-content .wp-block-columns {
    gap: 24px;
}

/* -- Buttons and file downloads: same pill as the theme's .btn -- */
.blog-content .wp-block-buttons {
    gap: 12px;
}

.blog-content .wp-block-button__link,
.blog-content .wp-block-file__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 26px;
    border: 2px solid var(--color-dark);
    border-radius: var(--radius-full);
    background: var(--color-dark);
    font-family: var(--font-heading);
    font-size: var(--fs-base);
    line-height: 1;
    text-decoration: none;
    color: var(--color-white);
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.blog-content .wp-block-button__link:hover,
.blog-content .wp-block-file__button:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: var(--color-white);
}

.blog-content .wp-block-button.has-custom-width .wp-block-button__link {
    width: 100%;
}

.blog-content .is-style-outline > .wp-block-button__link {
    background: transparent;
    color: var(--color-dark);
}

.blog-content .is-style-outline > .wp-block-button__link:hover {
    background: var(--color-dark);
    color: var(--color-white);
}

/* Editor-chosen colours win over the defaults above. */
.blog-content .wp-block-button__link.has-background {
    border-color: transparent;
}

.blog-content .wp-block-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 16px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    font-size: var(--fs-base);
}

.blog-content .wp-block-file > a:not(.wp-block-file__button) {
    overflow-wrap: anywhere;
    color: var(--color-dark);
}

.blog-content .wp-block-file__button {
    margin-left: auto;
    padding: 10px 20px;
    font-size: var(--fs-sm);
}

/* -- Tables: one look for default and striped -- */
.blog-content .wp-block-table thead,
.blog-content .wp-block-table tfoot {
    border: 0;
}

.blog-content .wp-block-table.is-style-stripes {
    border-bottom: 0;
}

.blog-content .wp-block-table.is-style-stripes th,
.blog-content .wp-block-table.is-style-stripes td {
    border-color: var(--color-border);
}

.blog-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) td {
    background: var(--color-bg);
}

.blog-content tfoot td {
    font-weight: var(--fw-semibold);
}

/* -- Preformatted and verse read as text, not code -- */
.blog-content .wp-block-preformatted {
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-dark);
}

.blog-content .wp-block-verse {
    padding: 0 0 0 20px;
    border-left: 2px solid var(--blog-accent);
    border-radius: 0;
    background: none;
    font-family: var(--font-body);
    font-size: inherit;
    font-style: italic;
    color: inherit;
    white-space: pre-wrap;
}

/* -- Details -- */
.blog-content .wp-block-details,
.blog-content details {
    padding: 16px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
}

.blog-content summary {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    color: var(--color-dark);
    cursor: pointer;
}

.blog-content details[open] > summary {
    margin-bottom: 10px;
}

/* -- Social links and other lists that are not prose lists -- */
.blog-content ul.wp-block-social-links {
    padding-left: 0;
    list-style: none;
}

.blog-content ul.wp-block-social-links li::marker {
    content: none;
}

@media (max-width: 480px) {
    .blog-content .alignleft,
    .blog-content .alignright {
        float: none;
        max-width: 100%;
        margin: 0 0 1em;
    }

    .blog-content .wp-block-file__button {
        margin-left: 0;
    }
}

/* ====================================================================
   SINGLE: footer, adjacent, related
   ==================================================================== */

.blog-article__footer {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
    margin-top: var(--sp-2xl);
    padding-top: var(--sp-lg);
    border-top: 1px solid var(--color-border);
}

.blog-tags,
.blog-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.blog-tags a,
.blog-share__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-white);
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.blog-tags a::before {
    content: "#";
}

.blog-tags a:hover,
.blog-share__btn:hover {
    background: var(--color-dark);
    border-color: var(--color-dark);
    color: var(--color-white);
}

.blog-share__label {
    margin-right: 4px;
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

.blog-adjacent {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding-bottom: var(--sp-3xl);
}

.blog-adjacent__link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border: 1px solid var(--blog-card-border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.blog-adjacent__link:hover {
    border-color: var(--color-dark);
    box-shadow: var(--blog-card-shadow);
}

.blog-adjacent__link--next {
    align-items: flex-end;
    text-align: right;
}

.blog-adjacent__dir {
    font-size: var(--fs-sm);
    color: var(--color-text-subtle);
}

.blog-adjacent__title {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    line-height: 1.35;
    color: var(--color-dark);
}

.blog-related {
    padding: var(--sp-3xl) 0 var(--sp-4xl);
    border-top: 1px solid var(--color-border);
}

.blog-related__heading {
    margin-bottom: var(--sp-xl);
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.02em;
}

/* ====================================================================
   SINGLE: Twenty2 CTA card
   ==================================================================== */

.blog-cta-card {
    position: relative;
    display: grid;
    margin-top: var(--sp-2xl);
    padding: 36px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(122, 148, 255, 0.45) 0%, transparent 70%),
        radial-gradient(380px 260px at 100% 100%, rgba(255, 138, 92, 0.3) 0%, transparent 70%),
        var(--color-dark);
    color: var(--color-white);
}

.blog-cta-card__eyebrow {
    margin-bottom: 10px;
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #b8c4ff;
}

.blog-cta-card__title {
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-white);
}

.blog-cta-card__text {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.blog-cta-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-top: var(--sp-lg);
}

.blog-cta-card__actions .btn {
    min-width: 0;
    padding: 14px 24px;
}

.blog-cta-card__link {
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    color: var(--color-white);
}

.blog-cta-card__link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}




.blog-cta-card a:focus-visible {
    outline-color: var(--color-white);
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */

@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


    .blog-article__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--sp-xl);
    }

    .blog-toc {
        max-width: 820px;
    }

    .blog-article__main,
    .blog-toc {
        grid-column: 1;
        grid-row: auto;
    }

    /* TOC becomes a collapsible card above the article. */
    .blog-toc {
        position: static;
        padding: 0;
    }

    .blog-toc__toggle {
        min-height: 52px;
        padding: 0 20px;
        cursor: pointer;
    }

    .blog-toc__chevron {
        display: block;
    }

    .blog-toc__toggle[aria-expanded="true"] .blog-toc__chevron {
        transform: rotate(180deg);
    }

    .blog-toc__body {
        max-height: 50vh;
        margin: 0;
        padding: 0 12px 16px;
    }

    .blog-toc__toggle[aria-expanded="false"] + .blog-toc__body {
        display: none;
    }
}

@media (max-width: 900px) {
    .blog-article__hero {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--sp-xl);
    }

    .blog-article__cover,
    .blog-post-art {
        aspect-ratio: 16 / 9;
    }

    .blog-hero--split .blog-hero__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--sp-2xl);
    }

    .blog-hero__feature {
        max-width: 640px;
    }
}

@media (max-width: 1024px) and (min-width: 901px) {
    .blog-hero--split .blog-hero__inner {
        gap: var(--sp-2xl);
    }
}

@media (max-width: 767px) {
    /* The decorative panel would push the article below the fold on phones. */
    .blog-post-art {
        display: none;
    }

    .blog-cta-card {
        padding: 28px 22px;
    }

    .blog-byline {
        margin-top: var(--sp-lg);
    }

    .blog-container {
        width: calc(100% - 32px);
    }

    .blog-hero,
    .blog-article__header {
        padding-top: 120px;
    }

    .blog-hero__inner {
        padding-bottom: var(--sp-2xl);
    }

    .blog-hero__sub {
        font-size: var(--fs-base);
    }

    .blog-ticker__inner {
        min-height: 56px;
    }

    .blog-ticker__label {
        display: none;
    }

    .blog-ticker__list li {
        font-size: var(--fs-md);
    }

    .blog-grid,
    .blog-adjacent {
        grid-template-columns: 1fr;
    }

    .blog-card--featured .blog-card__body {
        padding: 24px;
    }

    .blog-filter {
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin-inline: -16px;
        padding: 0 16px 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .blog-chip {
        flex-shrink: 0;
    }

    .blog-content {
        font-size: 17px;
    }

    .blog-adjacent__link--next {
        align-items: flex-start;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .blog-ticker__list,
    .blog-hero__dot::after {
        animation: none;
    }

    .blog-ticker__track {
        overflow-x: auto;
    }

    .blog-card,
    .blog-toc__chevron {
        transition: none;
    }

    .blog-card:hover {
        transform: none;
    }
}
