/**
 * single.css — Styling untuk single post template kustom (.fo-single).
 *
 * Dipakai bersama single.php override di child theme.
 * Senada visual home.css: Navy + Orange, Inter, card with rounded + shadow,
 * section header dengan badge eyebrow + accent line.
 *
 * Cascade: tokens.css → core.css → single.css (terakhir).
 */

/* ============================================================ */
/*  RESET GP CONTAINER UNTUK fo-single — FULL BLEED             */
/* ============================================================ */

body.single-post {
    background-color: var(--fo-color-bg) !important;
}

body.single-post .site,
body.single-post #page {
    max-width: 100% !important;
    width: 100%;
    padding: 0;
    margin: 0;
    background: var(--fo-color-bg);
}

body.single-post .site-content {
    padding: 0 !important;
    max-width: 100%;
    background: var(--fo-color-bg);
    display: block;
}

body.single-post .content-area {
    width: 100% !important;
    max-width: 100%;
    float: none;
    padding: 0 !important;
    background: var(--fo-color-bg);
}

body.single-post .site-main {
    background: transparent;
    margin: 0 !important;
    padding: 0 !important;
}

body.single-post .separate-containers .inside-article,
body.single-post .separate-containers .paging-navigation,
body.single-post .separate-containers .comments-area {
    background-color: transparent !important;
    box-shadow: none;
    padding: 0 !important;
}

/* fo-single container */
.fo-single {
    background: var(--fo-color-bg);
    color: var(--fo-color-text);
}

.fo-single__article {
    margin: 0;
    padding: 0;
}

/* ============================================================ */
/*  HERO BAND — full-bleed, gradient navy/orange, badge eyebrow */
/* ============================================================ */

.fo-single__hero {
    position: relative;
    padding: var(--fo-space-12) var(--fo-space-4) var(--fo-space-10);
    text-align: center;
    background:
        radial-gradient(ellipse at top, rgba(255, 107, 26, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, var(--fo-color-primary-50) 0%, var(--fo-color-bg) 100%);
    border-bottom: 1px solid var(--fo-color-border);
    overflow: hidden;
}

@media (min-width: 768px) {
    .fo-single__hero {
        padding: var(--fo-space-16) var(--fo-space-8) var(--fo-space-12);
    }
}

@media (min-width: 1024px) {
    .fo-single__hero {
        padding: var(--fo-space-20) var(--fo-space-8) var(--fo-space-16);
    }
}

/* Accent line bottom-center */
.fo-single__hero::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--fo-color-accent);
    border-radius: var(--fo-radius-sm);
}

.fo-single__hero-inner {
    max-width: 1080px;
    margin: 0 auto;
}

.fo-single__hero-badge {
    display: inline-block;
    margin-bottom: var(--fo-space-5);
    text-decoration: none;
    transition: transform var(--fo-duration-fast) var(--fo-ease-out);
}

.fo-single__hero-badge:hover {
    transform: translateY(-1px);
}

.fo-single__hero-title {
    font-family: var(--fo-font-heading);
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
    line-height: var(--fo-lh-tight);
    font-weight: var(--fo-fw-extrabold);
    color: var(--fo-color-text-strong);
    margin: 0 0 var(--fo-space-5);
    letter-spacing: -0.015em;
}

@media (min-width: 1024px) {
    .fo-single__hero-title {
        font-size: var(--fo-text-5xl);
    }
}

.fo-single__hero-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--fo-space-2);
    color: var(--fo-color-text-muted);
    font-size: var(--fo-text-sm);
    margin: 0;
}

.fo-single__hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--fo-space-2);
}

.fo-single__hero-meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--fo-color-primary);
    opacity: 0.7;
}

.fo-single__hero-meta-sep {
    color: var(--fo-color-text-subtle);
    user-select: none;
}

/* ============================================================ */
/*  FEATURED IMAGE HERO — big, rounded, shadow                  */
/* ============================================================ */

