/* ==========================================================================
  BANGGANESIA BATUI THEMES  - SINGLE.CSS
   Styling untuk Halaman Detail Artikel (Single Post)
   Layout: Breadcrumb → Judul → Excerpt → Author | Share → Featured Image
           → Caption → Konten → Tags → Related → Comments
   Font: Manrope (self-hosted) · Aksen: dark red #8B0000
   ========================================================================== */

/* ==========================================================================
   ROOT VARIABLES
   ========================================================================== */
:root {
    /* ✅ Font Manrope (self-hosted) untuk semua teks */
    --single-font: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", 
                   Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    
    /* Default Font Size untuk Konten Artikel */
    --default-font: 17px;
    
    /* Warna */
    --single-text: #1a1a1a;
    --single-text-dim: #555555;
    --single-text-muted: #888888;
    --single-bg: #ffffff;
    --single-border: #eeeeee;
    --single-accent: #8B0000;
    --single-accent-hover: #6b0000;
    --single-link: #1a1a1a;
}

/* ==========================================================================
   1. SINGLE POST HEADER (Breadcrumb + Judul + Excerpt + Author | Share)
   ========================================================================== */

.single-post-main {
    background: var(--single-bg);
    padding: 0;
}

.single-post-header {
    margin-bottom: 28px;
    padding-bottom: 0;
    border-bottom: none;
}

