/* =================================================
   BERITA.CSS - HALAMAN BERITA SEKOLAH
   Tema Biru Putih Modern - Sidebar Kiri
   ================================================= */

/* ========== VARIABEL WARNA ========== */
:root {
    --primary-blue: #0a4d8c;
    --secondary-blue: #1e6eb5;
    --accent-blue: #3498db;
    --light-blue: #eef5fc;
    --pure-white: #ffffff;
    --soft-white: #f8fafd;
    --text-dark: #2c3e50;
    --text-light: #5a6a7a;
    --border-light: #d9e6f2;
    --shadow: 0 10px 30px rgba(10, 77, 140, 0.08);
    --shadow-hover: 0 15px 40px rgba(10, 77, 140, 0.12);
    --gradient-blue: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
}

/* ========== RESET & DASAR ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--soft-white);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== BANNER HALAMAN (SAMA DENGAN GALERI FOTO) ========== */
.page-banner {
    position: relative;
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--pure-white);
    margin-bottom: 3rem;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.banner-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.8s ease-out;
}

.banner-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--pure-white);
    text-decoration: underline;
}

.breadcrumb i {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.breadcrumb span {
    color: var(--pure-white);
    font-weight: 500;
}

/* ========== SECTION HEADER ========== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 1rem;
}

.header-line {
    width: 80px;
    height: 4px;
    background: var(--accent-blue);
    margin: 0 auto 1rem;
    border-radius: 4px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* ========== CONTENT WRAPPER REVERSE (Sidebar Kiri) ========== */
.content-wrapper.reverse {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Main Content (Berita) */
.main-content {
    width: 100%;
}

/* ========== BERITA GRID ========== */
.berita-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Berita Card */
.berita-card {
    background: var(--pure-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.berita-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* Card Image */
.card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.berita-card:hover .card-image img {
    transform: scale(1.1);
}

/* Card Date */
.card-date {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(10, 77, 140, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.card-date i {
    font-size: 0.7rem;
}

/* Badge NEW */
.badge-new {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    z-index: 2;
}

/* Card Content */
.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.2rem;
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    
    /* Line clamp untuk judul - 2 baris */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: box;
    line-clamp: 2;
    box-orient: vertical;
    overflow: hidden;
    
    /* Fallback untuk browser lama */
    max-height: 3.3rem;
    min-height: 3.3rem;
}

.card-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
    
    /* Line clamp untuk deskripsi - 3 baris */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    display: box;
    line-clamp: 3;
    box-orient: vertical;
    overflow: hidden;
    
    /* Fallback untuk browser lama */
    max-height: 4.8rem;
    flex: 1;
}

/* Card Meta */
.card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.2rem;
    font-size: 0.8rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
    flex-wrap: wrap;
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.card-meta i {
    color: var(--accent-blue);
    width: 16px;
}

/* Button Detail */
.btn-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--light-blue);
    color: var(--primary-blue);
    padding: 0.7rem 1.2rem;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    margin-top: 0.5rem;
    align-self: flex-start;
}

.btn-detail:hover {
    background: var(--primary-blue);
    color: var(--pure-white);
    transform: translateY(-2px);
}

.btn-detail i {
    transition: transform 0.3s ease;
}

.btn-detail:hover i {
    transform: translateX(5px);
}

/* ========== SIDEBAR ========== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: var(--pure-white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.widget-title {
    font-size: 1.2rem;
    color: var(--primary-blue);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid var(--light-blue);
    padding-bottom: 0.8rem;
}

.widget-title i {
    color: var(--accent-blue);
}

/* Recent News */
.recent-news {
    list-style: none;
    padding: 0;
}

.recent-news li {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
}

.recent-news li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.recent-news a {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    align-items: center;
}

.recent-news img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--border-light);
    flex-shrink: 0;
}

.recent-info h4 {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
    line-height: 1.4;
    font-weight: 500;
}

.recent-info small {
    font-size: 0.7rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 3px;
}

.recent-info small i {
    color: var(--accent-blue);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

.share-btn.facebook { background: #3b5998; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pure-white);
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    font-weight: 500;
}

.page-link:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--gradient-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* ========== NO DATA ========== */
.no-data {
    text-align: center;
    padding: 4rem;
    background: var(--pure-white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.no-data i {
    font-size: 4rem;
    color: var(--border-light);
    margin-bottom: 1rem;
}

.no-data p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ========== TOMBOL KEMBALI ========== */
.button-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 3rem;
}

.btn-kembali {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 30px;
    background: var(--primary-blue);
    color: var(--pure-white);
    border: none;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-kembali:hover {
    background: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-kembali i {
    font-size: 0.9rem;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 992px) {
    .banner-content h1 {
        font-size: 2.5rem;
    }
    
    .content-wrapper.reverse {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .page-banner {
        height: 250px;
    }
    
    .banner-content h1 {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .berita-grid {
        grid-template-columns: 1fr;
    }
    
    .card-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-detail {
        align-self: stretch;
        justify-content: center;
    }
    
    .button-wrapper {
        justify-content: center;
    }
    
    .btn-kembali {
        width: 100%;
        justify-content: center;
    }
    
    .share-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .banner-content h1 {
        font-size: 1.8rem;
    }
    
    .breadcrumb {
        font-size: 0.9rem;
    }
    
    .card-image {
        height: 180px;
    }
    
    .card-content h3 {
        font-size: 1.1rem;
        max-height: 3rem;
        min-height: 3rem;
    }
    
    .recent-news a {
        flex-direction: column;
        text-align: center;
    }
    
    .recent-news img {
        width: 100%;
        height: 120px;
    }
}