.fo-single__featured {
    max-width: 1180px;
    margin: calc(-1 * var(--fo-space-6)) auto var(--fo-space-12);
    padding: 0 var(--fo-space-4);
    position: relative;
    z-index: 2;
}

@media (min-width: 768px) {
    .fo-single__featured {
        margin: calc(-1 * var(--fo-space-8)) auto var(--fo-space-16);
        padding: 0 var(--fo-space-8);
    }
}

.fo-single__featured img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--fo-radius-lg);
    box-shadow: var(--fo-shadow-lg);
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

@media (min-width: 768px) {
    .fo-single__featured img {
        border-radius: var(--fo-radius-xl);
        box-shadow: var(--fo-shadow-xl);
    }
}

/* ============================================================ */
/*  ENTRY CONTENT — typography, max 820px                       */
/* ============================================================ */

.fo-single__content {
    font-family: var(--fo-font-body);
    font-size: var(--fo-text-lg);
    line-height: var(--fo-lh-loose);
    color: var(--fo-color-text);
    word-wrap: break-word;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--fo-space-4);
}

@media (min-width: 768px) {
    .fo-single__content {
        padding: 0 var(--fo-space-8);
    }
}

.fo-single__content > * {
    margin-top: 0;
    margin-bottom: var(--fo-space-5);
}

.fo-single__content p {
    margin: 0 0 var(--fo-space-5);
}

.fo-single__content p:first-of-type {
    font-size: var(--fo-text-xl);
    line-height: var(--fo-lh-normal);
    color: var(--fo-color-text-strong);
}

.fo-single__content h2 {
    font-family: var(--fo-font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: var(--fo-fw-extrabold);
    color: var(--fo-color-text-strong);
    margin: var(--fo-space-12) 0 var(--fo-space-5);
    line-height: var(--fo-lh-tight);
    letter-spacing: -0.015em;
    position: relative;
    padding-left: var(--fo-space-4);
}

.fo-single__content h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35em;
    bottom: 0.25em;
    width: 4px;
    border-radius: var(--fo-radius-sm);
    background: var(--fo-color-accent);
}

.fo-single__content h3 {
    font-family: var(--fo-font-heading);
    font-size: var(--fo-text-xl);
    font-weight: var(--fo-fw-bold);
    color: var(--fo-color-text-strong);
    margin: var(--fo-space-10) 0 var(--fo-space-3);
    line-height: var(--fo-lh-snug);
}

@media (min-width: 768px) {
    .fo-single__content h3 {
        font-size: var(--fo-text-2xl);
    }
}

.fo-single__content h4 {
    font-family: var(--fo-font-heading);
    font-size: var(--fo-text-lg);
    font-weight: var(--fo-fw-semibold);
    color: var(--fo-color-text-strong);
    margin: var(--fo-space-8) 0 var(--fo-space-3);
}

.fo-single__content a {
    color: var(--fo-color-primary);
    text-decoration: underline;
    text-decoration-color: rgba(15, 44, 89, 0.3);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    transition: color var(--fo-duration-fast) var(--fo-ease-out),
                text-decoration-color var(--fo-duration-fast) var(--fo-ease-out);
}

.fo-single__content a:hover {
    color: var(--fo-color-accent);
    text-decoration-color: var(--fo-color-accent);
}

.fo-single__content strong {
    color: var(--fo-color-text-strong);
    font-weight: var(--fo-fw-semibold);
}

.fo-single__content em {
    font-style: italic;
    color: var(--fo-color-text);
}

.fo-single__content ul,
.fo-single__content ol {
    margin: 0 0 var(--fo-space-6);
    padding-left: var(--fo-space-6);
}

.fo-single__content ul li,
.fo-single__content ol li {
    margin-bottom: var(--fo-space-2);
    line-height: var(--fo-lh-normal);
}

.fo-single__content ul li::marker {
    color: var(--fo-color-accent);
}

.fo-single__content blockquote {
    margin: var(--fo-space-10) 0;
    padding: var(--fo-space-6) var(--fo-space-8);
    background: var(--fo-color-primary-50);
    border-left: 4px solid var(--fo-color-primary);
    border-radius: var(--fo-radius-md);
    font-style: italic;
    font-size: var(--fo-text-xl);
    color: var(--fo-color-text-strong);
    box-shadow: var(--fo-shadow-sm);
    position: relative;
}

