/* General Styling */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --dark-grey: #495057;
}

body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden; /* Mencegah scroll horizontal */
}

body.no-scroll {
    overflow: hidden; /* Untuk menonaktifkan scroll saat menu mobile terbuka */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-grey);
    margin-bottom: 20px;
}

h1 {
    font-size: 2.8em;
    line-height: 1.2;
}

h2 {
    font-size: 2.2em;
    text-align: center;
    margin-bottom: 40px;
}

h3 {
    font-size: 1.5em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

p {
    margin-bottom: 15px;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 5px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: var(--primary-color);
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Header & Navbar */
.transparent-header {
    background-color: transparent;
    box-shadow: none;
    padding: 20px 0;
    position: absolute; /* Tetap absolut agar di atas hero */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.transparent-header.scrolled {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed; /* Fix saat discroll */
}

.navbar .container {
    display: flex;
    justify-content: space-between; /* Logo kiri, Nav kanan */
    align-items: center;
}

/* School Brand (Logo + Name) */
.school-brand {
    display: flex;
    align-items: center;
    color: var(--white); /* Warna teks default */
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.2em;
    text-decoration: none;
    white-space: nowrap; /* Mencegah teks patah baris */
}

.school-logo-img {
    height: 40px;
    margin-right: 10px;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Default desktop: tampilkan menu */
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--white); /* Warna link default */
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Warna link dan logo sekolah saat navbar discroll */
.transparent-header.scrolled .school-brand,
.transparent-header.scrolled .nav-links a {
    color: var(--dark-grey); /* Warna teks saat discroll */
}
.transparent-header.scrolled .school-logo-img {
    /* Opsional: filter brightness jika logo awalnya terang dan perlu kontras di latar putih */
    /* filter: brightness(0.6); */
}

.hamburger {
    display: none; /* Sembunyikan secara default di desktop */
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    z-index: 3; /* Pastikan di atas overlay menu mobile */
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--white); /* Warna default hamburger */
    border-radius: 3px;
    transition: all 0.3s ease;
}

.transparent-header.scrolled .hamburger span {
    background-color: var(--dark-grey); /* Warna hamburger saat discroll */
}


/* --- Hero Section & Slider --- */
.hero {
    padding: 180px 20px 120px; /* Padding lebih besar untuk konten hero */
    min-height: 80vh; /* Tinggi minimal hero */
    position: relative; /* Penting untuk positioning slider */
    overflow: hidden; /* Sembunyikan overflow dari slide */
    display: flex; /* Menggunakan flexbox untuk menengahkan konten hero */
    align-items: center; /* Tengah vertikal */
    justify-content: center; /* Tengah horizontal */
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex; /* Gunakan flexbox untuk menata slide */
    transition: transform 1s ease-in-out; /* Animasi geser */
}

.hero-slider .slide {
    min-width: 100%; /* Setiap slide mengambil lebar penuh */
    height: 100%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0; /* Penting agar slide tidak mengecil */
    position: relative;
}

/* Overlay untuk setiap slide */
.hero-slider .slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6); /* Overlay gelap untuk teks */
}

.hero-content {
    position: relative; /* Agar konten hero tetap di atas slider */
    z-index: 10; /* Pastikan di atas slider */
    text-align: center;
    color: var(--white);
    max-width: 800px; /* Lebar maksimal konten hero */
}


/* --- Sections & Grid Layouts --- */
section {
    padding: 80px 0;
}

section:nth-of-type(even) { /* Warna background bergantian */
    background-color: var(--light-bg);
}

.layanan-grid,
.portofolio-grid,
.pengurus-grid,
.footer-grid {
    display: grid;
    gap: 30px;
}

