/* --- 1. CORE VARIABLES & RESET --- */
:root {
    --cmi-blue: #004a80;
    --cmi-light-blue: #4373a1;
    --cmi-dark: #1e293b;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #334155;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- 2. HEADER & NAVIGATION --- */
header {
    background: var(--white);
    padding: 25px 20px;
    text-align: center;
    border-bottom: 2px solid var(--cmi-blue);
}

.logo {
    height: 65px;
    margin-bottom: 10px;
    object-fit: contain;
}

header h1 {
    font-size: 1.3rem;
    color: var(--cmi-blue);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
    font-weight: 900;
}

nav {
    background-color: var(--cmi-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
}

nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 18px 25px;
    display: block;
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.15);
}

#main-nav li a.active {
    background-color: var(--cmi-light-blue) !important;
    color: var(--white) !important;
    opacity: 1 !important;
}

/* --- 3. LAYOUT SYSTEM --- */
.container {
    max-width: 1200px;
    margin: 30px auto;
    display: grid;
    grid-template-columns: 8.5fr 3.5fr;
    gap: 30px;
    padding: 0 20px;
    align-items: start;
}

.main-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* --- 4. ARTICLE GRID & CARDS --- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.article-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.media-container {
    width: 100%;
    height: 200px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.media-container img,
.media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-body h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 12px 0;
    color: var(--cmi-dark);
    line-height: 1.4;
    height: 50px;
    /* Jaga judul tetap sejajar */
    overflow: hidden;
}

.card-body p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Tombol Baca */
.btn-read {
    margin-top: auto;
    background: var(--cmi-blue);
    color: var(--white) !important;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.3s;
}

.btn-read:hover {
    background: var(--cmi-dark);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
}

.pagination button {
    background-color: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
    width: 45px; /* Sesuai kotak di image_b4b1bb.png */
    height: 45px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pagination button.active {
    background-color: #004a80; /* Warna biru CMI NEWS */
    color: #ffffff;
    border-color: #004a80;
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination i {
    font-size: 12px; /* Ukuran icon panah agar pas */
}

/* --- 5. SIDEBAR & WIDGETS --- */
.sidebar-wrapper {
    position: relative;
    /* Berubah dari sticky ke relative */
    top: 0;
    transform: none !important;
    /* Mematikan semua efek gerak */
    transition: none;
}

.sidebar {
    height: auto;
    align-self: start;
}

.sidebar h3 {
    font-size: 14px;
    border-left: 4px solid var(--cmi-blue);
    padding-left: 10px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 900;
    color: var(--cmi-dark);
}

.blogroll-widget {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
}

/* --- 6. DETAIL PAGE & ABOUT --- */
.entry-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--cmi-dark);
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-line;
}

.article-body a,
.desc-content a {
    color: var(--cmi-blue);
    text-decoration: none !important;
    font-weight: 700;
}

.category-header {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 6px solid var(--cmi-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.about-container {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.box {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid var(--cmi-blue);
    margin-bottom: 20px;
}

/* --- 7. PAGINATION & BUTTONS --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
}

.pagination button {
    background: var(--white);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button.active {
    background: var(--cmi-blue);
    color: var(--white);
    border-color: var(--cmi-blue);
}

.detail-navigation {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn-back-home {
    background: var(--cmi-blue);
    color: var(--white) !important;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none !important;
}

.btn-scroll-top {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-scroll-top:hover {
    background-color: var(--border-color);
    color: var(--cmi-dark);
}

.media-full {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0 30px 0;
    aspect-ratio: 16 / 9; /* Menjamin gambar detail tidak gepeng */
    object-fit: cover;
    background: #000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- 8. RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
        padding: 0 15px;
        gap: 40px;
    }

    .sidebar {
        width: 100%;
        display: block !important;
    }

    .sidebar-wrapper {
        position: relative !important;
        top: 0 !important;
        transform: none !important;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    nav a {
        padding: 12px 15px;
        font-size: 11px;
    }

    nav ul {
        flex-wrap: wrap;
    }

    .entry-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    .detail-navigation {
        flex-direction: column;
    }

    .about-container {
        padding: 20px;
    }
}