.fo-single__content blockquote::before {
    content: "\201C";
    position: absolute;
    top: -10px;
    left: 16px;
    font-size: 4rem;
    font-family: Georgia, serif;
    line-height: 1;
    color: var(--fo-color-accent);
    opacity: 0.3;
}

.fo-single__content blockquote p:last-child {
    margin-bottom: 0;
}

/* Figure & image — kill inline-style override risk via specificity */
.fo-single__content figure,
.fo-single__content figure.wp-block-image {
    margin: var(--fo-space-10) 0;
    text-align: center;
}

.fo-single__content figure img,
.fo-single__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--fo-radius-md);
    box-shadow: var(--fo-shadow-md);
    display: block;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .fo-single__content figure img,
    .fo-single__content img {
        border-radius: var(--fo-radius-lg);
    }
}

.fo-single__content figcaption,
.fo-single__content figure figcaption {
    text-align: center;
    color: var(--fo-color-text-muted);
    font-size: var(--fo-text-sm);
    font-style: italic;
    margin-top: var(--fo-space-3);
    line-height: var(--fo-lh-snug);
}

.fo-single__content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--fo-space-8) 0;
    font-size: var(--fo-text-base);
    box-shadow: var(--fo-shadow-md);
    border-radius: var(--fo-radius-md);
    overflow: hidden;
}

.fo-single__content thead {
    background: var(--fo-color-primary);
    color: #fff;
}

.fo-single__content th,
.fo-single__content td {
    padding: var(--fo-space-3) var(--fo-space-4);
    text-align: left;
    border-bottom: 1px solid var(--fo-color-border);
}

.fo-single__content tbody tr:nth-child(even) {
    background: var(--fo-color-bg-section);
}

.fo-single__content hr {
    border: 0;
    height: 1px;
    background: var(--fo-color-border);
    margin: var(--fo-space-12) 0;
}

/* ============================================================ */
/*  EZ-TOC — card style senada                                  */
/* ============================================================ */

.fo-single #ez-toc-container {
    background: var(--fo-color-bg-section);
    border: 1px solid var(--fo-color-border);
    border-radius: var(--fo-radius-md);
    padding: var(--fo-space-5) var(--fo-space-6);
    margin: 0 auto var(--fo-space-10);
    max-width: 1080px;
    box-shadow: var(--fo-shadow-sm);
}

.fo-single #ez-toc-container .ez-toc-title-container {
    margin-bottom: var(--fo-space-3);
    padding-bottom: var(--fo-space-3);
    border-bottom: 1px solid var(--fo-color-border);
}

.fo-single #ez-toc-container .ez-toc-title {
    font-family: var(--fo-font-heading);
    font-size: var(--fo-text-base);
    font-weight: var(--fo-fw-bold);
    color: var(--fo-color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fo-single #ez-toc-container a {
    color: var(--fo-color-text);
    text-decoration: none;
    font-size: var(--fo-text-base);
    transition: color var(--fo-duration-fast) var(--fo-ease-out);
}

.fo-single #ez-toc-container a:hover {
    color: var(--fo-color-accent);
}

/* ============================================================ */
/*  AUTHOR BYLINE CARD — E-E-A-T sinyal                         */
/* ============================================================ */

.fo-single__author {
    max-width: 1080px;
    margin: var(--fo-space-12) auto 0;
    padding: 0 var(--fo-space-4);
}

@media (min-width: 768px) {
    .fo-single__author {
        padding: 0 var(--fo-space-8);
    }
}

.fo-single__author-inner {
    display: flex;
    gap: var(--fo-space-5);
    align-items: flex-start;
    padding: var(--fo-space-6);
    background: var(--fo-color-bg-section);
    border-radius: var(--fo-radius-lg);
    border: 1px solid var(--fo-color-border);
    box-shadow: var(--fo-shadow-sm);
}

