/*
Theme Name: kma
Theme URI: https://kma.my.id/kma
Author: Ridwan Onchy
Description: Tema Multifungsi (Video Streaming, E-Commerce, Kursus, Business Listing, AdSense & VAST Ads).
Version: 1.0.0
Text Domain: kma
*/

:root {
    --bg-color: #ffffff;
    --text-color: #111111;
    --card-bg: #f9f9f9;
    --primary-color: #ff0000;
}

[data-theme="dark"] {
    --bg-color: #0f0f0f;
    --text-color: #ffffff;
    --card-bg: #1f1f1f;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Header Sticky Fullwidth */
.kma-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #ccc;
}

/* Horizontal Infinite Slider Menu & Categories */
.kma-horizontal-scroll {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
}
.kma-horizontal-scroll::-webkit-scrollbar { display: none; }

/* Grid Layouts */
.grid-2-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-4-row-2-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* Ad Containers */
.kma-ad-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 15px auto;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Popup Share */
.kma-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.kma-modal-content {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}
/* ==========================================
   POLESAN HEADER, NAVIGASI & DARK MODE TOGGLE
   ========================================== */
.kma-main-header {
    background-color: var(--card-bg, #ffffff);
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    padding: 10px 16px;
}

.kma-header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Logo & Branding */
.kma-brand-logo a {
    font-size: 20px;
    font-weight: 900;
    color: var(--primary-color, #ff0000);
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Navigasi Menu Horizontal (Scrollable di Mobile) */
.kma-nav-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 4px 0;
}

.kma-nav-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.kma-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color, #333333);
    text-decoration: none;
    background: rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}

.kma-nav-link:hover, .kma-nav-link.active {
    background: var(--primary-color, #ff0000);
    color: #ffffff;
}

/* Tombol Aksi / Dark Mode */
.kma-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.kma-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.04);
    color: var(--text-color, #222222);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s ease;
}

.kma-icon-btn:hover {
    background: rgba(0,0,0,0.08);
}

/* =====================================================
   KMA VIDEO CONTAINER FIX - 16:9 CINEMATIC ASPECT RATIO
   ===================================================== */

/* Force Video Container di Beranda & Single Post menjadi 16:9 */
.kma-video-wrapper, 
.video-container, 
.single-video-wrapper,
div[class*="video-player"] {
    position: relative !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto 20px auto !important;
    padding-top: 56.25% !important; /* Magic Ratio 16:9 */
    background: #000 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Force Video Elements Fill 16:9 Perfectly */
.kma-video-wrapper video, 
.video-container video, 
.single-video-wrapper video,
div[class*="video-player"] video,
div[class*="video-player"] iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Menjaga proporsi video agar tidak gepeng */
    background: #000 !important;
}