/**
 * Junnect SEO — single blog post template (E1).
 *
 * Every colour/typography/radius/spacing value consumes a --jseo-* custom
 * property emitted by StyleResolver (theme values first, plugin fallback),
 * with a WCAG-AA-safe literal fallback in each var().
 */

.junnect-blog {
    --_accent: var(--jseo-accent-color, #0f766e);
    --_text: var(--jseo-text-color, #1f2937);
    --_muted: var(--jseo-muted-color, #4b5563);
    --_bg: var(--jseo-background-color, #ffffff);
    --_radius: var(--jseo-border-radius, 8px);
    --_space: var(--jseo-spacing, 1.5rem);
    color: var(--_text);
    font-family: var(--jseo-body-font, inherit);
    box-sizing: border-box;
}

.junnect-blog *,
.junnect-blog *::before,
.junnect-blog *::after {
    box-sizing: inherit;
}

.junnect-blog a {
    color: var(--_accent);
}

.junnect-blog h1,
.junnect-blog h2,
.junnect-blog h3,
.junnect-blog h4,
h1.junnect-blog,
h2.junnect-blog,
h3.junnect-blog,
h4.junnect-blog,
.junnect-blog .junnect-card__title {
    color: var(--jseo-heading-color, var(--jseo-text-color));
}

.junnect-blog :focus-visible {
    outline: 2px solid var(--_accent);
    outline-offset: 2px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .junnect-blog *,
    .junnect-blog *::before,
    .junnect-blog *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

.junnect-blog-single {
    display: block;
    max-width: 48rem;
    margin-inline: auto;
    padding-block: var(--_space);
}

/* Breadcrumbs (visible trail only — JSON-LD is Hub-owned) */
.junnect-breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0 0 var(--_space);
    padding: 0;
    font-size: 0.875rem;
    color: var(--_muted);
}

.junnect-breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.junnect-breadcrumbs li + li::before {
    content: "\203A";
    color: var(--_muted);
}

.junnect-breadcrumbs a {
    color: var(--_muted);
    text-decoration: none;
}

.junnect-breadcrumbs a:hover,
.junnect-breadcrumbs a:focus-visible {
    color: var(--_accent);
    text-decoration: underline;
}

/* Title */
.junnect-post-title {
    font-family: var(--jseo-heading-font, inherit);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin: 0 0 calc(var(--_space) / 2);
}

/* Meta row */
.junnect-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.875rem;
    color: var(--_muted);
    margin-block-end: var(--_space);
}

/* Term chips */
.junnect-post-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block-end: var(--_space);
}

.junnect-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--_accent);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--_accent);
    text-decoration: none;
}

.junnect-tag:hover,
.junnect-tag:focus-visible {
    background: var(--_accent);
    color: var(--_bg);
}

/* Featured image */
.junnect-featured-image {
    margin: 0 0 var(--_space);
}

.junnect-featured-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--_radius);
}

/* Table of contents */
.junnect-toc {
    border: 1px solid color-mix(in srgb, var(--_muted) 25%, transparent);
    border-radius: var(--_radius);
    padding: calc(var(--_space) / 1.5);
    margin-block-end: var(--_space);
}

