:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --transition: all 0.3s ease;
}

.berita-container {
    width: min(1200px, 100%);
    margin-inline: auto;
    padding-inline: 16px; /* gutter kiri-kanan agar tidak mepet */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
header {
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
}

.logo i {
    color: var(--secondary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: var(--transition);
}
nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 0.5rem 1rem;
    width: 250px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    padding: 0.5rem;
    outline: none;
}

.search-bar button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url("https://placehold.co/1200x600") no-repeat center center/cover;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* News Grid */
.section-title {
    font-size: 2rem;
    margin: 1.25rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #009241;
    display: inline-block;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.news-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.news-category {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.news-title {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    transition: var(--transition);
    min-height: 2.8em;                 /* cukup untuk 2 baris */
    display: -webkit-box;              /* line clamp 2 baris */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-title:hover {
    color: var(--secondary-color);
}

.news-excerpt {
    color: var(--gray-color);
    margin-bottom: 1rem;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;                    /* dorong elemen selanjutnya ke bawah (CTA) */
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gray-color);
}

.news-meta i {
    margin-right: 0.3rem;
}

/* Featured News */
.featured-news {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.25rem 0 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.featured-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.featured-main {
    position: relative;
}

.featured-main-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    background-color: #0000;
    border-radius: 10px;
}

.featured-main-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
}

.featured-main-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.featured-main-excerpt {
    margin-bottom: 1.5rem;
}

.featured-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.featured-side-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    column-gap: 12px;
    align-items: center;
    min-height: 70px;
}

.featured-side-img {
    width: 100px;
    aspect-ratio: 10 / 7;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.featured-side-content h3 {
    font-size: 1rem;
    line-height: 1.25;
    margin: 0 0 6px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-side-content h3:hover {
    color: var(--secondary-color);
}

.featured-side-content .date {
    font-size: 0.8rem;
    color: #95a5a6;
    margin: 0;
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.category-btn {
    padding: 0.8rem 1.5rem;
    background-color: var(--light-color);
    border: none;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.category-btn:hover,
.category-btn.active {
    background-color: var(--secondary-color);
    color: white;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--primary-color), #1a252f);
    color: white;
    padding: 3rem 0;
    border-radius: 10px;
    margin: 3rem 0;
}

.newsletter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.newsletter h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    width: 100%;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 30px 0 0 30px;
    outline: none;
}

.newsletter-form button {
    padding: 0.8rem 1.5rem;
    border: none;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background-color: #c0392b;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-col h3 {
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--secondary-color);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col a {
    color: var(--light-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--gray-color);
}

@media (max-width: 992px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-main-img {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-bar {
        width: 100%;
        max-width: 300px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        padding-inline: 2px; /* jaga gutter kecil di layar kecil */
    }
}

@media (max-width: 576px) {
    .mobile-menu-btn {
        display: block;
    }

    nav ul {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem 0;
        background-color: rgba(0, 0, 0, 0.1);
    }

    nav ul.show {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
        gap: 1rem;
    }

    .newsletter-form input,
    .newsletter-form button {
        border-radius: 30px;
        width: 100%;
        text-align: center;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}
.delay-2 {
    animation-delay: 0.2s;
}
.delay-3 {
    animation-delay: 0.3s;
}
.delay-4 {
    animation-delay: 0.4s;
}
