/*
Theme Name: Azwin Graceful Theme
Author: Azwin Lubis
Description: Tema modern minimalis - Optimized Version (Final Fix Search & About)
Version: 3.2
*/

/* --- 1. VARIABLES & RESET --- */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;600&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

:root {
    /* Color Palette */
    --bg-body: #f2f2f2;
    --bg-dark: #1e1e1e;
    --text-main: #333333;
    --text-light: #f2f2f2;
    
    /* UI Elements */
    --radius: 15px;
    --shadow-card: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-hover: 0 15px 40px rgba(0,0,0,0.12);
    --trans-speed: 0.3s ease;
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-serif: 'EB Garamond', serif;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--bg-body);
    font-family: var(--font-sans);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: var(--trans-speed); }
ul, li { list-style: none; padding: 0; margin: 0; }
* { box-sizing: border-box; }

/* --- 2. HEADER --- */
.header-wrapper {
    padding: 20px;
    max-width: 1300px;
    margin: 0 auto;
}

header {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 15px 40px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

/* Branding */
.site-branding a {
    font-family: var(--font-serif);
    font-size: 25px;
    display: inline-block;
    transition: transform 0.2s ease;

    /* --- PROTEKSI BRANDING --- */
    user-select: none;          /* Mencegah teks diblok/di-copy */
    -webkit-user-select: none;  /* Support untuk browser Safari/Chrome */
    -webkit-user-drag: none;    /* Mencegah tulisan di-drag */
    
    /* Catatan: Saya tidak menambahkan 'pointer-events: none' 
       agar logo ini TETAP BISA DIKLIK untuk kembali ke Home. */
}-branding a:hover { transform: scale(1.1); }

/* Navigation */
.nav-btn {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.nav-btn:hover { transform: scale(1.1); }

/* --- 3. HERO SLIDER --- */
.hero-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Gradasi Fade Out */
.hero-section::before,
.hero-section::after {
    content: "";
    position: absolute;
    top: 0; width: 80px; height: 100%;
    z-index: 5;
    pointer-events: none;
}
.hero-section::before { left: 0; background: linear-gradient(to right, var(--bg-body), transparent); }
.hero-section::after { right: 0; background: linear-gradient(to right, transparent, var(--bg-body)); }

/* Swiper Fix */
.hero-section .swiper {
    padding: 40px !important;
    margin: -40px !important;
    overflow: visible !important;
}

/* Hide Navigation (Global) */
.swiper-button-next, .swiper-button-prev { display: none !important; }

/* --- 4. CARD COMPONENT --- */
.post-card {
    background: #fff; 
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex; flex-direction: column;
    margin: 5px;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

.card-img-wrap { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; position: relative; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.post-card:hover .card-img { transform: scale(1.05); }

.card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { font-weight: 700; font-size: 20px; margin: 0 0 8px 0; line-height: 1.3; }
.card-subtitle { font-size: 15px; font-weight: 700; margin-bottom: 10px; opacity: 0.8; }
.card-date { font-size: 15px; opacity: 0.6; margin-top: auto; }

/* --- 5. GRID SECTION --- */
.grid-section { max-width: 1200px; margin: 0 auto 60px auto; padding: 0 20px; }
.section-heading { font-weight: 700; font-size: 25px; margin: 50px 0 30px 0; }
.posts-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.grid-item { min-width: 0; }

/* --- 6. SINGLE PAGE --- */
.single-container { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.single-feat-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.img-caption { font-size: 17px; font-style: italic; margin-top: 10px; display: block; color: var(--text-main); }
.single-title { font-weight: 700; font-size: 50px; line-height: 1.1; margin: 30px 0 10px 0; }
.single-subtitle { font-weight: 700; font-size: 25px; margin-bottom: 15px; }
.single-meta { font-size: 17px; margin-bottom: 40px; display: block; }
.entry-content { font-size: 17px; line-height: 1.8; }
.entry-content p { margin-bottom: 25px; }

/* Navigation */
.post-navigation { display: flex; justify-content: space-between; margin-top: 60px; padding-top: 30px; border-top: 1px solid #ddd; }
.nav-links a { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.nav-circle, .page-numbers { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.nav-circle { background-color: var(--bg-dark); color: #fff; }

.pagination { margin-top: 50px; display: flex; justify-content: center; gap: 10px; }
.page-numbers { background: #e0e0e0; font-weight: bold; }
.page-numbers.current { background: var(--bg-dark); color: #fff; }
.page-numbers:hover { background: #ccc; }

/* --- 7. ABOUT PAGE (Old Style - kept for compatibility) --- */
.about-header { text-align: center; margin-bottom: 40px; }
.about-photo { width: 200px; height: 200px; border-radius: 20px; object-fit: cover; margin-bottom: 20px; box-shadow: var(--shadow-card); }
.about-name { font-family: var(--font-serif); font-size: 30px; margin-bottom: 10px; }
.related-links-title { font-weight: 700; font-size: 25px; margin: 40px 0 15px 0; }

/* --- 8. FOOTER --- */
.footer-wrapper { padding: 20px; max-width: 1300px; margin: 50px auto 0 auto; }
footer { background-color: var(--bg-dark); color: var(--text-light); border-radius: var(--radius); padding: 40px 20px; text-align: center; }
.footer-inner { display: flex; flex-direction: column; gap: 15px; align-items: center; }
.footer-socials { display: flex; gap: 20px; margin-bottom: 10px; }
.footer-socials a { font-size: 20px; }

/* --- 9. SEARCH OVERLAY (FIXED BUG & OPTIMIZED) --- */
.search-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    right: 0;
    bottom: 0; /* Menggunakan top-bottom 0 lebih stabil daripada height 100dvh saat keyboard muncul */
    background: rgba(255, 255, 255, 0.98); /* Sedikit lebih solid agar background belakang tertutup total */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999999 !important;
    display: flex; 
    justify-content: center; 
    align-items: center;
    opacity: 0; 
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    /* Mencegah scroll pada background saat overlay aktif */
    overscroll-behavior: contain;
}
.search-overlay.active { opacity: 1; visibility: visible; }

.search-form { width: 100%; max-width: 600px; padding: 0 30px; position: relative; z-index: 2; }
.search-form input {
    width: 100%; 
    background: transparent; 
    border: none;
    border-bottom: 2px solid var(--text-main);
    font-family: var(--font-sans); 
    font-size: 30px; /* Default Desktop */
    color: var(--text-main); 
    font-weight: 700;
    padding: 15px 0; 
    outline: none; 
    text-align: center;
    border-radius: 0;
    /* Tambahan Penting: */
    touch-action: manipulation; /* Mencegah double-tap to zoom */
}
.search-form input:focus { border-bottom: 2px solid #000; }
.search-form input::placeholder { color: var(--text-main); opacity: 0.4; font-weight: 400; }

.close-search {
    position: absolute;
    top: 40px; right: 40px;
    font-size: 45px;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.3s ease;
    line-height: 1;
    z-index: 1000000; /* Layer paling atas */
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
}
.close-search:hover { transform: rotate(90deg); }

/* --- 10. RESPONSIVE (MOBILE) --- */
@media (max-width: 768px) {
    /* Header & Footer */
    .header-wrapper, .footer-wrapper { padding: 10px; }
    header { padding: 10px 20px; }
    .site-branding a { font-size: 20px; }

    /* Hero */
    .hero-section::before, .hero-section::after { display: none; }
    .hero-section { overflow: visible; }

    /* Grid Mini */
    .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .posts-grid .grid-item:nth-child(n+7) { display: none; }

    /* Card Mobile */
    .grid-item .post-card { min-height: 0; }
    .grid-item .card-body { padding: 12px; }
    .grid-item .card-title { font-size: 14px; margin-bottom: 5px; }
    .grid-item .card-subtitle {
        font-size: 12px; margin-bottom: 8px; line-height: 1.4;
        display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    }
    .grid-item .card-date { font-size: 11px; }

    /* FIX Search Mobile Positioning */
    .close-search { top: 25px; right: 20px; font-size: 35px; }
    .search-form input, .search-form input::placeholder { font-size: 24px; }
    
    /* Single Page */
    .single-title { font-size: 30px; }
    .single-subtitle { font-size: 18px; }
    .single-container { padding: 0 15px; margin-top: 20px; }
}

/* =========================================
   STYLE KHUSUS HALAMAN ABOUT (NEW)
   ========================================= */

/* 1. Wrapper Utama */
.about-page-wrapper {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.8;
    color: #333333;
    text-align: left;
    margin-top: 40px;
    margin-bottom: 80px;
}

/* Update pada bagian .about-logo-svg */
.about-logo-svg {
    /* --- Style Tampilan (Sama seperti sebelumnya) --- */
    width: 100px;           
    aspect-ratio: 1 / 1;    
    object-fit: cover;      
    border-radius: var(--radius); 
    box-shadow: var(--shadow-card); 
    display: block;
    margin-bottom: 20px;

    /* --- PROTEKSI FOTO (Baru) --- */
    pointer-events: none;      /* Mencegah klik kanan & hover */
    user-select: none;         /* Mencegah gambar diblok/select */
    -webkit-user-drag: none;   /* Mencegah gambar di-drag ke desktop */
}

/* 3. Link Style */
.about-page-wrapper a {
    color: #333333;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.about-page-wrapper a:hover { opacity: 0.7; }

/* 4. Social Icons (FINAL: Jarak Rapi & Seimbang) */
.about-social-section { 
    margin-top: 5px;       /* Jarak dekat ke 'Contact' */
    margin-bottom: 25px;   /* Jarak ideal ke 'Related Links' */
}

.about-social-label { 
    display: block; 
    margin-bottom: 8px;    /* Jarak label ke icon */
    font-size: 17px; 
}

.about-social-icons { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
}

.about-icon-svg {
    width: 24px; height: 24px;
    fill: #333333; 
    transition: transform 0.2s ease;
}
.about-social-icons a:hover .about-icon-svg { transform: scale(1.1); }

/* 5. Related Links (FINAL: List Menurun/Perincian) */
.about-related-list { 
    display: flex; 
    flex-direction: column; /* WAJIB: Agar link tersusun ke bawah (perincian) */
    gap: 8px;               /* Jarak antar link agar tidak terlalu rapat */
    margin-top: 5px;
}

.about-related-list a {
    display: block;         /* Memastikan link mengisi baris sendiri */
    width: fit-content;     /* Agar area klik pas dengan panjang teks */
    color: #333333;
    opacity: 0.8;           /* Sedikit transparan agar elegan */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.about-related-list a:hover {
    opacity: 1;
    transform: translateX(5px); /* Efek geser sedikit saat di-hover */
    text-decoration: underline;
}

/* =========================================
   PROTEKSI LOGO + FIX EFEK HOVER
   ========================================= */

/* 1. Setting Container Link */
.site-branding a {
    position: relative !important; /* Wajib: Agar lapisan transparan menempel pas */
    display: inline-block;         /* Memastikan transformasi bekerja */
    -webkit-touch-callout: none !important; /* Mencegah menu save di Mobile */
    -webkit-tap-highlight-color: transparent;
}

/* 2. Matikan akses langsung ke Gambar (Anti-Download) */
/* Mouse akan 'menembus' gambar sehingga browser tidak sadar ada gambar disitu */
.site-branding a img, 
.site-branding a svg {
    pointer-events: none !important; 
    user-select: none !important;
    -webkit-user-drag: none !important;
}

/* 3. TEKNIK OVERLAY: Membuat lapisan transparan di atas gambar */
/* Lapisan inilah yang 'menangkap' hover mouse Anda, bukan gambarnya */
.site-branding a::after {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 10;      /* Pastikan lapisan ini berada DI ATAS gambar */
    cursor: pointer;  /* Menampilkan icon jari telunjuk */
}

/* =========================================
   EASTER EGG GAME STYLE
   ========================================= */

/* 1. Wrapper Foto (Agar bisa diklik untuk trigger) */
.about-photo-wrapper {
    display: inline-block;
    cursor: pointer; /* Menunjukkan bisa diklik */
    position: relative;
    /* Mencegah highlight biru di mobile saat tap cepat */
    -webkit-tap-highlight-color: transparent; 
}

/* Pastikan foto di dalamnya tetap terlindungi dari download */
.about-photo-wrapper img {
    /* Tetap gunakan proteksi yang sudah kita buat sebelumnya */
    pointer-events: none; 
    user-select: none;
}

/* 2. Tampilan Overlay Game */
#hidden-game-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #f2f2f2; /* Warna background sama dengan body */
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.game-container {
    text-align: center;
    position: relative;
}

#game-canvas {
    background: #fff;
    border: 2px solid #333;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

#game-score {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.game-instruction {
    margin-top: 15px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #777;
    font-size: 14px;
}

#close-game {
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 40px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    line-height: 1;
}
#close-game:hover { color: #000; }