/*
Theme Name: BeritaKilat
Theme URI: https://example.com/beritakilat
Author: Qwen3.7 Expert Dev
Author URI: https://example.com
Description: Tema blog berita yang ringan, cepat, mobile-friendly, dan SEO-ready. Dibangun dengan CSS Grid/Flexbox murni tanpa framework berat.
Version: 1.4.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: beritakilat
Tags: news, blog, lightweight, responsive, mobile-friendly
*/

/* ===== VARIABLES ===== */
:root {
    --primary-color: #1a1a1a;
    --accent-color: #d32f2f;
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --light-gray: #e9ecef;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --container-width: 1200px;
    --spacing: 1.5rem;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); background: var(--bg-color); color: var(--text-color); line-height: 1.6; font-size: 16px; }
a { text-decoration: none; color: var(--primary-color); transition: color 0.2s; }
a:hover { color: var(--accent-color); }
img { max-width: 100%; height: auto; display: block; }

/* ===== LAYOUT CONTAINER ===== */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 var(--spacing); }

/* ===== HEADER LAYOUT ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--light-gray);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
    gap: 2rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== NAVIGATION & DROPDOWN ===== */
.main-navigation { flex-shrink: 0; }
.main-navigation ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.main-navigation a {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    display: inline-block;
    position: relative;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}
.main-navigation a:hover::after { width: 100%; }

.main-navigation li { position: relative; }
.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    padding: 0.75rem 0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border: 1px solid var(--light-gray);
    z-index: 200;
    flex-direction: column;
    gap: 0;
    margin-top: 0.5rem;
}

.main-navigation li:last-child .sub-menu,
.main-navigation li:nth-last-child(2) .sub-menu {
    left: auto;
    right: 0;
}
.main-navigation li:hover > .sub-menu { display: flex; }
.main-navigation .sub-menu li { padding: 0 1rem; }
.main-navigation .sub-menu a { padding: 0.5rem 0; font-size: 0.9rem; font-weight: 500; display: block; white-space: nowrap; }
.main-navigation .sub-menu a::after { display: none; }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* ===== MAIN CONTENT GRID ===== */
.site-content { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; margin-top: 2rem; margin-bottom: 3rem; }

/* ===== POST CARD - HORIZONTAL LAYOUT (DESKTOP) ===== */
.post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.post-card .post-thumbnail-wrapper {
    flex-shrink: 0;
    width: 280px;
    position: relative;
    overflow: hidden;
}
.post-card .post-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.post-card:hover .post-thumbnail { transform: scale(1.05); }

