/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* ==============================================
   1. SETUP GRID HALAMAN DEPAN (WADAH UTAMA)
   ============================================== */

/* Setup Grid 2 Kolom untuk Mobile */
.blog .site-main, 
.archive .site-main, 
.search .site-main {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px;
}

/* Fix untuk Desktop (4 Kolom) */
@media (min-width: 768px) {
    .blog .site-main, 
    .archive .site-main, 
    .search .site-main {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1000px;
        margin: 0 auto;
    }
}

/* Reset Container GeneratePress di Halaman Depan */
.blog .generate-columns-container article .inside-article,
.archive .generate-columns-container article .inside-article {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}


/* ==============================================
   2. DESAIN KARTU WALLPAPER (GRID ITEM)
   ============================================== */

.blog article.post, 
.archive article.post,
.search article.post {
    display: block;
    position: relative !important;
    width: 100%;
    aspect-ratio: 9 / 16 !important; /* KUNCI: Kotak memanjang */
    background-color: #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

/* Efek pencet */
.blog article.post:active,
.archive article.post:active {
    transform: scale(0.98);
}

/* Gambar Full Frame di Grid */
.blog .post-image img,
.archive .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* JUDUL DI GRID (PUTIH & OVERLAY) */
.blog .entry-header,
.archive .entry-header,
.search .entry-header {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 40px 10px 15px;
    z-index: 10;
    margin: 0;
}

.blog .entry-title a,
.archive .entry-title a,
.search .entry-title a {
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    text-decoration: none;
}


/* ==============================================
   3. FIX HALAMAN DALAM / SINGLE POST (PENTING!)
   ============================================== */

/* Reset Layout Utama (Jangan Grid) */
.single .site-main {
    display: block !important;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Reset Kartu Postingan */
.single article.post {
    box-shadow: none !important;
    background: transparent !important;
    aspect-ratio: auto !important; /* Hapus rasio paksa */
    overflow: visible !important;
}

/* --- PERBAIKAN GAMBAR RAKSASA DI SINI --- */
/* Kita paksa gambar untuk "duduk manis" (Relative), bukan melayang (Absolute) */
.single .post-image,
.single .post-image img,
.single img.external-img-force {
    position: relative !important; /* KUNCI: Agar teks tidak ketutup */
    width: 100% !important;
    height: auto !important; /* Biarkan tinggi menyesuaikan */
    max-height: 500px; /* Batasi tinggi maksimal agar tidak menuhin layar */
    object-fit: contain !important; /* Gambar utuh, tidak terpotong */
    border-radius: 12px;
    margin-bottom: 20px; /* Jarak ke judul */
    display: block;
    top: auto !important;
    left: auto !important;
}

/* Judul Halaman Dalam (Hitam) */
.single .entry-header {
    position: static !important; /* Kembali ke aliran normal */
    background: none !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
}

.single .entry-title {
    color: #1a1a1a !important; /* Hitam */
    font-size: 22px !important;
    font-weight: 700;
    text-shadow: none !important;
}

/* Teks Penjelasan (Konten) */
.single .entry-content {
    color: #333;
    line-height: 1.6;
    font-size: 16px;
}

.single h2 {
    margin-top: 30px;
    font-size: 18px;
    font-weight: bold;
}


/* ==============================================
   4. NAVIGASI BAWAH & SEARCH (Full Style)
   ============================================== */

.app-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%; height: 65px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0; z-index: 9999;
}

.nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-decoration: none; height: 100%;
    color: #999; -webkit-tap-highlight-color: transparent;
}

.nav-icon-svg {
    width: 24px; height: 24px; margin-bottom: 4px;
    stroke: #999; transition: stroke 0.2s ease;
}

.nav-text { font-size: 10px; font-weight: 500; }

.nav-item:active .nav-text, .nav-item:hover .nav-text { color: #000; }
.nav-item:active .nav-icon-svg, .nav-item:hover .nav-icon-svg { stroke: #000; }

/* SEARCH MODAL */
.search-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(5px);
    z-index: 99999; opacity: 0; visibility: hidden;
    transform: translateY(-10px); transition: all 0.25s ease;
    display: flex; align-items: center; justify-content: center;
}
.search-modal.active { opacity: 1; visibility: visible; transform: translateY(0); }
.search-form { width: 80%; max-width: 400px; display: flex; gap: 10px; }
.search-field {
    width: 100%; padding: 12px 20px; border-radius: 50px;
    border: 1px solid #ddd; background: #f5f5f5; font-size: 16px;
}
.close-search {
    background: #222; color: #fff; border: none; width: 45px; height: 45px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.close-search svg { stroke: #fff; }

/* ==============================================
   5. STYLE UNTUK SHORTCODE [wall]
   ============================================== */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; margin-top: 20px; margin-bottom: 20px;
}
.wall-grid-item {
    position: relative; border-radius: 12px;
    overflow: hidden; background: #f0f0f0; aspect-ratio: 9 / 16;
}
.wall-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wall-actions {
    position: absolute; bottom: 10px; left: 0; width: 100%;
    text-align: center; opacity: 0.9;
}
.dl-btn {
    background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
    color: #fff !important; padding: 6px 14px; border-radius: 20px;
    font-size: 11px; text-transform: uppercase; display: inline-flex;
    align-items: center; text-decoration: none;
}