/*
Theme Name: Ujian Online
Theme URI: https://serbatahu.id
Description: Tema Platform Tryout & Simulasi Ujian Online (SD, SMP, SMA, Kuliah, CPNS) bergaya SerbaTahu dengan Dark Mode.
Author: Ujian Online
Version: 1.0.0
Text Domain: ujian-online
*/

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-page: #F8F9FA;
    --bg-card: #FFFFFF;
    --bg-header: #FFFFFF;
    --color-text-main: #1A202C;
    --color-text-muted: #4A5568;
    --color-accent: #2B6CB0;
    --color-accent-hover: #2C5282;
    --color-accent-text: #2B6CB0;
    --color-accent-soft: #EBF4FF;
    --color-sage: #689F77;
    --color-warm: #F6AD55;
    --color-warm-hover: #ED8936;
    --color-amber: #F6AD55;
    --color-border: #E2E8F0;
    --color-input-bg: #EDF2F7;
    --max-width: 1100px;
    --font-stack: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html.dark-mode, body.dark-mode {
    --bg-page: #121619;
    --bg-card: #1E242B;
    --bg-header: #1E242B;
    --color-text-main: #E2E8F0;
    --color-text-muted: #94A3B8;
    --color-accent: #63B3ED;
    --color-accent-hover: #4299E1;
    --color-accent-text: #63B3ED;
    --color-accent-soft: rgba(99, 179, 237, 0.14);
    --color-sage: #8FBC94;
    --color-warm: #FBD38D;
    --color-warm-hover: #F6AD55;
    --color-amber: #FBD38D;
    --color-border: #2D3748;
    --color-input-bg: #171C22;
}