.layanan-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.layanan-item {
    text-align: center;
    padding: 30px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.layanan-item:hover {
    transform: translateY(-5px);
}

.layanan-item img {
    max-width: 100px;
    margin-bottom: 20px;
}

.portofolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.portofolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.portofolio-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portofolio-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portofolio-item:hover .overlay {
    opacity: 1;
}

.portofolio-item:hover img {
    transform: scale(1.05);
}

.portofolio-item .overlay h3 {
    color: var(--white);
    margin-bottom: 10px;
}

.portofolio-item .overlay p {
    font-size: 0.9em;
}

/* Sambutan Kepala Sekolah */
.sambutan-content {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.kepsek-foto {
    flex-shrink: 0; /* Mencegah gambar mengecil */
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
}

.sambutan-teks p {
    margin-bottom: 15px;
}

.sambutan-teks .jabatan {
    font-style: italic;
    color: var(--secondary-color);
    margin-top: -10px;
    margin-bottom: 20px;
}

.sambutan-teks .penutup {
    margin-top: 20px;
    font-weight: 600;
}

/* Pengurus */
.pengurus-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    text-align: center;
}

.pengurus-item img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--primary-color);
}

/* Kontak */
.kontak {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
}

.kontak h2, .kontak h3 {
    color: var(--white);
}

.kontak ul {
    list-style: none;
    padding: 0;
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.kontak li {
    font-size: 1.1em;
}

.kontak li i {
    margin-right: 10px;
    font-size: 1.2em;
}

.kontak a {
    color: var(--white);
    text-decoration: underline;
}

.kontak address {
    font-style: normal;
    margin-top: 30px;
    line-height: 1.8;
}

/* Footer */
footer {
    background-color: var(--dark-grey);
    color: var(--white);
    padding-top: 50px;
    font-size: 0.9em;
}

.footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-col p, .footer-col a {
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    background-color: #343a40; /* Sedikit lebih gelap dari dark-grey */
}


/* Fade-in Animation Classes */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Responsive Design for Mobile (<= 768px) --- */
@media (max-width: 768px) {
    /* Umum */
    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.6em;
        margin-bottom: 25px;
    }

    section {
        padding: 50px 0;
    }

    /* Navbar Mobile Layout: Logo Kiri, Hamburger Kanan */
    .navbar .container {
        flex-direction: row; /* Tetap satu baris */
        justify-content: space-between; /* Logo kiri, Hamburger kanan */
        padding: 10px 20px;
    }

    .school-brand {
        font-size: 1em; /* Ukuran font lebih kecil di mobile */
    }
    .school-logo-img {
        height: 35px; /* Ukuran logo lebih kecil di mobile */
    }

    .nav-links {
        display: none; /* Sembunyikan default di mobile */
        flex-direction: column; /* Tumpuk menu vertikal saat terbuka */
        width: 100%; /* Ambil lebar penuh */
        background-color: var(--white);
        position: absolute; /* Posisi absolut di bawah header */
        top: auto; /* Akan diatur oleh JS */
        left: 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        padding: 20px 0;
        border-top: 1px solid rgba(0,0,0,0.1);
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.3s ease-out, transform 0.3s ease-out;
        pointer-events: none;
        z-index: 900;
    }

    .nav-links.active {
        display: flex;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-links li {
        margin: 10px 0;
        text-align: center; /* Tengahkan item menu di mobile */
    }

    .nav-links a {
        color: var(--dark-grey); /* Warna link saat di menu mobile */
        font-size: 1.1em;
        padding: 8px 0;
        display: block;
    }

    .hamburger {
        display: flex; /* Tampilkan hamburger di mobile */
    }

    /* Hamburger animation */
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Hero Section */
    .hero {
        padding: 120px 20px 80px; /* Sesuaikan padding hero untuk mobile */
        min-height: 50vh; /* Tinggi minimal hero di mobile */
    }

    .hero-content {
        max-width: 90%; /* Konten hero lebih sempit di mobile */
    }

    /* Grid Layouts akan menjadi satu kolom */
    .layanan-grid,
    .portofolio-grid,
    .pengurus-grid,
    .footer-grid {
        grid-template-columns: 1fr; /* Satu kolom untuk semua grid di mobile */
    }

    .layanan-item,
    .portofolio-item,
    .pengurus-item,
    .footer-col {
        margin: 0 auto; /* Tengahkankan item */
        max-width: 400px; /* Batasi lebar maksimal */
    }

    /* Sambutan Kepala Sekolah */
    .sambutan-content {
        flex-direction: column; /* Tumpuk vertikal */
        text-align: center;
        padding: 30px;
    }

    .kepsek-foto {
        margin-bottom: 20px;
    }

    /* Kontak */
    .kontak ul {
        flex-direction: column; /* Tumpuk item kontak vertikal */
        gap: 15px;
    }
}