
/**
 * JOY-TEX — Single Post
 *
 * Scope: Native WordPress single posts.
 *
 * Step 02-A:
 * - Narrow editorial layout
 * - Shared horizontal alignment
 *
 * @package JOY_TEX
 */

/* =========================================================
   01. Narrow Editorial Layout
   ========================================================= */

.joy-single-post {
    --joy-single-post-reading-max: 47.5rem; /* 760px */
}

.joy-single-post__narrow {
    width: 100%;
    max-width: var(--joy-single-post-reading-max);
    min-width: 0;
    margin-inline: auto;
    text-align: left;
}


/* =========================================================
   02. Article Foundation
   ========================================================= */

.joy-single-post__article {
    min-width: 0;
}

/* Prevent ordinary media from exceeding reading width. */

.joy-single-post__article img {
    max-width: 100%;
    height: auto;
}

/* Featured Image — spacing before article body */

.joy-single-post__article > img.wp-post-image {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: var(--joy-space-7); /* 48px */
}

/* Single Post — align Breadcrumb with article content. */

.joy-single-post .joy-breadcrumb > .joy-container {
    padding-inline: 0;
}


/* =========================================================
   03. Article Header
   ========================================================= */

.joy-single-post__header {
    margin: 0 0 var(--joy-space-7);
}

.joy-single-post__title {
    margin: 0;
    color: var(--joy-color-editorial-heading);
    font-family: var(--joy-font-sans);
    font-size: 1.875rem;
    font-weight: var(--joy-font-weight-medium);
    line-height: 1.2;
    overflow-wrap: break-word;
}

/* =========================================================
   04. Article Metadata
   ========================================================= */

.joy-single-post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--joy-space-3);
    margin-top: var(--joy-space-4);
    color: var(--joy-color-editorial-secondary);
    font-family: var(--joy-font-sans);
    font-size: 0.875rem;
    font-weight: var(--joy-font-weight-regular);
    line-height: 1.5;
}

.joy-single-post__category,
.joy-single-post__category:visited {
    color: var(--joy-color-editorial-heading);
    font-weight: var(--joy-font-weight-medium);
    text-decoration: none;
    transition: color 160ms ease;
}

.joy-single-post__category:hover {
    color: var(--joy-color-accent-red);
    text-decoration: none;
}

.joy-single-post__category:focus-visible {
    outline: 2px solid var(--joy-color-brand);
    outline-offset: 3px;
}

.joy-single-post__date {
    color: var(--joy-color-editorial-secondary);
}

/* =========================================================
   05. Responsive Article Header
   ========================================================= */

@media (max-width: 999px) {
    .joy-single-post__title {
        font-size: 1.75rem;
    }
}

@media (max-width: 767px) {
    .joy-single-post__title {
        font-size: 1.625rem;
    }

    .joy-single-post__header {
        margin-bottom: var(--joy-space-6);
    }

    .joy-single-post__article > img.wp-post-image {
        margin-bottom: var(--joy-space-6); /* 32px */
    }
}


/* =========================================================
   06. Article Body — Typography & Headings
   Scope: Single Post Gutenberg content only.
   ========================================================= */

.joy-single-post .entry-content {
    min-width: 0;
    color: var(--joy-color-editorial-secondary);
    font-family: var(--joy-font-sans);
    font-size: 1rem;
    font-weight: var(--joy-font-weight-regular);
    line-height: 1.7;
    overflow-wrap: break-word;
}

/* Paragraphs */

.joy-single-post .entry-content p {
    margin: 0 0 1.25rem;
}

/* Heading foundation */

.joy-single-post .entry-content :is(h2, h3, h4, h5, h6) {
    color: var(--joy-color-editorial-heading);
    font-family: var(--joy-font-sans);
    font-weight: var(--joy-font-weight-medium);
    overflow-wrap: break-word;
}

/* Individual heading hierarchy */

.joy-single-post .entry-content h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.625rem;
    line-height: 1.3;
}

.joy-single-post .entry-content h3 {
    margin: 2rem 0 0.75rem;
    font-size: 1.3125rem;
    line-height: 1.35;
}

.joy-single-post .entry-content h4 {
    margin: 1.75rem 0 0.75rem;
    font-size: 1.125rem;
    line-height: 1.4;
}

.joy-single-post .entry-content h5 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1rem;
    font-weight: var(--joy-font-weight-semibold);
    line-height: 1.45;
}