.fad, .fa-duotone {
    --fa-primary-color: currentColor;
    --fa-secondary-color: currentColor;
    --fa-secondary-opacity: 0.35;
    display: inline-block;
    vertical-align: -0.125em;
}
.fad.icon-accent { color: var(--color-accent-text, var(--color-accent)); }
.fad.icon-amber { color: #FBBF24; }
.fad.icon-success { color: #34D399; }
.fad.icon-danger { color: #F87171; }

html, body { overflow-x: clip; width: 100%; }
body {
    background-color: var(--bg-page);
    color: var(--color-text-main);
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}
main.site-main { flex: 1 0 auto; }
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover, a:focus, a:active { text-decoration: none; }
p a:not(.uo-btn),
.entry-content a:not(.uo-btn),
.uo-card p a:not(.uo-btn),
.site-footer a {
    color: var(--color-accent-text, var(--color-accent));
    font-weight: 600;
}
p a:not(.uo-btn):hover,
.entry-content a:not(.uo-btn):hover,
.uo-card p a:not(.uo-btn):hover,
.site-footer a:hover {
    color: var(--color-accent-hover);
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0; z-index: 100;
}
.header-container {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 68px;
}
.site-branding { flex-shrink: 0; }
.site-branding-link {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.site-logo-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.site-logo-wrap img,
.site-logo-wrap .custom-logo {
    display: block;
    height: 44px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
.site-title { font-size: 18px; font-weight: 800; color: var(--color-accent-text, var(--color-accent)); display: block; line-height: 1.2; white-space: nowrap; }
.site-description { font-size: 11px; color: var(--color-text-muted); display: block; white-space: nowrap; }
.main-navigation { flex: 1; display: flex; justify-content: center; overflow: hidden; }
.nav-menu { display: flex; list-style: none; gap: 20px; align-items: center; }
.nav-menu a { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--color-text-main); white-space: nowrap; }
.nav-menu a:hover { color: var(--color-accent); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-cta {
    padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700;
    background: var(--color-accent); color: #fff; text-decoration: none; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
}
.header-cta:hover { background: var(--color-accent-hover); }
.dark-mode-toggle,
.mobile-menu-toggle {
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--color-border); background: var(--color-input-bg);
    color: var(--color-text-main); cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.mobile-menu-toggle { display: none; }
.dark-mode-toggle .sun-icon { display: none; }
body.dark-mode .dark-mode-toggle .sun-icon { display: inline-block; }
body.dark-mode .dark-mode-toggle .moon-icon { display: none; }

/* Hero Search & Filter Pills */
.hero-search-section { padding: 36px 0 20px; text-align: center; }
.hero-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.hero-subtitle { color: var(--color-text-muted); margin-bottom: 20px; font-size: 15px; }
.search-form-container {
    max-width: 620px; margin: 0 auto 18px;
    display: flex; background: var(--bg-card);
    border: 1px solid var(--color-border); border-radius: 14px; padding: 6px;
}
.search-field {
    flex: 1; border: none; background: transparent; padding: 10px 14px;
    color: var(--color-text-main); font-size: 15px; outline: none;
}
.search-submit {
    background: var(--color-accent); color: #fff; border: none;
    border-radius: 10px; padding: 0 18px; cursor: pointer;
}
.level-pills {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px;
}
.level-pill {
    padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
    border: 1px solid var(--color-border); background: var(--bg-card);
    color: var(--color-text-main); cursor: pointer; text-decoration: none;
}
.level-pill.active, .level-pill:hover {
    background: var(--color-accent); color: #fff; border-color: transparent;
}

/* Grids & Cards (SerbaTahu Style) */
.section-title {
    font-size: 20px; font-weight: 800; margin: 24px 0 16px;
    display: flex; align-items: center; gap: 8px;
}
.posts-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 20px; margin-bottom: 32px;
}
.post-card {
    background: var(--bg-card); border: 1px solid var(--color-border);
    border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
    transition: transform 0.2s ease;
}
.post-card:hover { transform: translateY(-3px); }
.post-card-image {
    width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
}
.post-card-image img {
    width: 100% !important; height: 100% !important; object-fit: cover !important; display: block;
}
.compact-card-image {
    width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; margin-bottom: 10px;
}
.compact-card-image img {
    width: 100% !important; height: 100% !important; object-fit: cover !important; display: block;
}
.single-featured-image {
    margin: -22px -22px 18px -22px; width: calc(100% + 44px); height: 340px; overflow: hidden; border-radius: 14px 14px 0 0;
}
.single-featured-image img {
    width: 100% !important; height: 100% !important; object-fit: cover !important; display: block;
}
.post-card-content { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.post-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.badge-level {
    font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    background: var(--color-accent-soft); color: var(--color-accent);
}
.badge-free { background: #dcfce7; color: #166534; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge-paid { background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.post-card-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.post-card-title a { text-decoration: none; }
.post-card-excerpt { font-size: 14px; color: var(--color-text-muted); margin-bottom: 14px; flex: 1; }
.post-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 12px; border-top: 1px solid var(--color-border); font-size: 13px;
}

/* Category Block Sections */
.category-block-section { margin: 28px 0; }
.category-block-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.category-block-title { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.category-block-more { font-size: 13px; font-weight: 600; color: var(--color-accent-text, var(--color-accent)); text-decoration: none; }
.category-compact-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px;
}
.compact-post-card {
    background: var(--bg-card); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
}
.compact-card-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.compact-card-title a { text-decoration: none; }
.compact-card-date { font-size: 12px; color: var(--color-text-muted); }

/* Native Promo Banner (B2B & Camp) */
.promo-banner {
    background: var(--bg-card); border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-warm); border-radius: 14px;
    padding: 22px; margin: 28px 0;
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
}

.site-footer {
    margin-top: 48px; padding: 28px 0; border-top: 1px solid var(--color-border);
    text-align: center; font-size: 13px; color: var(--color-text-muted);
}

/* Responsive Header: Tablet (<= 960px) & Mobile (<= 640px / 480px) */
@media (max-width: 960px) {
    .mobile-menu-toggle { display: flex; }
    .main-navigation { display: none; }
    .main-navigation.active {
        display: block; position: absolute; top: 100%; left: 0; right: 0; z-index: 99;
        background: var(--bg-header); border-bottom: 1px solid var(--color-border);
        padding: 16px 20px; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    }
    .nav-menu { flex-direction: column; align-items: flex-start; gap: 12px; }
    .nav-menu a { display: block; width: 100%; padding: 6px 0; font-size: 15px; }
}

@media (max-width: 640px) {
    .container { padding: 0 14px; }
    .header-container { min-height: 60px; gap: 10px; }
    .site-description { display: none; }
    .site-logo-wrap img, .site-logo-wrap img.custom-logo { max-height: 36px !important; }
    .site-title { font-size: 16px !important; }
    .header-cta { padding: 8px 11px; font-size: 12px; }
    .hero-search-section { padding: 20px 0 14px; }
    .hero-title { font-size: 22px; }
    .hero-subtitle { font-size: 14px; }
    .posts-grid { grid-template-columns: 1fr; gap: 14px; }
    .category-compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .promo-banner { padding: 16px; }
    .single-featured-image { margin: -16px -16px 14px -16px; width: calc(100% + 32px); height: 210px; }
}

@media (max-width: 420px) {
    .header-cta-text { display: none; }
    .header-cta { width: 38px; height: 38px; padding: 0; justify-content: center; }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    body:not(.page-ruang-ujian) { padding-bottom: 76px; }
    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: end;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 95;
        background: var(--bg-header);
        border-top: 1px solid var(--color-border);
        padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    }
    .bottom-nav-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 3px; text-decoration: none;
        color: var(--color-text-muted); font-size: 11px; font-weight: 600;
        padding: 4px 0;
    }
    .bottom-nav-item i { font-size: 18px; }
    .bottom-nav-item.active { color: var(--color-accent-text, var(--color-accent)); }
    .bottom-nav-center { position: relative; color: var(--color-text-main); font-weight: 700; }
    .bottom-nav-fab {
        width: 48px; height: 48px; border-radius: 50%;
        background: var(--color-warm); color: #fff;
        display: flex; align-items: center; justify-content: center;
        margin-top: -22px;
        border: 3px solid var(--bg-header);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    }
    .bottom-nav-fab i { font-size: 20px; }
}
