/*
 Theme Name:   CAKNEWSPress
 Theme URI:    https://yusufaa.web.id
 Description:  Child theme untuk CakNews
 Author:       Cak Yus
 Template:     generatepress
 Version:      1.2
*/


/* --- 1. DESAIN SIDEBAR (Unified: Widget Populer & Related) --- */

/* Judul Widget (Berlaku untuk semua widget sidebar) */
.sidebar .widget-title {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    margin-bottom: 20px;
    background: transparent;
    padding-left: 0;
    border-bottom: none;
    /* Warna mengikuti Customizer */
}

.sidebar .widget-title::after {
    content: "";
    display: block;
    width: 100%;
    height: 3px;
    background-color: #e74c3c; /* Merah */
    flex: 1;
}

/* CONTAINER LIST */
/* Widget Bawaan (UL) & Widget Custom Kita (DIV) */
.sidebar ul.wp-block-latest-posts,
.caknews-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ITEM LIST */
/* Widget Bawaan (LI) & Widget Custom Kita (ARTICLE) */
.sidebar ul.wp-block-latest-posts li,
.caknews-sidebar-list .caknews-sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: none;
    padding-bottom: 0;
}

/* GAMBAR THUMBNAIL */
.sidebar .wp-block-latest-posts__featured-image,
.caknews-sidebar-list .sidebar-thumb {
    width: 80px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.sidebar .wp-block-latest-posts__featured-image img,
.caknews-sidebar-list .sidebar-thumb img {
    border-radius: 5px;
    object-fit: cover;
    height: 65px; /* Tinggi fix agar rapi */
    width: 100%;
    display: block;
}

/* TEKS JUDUL ARTIKEL */
.sidebar .wp-block-latest-posts__list a,
.caknews-sidebar-list .sidebar-text a {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    color: inherit; /* Mengikuti warna link tema */
    display: block;
}

.sidebar .wp-block-latest-posts__list a:hover,
.caknews-sidebar-list .sidebar-text a:hover {
    color: #e74c3c; /* Merah saat hover */
}

/* --- 2. DESAIN ARCHIVE / HOME (Grid Atas, List Bawah) --- */

.blog .generate-columns-container,
.archive .generate-columns-container {
    flex-wrap: wrap;
}

.blog .generate-columns-container .post:nth-child(n+3),
.archive .generate-columns-container .post:nth-child(n+3) {
    width: 100%;
    float: none;
    display: block;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.blog .generate-columns-container .post:nth-child(n+3) .inside-article {
    display: grid;
    grid-template-columns: 1fr 250px; 
    grid-template-areas: 
        "header image"
        "summary image"
        "meta image";
    gap: 10px 30px;
}

.blog .generate-columns-container .post:nth-child(n+3) .post-image {
    grid-area: image;
    width: 100%;
    margin: 0 !important;
}

.blog .generate-columns-container .post:nth-child(n+3) .post-image img {
    height: 150px;
    width: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.blog .generate-columns-container .post:nth-child(n+3) .entry-header { grid-area: header; }
.blog .generate-columns-container .post:nth-child(n+3) .entry-summary { grid-area: summary; }
.blog .generate-columns-container .post:nth-child(n+3) .entry-meta { grid-area: meta; }

@media (max-width: 768px) {
    .blog .generate-columns-container .post:nth-child(n+3) .inside-article { display: block; }
    .blog .generate-columns-container .post:nth-child(n+3) .post-image {
        width: 100%;
        margin-bottom: 20px !important;
    }
}

/* --- SINGLE POST STYLING --- */

/* 1. Kategori Badge */
.custom-cat-badge {
    margin-bottom: 15px;
}

.custom-cat-badge a {
    display: inline-block;
    background-color: #e74c3c;
    color: #fff;
    padding: 4px 10px;
    border: 1px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.custom-cat-badge a:hover {
    background-color: #c0392b;
    color: #fff;
}

/* 2. Judul Artikel (H1) */
.single .entry-title {
    margin-bottom: 15px;
    /* Warna dihapus: Mengikuti Customize > Colors > Content > H1 */
}

/* 3. Meta Data (Author & Date) */
.custom-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 25px;
    font-size: 15px;
    color: inherit; /* Mengikuti warna teks body */
    opacity: 0.8;   /* Sedikit transparan agar beda dengan konten */
}

.custom-post-meta .byline {
    display: block;
    margin-bottom: 4px;
}

/* Link Author Merah */
.custom-post-meta a.url {
    color: #e74c3c; 
    font-weight: 600;
    text-decoration: none;
}

.custom-post-meta a.url:hover {
    text-decoration: underline;
}

.custom-post-meta .source-name {
    color: #e74c3c;
}

.custom-post-meta .posted-on {
    font-size: 13px;
    opacity: 0.8;
}

/* Ikon Share Merah */
/* --- TOMBOL SHARE BARU --- */

.native-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f7f8f9; /* Warna background kalem */
    border: 1px solid #e1e1e1;
    color: #333;
    padding: 6px 16px; /* Saya sesuaikan sedikit paddingnya agar pas */
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1; /* Agar teks dan ikon sejajar vertikal */
}

.native-share-btn:hover {
    background-color: #e92b1d; /* Warna Aksen */
    color: white;
    border-color: #e92b1d;
}

/* Responsif Mobile: Sembunyikan teks "Bagikan" jika layar terlalu sempit (Opsional) */
@media (max-width: 480px) {
    .native-share-btn span {
        display: none;
    }
    .native-share-btn {
        padding: 8px; /* Jadi bulat/kotak kecil saja */
        border-radius: 50%; 
    }
}
/* 4. Gambar Utama */
.custom-feat-image {
    margin-bottom: 30px;
}

.custom-feat-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 5. Konten Tulisan */
.entry-content {
    /* Warna dihapus: Mengikuti Customize > Colors > Content > Text */
}

/* Tombol Share */
button.meta-right-share {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #e74c3c;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

button.meta-right-share:hover {
    transform: scale(1.1);
    color: #c0392b;
}

button.meta-right-share:focus {
    outline: none;
}


/* --- SINGLE POST TAGS --- */

.single-post-tags {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Label TAGS */
.single-post-tags .tags-label {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    color: inherit; /* Mengikuti warna teks body */
    font-weight: 800;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Container List Tag */
.single-post-tags .tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Link Tag */
.single-post-tags .tags-list a {
    display: inline-block;
    background-color: #f3f4f6;
    color: inherit; /* Mengikuti warna teks body (bukan hitam pekat) */
    opacity: 0.8;
    padding: 6px 15px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.single-post-tags .tags-list a:hover {
    background-color: #fff;
    color: #e74c3c;
    border-color: #e74c3c;
    opacity: 1;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.15);
}

@media (max-width: 768px) {
    .single-post-tags {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

/* --- HEADER BORDER --- */
.site-header {
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

/* Styling Follow Google News Box */
.cn-google-news-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #e3f2fd; /* Warna biru muda sesuai gambar */
    padding: 15px 25px;
    border-radius: 4px;
    margin: 25px 0;
    border: 1px solid rgba(21, 88, 214, 0.1);
}

.cn-gn-content p {
    margin: 0 !important;
    font-size: 16px;
    color: #333;
    line-height: 1.4;
}

.cn-gn-content strong {
    color: #1558d6; /* Warna biru untuk penekanan nama brand */
}

.cn-gn-btn {
    background-color: #1558d6; /* Warna tombol biru */
    color: #ffffff !important;
    padding: 8px 24px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none !important;
    font-size: 14px;
    transition: background 0.3s ease;
    display: inline-block;
}

.cn-gn-btn:hover {
    background-color: #1246ad;
    color: #ffffff !important;
}

/* Responsif Mobile */
@media (max-width: 600px) {
    .cn-google-news-box {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    
    .cn-gn-btn {
        width: 100%;
    }
}
/* ==========================================================
   ARCHIVE FINAL FIX (LURUS & TIDAK MEPET)
   ========================================================== */

.caknews-archive-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.custom-archive-header {
    margin-bottom: 30px;
    padding: 0 !important;
    margin-left: 0 !important;
    border-bottom: none;
}

.custom-archive-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
    /* Warna dihapus: Mengikuti Customize > Colors > Content > H1 */
}

.custom-archive-header .archive-description {
    color: inherit; /* Mengikuti warna teks body */
    font-size: 16px;
    margin: 0;
}

.caknews-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 30px;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

.caknews-card {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

.caknews-card-image {
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
}

.caknews-card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.caknews-cat { margin-bottom: 8px; }
.caknews-cat a {
    color: #e74c3c;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
}

.caknews-title {
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
    margin: 0 0 8px 0;
}
.caknews-title a { 
    color: inherit; /* Mengikuti Customize > Colors > Content > H2 (atau Link) */
    text-decoration: none; 
}
.caknews-title a:hover { color: #e74c3c; }

.caknews-date { font-size: 12px; color: inherit; opacity: 0.6; }

/* Pagination */
.caknews-pagination {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}
.caknews-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.caknews-pagination .page-numbers {
    padding: 8px 16px;
    border: 1px solid #eee;
    color: #e74c3c;
    text-decoration: none;
    border-radius: 4px;
}
.caknews-pagination .page-numbers.current {
    background: #e74c3c; color: #fff; border-color: #e74c3c;
}


/* ==========================================================
   MOBILE & TABLET FIX
   ========================================================== */

@media (max-width: 768px) {
    #main.site-main {
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box;
    }
    .caknews-grid-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .caknews-card-image img {
        height: auto;
        aspect-ratio: 16/9;
    }
    .custom-archive-header h1 { font-size: 28px; }
    .caknews-title { font-size: 18px; }
}


/* --- HOMEPAGE STYLES FINAL --- */

.caknews-home-section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h2.section-title {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    padding-left: 15px;
    position: relative;
    line-height: 1.2;
    color: inherit; /* Mengikuti Customize > Colors > Content > H2 */
}

h2.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    background-color: #e74c3c;
}

.section-more {
    font-size: 13px;
    color: inherit; /* Mengikuti warna teks biasa */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    opacity: 0.8;
}
.section-more:hover {
    color: #e74c3c;
    text-decoration: underline;
    opacity: 1;
}

/* Grid Home */
.caknews-card-content h3.caknews-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin: 8px 0;
}

.caknews-cat {
    font-size: 12px;
    color: #e74c3c;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

/* List Terbaru */
.caknews-list-container {
    display: block;
}

.caknews-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
}

.caknews-list-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.list-text {
    flex: 1;
}

.small-cat {
    font-size: 11px;
    margin-bottom: 6px;
    color: #e74c3c;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
}

h3.list-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

h3.list-title a {
    color: inherit; /* Mengikuti Customize > Colors > Content > H3 (atau Link) */
    text-decoration: none;
}
h3.list-title a:hover {
    color: #e74c3c;
}

.list-image {
    width: 90px;
    flex-shrink: 0;
}
.list-image img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

@media (max-width: 768px) {
    h2.section-title { font-size: 18px; }
    .caknews-card-content h3.caknews-title { font-size: 17px; }
    h3.list-title { font-size: 15px; }
    .caknews-list-item { align-items: center; }
}

/* --- HALAMAN 404 CUSTOM --- */

.caknews-404-wrapper {
    text-align: center;
    padding: 80px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.caknews-404-wrapper .error-code {
    font-size: 120px;
    font-weight: 900;
    color: #e74c3c;
    line-height: 1;
    margin-bottom: 20px;
    letter-spacing: -5px;
}

.caknews-404-wrapper .page-title {
    font-size: 32px;
    margin-bottom: 15px;
    /* Warna dihapus: Ikut settingan H1 */
}

.caknews-404-wrapper p {
    font-size: 16px;
    color: inherit; /* Ikut warna teks body */
    margin-bottom: 15px;
    line-height: 1.6;
}

.caknews-404-wrapper .error-actions {
    margin-top: 30px;
}

.caknews-btn-red {
    display: inline-block;
    background-color: #e74c3c;
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border: none;
}

.caknews-btn-red:hover {
    background-color: #c0392b;
    color: #ffffff;
}

@media (max-width: 768px) {
    .caknews-404-wrapper { padding: 50px 20px; }
    .caknews-404-wrapper .error-code { font-size: 80px; }
    .caknews-404-wrapper .page-title { font-size: 24px; }
}

/* --- CUSTOM FOOTER FINAL (Fix Kanan-Kiri) --- */

.site-info {
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 30px 0;
    font-size: 14px;
    color: #444;
}

/* Container Utama Flexbox */
.site-info .inside-site-info {
    display: flex;
    justify-content: space-between; /* Paksa Kiri - Kanan */
    align-items: center;
    width: 100%; /* Wajib full width agar space-between bekerja */
    flex-wrap: wrap; /* Agar responsif turun ke bawah di HP */
}

/* 1. Bagian Kiri (Copyright) */
.footer-left-copyright {
    text-align: left;
    color: #333;
    font-weight: 500;
}
/* Memastikan teks copyright bawaan GP tidak ada margin aneh */
.footer-left-copyright .copyright-bar {
    margin-bottom: 0;
}

/* 2. Bagian Kanan (Menu) */
.footer-right-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px; /* Jarak antar link */
}

.footer-right-menu ul li {
    margin: 0;
}

.footer-right-menu ul li a {
    text-decoration: none;
    color: #e74c3c; /* Merah */
    font-weight: 500;
    transition: color 0.2s;
}

.footer-right-menu ul li a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* --- RESPONSIF MOBILE (HP) --- */
@media (max-width: 768px) {
    .site-info .inside-site-info {
        flex-direction: column-reverse; /* Menu di atas, Copyright di bawah */
        justify-content: center;
        gap: 20px;
        text-align: center;
    }
    
    .footer-left-copyright {
        text-align: center;
        width: 100%;
    }

    .footer-right-menu {
        width: 100%;
    }

    .footer-right-menu ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* --- SHORTCODE BACA JUGA (IN-CONTENT) --- */

.baca-juga-box {
    background-color: #f9f9f9; /* Abu-abu sangat muda */
    border-left: 5px solid #e74c3c; /* Garis Merah Tebal di Kiri */
    padding: 15px 20px;
    margin: 30px 0; /* Jarak atas bawah */
    font-size: 16px;
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap; /* Aman untuk HP */
    gap: 5px;
    align-items: baseline;
}

/* Teks "Baca Juga:" */
.baca-juga-label {
    font-weight: 700;
    color: #222; /* Hitam pekat */
    white-space: nowrap; /* Biar gak kepotong */
}

/* Link Artikel */
.baca-juga-link {
    color: #e74c3c; /* Merah */
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.baca-juga-link:hover {
    color: #c0392b; /* Merah gelap pas hover */
    text-decoration: underline;
}

/* Responsif di HP */
@media (max-width: 768px) {
    .baca-juga-box {
        padding: 12px 15px;
        font-size: 15px;
    }
}

/* Memberi jarak antar artikel di mode infinite scroll */
.single-post + .single-post {
    margin-top: 50px;
    padding-top: 50px;
    border-top: 2px dashed #eee;
}

/* Animasi saat artikel baru muncul */
.single-post {
    transition: opacity 0.5s ease-in;
}

.infinite-scroll-divider {
    text-align: center;
    margin: 40px 0;
    position: relative;
    border-bottom: 2px dashed #eee;
}
.infinite-scroll-divider span {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 15px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #e74c3c;
}