.joy-single-post .entry-content h6 {
    margin: 1.5rem 0 0.5rem;
    color: var(--joy-color-editorial-secondary);
    font-size: 0.875rem;
    font-weight: var(--joy-font-weight-semibold);
    line-height: 1.5;
}

/* Emphasis */

.joy-single-post .entry-content strong,
.joy-single-post .entry-content b {
    color: var(--joy-color-text);
    font-weight: var(--joy-font-weight-semibold);
}

/* Content boundaries */

.joy-single-post .entry-content > :first-child {
    margin-top: 0;
}

.joy-single-post .entry-content > :last-child {
    margin-bottom: 0;
}

/* Tablet */

@media (max-width: 999px) {
    .joy-single-post .entry-content h2 {
        font-size: 1.5rem;
    }

    .joy-single-post .entry-content h3 {
        font-size: 1.25rem;
    }
}

/* Mobile */

@media (max-width: 767px) {
    .joy-single-post .entry-content h2 {
        font-size: 1.4375rem;
    }

    .joy-single-post .entry-content h3 {
        font-size: 1.1875rem;
    }

    .joy-single-post .entry-content h4 {
        font-size: 1.0625rem;
    }
}



/* =========================================================
   07. Article Body — Lists & Nested Lists
   Scope: Single Post Gutenberg content only.
   ========================================================= */

/* Base lists */

.joy-single-post .entry-content :is(ul, ol) {
    margin: 0 0 1.25rem;
    padding-inline-start: 1.5rem;

    color: var(--joy-color-editorial-secondary);
    font-size: inherit;
    line-height: inherit;
}

/* Preserve native list markers */

.joy-single-post .entry-content ul {
    list-style-type: disc;
}

.joy-single-post .entry-content ol {
    list-style-type: decimal;
}

/* List items */

.joy-single-post .entry-content li {
    margin: 0;
    padding: 0;
}

.joy-single-post .entry-content li + li {
    margin-top: 0.5rem;
}

/* Marker styling */

.joy-single-post .entry-content li::marker {
    color: var(--joy-color-editorial-heading);
}

/* Nested lists */

.joy-single-post .entry-content li > :is(ul, ol) {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Nested unordered list hierarchy */

.joy-single-post .entry-content ul ul {
    list-style-type: circle;
}

.joy-single-post .entry-content ul ul ul {
    list-style-type: square;
}

/* Paragraphs inside list items */

.joy-single-post .entry-content li > p {
    margin: 0;
}

.joy-single-post .entry-content li > p + p {
    margin-top: 0.5rem;
}


/* =========================================================
   08. Article Body — Images, Videos & Captions
   Scope: Single Post Gutenberg content only.
   ========================================================= */

/* Media blocks: consistent editorial spacing */

.joy-single-post .entry-content > :is(
    .wp-block-image,
    .wp-block-video,
    .wp-block-embed,
    .wp-block-gallery
) {
    margin-block: var(--joy-space-6);
}

/* Images */

.joy-single-post .entry-content .wp-block-image {
    max-width: 100%;
}

.joy-single-post .entry-content .wp-block-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0;
}

/* Native video */

.joy-single-post .entry-content .wp-block-video video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* Embedded video */

.joy-single-post .entry-content .wp-block-embed {
    max-width: 100%;
    min-width: 0;
}

.joy-single-post .entry-content .wp-block-embed__wrapper {
    max-width: 100%;
}

.joy-single-post .entry-content .wp-block-embed.is-type-video iframe {
    max-width: 100%;
}

/* Gutenberg Gallery */

.joy-single-post .entry-content .wp-block-gallery {
    max-width: 100%;
}

.joy-single-post .entry-content .wp-block-gallery .wp-block-image {
    margin: 0;
}

/* Captions */

.joy-single-post .entry-content :is(
    .wp-element-caption,
    .wp-block-image figcaption,
    .wp-block-video figcaption,
    .wp-block-embed figcaption,
    .wp-block-gallery figcaption
) {
    margin: 0.5rem 0 0;
    color: var(--joy-color-editorial-secondary);
    font-family: var(--joy-font-sans);
    font-size: 0.875rem; /* 14px */
    font-weight: var(--joy-font-weight-regular);
    line-height: 1.5;
    text-align: left;
}

/* Remove unexpected margins inside media figures */

.joy-single-post .entry-content .wp-block-image > figure,
.joy-single-post .entry-content .wp-block-gallery figure {
    margin-block: 0;
}

/* Mobile */

