/* Container Utama Card */
.card-post {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    /* Sudut membulat modern */
    background-color: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition:
        transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1),
        box-shadow 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    /* Memastikan tinggi card sama dalam 1 baris */
    display: flex;
    flex-direction: column;
}

/* Efek Hover pada Card */
.card-post:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.09);
}

/* Pembungkus Gambar dengan Rasio Aspek Tetap (16:10) */
.card-post .card-post-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 62.5%;
    /* Rasio 16:10 */
    overflow: hidden;
    background-color: #e9ecef;
}

/* Gambar Thumbnail */
.card-post .card-post-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Efek Zoom Halus pada Gambar saat Card di-hover */
.card-post:hover .card-post-img {
    transform: scale(1.06);
}

/* Badge Kategori Opsional di atas Gambar (Glassmorphism) */
.card-post .card-post-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Area Konten Utama */
.card-post .card-post-body {
    padding: 1.5rem 1.5rem 1.25rem 1.5rem;
    flex: 1 1 auto;
    /* Mengisi ruang kosong agar footer selalu rata bawah */
    display: flex;
    flex-direction: column;
}

/* Judul Post (Maksimal 2 baris) */
.card-post .card-post-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    /* Line Clamp untuk memotong judul jika lebih dari 2 baris */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Link pada Judul */
.card-post .card-post-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-post .card-post-title a:hover {
    color: #01747b;
    /* Warna aksen biru khas Porto, silakan sesuaikan */
}

/* Deskripsi Singkat (Maksimal 3 baris & otomatis terpotong '...') */
.card-post .card-post-excerpt {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 0;
    /* Line Clamp 3 Baris */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bagian Footer Card */
.card-post .card-post-footer {
    padding: 0.95rem 1.5rem;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Tanggal Post */
.card-post .card-post-date {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.card-post .card-post-date i {
    margin-right: 6px;
    font-size: 0.85rem;
    color: #cbd5e1;
}

/* Tombol / Link Baca Selengkapnya */
.card-post .card-post-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #01747b;
    background-color: rgba(0, 136, 204, 0.08);
    padding: 6px 14px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.25s ease;
}

.card-post .card-post-link i {
    margin-left: 6px;
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

/* Hover pada Tombol/Link */
.card-post .card-post-link:hover {
    background-color: #01747b;
    color: #ffffff;
    text-decoration: none;
}

.card-post .card-post-link:hover i {
    transform: translateX(3px);
}

/* Wrapper untuk menampung Tanggal & Jumlah Views */
.card-post-meta-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Styling khusus untuk Jumlah Views (selaras dengan .card-post-date) */
.card-post-views {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid #e2e8f0; /* Garis pemisah tipis antara tanggal dan views */
}

.card-post-views i {
    margin-right: 6px;
    font-size: 0.85rem;
    color: #cbd5e1;
}

/* Modifier Class untuk Layout Horizontal (Desktop & Tablet >= 768px) */
@media (min-width: 768px) {
    .card-post.card-post-horizontal {
        flex-direction: row; /* Ubah arah flex dari kolom menjadi baris (kiri-kanan) */
        align-items: stretch;
    }

    /* Bagian Kiri: Gambar */
    .card-post.card-post-horizontal .card-post-img-wrap {
        width: 36%; /* Lebar gambar 36% dari total card */
        min-width: 260px; /* Lebar minimal agar gambar tetap proporsional */
        max-width: 340px;
        padding-top: 0; /* Reset rasio padding-top vertikal */
        min-height: 225px; /* Tinggi minimal card agar konsisten */
        flex-shrink: 0; /* Mencegah gambar menyusut saat teks panjang */
    }

    /* Bagian Kanan: Pembungkus Body & Footer */
    .card-post.card-post-horizontal .card-post-content-right {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-width: 0; /* Mencegah teks meluber keluar container flex */
    }

    .card-post.card-post-horizontal .card-post-body {
        padding: 1.5rem 1.75rem 1rem 1.75rem;
    }

    .card-post.card-post-horizontal .card-post-footer {
        padding: 0.95rem 1.75rem;
    }
}

/* Penyesuaian pada layar sangat kecil (< 420px) agar footer tetap rapi */
@media (max-width: 420px) {
    .card-post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .card-post-link {
        align-self: flex-end;
    }
}

/* ==========================================================================
           1. BREADCRUMB & NAVIGASI KEMBALI
           ========================================================================== */
.post-detail-breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.post-detail-breadcrumb .breadcrumb-item a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-detail-breadcrumb .breadcrumb-item a:hover {
    color: #01747b;
}

.post-detail-breadcrumb .breadcrumb-item.active {
    color: #01747b;
    font-weight: 600;
}

/* ==========================================================================
           2. CONTAINER UTAMA HALAMAN DETAIL POST
           ========================================================================== */
.post-detail-card {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    padding: 2.25rem;
}

@media (max-width: 767.98px) {
    .post-detail-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
}

/* Badge Kategori */
.post-detail-badge {
    display: inline-block;
    background-color: rgba(1, 116, 123, 0.1);
    color: #01747b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 1rem;
}

/* Judul Utama Artikel */
.post-detail-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

@media (max-width: 767.98px) {
    .post-detail-title {
        font-size: 1.5rem;
    }
}

/* Baris Meta Informasi (Author, Tanggal, Views, Estimasi Baca) */
.post-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #64748b;
}

.post-detail-meta-item {
    display: inline-flex;
    align-items: center;
}

.post-detail-meta-item i {
    color: #01747b;
    margin-right: 7px;
    font-size: 0.9rem;
}

.post-detail-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 9px;
    border: 2px solid #e2e8f0;
}

/* Gambar Utama (Featured Image) */
.post-detail-featured-img-wrap {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    background-color: #e9ecef;
}

.post-detail-featured-img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
}