.junnect-toc__title {
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.junnect-toc__list {
    margin: 0;
    padding-inline-start: 1.25rem;
}

.junnect-toc__list li {
    margin-block: 0.25rem;
}

.junnect-toc__list .junnect-toc__item--h3 {
    list-style: none;
    margin-inline-start: 1rem;
    font-size: 0.9375rem;
}

/* Content formatting (Essential: H2/H3, paragraphs, lists, tables, quotes) */
.junnect-blog.junnect-post-content {
    font-size: 1.0625rem;
    line-height: 1.7;
}

.junnect-blog.junnect-post-content h1,
.junnect-blog.junnect-post-content h2,
.junnect-blog.junnect-post-content h3,
.junnect-blog.junnect-post-content h4 {
    font-family: var(--jseo-heading-font, inherit);
    line-height: 1.3;
    margin-block: calc(var(--_space) * 1.25) calc(var(--_space) / 2);
    scroll-margin-top: 6rem;
}

.junnect-blog.junnect-post-content h1 { font-size: 1.75rem; }
.junnect-blog.junnect-post-content h2 { font-size: 1.5rem; }
.junnect-blog.junnect-post-content h3 { font-size: 1.25rem; }
.junnect-blog.junnect-post-content h4 { font-size: 1.125rem; }

.junnect-blog.junnect-post-content p {
    margin-block: 0 var(--_space);
}

.junnect-blog.junnect-post-content a {
    color: var(--_accent);
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.junnect-blog.junnect-post-content a:hover,
.junnect-blog.junnect-post-content a:focus-visible {
    text-decoration-thickness: 0.12em;
}

.junnect-blog.junnect-post-content ul,
.junnect-blog.junnect-post-content ol {
    margin-block: 0 var(--_space);
    padding-inline-start: 1.75rem;
}

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

.junnect-blog.junnect-post-content ul ul {
    list-style-type: circle;
}

.junnect-blog.junnect-post-content ul ul ul {
    list-style-type: square;
}

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

.junnect-blog.junnect-post-content ol ol {
    list-style-type: lower-alpha;
}

.junnect-blog.junnect-post-content ol ol ol {
    list-style-type: lower-roman;
}

.junnect-blog.junnect-post-content li {
    margin-block: 0.375rem;
}

.junnect-blog.junnect-post-content li > ul,
.junnect-blog.junnect-post-content li > ol {
    margin-block: 0.375rem 0;
}

.junnect-blog.junnect-post-content blockquote {
    margin: 0 0 var(--_space);
    padding: calc(var(--_space) / 2) var(--_space);
    border-inline-start: 4px solid var(--_accent);
    background: color-mix(in srgb, var(--_accent) 6%, var(--_bg));
    border-radius: 0 var(--_radius) var(--_radius) 0;
    color: var(--_muted);
    font-style: italic;
}

.junnect-blog.junnect-post-content blockquote > :last-child {
    margin-block-end: 0;
}

.junnect-blog.junnect-post-content hr {
    border: 0;
    border-block-start: 1px solid color-mix(in srgb, var(--_muted) 30%, transparent);
    margin-block: calc(var(--_space) * 1.5);
}

.junnect-blog.junnect-post-content figure {
    margin: 0 0 var(--_space);
    max-width: 100%;
}

.junnect-blog.junnect-post-content figcaption {
    margin-block-start: 0.5rem;
    color: var(--_muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.junnect-blog.junnect-post-content .wp-block-table,
.junnect-blog.junnect-post-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-block: 0 var(--_space);
    overflow-x: auto;
    display: block;
}

.junnect-blog.junnect-post-content th,
.junnect-blog.junnect-post-content td {
    border: 1px solid color-mix(in srgb, var(--_muted) 30%, transparent);
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.junnect-blog.junnect-post-content th {
    background: color-mix(in srgb, var(--_muted) 8%, var(--_bg));
    color: var(--jseo-heading-color, var(--jseo-text-color));
    font-weight: 700;
}

.junnect-blog.junnect-post-content pre,
.junnect-blog.junnect-post-content code {
    background: color-mix(in srgb, var(--_muted) 12%, var(--_bg));
    border-radius: var(--_radius);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.9375em;
}

.junnect-blog.junnect-post-content code {
    padding: 0.125rem 0.25rem;
}

.junnect-blog.junnect-post-content pre {
    margin-block: 0 var(--_space);
    max-width: 100%;
    overflow-x: auto;
    padding: calc(var(--_space) / 1.5);
}

.junnect-blog.junnect-post-content pre code {
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.junnect-blog.junnect-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--_radius);
}

/* CTA */
.junnect-cta {
    background: color-mix(in srgb, var(--_accent) 8%, var(--_bg));
    border-radius: var(--_radius);
    padding: var(--_space);
    margin-block: var(--_space);
}

.junnect-cta__title {
    font-family: var(--jseo-heading-font, inherit);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.junnect-cta__text {
    margin: 0 0 calc(var(--_space) / 2);
    color: var(--_muted);
}

.junnect-button {
    display: inline-block;
    background: var(--_accent);
    color: var(--_bg);
    border: 1px solid var(--_accent);
    border-radius: var(--_radius);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.junnect-button:hover,
.junnect-button:focus-visible {
    background: color-mix(in srgb, var(--_accent) 85%, #000000);
    color: var(--_bg);
}

/* Author box (E-E-A-T) */
.junnect-author-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    border: 1px solid color-mix(in srgb, var(--_muted) 25%, transparent);
    border-radius: var(--_radius);
    padding: var(--_space);
    margin-block: var(--_space);
}

.junnect-author-box__avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.junnect-author-box__label {
    display: block;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--_muted);
}

.junnect-author-box__name {
    display: block;
    font-weight: 700;
    margin-block: 0.125rem 0.375rem;
}

.junnect-author-box__bio {
    margin: 0;
    color: var(--_muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Share buttons */
.junnect-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-block: var(--_space);
}

.junnect-share__label {
    font-weight: 600;
    font-size: 0.9375rem;
}

.junnect-share__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.junnect-share__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid color-mix(in srgb, var(--_muted) 35%, transparent);
    border-radius: 50%;
    background: var(--_bg);
    color: var(--_text);
    cursor: pointer;
    text-decoration: none;
}

.junnect-share__button:hover,
.junnect-share__button:focus-visible {
    border-color: var(--_accent);
    color: var(--_accent);
}

.junnect-share__button.is-copied {
    border-color: var(--_accent);
    background: var(--_accent);
    color: var(--_bg);
}

/* Related posts (shared card styles) */
.junnect-related {
    margin-block: var(--_space);
}

.junnect-related h2 {
    font-family: var(--jseo-heading-font, inherit);
    font-size: 1.5rem;
    margin: 0 0 var(--_space);
}

.junnect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: var(--_space);
}

.junnect-card {
    position: relative;
}

.junnect-card > a {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: var(--_radius);
}

.junnect-card__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--_radius);
    margin-block-end: 0.75rem;
}

.junnect-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.junnect-card:hover .junnect-card__media img {
    transform: scale(1.03);
}

.junnect-card__title {
    font-family: var(--jseo-heading-font, inherit);
    font-size: 1.125rem;
    line-height: 1.35;
    margin: 0 0 0.375rem;
}

.junnect-card:hover .junnect-card__title {
    color: var(--_accent);
}

.junnect-card__date {
    font-size: 0.8125rem;
    color: var(--_muted);
}

@media (max-width: 40rem) {
    .junnect-blog-single {
        padding-inline: 1rem;
    }

    .junnect-author-box {
        flex-direction: column;
    }
}