@media (max-width: 767px) {
    .joy-single-post .entry-content > :is(
        .wp-block-image,
        .wp-block-video,
        .wp-block-embed,
        .wp-block-gallery
    ) {
        margin-block: var(--joy-space-5);
    }
}


/* =========================================================
   09. Article Body — Tables & Wide Tables
   Scope: Single Post Gutenberg content only.
   ========================================================= */

.joy-single-post {
    --joy-single-post-table-wide-max: 70rem; /* 1120px */
}

/* Gutenberg Table Block */

.joy-single-post .entry-content > .wp-block-table {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: var(--joy-space-6) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table appearance */

.joy-single-post .entry-content .wp-block-table table {
    width: 100% !important;
    min-width: 0;
    margin: 0;
    border: 0 !important;
    border-collapse: collapse;
    border-spacing: 0;
    background: transparent !important;
    color: var(--joy-color-text);
    font-family: var(--joy-font-sans);
    font-size: 0.875rem !important;
    line-height: 1.55;
}

/* Cells */

.joy-single-post .entry-content .wp-block-table :is(th, td) {
    min-width: 0;
    padding: 0.875rem 1rem !important;
    border: 0 !important;
    border-bottom: 1px solid var(--joy-color-rule) !important;
    background: transparent !important;
    color: var(--joy-color-text) !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-align: left;
    vertical-align: top;
}

/* Header cells */

.joy-single-post .entry-content .wp-block-table th {
    font-weight: var(--joy-font-weight-semibold) !important;
}

.joy-single-post .entry-content .wp-block-table thead th {
    border-bottom-color: var(--joy-color-border) !important;
    color: var(--joy-color-ink) !important;
}

/* Neutralize common pasted inline text formatting */

.joy-single-post .entry-content .wp-block-table :is(th, td)
:is(span, strong, em) {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
}

/* Optional Wide Table
   Gutenberg block class: is-style-joy-wide-table */

@media (min-width: 768px) {
    .joy-single-post .entry-content >
    .wp-block-table.is-style-joy-wide-table {
        width: min(
            var(--joy-single-post-table-wide-max),
            calc(100vw - 2 * var(--joy-container-gutter, 24px))
        );
        max-width: none;
        margin-inline: 50%;
        transform: translateX(-50%);
    }
}

/* Mobile */

@media (max-width: 767px) {
    .joy-single-post .entry-content > .wp-block-table {
        margin-block: var(--joy-space-5);
    }

    .joy-single-post .entry-content .wp-block-table table {
        font-size: 0.8125rem !important;
    }

    .joy-single-post .entry-content .wp-block-table :is(th, td) {
        padding: 0.75rem !important;
    }

    /* Wide Table — Horizontal Scrolling on Narrow Screens */
    .joy-single-post .entry-content >
    .wp-block-table.is-style-joy-wide-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .joy-single-post .entry-content >
    .wp-block-table.is-style-joy-wide-table table {
        width: 100% !important;
        min-width: 760px;
        table-layout: auto;
    }

    .joy-single-post .entry-content >
    .wp-block-table.is-style-joy-wide-table :is(th, td) {
        overflow-wrap: normal;
        word-break: normal;
    }
}



/* =========================================================
   10. Article Body — Links & Blockquotes
   Scope: Single Post Gutenberg content only.
   ========================================================= */


/* Inline links — exclude Gutenberg File download buttons */

.joy-single-post .entry-content
a:not(.wp-element-button):not(.wp-block-file__button) {
    color: var(--joy-color-brand);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 160ms ease;
}

.joy-single-post .entry-content
a:not(.wp-element-button):not(.wp-block-file__button):visited {
    color: var(--joy-color-brand);
}

.joy-single-post .entry-content
a:not(.wp-element-button):not(.wp-block-file__button):hover {
    color: var(--joy-color-accent-red);
}

.joy-single-post .entry-content
a:not(.wp-element-button):not(.wp-block-file__button):focus-visible {
    outline: 2px solid var(--joy-color-brand);
    outline-offset: 3px;
}

/* Bold inline links retain the same color and hover behavior. */
.joy-single-post .entry-content a:not(.wp-element-button):not(.wp-block-file__button) :is(strong, b) {
    color: inherit;
}

/* Gutenberg Quote Block */

.joy-single-post .entry-content .wp-block-quote {
    margin: var(--joy-space-6) 0;
    padding: 0 0 0 1.5rem;
    border: 0;
    border-left: 3px solid var(--joy-color-border);
    background: transparent;
    color: var(--joy-color-editorial-secondary);
}


/* Quote paragraphs */

.joy-single-post .entry-content .wp-block-quote p {
    margin: 0;
    color: inherit;
    font-size: 1.125rem;
    font-weight: var(--joy-font-weight-medium);
    line-height: 1.6;
    font-style: normal;
}

.joy-single-post .entry-content .wp-block-quote p + p {
    margin-top: 0.75rem;
}

/* Quote citation */

.joy-single-post .entry-content .wp-block-quote cite,
.joy-single-post .entry-content .wp-block-quote footer {
    display: block;
    margin-top: 0.75rem;
    color: var(--joy-color-editorial-secondary);
    font-family: var(--joy-font-sans);
    font-size: 0.875rem;
    font-weight: var(--joy-font-weight-regular);
    line-height: 1.5;
    font-style: normal;
}

/* Mobile */

@media (max-width: 767px) {
    .joy-single-post .entry-content .wp-block-quote {
        margin-block: var(--joy-space-5);
        padding-left: 1rem;
    }

    .joy-single-post .entry-content .wp-block-quote p {
        font-size: 1.0625rem;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    .joy-single-post .entry-content
    a:not(.wp-element-button):not(.wp-block-file__button) {
        transition: none;
    }
}



/* =========================================================
   11. Article Body — Supporting Gutenberg Blocks
   Scope: Single Post Gutenberg content only.
   ========================================================= */

/* ---------------------------------------------------------
   11.1 Separator
   --------------------------------------------------------- */

.joy-single-post .entry-content > .wp-block-separator {
    width: 100%;
    height: 0;
    margin: var(--joy-space-6) 0;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--joy-color-rule);
    background: transparent;
    opacity: 1;
}

/* ---------------------------------------------------------
   11.2 Inline Code
   --------------------------------------------------------- */

.joy-single-post .entry-content :not(pre) > code {
    padding: 0.125em 0.3em;
    background: var(--joy-color-surface-interactive);
    color: var(--joy-color-text);
    font-family: ui-monospace, SFMono-Regular, Consolas,
        "Liberation Mono", monospace;
    font-size: 0.875em;
    border-radius: 0;
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------
   11.3 Code & Preformatted Blocks
   --------------------------------------------------------- */

.joy-single-post .entry-content > :is(
    .wp-block-code,
    .wp-block-preformatted
) {
    max-width: 100%;
    margin: var(--joy-space-6) 0;
    padding: var(--joy-space-4);
    border: 0;
    border-radius: 0;
    background: var(--joy-color-surface-interactive);
    color: var(--joy-color-text);
    font-family: ui-monospace, SFMono-Regular, Consolas,
        "Liberation Mono", monospace;
    font-size: 0.875rem;
    font-weight: var(--joy-font-weight-regular);
    line-height: 1.6;
    white-space: pre;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Code Block internal element */

.joy-single-post .entry-content .wp-block-code code {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    white-space: inherit;
}

/* ---------------------------------------------------------
   11.4 File Block
   --------------------------------------------------------- */

.joy-single-post .entry-content > .wp-block-file {
    margin: var(--joy-space-6) 0;
    color: var(--joy-color-editorial-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* File name link */

.joy-single-post .entry-content .wp-block-file > a:not(
    .wp-block-file__button
) {
    color: var(--joy-color-brand);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* File download button — compact primary style */

.joy-single-post .entry-content .wp-block-file__button,
.joy-single-post .entry-content .wp-block-file__button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 2rem;
    margin: 0.5rem 0 0 1rem;
    padding: 0.5rem 0.75rem;

    border: 1px solid transparent;
    border-radius: 3px;

    background-color: var(--joy-color-brand);
    color: var(--joy-color-surface);

    font-family: var(--joy-font-sans);
    font-size: 0.8125rem;
    font-weight: var(--joy-font-weight-medium);
    line-height: 1.2;
    text-decoration: none;

    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.joy-single-post .entry-content .wp-block-file__button:hover {
    background-color: var(--joy-color-accent-red);
    color: var(--joy-color-surface);
    text-decoration: none;
}

.joy-single-post .entry-content .wp-block-file__button:focus-visible {
    outline: 2px solid var(--joy-color-brand);
    outline-offset: 3px;
}


/* ---------------------------------------------------------
   11.5 Mobile
   --------------------------------------------------------- */

@media (max-width: 767px) {

    .joy-single-post .entry-content > :is(
        .wp-block-separator,
        .wp-block-code,
        .wp-block-preformatted,
        .wp-block-file
    ) {
        margin-block: var(--joy-space-5);
    }

    .joy-single-post .entry-content > :is(
        .wp-block-code,
        .wp-block-preformatted
    ) {
        padding: var(--joy-space-3);
        font-size: 0.8125rem;
    }

    .joy-single-post .entry-content .wp-block-file__button {
        margin-left: 1rem;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    .joy-single-post .entry-content .wp-block-file__button {
        transition: none;
    }
}


/* =========================================================
   12. Article Footer — Social Sharing
   ========================================================= */

.joy-single-post__sharing {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: var(--joy-space-7); /* 48px */
    color: var(--joy-color-ink);
    font-family: var(--joy-font-sans);
}

.joy-single-post__sharing-label {
    color: var(--joy-color-editorial-secondary);
    font-size: 0.875rem;
    font-weight: var(--joy-font-weight-medium);
    line-height: 1.5;
}

.joy-single-post__sharing-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.joy-single-post__share-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    width: 36px;
    height: 36px;
    padding: 0;

    border: 0;
    border-radius: 0;
    background: transparent;

    color: var(--joy-color-ink);
    text-decoration: none;
    cursor: pointer;

    transition: color 160ms ease;
}

.joy-single-post__share-action:visited {
    color: var(--joy-color-ink);
}

.joy-single-post__share-action:hover,
.joy-single-post__share-action:visited:hover {
    color: var(--joy-color-accent-red);
}

.joy-single-post__share-action:focus-visible {
    outline: 2px solid var(--joy-color-brand);
    outline-offset: 3px;
}

.joy-single-post__share-icon {
    display: block;
    width: 24px;
    height: 24px;

    background-color: currentColor;

    -webkit-mask-image: var(--joy-share-mask);
    mask-image: var(--joy-share-mask);

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Mobile */

@media (max-width: 767px) {
    .joy-single-post__sharing {
        margin-top: var(--joy-space-6); /* 32px */
    }

    .joy-single-post__share-action {
        width: 44px;
        height: 44px;
    }
}

/* Reduced Motion */

@media (prefers-reduced-motion: reduce) {
    .joy-single-post__share-action {
        transition: none;
    }
}


/* =========================================================
   13. Article Footer — Previous / Next Post Navigation
   ========================================================= */

.joy-single-post__post-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--joy-space-6);
    margin-top: var(--joy-space-7); /* 48px after sharing */
    font-family: var(--joy-font-sans);
}

.joy-single-post__post-nav-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--joy-space-2, 8px);
    min-width: 0;
    color: var(--joy-color-editorial-heading);
    text-decoration: none;
}

.joy-single-post__post-nav-item:visited {
    color: var(--joy-color-editorial-heading);
}

.joy-single-post__post-nav-item--next {
    grid-column: 2;
    align-items: flex-end;
    text-align: right;
}

.joy-single-post__post-nav-label {
    color: var(--joy-color-editorial-secondary);
    font-size: 0.8125rem; /* 13px */
    font-weight: var(--joy-font-weight-medium);
    line-height: 1.5;
}

.joy-single-post__post-nav-title {
    color: var(--joy-color-editorial-heading);
    font-size: 1rem;
    font-weight: var(--joy-font-weight-medium);
    line-height: 1.5;
    overflow-wrap: anywhere;
    transition: color 160ms ease;
}

.joy-single-post__post-nav-item:hover .joy-single-post__post-nav-title,
.joy-single-post__post-nav-item:focus-visible .joy-single-post__post-nav-title {
    color: var(--joy-color-accent-red);
}

.joy-single-post__post-nav-item:focus-visible {
    outline: 2px solid var(--joy-color-brand);
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .joy-single-post__post-nav {
        column-gap: var(--joy-space-4);
        margin-top: var(--joy-space-6); /* 32px */
    }
}

@media (prefers-reduced-motion: reduce) {
    .joy-single-post__post-nav-title {
        transition: none;
    }
}


/* =========================================================
   14. Related Insights — Full-width Editorial Section
   ========================================================= */

/* Separate article region from the full-width background. */
.joy-single-post__article-region {
    padding-bottom: var(--joy-section-space);
}

.joy-single-post__related {
    background: var(--joy-color-surface-interactive);
}

.joy-single-post__related .joy-section__header {
    margin-bottom: var(--joy-space-5);
}

.joy-single-post__related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--joy-space-6);
    align-items: start;
}

.joy-single-post__related-card { min-width: 0; }

.joy-single-post__related-media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--joy-color-surface);
    text-decoration: none;
}