.post-card .post-content {
    padding: 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.post-card .post-meta {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.post-card .post-meta .category {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.post-card .post-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    font-weight: 700;
}
.post-card .post-title a { color: var(--primary-color); transition: color 0.2s; }
.post-card .post-title a:hover { color: var(--accent-color); }

.post-card .post-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card .read-more {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: auto;
    align-self: flex-start;
}
.post-card .read-more:hover { text-decoration: underline; }

/* ===== SIDEBAR ===== */
.sidebar .widget { background: #fff; padding: 1.5rem; border-radius: 8px; margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.widget-title { font-size: 1.1rem; border-bottom: 2px solid var(--accent-color); padding-bottom: 0.5rem; margin-bottom: 1rem; display: inline-block; }

/* ===== FOOTER ===== */
.site-footer { background: var(--primary-color); color: #fff; text-align: center; padding: 2rem 0; margin-top: auto; }
.site-footer a { color: #fff; text-decoration: underline; }

/* ===== SINGLE POST ===== */
.single-post .post-title { font-size: 2rem; margin-bottom: 1rem; }
.single-post .entry-content { font-size: 1.1rem; line-height: 1.8; }
.single-post .entry-content p { margin-bottom: 1.5rem; }

/* ===== COMMENT FORM ===== */
.comment-form {
    max-width: 100%;
    margin: 2rem 0;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.comment-form p { margin-bottom: 1.5rem; display: flex; flex-direction: column; }
.comment-form label { font-weight: 600; margin-bottom: 0.5rem; color: var(--primary-color); font-size: 0.95rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.comment-form input:focus, .comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}
.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form .required { color: var(--accent-color); margin-left: 2px; }

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.comment-form-cookies-consent input[type="checkbox"] { margin-top: 0.25rem; width: 18px; height: 18px; cursor: pointer; }
.comment-form-cookies-consent label { font-weight: 400; font-size: 0.9rem; color: #666; cursor: pointer; margin: 0; }

.comment-form .submit {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: inline-block;
    width: auto;
}
.comment-form .submit:hover { background: #b71c1c; transform: translateY(-2px); }
.comment-form .submit:active { transform: translateY(0); }

/* ===== COMMENT LIST ===== */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--light-gray); }
.comments-area h2, .comments-area h3 { margin-bottom: 1.5rem; color: var(--primary-color); }
.comment-list { list-style: none; padding: 0; margin: 2rem 0; }
.comment-list li { margin-bottom: 2rem; padding: 1.5rem; background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.comment-meta { margin-bottom: 1rem; }
.comment-author { font-weight: 700; color: var(--primary-color); font-size: 1.1rem; }
.comment-metadata { font-size: 0.85rem; color: #666; margin-top: 0.25rem; }
.comment-metadata a { color: #666; }
.comment-metadata a:hover { color: var(--accent-color); }
.comment-content { line-height: 1.7; color: var(--text-color); }
.reply { margin-top: 1rem; }
.reply a { color: var(--accent-color); font-weight: 600; font-size: 0.9rem; }
.reply a:hover { text-decoration: underline; }
.children { list-style: none; margin-left: 2rem; margin-top: 2rem; }

/* ===== RESPONSIVE / MEDIA QUERIES ===== */

/* Tablet (769px - 1024px) */
@media (max-width: 1024px) {
    .post-card .post-thumbnail-wrapper { width: 220px; }
}

/* =========================================
   MOBILE (≤ 768px) - GRID 2 KOLOM
   Seperti contoh gambar yang diberikan
   ========================================= */
@media (max-width: 768px) {
    /* Header & Nav Mobile */
    .header-inner { padding: 1rem 1.25rem; }
    .mobile-menu-toggle { display: block; }
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--light-gray);
        padding: 1rem 1.25rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    }
    .main-navigation.active { display: block; }
    .main-navigation ul { flex-direction: column; gap: 0.75rem; }
    .main-navigation a { padding: 0.75rem 0; border-bottom: 1px solid var(--light-gray); display: block; }
    .main-navigation a::after { display: none; }
    .main-navigation .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0.5rem 0 0.5rem 1rem;
        margin-top: 0;
        background: #f8f9fa;
        min-width: auto;
    }
    .main-navigation li:hover > .sub-menu { display: flex; }

    /* ===== GRID 2 KOLOM UNTUK POSTINGAN ===== */
    .site-content { 
        grid-template-columns: 1fr; 
        gap: 1rem;
    }
    
    .primary-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2 kolom */
        gap: 0.75rem;
    }
    
    /* ===== POST CARD MOBILE - GRID STYLE ===== */
    .post-card { 
        display: flex;
        flex-direction: column; /* Vertical: gambar di atas, teks di bawah */
        margin-bottom: 0;
        border-radius: 6px;
        overflow: hidden;
        height: 100%;
    }
    
    .post-card .post-thumbnail-wrapper { 
        width: 100%;
        height: 140px; /* Fixed height untuk konsistensi */
        flex-shrink: 0;
    }
    
    .post-card .post-thumbnail {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 6px 6px 0 0;
    }
    
    .post-card .post-content { 
        padding: 0.625rem;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .post-card .post-meta {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }
    
    .post-card .post-meta .category {
        color: #e67e22; /* Warna oranye seperti contoh */
        font-weight: 700;
        font-size: 0.75rem;
    }
    
    .post-card .post-title { 
        font-size: 0.85rem;
        line-height: 1.35;
        font-weight: 700;
        margin-bottom: 0;
    }
    
    .post-card .post-title a {
        color: #000;
    }
    
    /* Hide excerpt dan read more di mobile grid */
    .post-card .post-excerpt,
    .post-card .read-more {
        display: none;
    }
    
    /* Sidebar tetap full width di bawah */
    .sidebar {
        width: 100%;
    }
    
    /* Single Post & Comment Mobile */
    .single-post .post-title { font-size: 1.5rem; }
    .single-post .primary-content {
        grid-template-columns: 1fr; /* Kembali ke 1 kolom untuk single post */
    }
    .comment-form { padding: 1.5rem; }
    .comment-form p { margin-bottom: 1.25rem; }
    .comment-form input, .comment-form textarea { padding: 0.625rem 0.875rem; font-size: 16px; }
    .comment-form .submit { width: 100%; padding: 1rem; }
    .children { margin-left: 1rem; }
}

/* Mobile Sangat Kecil (≤ 480px) - Tetap 2 kolom tapi lebih compact */
@media (max-width: 480px) {
    .header-inner { padding: 0.875rem 1rem; }
    .site-title { font-size: 1.25rem; }
    
    .primary-content {
        gap: 0.5rem;
    }
    
    .post-card .post-thumbnail-wrapper {
        height: 120px; /* Lebih kecil lagi */
    }
    
    .post-card .post-content {
        padding: 0.5rem;
    }
    
    .post-card .post-title {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .post-card .post-meta {
        font-size: 0.65rem;
    }
}

/* Layar Sangat Lebar (> 1400px) */
@media (min-width: 1400px) {
    .header-inner {
        padding: 1.25rem 3rem;
    }
}