.post-detail-img-caption {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 0.65rem;
    font-style: italic;
}

/* Tipografi Konten Artikel */
.post-detail-content {
    font-size: 1.02rem;
    line-height: 1.8;
    color: #334155;
}

.post-detail-content p {
    margin-bottom: 1.4rem;
}

.post-detail-content h2,
.post-detail-content h3 {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2.2rem;
    margin-bottom: 1rem;
}

.post-detail-content h2 {
    font-size: 1.45rem;
}

.post-detail-content h3 {
    font-size: 1.2rem;
}

.post-detail-content ul,
.post-detail-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.35rem;
}

.post-detail-content li {
    margin-bottom: 0.5rem;
}

/* Blockquote Modern */
.post-detail-quote {
    background-color: #f8fafc;
    border-left: 4px solid #01747b;
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    font-style: italic;
    color: #1e293b;
    font-weight: 500;
}

/* Footer Artikel: Tags & Tombol Share */
.post-detail-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.post-detail-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.post-detail-tag-item {
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    background-color: #f1f5f9;
    padding: 5px 12px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-detail-tag-item:hover {
    background-color: #01747b;
    color: #ffffff;
    text-decoration: none;
}

.post-detail-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-detail-share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    color: #475569;
    border: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.post-detail-share-btn:hover {
    background-color: #01747b;
    color: #ffffff;
    transform: translateY(-2px);
    text-decoration: none;
}

/* ==========================================================================
           3. SIDEBAR WIDGETS (POST TERKAIT & KATEGORI)
           ========================================================================== */
.sidebar-widget {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
}

.sidebar-widget-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.sidebar-widget-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 45px;
    height: 2px;
    background-color: #01747b;
}

/* Mini Card Post di Sidebar */
.mini-post-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.1rem;
    text-decoration: none;
}

.mini-post-item:last-child {
    margin-bottom: 0;
}

.mini-post-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 0.9rem;
}

.mini-post-info {
    min-width: 0;
}

.mini-post-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.mini-post-item:hover .mini-post-title {
    color: #01747b;
}

.mini-post-meta {
    font-size: 0.76rem;
    color: #94a3b8;
}

/* List Kategori di Sidebar */
.sidebar-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-cat-list li {
    margin-bottom: 0.6rem;
}

.sidebar-cat-list li:last-child {
    margin-bottom: 0;
}

.sidebar-cat-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-cat-list a:hover {
    background-color: rgba(1, 116, 123, 0.08);
    color: #01747b;
}

.sidebar-cat-count {
    font-size: 0.75rem;
    background-color: #f1f5f9;
    color: #64748b;
    padding: 2px 9px;
    border-radius: 50px;
    font-weight: 600;
}

/* Notifikasi Toast Salin Link */
.copy-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #0f172a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 9999;
}

.copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}