.joy-single-post__related-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.joy-single-post__related-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--joy-color-surface);
}

/* Match editorial archive metadata without adding separators. */
.joy-single-post__related-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 12px;
    row-gap: 4px;
    margin-top: var(--joy-space-4);
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.joy-single-post__related-category,
.joy-single-post__related-category:visited {
    color: var(--joy-color-editorial-heading);
    text-decoration: none;
    font-weight: var(--joy-font-weight-medium);
    transition: color 160ms ease;
}

.joy-single-post__related-category:hover,
.joy-single-post__related-category:focus-visible {
    color: var(--joy-color-accent-red);
}

.joy-single-post__related-date { color: var(--joy-color-editorial-secondary); }

.joy-single-post__related-title { margin: 0; overflow-wrap: anywhere; }

.joy-single-post__related-title a,
.joy-single-post__related-title a:visited {
    color: inherit;
    text-decoration: none;
    transition: color 180ms ease;
}

.joy-single-post__related-title a:hover,
.joy-single-post__related-title a:focus-visible {
    color: var(--joy-color-accent-red);
}

.joy-single-post__related :is(a):focus-visible {
    outline: 2px solid var(--joy-color-accent-red);
    outline-offset: 4px;
}

@media (max-width: 999px) {
    .joy-single-post__related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--joy-space-5);
    }
}