@media (min-width: 768px) {
    .fo-single__author-inner {
        padding: var(--fo-space-8);
        gap: var(--fo-space-6);
    }
}

.fo-single__author-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--fo-radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid #fff;
    box-shadow: var(--fo-shadow-md);
}

@media (min-width: 768px) {
    .fo-single__author-avatar {
        width: 88px;
        height: 88px;
    }
}

.fo-single__author-body {
    flex: 1;
    min-width: 0;
}

.fo-single__author-eyebrow {
    display: inline-block;
    font-size: var(--fo-text-xs);
    font-weight: var(--fo-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fo-color-accent);
    margin-bottom: var(--fo-space-1);
}

.fo-single__author-name {
    font-family: var(--fo-font-heading);
    font-size: var(--fo-text-lg);
    font-weight: var(--fo-fw-bold);
    color: var(--fo-color-text-strong);
    margin: 0 0 var(--fo-space-2);
    line-height: var(--fo-lh-snug);
}

@media (min-width: 768px) {
    .fo-single__author-name {
        font-size: var(--fo-text-xl);
    }
}

.fo-single__author-bio {
    color: var(--fo-color-text-muted);
    font-size: var(--fo-text-sm);
    line-height: var(--fo-lh-normal);
    margin: 0;
}

@media (min-width: 768px) {
    .fo-single__author-bio {
        font-size: var(--fo-text-base);
    }
}

/* ============================================================ */
/*  RELATED ARTICLES — grid 3 card senada home                  */
/* ============================================================ */

.fo-single__related {
    background: var(--fo-color-bg-section);
    padding: var(--fo-section-py) 0;
    margin: var(--fo-space-16) 0 0;
    border-top: 1px solid var(--fo-color-border);
}

@media (min-width: 768px) {
    .fo-single__related {
        padding: var(--fo-section-py-desktop) 0;
    }
}

.fo-single__related-inner {
    max-width: var(--fo-container-max);
    margin: 0 auto;
    padding: 0 var(--fo-container-padding);
}

@media (min-width: 768px) {
    .fo-single__related-inner {
        padding: 0 var(--fo-container-padding-lg);
    }
}

.fo-single__related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--fo-grid-gap);
    margin-top: var(--fo-space-8);
}

@media (min-width: 640px) {
    .fo-single__related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .fo-single__related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--fo-grid-gap-lg);
    }
}

.fo-single__related-card {
    overflow: hidden;
    transition: transform var(--fo-duration-base) var(--fo-ease-out),
                box-shadow var(--fo-duration-base) var(--fo-ease-out);
    padding: 0;
    background: var(--fo-color-bg);
    border: 1px solid var(--fo-color-border);
    border-radius: var(--fo-radius-md);
}

.fo-single__related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fo-shadow-lg);
}

.fo-single__related-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.fo-single__related-image {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--fo-color-bg-section);
}

.fo-single__related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--fo-duration-slow) var(--fo-ease-out);
}

.fo-single__related-card:hover .fo-single__related-image img {
    transform: scale(1.05);
}

.fo-single__related-body {
    display: flex;
    flex-direction: column;
    gap: var(--fo-space-2);
    padding: var(--fo-space-5);
    flex: 1;
}

.fo-single__related-cat {
    font-size: var(--fo-text-xs);
    font-weight: var(--fo-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fo-color-accent);
}

.fo-single__related-title {
    font-family: var(--fo-font-heading);
    font-size: var(--fo-text-lg);
    font-weight: var(--fo-fw-bold);
    color: var(--fo-color-text-strong);
    line-height: var(--fo-lh-snug);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--fo-duration-fast) var(--fo-ease-out);
}

.fo-single__related-card:hover .fo-single__related-title {
    color: var(--fo-color-primary);
}

.fo-single__related-cta {
    margin-top: auto;
    padding-top: var(--fo-space-3);
    font-size: var(--fo-text-sm);
    font-weight: var(--fo-fw-semibold);
    color: var(--fo-color-primary);
    transition: color var(--fo-duration-fast) var(--fo-ease-out),
                transform var(--fo-duration-fast) var(--fo-ease-out);
    display: inline-block;
}

