/* ============================================================
   mobile.css — Mobile Optimization Override
   Tambahkan di header.php SETELAH style.css dan hero-upgrade.css:
   <link rel="stylesheet" href="<?= $asset_base ?>mobile.css?v=2">
   ============================================================ */

/* ── ≤768px (smartphone) ── */
@media (max-width: 768px) {

    /* Container */
    .container {
        padding: 0 14px;
    }

    /* Navbar */
    .navbar {
        height: 60px;
    }

    .mobile-nav-drawer {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .sidebar {
        top: 60px;
        margin-top: 20px;
    }

    .logo {
        font-size: 1rem;
        max-width: 175px;
    }

    /* ── Hero ── */
    .hero-section {
        padding: 14px 0 10px;
    }

    /* hero-upgrade.css sudah handle overlay style;
       di sini override khusus ukuran mobile */
    .hero-split-img {
        height: 260px;
    }

    .hero-split-body {
        padding: 18px 16px 22px;
        gap: 10px;
    }

    .hero-split-body::before {
        left: 16px;
        right: 16px;
    }

    .hero-title {
        font-size: 1.25rem;
        line-height: 1.25;
        letter-spacing: -0.03em;
    }

    .hero-desc {
        font-size: 0.83rem;
        line-height: 1.58;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hero-meta-row {
        gap: 8px;
    }

    /* Sub-featured */
    .sub-featured-row {
        display: flex;
        flex-direction: column;
        margin-top: 10px;
    }

    .sub-featured-col {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 14px 16px;
    }

    .sub-featured-col:last-child {
        border-bottom: none;
    }

    .sub-featured-col:first-child,
    .sub-featured-col:not(:first-child) {
        padding-left: 16px;
        padding-right: 16px;
    }

    .sub-featured-col::before {
        top: 14px;
        bottom: 14px;
    }

    .sub-featured-title {
        font-size: 0.92rem;
    }

    /* ── Section title (dari hero-upgrade.css) ── */
    .section-title {
        margin-top: 18px;
        margin-bottom: 10px;
    }

    /* ── LIST HEADER ── */
    .list-header {
        padding: 16px 0 12px;
        margin-bottom: 14px;
    }

    .list-header-title {
        font-family: var(--font-heading);
        font-size: 1.3rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        line-height: 1.2;
    }

    .list-header-meta {
        font-size: 0.82rem;
        margin-top: 4px;
        color: var(--text-muted);
    }

    /* ── POST CARD — compact horizontal ──
       Override style.css yg force vertical di mobile */
    .post-card {
        flex-direction: row !important;
        align-items: stretch !important;
        padding: 10px !important;
        gap: 12px !important;
        border-radius: 10px !important;
    }

    .post-thumb {
        width: 90px !important;
        min-width: 90px !important;
        height: auto !important;
        min-height: 70px;
        border-radius: 7px !important;
        align-self: stretch;
    }

    /* Pastikan gambar mengisi thumb sepenuhnya */
    .post-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .post-card-content {
        padding: 2px 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px !important;
        flex: 1;
        min-width: 0;
    }

    .post-card-tags {
        gap: 4px;
        margin-bottom: 0;
    }

    /* Tag badge lebih compact */
    .post-card-tags .tag-badge {
        font-size: 0.62rem !important;
        padding: 2px 7px !important;
        letter-spacing: 0.04em;
        border-radius: 50px;
    }

    .post-card-title {
        font-size: 0.88rem !important;
        line-height: 1.38 !important;
        -webkit-line-clamp: 2;
        letter-spacing: -0.02em;
    }

    /* Sembunyikan deskripsi — cukup judul + meta */
    .post-card-desc {
        display: none !important;
    }

    .post-card-meta {
        font-size: 0.7rem !important;
        margin-top: 2px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: var(--text-muted);
    }

    /* Teks "Detail ›" sedikit lebih kecil */
    .post-card-meta a {
        font-size: 0.7rem;
        font-weight: 600;
    }

    /* Grid gap lebih rapat */
    .posts-grid {
        gap: 8px !important;
    }

    /* ── Layout ── */
    .main-layout {
        padding-bottom: 36px;
        gap: 24px;
    }

    /* ── Sidebar Widget ── */
    .widget {
        padding: 16px 14px;
    }

    .widget-title {
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    /* ── Detail Page ── */
    .detail-layout {
        padding: 16px 0 44px;
    }

    .detail-header {
        gap: 10px;
        margin-bottom: 20px;
    }

    .detail-title {
        font-size: 1.45rem;
        line-height: 1.28;
        letter-spacing: -0.035em;
    }

    .detail-meta {
        gap: 12px;
        font-size: 0.8rem;
        padding-bottom: 14px;
    }

    .detail-hero-img {
        height: 210px;
        border-radius: var(--radius-md);
        margin-bottom: 20px;
    }

    .detail-body {
        font-size: 0.98rem;
        line-height: 1.76;
    }

    .detail-body p {
        margin-bottom: 16px;
    }

    .detail-tags-section {
        padding: 18px 0;
        margin: 24px 0;
    }

    .detail-content-wrapper {
        grid-template-columns: 1fr;
    }

    .related-posts {
        margin-top: 28px;
    }

    /* ── Key Takeaway ── */
    .key-takeaway-box {
        padding: 14px 16px;
        gap: 12px;
        margin-top: 20px;
    }

    .key-takeaway-icon {
        font-size: 1.2rem;
    }

    /* ── Topik / Related ── */
    .topik-section {
        padding: 20px 0 10px;
        margin-top: 10px;
    }

    .topik-post-thumb {
        width: 78px;
        min-width: 78px;
        height: 56px;
    }

    .topik-post-title {
        font-size: 0.86rem;
    }

    /* ── Popular Widget ── */
    .popular-number {
        font-size: 1.5rem;
        min-width: 22px;
    }

    .popular-item {
        padding: 10px 0;
        gap: 10px;
    }

    .popular-item-title {
        font-size: 0.86rem;
    }

    /* ── Pagination ── */
    .pagination {
        margin-top: 24px;
        gap: 6px;
    }

    .page-link {
        width: 36px;
        height: 36px;
        font-size: 0.82rem;
    }

    /* ── Footer ── */
    footer {
        padding: 32px 0 20px;
    }

    .footer-content {
        gap: 18px;
        margin-bottom: 20px;
    }

    .footer-brand-desc {
        font-size: 0.85rem;
    }

    .footer-links-title {
        margin-bottom: 10px;
        font-size: 0.9rem;
    }

    .footer-links-list {
        gap: 9px;
        font-size: 0.85rem;
    }

    .footer-bottom {
        padding-top: 18px;
        gap: 10px;
        font-size: 0.78rem;
    }

    /* ── Misc ── */
    .embed-container {
        margin: 18px auto;
    }

    .tag-badge {
        font-size: 0.68rem;
        padding: 3px 9px;
    }

    .tag-cloud-item {
        font-size: 0.78rem;
        padding: 5px 11px;
    }

    .empty-state {
        padding: 44px 20px;
    }
}

/* ── ≤480px (HP kecil) ── */
@media (max-width: 480px) {

    .container {
        padding: 0 12px;
    }

    /* Hero lebih compact */
    .hero-split-img {
        height: 220px;
    }

    .hero-title {
        font-size: 1.1rem;
    }

    .hero-desc {
        -webkit-line-clamp: 2;
    }

    /* List header */
    .list-header-title {
        font-size: 1.15rem;
    }

    /* Post card di HP kecil */
    .post-thumb {
        width: 80px !important;
        min-width: 80px !important;
        min-height: 64px;
    }

    .post-card-title {
        font-size: 0.84rem !important;
    }

    /* Detail */
    .detail-title {
        font-size: 1.25rem;
    }

    .detail-hero-img {
        height: 185px;
    }

    /* Section title line — hilang agar judul tidak terjepit */
    .section-title-line {
        display: none;
    }
}