@media (max-width: 767px) {
    .joy-single-post__related-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--joy-space-6);
    }
}

@media (prefers-reduced-motion: reduce) {
    .joy-single-post__related :is(.joy-single-post__related-category, .joy-single-post__related-title a) {
        transition: none;
    }
}


/* =========================================================
   15. Article-level Final CTA
   Scope: Gutenberg Custom HTML Block
   ========================================================= */

.joy-single-post .entry-content > .joy-article-cta {
    margin: var(--joy-space-7) 0 0;
    padding: var(--joy-space-6);
    background: var(--joy-color-surface-soft);
    text-align: left;
}

/* Heading */

.joy-single-post .entry-content .joy-article-cta__title {
    margin: 0 0 var(--joy-space-4);
    color: var(--joy-color-editorial-heading);
    font-family: var(--joy-font-sans);
    font-size: 1.5rem;
    font-weight: var(--joy-font-weight-medium);
    line-height: 1.3;
}

/* Description */

.joy-single-post .entry-content .joy-article-cta__description {
    margin: 0 0 var(--joy-space-5);
    color: var(--joy-color-text);
    font-size: 1rem;
    line-height: 1.65;
}

/* Article CTA Button — override editorial inline-link rules */

.joy-single-post .entry-content
a.joy-button.joy-article-cta__button,
.joy-single-post .entry-content
a.joy-button.joy-article-cta__button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1.125rem;
    width: auto;
    max-width: 100%;
    background-color: var(--joy-color-brand);
    color: var(--joy-color-surface);
    text-decoration: none;
}