.fo-single__related-card:hover .fo-single__related-cta {
    color: var(--fo-color-accent);
}

/* ============================================================ */
/*  OVERRIDE: hide entry-header lama GP yang mungkin masih       */
/*  ter-render dari content-single parent (safety net)           */
/* ============================================================ */

body.single-post > .site > .content > main > .entry-header,
body.single-post .inside-article > .entry-header,
body.single-post .inside-article > .featured-image,
body.single-post .inside-article > .post-image {
    display: none !important;
}

/* ============================================================ */
/*  ARTICLE CTA — auto-inject via firstoutbound_article_cta()    */
/*  Di-render setelah .fo-single__content, sebelum author card   */
/*  (atau di mana the_content() filter selesai)                  */
/* ============================================================ */

.fo-article-cta {
    max-width: 1080px;
    margin: var(--fo-space-12) auto 0;
    padding: var(--fo-space-8) var(--fo-space-6);
    background: linear-gradient(135deg, var(--fo-color-accent) 0%, var(--fo-color-accent-hover) 100%);
    border-radius: var(--fo-radius-lg);
    color: #fff;
    text-align: center;
    box-shadow: var(--fo-shadow-cta);
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .fo-article-cta {
        padding: var(--fo-space-10) var(--fo-space-12);
        border-radius: var(--fo-radius-xl);
    }
}

.fo-article-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(255, 255, 255, 0.18) 0%, transparent 60%);
    pointer-events: none;
}

.fo-article-cta > * {
    position: relative;
    z-index: 1;
}

.fo-article-cta__eyebrow {
    display: inline-block;
    font-size: var(--fo-text-xs);
    font-weight: var(--fo-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(255, 255, 255, 0.2);
    padding: var(--fo-space-1) var(--fo-space-3);
    border-radius: var(--fo-radius-full);
    margin-bottom: var(--fo-space-4);
    color: #fff;
}

.fo-article-cta__title {
    font-family: var(--fo-font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: var(--fo-fw-extrabold);
    color: #fff;
    margin: 0 0 var(--fo-space-3);
    line-height: var(--fo-lh-tight);
    letter-spacing: -0.01em;
    padding: 0;
}

/* Pastikan H2 di dalam CTA TIDAK kena style H2 .fo-single__content (accent line orange) */
.fo-article-cta__title::before {
    display: none !important;
}

.fo-article-cta__desc {
    font-size: var(--fo-text-base);
    margin: 0 auto var(--fo-space-6);
    max-width: 560px;
    line-height: var(--fo-lh-normal);
    color: rgba(255, 255, 255, 0.95);
}

@media (min-width: 768px) {
    .fo-article-cta__desc {
        font-size: var(--fo-text-lg);
    }
}

.fo-article-cta__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--fo-space-3);
    justify-content: center;
    align-items: center;
}

.fo-article-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: var(--fo-space-2);
    padding: var(--fo-space-3) var(--fo-space-6);
    border-radius: var(--fo-radius-full);
    font-weight: var(--fo-fw-semibold);
    font-size: var(--fo-text-base);
    text-decoration: none !important;
    transition: transform var(--fo-duration-base) var(--fo-ease-out),
                box-shadow var(--fo-duration-base) var(--fo-ease-out),
                background var(--fo-duration-base) var(--fo-ease-out);
    line-height: 1.2;
    white-space: nowrap;
}

.fo-article-cta__btn--wa {
    background: #fff;
    color: var(--fo-color-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fo-article-cta__btn--wa:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: var(--fo-color-accent-hover);
    background: #fff;
}

.fo-article-cta__btn--ghost {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.fo-article-cta__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.9);
}

.fo-article-cta__btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Pastikan CTA tidak terkena underline dari .fo-single__content a */
.fo-single__content + .fo-article-cta a,
.fo-article-cta a {
    text-decoration: none !important;
    text-decoration-color: transparent !important;
}
