@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
    /* Color Palette */
    --c-salmon: #fe938c;
    --c-sand: #e6b89c;
    --c-wheat: #ead2ac;
    --c-steel: #9cafb7;
    --c-cerulean: #4281a4;

    /* Base Colors */
    --text-dark: #1a202c;
    --text-muted: #718096;
    --bg-light: #f8f9fa;
    --bg-dark: #111827;
}

body {
    font-family: "Inter", sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* --- Utilities --- */
a {
    text-decoration: none;
    color: var(--c-cerulean);
    transition: 0.3s ease;
}
a:hover {
    color: var(--c-salmon);
}

.text-cerulean {
    color: var(--c-cerulean) !important;
}
.text-sand {
    color: var(--c-sand) !important;
}
.bg-cerulean {
    background-color: var(--c-cerulean) !important;
    color: white;
}
.bg-steel {
    background-color: var(--c-steel) !important;
    color: white;
}

.hover-cerulean:hover {
    color: var(--c-cerulean) !important;
}
.hover-salmon:hover {
    color: var(--c-salmon) !important;
}

/* Truncate text (Memotong text dengan titik-titik jika lebih dari 2 baris) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Section Titles --- */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}
.section-title::before {
    content: "";
    display: block;
    width: 5px;
    height: 22px;
    background-color: var(--c-cerulean);
    margin-right: 12px;
    border-radius: 4px;
}

/* --- Wrapper Carousel Utama --- */
/* Pindahkan radius dan shadow ke sini agar slide tetap melengkung rapi saat animasi bergeser */
.carousel-inner {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-color: #111827; /* Mencegah kedipan putih saat gambar loading */
}

/* --- Hero Section (Background Image) --- */
.hero-section {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Mengatur rasio pas 16:9 */
    max-height: 600px; /* Opsional: Mencegah gambar terlalu raksasa di monitor ultrawide */
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    overflow: hidden;
}

/* --- Pengaturan untuk tag img agar memenuhi hero-section --- */
.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ini yang membuat gambar proporsional dan tidak gepeng */
    z-index: 0;
}

/* --- Efek Gradien Gelap di Bawah Teks --- */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(17, 24, 39, 0.95) 0%,
        rgba(17, 24, 39, 0.1) 100%
    );
    z-index: 1;
}

/* --- Konten Teks --- */
.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    max-width: 800px;
    line-height: 1.3;
    margin-bottom: 0;
}

/* --- Tombol Navigasi Manual (Muncul Saat Hover) --- */
.custom-arrow {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    width: 8%; /* Membatasi area klik agar tidak menutupi teks berita */
    z-index: 10;
}

/* Tampilkan panah sedikit transparan saat area berita di-hover */
#headlineCarousel:hover .custom-arrow {
    opacity: 0.7;
}

/* Panah menjadi sangat jelas saat kursor tepat berada di atasnya */
#headlineCarousel .custom-arrow:hover {
    opacity: 1;
}

/* --- Penyesuaian untuk HP (Layar Kecil) --- */
/* --- Penyesuaian Khusus untuk Mobile (HP) --- */
@media (max-width: 768px) {
    .hero-section {
        /* Mengubah rasio menjadi lebih kotak/tinggi agar teks cukup ruang */
        aspect-ratio: 4 / 5;
        /* Alternatif jika kamu tetap ingin tinggi yang pas: min-height: 400px; */

        padding: 20px 15px; /* Mengurangi jarak kosong di pinggir */
    }

    .hero-title {
        font-size: 1.4rem; /* Memperkecil judul agar tidak memakan banyak baris */
        line-height: 1.4;
    }

    /* Memperkecil teks detail (waktu read & author) */
    .hero-content .d-flex {
        font-size: 0.75rem !important;
    }

    /* Memperkecil sedikit ukuran badge/label */
    .hero-content .badge {
        font-size: 0.75rem;
    }

    /* Menyembunyikan tombol panah di HP */
    /* Karena efek hover tidak bekerja di layar sentuh, dan Bootstrap 
       sudah otomatis mendukung 'swipe' (geser pakai jari) */
    .custom-arrow {
        display: none !important;
    }
}

/* --- Cards & Badges --- */
.badge-category {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-category.salmon {
    background-color: var(--c-salmon);
    color: white;
}
.badge-category.wheat {
    background-color: var(--c-wheat);
    color: var(--text-dark);
}

.story-card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;

    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}
.story-card:hover {
    transform: translateY(-5px);
}
.story-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px 15px 10px;
}

/* --- Article Cards --- */
.article-card {
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    background-color: white;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08) !important;
}

/* Memastikan tinggi thumbnail menyesuaikan card di mode Desktop */
.article-thumbnail {
    height: 100%;
    min-height: 100%;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 767.98px) {
    /* Tinggi fix untuk gambar di mobile agar tidak terpotong (gepeng) */
    .article-thumbnail {
        height: 220px;
    }

    /* Menghapus padding bawah yang berlebihan di konten mobile */
    .article-card .card-body {
        padding: 20px !important;
    }
}

/* --- Banner Hot Section (Dengan Ornamen) --- */
.hot-section-banner {
    position: relative;
    overflow: hidden;
    /* Gradient Cerulean ke Steel */
    background: linear-gradient(
        135deg,
        var(--c-cerulean) 0%,
        var(--c-steel) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.ornament-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
}
.circle-1 {
    width: 250px;
    height: 250px;
    top: -100px;
    right: -50px;
}
.circle-2 {
    width: 150px;
    height: 150px;
    bottom: -50px;
    left: 10%;
}

/* --- Trending Sidebar --- */
.trending-item {
    display: flex;
    gap: 18px;
    margin-bottom: 20px;
    align-items: flex-start;
}
.trending-item:last-child {
    margin-bottom: 0;
}
.trending-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 0.8;
    opacity: 0.8;
}

/* --- Mobile Responsiveness (The Magic) --- */
@media (max-width: 767.98px) {
    /* Hero Section */
    .hero-section {
        height: 400px;
        padding: 25px 20px;
    }
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .badge-category {
        font-size: 0.65rem;
        padding: 4px 10px;
    }

    /* Article List (Agar gambar tidak gepeng di HP) */
    .latest-article {
        flex-direction: column; /* Mengubah jejeran samping jadi atas-bawah */
        gap: 15px;
    }
    .latest-article img {
        width: 100%;
        height: 220px; /* Gambar dibuat lebar penuh */
    }
    .latest-article h4 {
        font-size: 0.72rem;
    }

    /* Hot Section Banner */
    .hot-section-banner {
        text-align: center;
        padding: 30px 20px !important;
    }
    .hot-section-banner button {
        margin-top: 20px;
        width: 100%;
    }
}
