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

/* --- 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: #ff3333; /* 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: #ff3333; /* 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: #ff3333; 
    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;
}

/* --- TOMBOL SHARE BARU (FIXED) --- */

.native-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ff3333; /* Warna background Merah */
    border: 1px solid #ff3333; /* Border disamakan dengan background agar rapi */
    color: #ffffff; /* Teks dan Ikon menjadi PUTIH */
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

/* Memastikan ikon SVG mengikuti warna teks (Putih) */
.native-share-btn svg {
    stroke: currentColor;
}

.native-share-btn:hover {
    background-color: #e92b1d; /* Warna Aksen lebih gelap saat hover */
    border-color: #e92b1d;
    color: #ffffff; /* Tetap putih saat hover */
}

/* Responsif Mobile: Sembunyikan teks "Bagikan" di HP kecil */
@media (max-width: 480px) {
    .native-share-btn span {
        display: none;
    }
    .native-share-btn {
        padding: 8px; /* Jadi bulat/kotak kecil */
        border-radius: 50%; 
        width: 34px;    /* Lebar & tinggi fix agar bulat sempurna */
        height: 34px;
        justify-content: center;
    }
}
/* 4. Gambar Utama */
.custom-feat-image {
	margin: 0;
}

.custom-feat-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block; 
}

/* 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; }
}

/* --- FOOTER MENU DINAMIS (HORIZONTAL) --- */

.footer-right-menu {
    /* Pastikan container menu mengisi ruang yang ada */
    flex: 1; 
    display: flex;
    justify-content: flex-end; /* Rata kanan di Desktop */
}

/* Styling List Menu (UL) */
ul.footer-nav-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;       /* KUNCI: Membuat menu horizontal */
    flex-wrap: wrap;     /* Agar turun ke bawah jika layar sempit */
    gap: 25px;           /* Jarak antar menu */
    align-items: center;
}

/* Styling Item Menu (LI) */
ul.footer-nav-list li {
    margin: 0 !important;
    padding: 0 !important;
}

/* Styling Link (A) */
ul.footer-nav-list li a {
    text-decoration: none;
    color: #ff3333;      /* Warna Merah */
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

ul.footer-nav-list li a:hover {
    color: #c0392b;      /* Merah Gelap saat Hover */
    text-decoration: underline;
}

/* RESPONSIF MOBILE (HP) */
@media (max-width: 768px) {
    .site-info .inside-site-info {
        flex-direction: column-reverse;
        gap: 20px;
    }

    .footer-right-menu {
        justify-content: center; /* Rata tengah di HP */
        width: 100%;
    }

    ul.footer-nav-list {
        justify-content: center;
        gap: 15px;
    }
}

/* =========================================
   SHORTCODE BACA JUGA (NEW DESIGN 2026)
   Style: Full Border, Gambar Kanan, Rounded
   ========================================= */

.bj-card-container {
    margin: 30px 0;
    width: 100%;
    box-sizing: border-box;
}

/* KOTAK UTAMA (Flexbox agar sejajar) */
.bj-card-inner {
    display: flex; /* WAJIB ADA: Ini yang bikin gambar pindah ke kanan */
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa; /* Abu sangat muda */
    border: 1px solid #ff3333; /* Garis Merah TIPIS keliling */
    border-radius: 12px;       /* Sudut membulat */
    padding: 15px;
    text-decoration: none;
    gap: 20px; /* Jarak antara teks dan gambar */
}

/* Efek Hover Ringan (Garis Bawah Judul Saja) */
.bj-card-inner:hover .bj-title {
    text-decoration: underline;
}

/* BAGIAN KIRI (Teks) */
.bj-card-text {
    flex: 1; /* Mengisi sisa ruang agar teks bisa panjang */
    display: flex;
    flex-direction: column;
}

.bj-label {
    font-size: 13px;
    font-weight: 800;
    color: #222; /* Hitam */
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
    line-height: 1;
}

.bj-title {
    font-size: 18px; /* Ukuran Judul */
    font-weight: 700;
    color: #ff3333; /* Merah */
    margin: 0;
    line-height: 1.3;
}

/* BAGIAN KANAN (Gambar) */
.bj-card-image {
    flex-shrink: 0; /* Mencegah gambar gepeng/mengecil */
    width: 90px;
    height: 90px;
    border-radius: 8px; /* Sudut gambar tumpul */
    overflow: hidden;
}

.bj-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop gambar biar pas kotak */
    display: block;
    border-radius: 8px;
}

/* RESPONSIF (Tampilan di HP) */
@media (max-width: 480px) {
    .bj-card-inner {
        padding: 12px;
        gap: 15px;
    }
    
    .bj-title {
        font-size: 15px; /* Judul lebih kecil di HP */
    }

    .bj-card-image {
        width: 70px;
        height: 70px; /* Gambar lebih kecil di HP */
    }
}