/* --- A. BREADCRUMB: Home › Kategori --- */
.single-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--single-font);
    font-size: 13px;
    color: var(--single-text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bc-link {
    color: var(--single-text-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bc-link:hover {
    color: var(--single-accent);
    text-decoration: underline;
}

.bc-sep {
    color: var(--single-text-muted);
    font-size: 14px;
    line-height: 1;
}

/* --- B. JUDUL ARTIKEL (H1) --- */
.single-post-title {
    font-family: var(--single-font);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--single-text);
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

/* --- C. EXCERPT / LEAD (Italic abu-abu) --- */
.single-post-excerpt {
    font-family: var(--single-font);
    font-size: 15px;
    font-style: italic;
    line-height: 1.6;
    color: var(--single-text-dim);
    margin: 0 0 20px 0;
    padding: 0;
}

/* --- D. META ROW: Author+Date (KIRI) | Share (KANAN) --- */
.single-post-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

/* Kiri: Author Block */
.meta-author-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.meta-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Container teks di sebelah kanan avatar */
.meta-author-text {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-family: var(--single-font);
    line-height: 1.1;
}

/* Baris 1: Nama + Sumber */
.meta-author-name-source {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 14px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.meta-author-name {
    font-family: var(--single-font);
    font-weight: 700;
    color: var(--single-text);
}

.meta-author-source {
    font-family: var(--single-font);
    color: var(--single-text-dim);
    font-weight: 400;
    font-size: 13px;
}

/* Baris 2: Tanggal */
.meta-date-text {
    font-family: var(--single-font);
    font-size: 12px;
    color: var(--single-text-muted);
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

/* Kanan: Share Block */
.meta-share-block {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.share-label-text {
    font-family: var(--single-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--single-text);
}

.share-icon-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Ikon Share */
.share-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--single-text);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.share-ico svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.share-ico.share-copy svg {
    fill: none;
    stroke: currentColor;
}

.share-ico:hover {
    color: var(--single-accent);
    transform: translateY(-2px);
}

/* ==========================================================================
   2. FEATURED IMAGE (16:9) & CAPTION
   ========================================================================== */
.single-post-featured-image {
    margin: 0 0 0 0;
    position: relative;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.single-post-featured-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* --- CAPTION: Berdiri sendiri, TANPA background --- */
.featured-image-caption {
    display: block;
    padding: 10px 4px 0 4px;
    font-family: var(--single-font);
    font-size: 13px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.4;
    color: var(--single-text-muted);
    text-align: left;
    background: transparent;
}

/* ==========================================================================
   3. KONTEN ARTIKEL (Typography & Gambar)
   ========================================================================== */

/* --- Style Utama Konten --- */
.single-post .entry-content,
.single-post-content {
    color: #3d3d3d;
    font-family: 'Manrope', sans-serif;
    font-size: var(--default-font, 17px);
    font-weight: 500;
    letter-spacing: 0.19px;
    line-height: 1.7;
    margin-bottom: 32px;
}

.single-post .entry-content p,
.single-post-content p {
    margin-bottom: 20px;
}

.single-post .entry-content h2,
.single-post .entry-content h3,
.single-post .entry-content h4,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
    font-family: var(--single-font);
    font-weight: 700;
    line-height: 1.3;
    margin: 32px 0 16px 0;
    color: var(--single-text);
}

.single-post .entry-content h2, .single-post-content h2 { font-size: 26px; }
.single-post .entry-content h3, .single-post-content h3 { font-size: 22px; }
.single-post .entry-content h4, .single-post-content h4 { font-size: 18px; }

.single-post .entry-content a,
.single-post-content a {
    color: var(--single-link);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.single-post .entry-content a:hover,
.single-post-content a:hover {
    color: var(--single-accent);
}

/* ==========================================================================
   GAMBAR DI DALAM KONTEN (Full Width Desktop, Rasio 16:9, Full Bleed Mobile)
   ========================================================================== */

/* --- 1. Wrapper Figure & Block Image (Gutenberg) --- */
.single-post .entry-content figure,
.single-post-content figure,
.single-post .entry-content .wp-block-image,
.single-post-content .wp-block-image {
    width: 100% !important;
    max-width: 100% !important;
    margin: 24px 0 !important;
    padding: 0 !important;
}

/* --- 2. Gambar Langsung --- */
.single-post .entry-content img,
.single-post-content img,
.single-post .entry-content .size-thumbnail,
.single-post .entry-content .size-medium,
.single-post .entry-content .size-large,
.single-post .entry-content .size-full,
.single-post .entry-content .aligncenter,
.single-post .entry-content .alignleft,
.single-post .entry-content .alignright {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 6px;
    margin: 24px 0 !important;
    float: none !important;
}

/* --- 3. Gambar dalam wrapper .wp-caption (Classic Editor) --- */
.single-post .entry-content .wp-caption,
.single-post-content .wp-caption {
    width: 100% !important;
    max-width: 100% !important;
    margin: 24px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.single-post .entry-content .wp-caption img,
.single-post-content .wp-caption img {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
}

/* --- 4. Caption Gambar (Identik dengan featured-image-caption) --- */
.single-post .entry-content .wp-caption-text,
.single-post-content .wp-caption-text,
.single-post .entry-content figcaption,
.single-post-content figcaption {
    display: block;
    padding: 10px 4px 0 4px;
    font-family: var(--single-font);
    font-size: 13px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.4;
    color: var(--single-text-muted);
    text-align: left;
    background: transparent;
    margin: 0;
}

/* --- Blockquote, List, Code --- */
.single-post .entry-content blockquote,
.single-post-content blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--single-accent);
    background: #f9f9f9;
    font-family: var(--single-font);
    font-style: italic;
    color: var(--single-text-dim);
}

.single-post .entry-content ul,
.single-post .entry-content ol,
.single-post-content ul,
.single-post-content ol {
    margin: 20px 0;
    padding-left: 32px;
}

.single-post .entry-content li,
.single-post-content li {
    margin-bottom: 8px;
}

.single-post .entry-content code,
.single-post-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.single-post .entry-content pre,
.single-post-content pre {
    background: #1a1a1a;
    color: #fff;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 24px 0;
}

.single-post .entry-content pre code,
.single-post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Page Links (artikel multi-halaman) */
.page-links {
    margin: 32px 0;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 6px;
    text-align: center;
}

.page-links-title {
    font-family: var(--single-font);
    font-weight: 700;
    margin-right: 12px;
}

.page-links a {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid var(--single-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--single-text);
    font-family: var(--single-font);
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-links a:hover {
    background: var(--single-accent);
    color: #fff;
    border-color: var(--single-accent);
}

/* ==========================================================================
   4. TAG ARTIKEL
   ========================================================================== */
.single-post-tags {
    margin-bottom: 32px;
}

.tags-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-item {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f0;
    color: var(--single-text-dim);
    text-decoration: none;
    border-radius: 20px;
    font-family: var(--single-font);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background: var(--single-accent);
    color: #fff;
}
/* ==========================================================================
   5. RELATED POSTS (Tanpa Gambar, 2 Kolom, Judul Only)
   ========================================================================== */
.single-related-posts {
    margin: 20px 0 0 0;
    padding-top: 24px;
}

.related-posts-title {
    font-family: var(--single-font);
    font-size: 18px;
    font-weight: 800;
    color: var(--single-accent);
    padding: 0;
    border: none;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
   }

.related-post-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    transition: none;
    padding: 16px 0;
    border-bottom: 1px solid var(--single-border);
}

/* Spasi antar kolom */
.related-post-card:nth-child(even) {
    padding-left: 20px;
}

.related-post-card:nth-child(odd) {
    padding-right: 20px;
}

.related-post-card:hover {
    box-shadow: none;
}

.related-post-thumb {
    display: none;
}

.related-post-content {
    padding: 0;
}

.related-post-title {
    font-family: var(--single-font);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-title a {
    color: var(--single-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-post-title a:hover {
    color: var(--single-accent);
}

.related-post-date {
    display: none;
}

/* ==========================================================================
   RESPONSIVE - MOBILE (< 768px)
   Tampilkan hanya 4 post (hide post ke-5 dan ke-6)
   ========================================================================== */
@media (max-width: 768px) {
    /* Sembunyikan post ke-5 dan ke-6 di mobile */
    .related-post-card:nth-child(n+5) {
        display: none !important;
    }
    
    /* Ubah jadi 1 kolom di mobile */
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hapus padding kiri-kanan antar kolom */
    .related-post-card:nth-child(even),
    .related-post-card:nth-child(odd) {
        padding-left: 0;
        padding-right: 0;
    }
    
    .related-post-title {
        font-size: 14px;
    }
}
/* ==========================================================================
   6. COMMENTS
   ========================================================================== */
.comments-area {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--single-border);
}

.comments-title {
    font-family: var(--single-font);
    font-size: 20px;
    font-weight: 700;
    color: var(--single-text);
    margin: 0 0 24px 0;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    margin-bottom: 24px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid var(--single-border);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-author img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.comment-author .fn {
    font-family: var(--single-font);
    font-weight: 700;
    color: var(--single-text);
}

.comment-metadata {
    font-family: var(--single-font);
    font-size: 12px;
    color: var(--single-text-muted);
    margin-bottom: 12px;
}

.comment-content {
    font-family: var(--single-font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--single-text-dim);
}

.comment-reply-link {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    background: var(--single-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-family: var(--single-font);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.comment-reply-link:hover {
    background: var(--single-accent-hover);
}

.comment-respond {
    margin-top: 32px;
    padding: 24px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid var(--single-border);
}

.comment-reply-title {
    font-family: var(--single-font);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
}

.comment-form label {
    display: block;
    font-family: var(--single-font);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--single-text);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--single-border);
    border-radius: 4px;
    font-family: var(--single-font);
    font-size: 14px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--single-accent);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .form-submit {
    margin: 0;
}

.comment-form .submit {
    padding: 10px 24px;
    background: var(--single-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: var(--single-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.comment-form .submit:hover {
    background: var(--single-accent-hover);
}

/* ==========================================================================
   7. RESPONSIVE - TABLET (769px - 1024px)
   ========================================================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .single-post-title {
        font-size: 28px;
    }
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   8. RESPONSIVE - MOBILE (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .single-post-title {
        font-size: 24px;
    }
    
    .single-post-excerpt {
        font-size: 14px;
    }
    
    /* Meta row: stack vertikal di mobile */
    .single-post-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .meta-share-block {
        width: 100%;
        justify-content: flex-start;
    }
    
    .meta-date-text {
        margin-left: 0;
    }
    
    /* ✅ GAMBAR KONTEN: Full-bleed di mobile */
    .single-post .entry-content img,
    .single-post-content img,
    .single-post .entry-content figure,
    .single-post-content figure,
    .single-post .entry-content .wp-block-image,
    .single-post-content .wp-block-image,
    .single-post .entry-content .wp-caption,
    .single-post-content .wp-caption {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        border-radius: 0 !important;
        margin-top: 24px !important;
        margin-bottom: 24px !important;
    }

    /* ✅ CAPTION KONTEN: Mengikuti container (TIDAK full-bleed) */
    .single-post .entry-content .wp-caption-text,
    .single-post-content .wp-caption-text,
    .single-post .entry-content figcaption,
    .single-post-content figcaption {
        padding: 10px 0 0 0;
        margin-bottom: 6px;
    }

    /* ✅ FEATURED IMAGE: Full-bleed (rapat ke tepi), tanpa border radius */
    .single-post-featured-image {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        border-radius: 0;
        margin-bottom: 0;
    }

    .single-post-featured-image img {
        border-radius: 0;
    }

    /* ✅ FEATURED CAPTION: Mengikuti container (TIDAK full-bleed) */
    .featured-image-caption {
        padding: 10px 0 0 0;
        margin-bottom: 6px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
       }
    
    .comment {
        padding: 16px;
    }
    
    .comment-author img {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================================
   9. RESPONSIVE - SMALL MOBILE (< 480px)
   ========================================================================== */
@media (max-width: 480px) {
    .single-post-title {
        font-size: 20px;
    }
    
    .share-icon-buttons {
        gap: 2px;
    }
    
    .share-ico {
        width: 32px;
        height: 32px;
    }
    
    .share-ico svg {
        width: 18px;
        height: 18px;
    }
}