.joy-single-post .entry-content
a.joy-button.joy-article-cta__button:hover,
.joy-single-post .entry-content
a.joy-button.joy-article-cta__button:visited:hover {
    background-color: var(--joy-color-accent-red);
    color: var(--joy-color-surface);
    text-decoration: none;
}

.joy-single-post .entry-content
a.joy-article-cta__button:focus-visible {
    outline: 2px solid var(--joy-color-brand);
    outline-offset: 4px;
}

/* Match Header Contact arrow behavior */

.joy-article-cta__button-arrow {
    display: inline-block;
    flex-shrink: 0;
    line-height: 1;
    transition: transform 160ms ease;
}

.joy-article-cta__button:hover
.joy-article-cta__button-arrow {
    transform: translateX(0.1875rem);
}

@media (prefers-reduced-motion: reduce) {
    .joy-article-cta__button-arrow {
        transition: none;
    }
}


/* Tablet */

@media (max-width: 999px) {
    .joy-single-post .entry-content > .joy-article-cta {
        margin-top: var(--joy-space-6);
    }
}

/* Mobile */

@media (max-width: 767px) {
    .joy-single-post .entry-content > .joy-article-cta {
        padding: var(--joy-space-5);
    }

    .joy-single-post .entry-content .joy-article-cta__title {
        font-size: 1.375rem;
    }

    .joy-single-post .entry-content
    .joy-article-cta__button {
        max-width: 100%;
        white-space: normal;
    }
}
