/* ==========================================
   GLOBAL RESET & VARIABLES
========================================== */
:root {
    --dark-blue: #0d2a4d;
    --blue: #1a4e7a;
    --light-blue: #3498db;
    --accent: #e74c3c;
    --white: #ffffff;
    --light: #ecf0f1;
    --gray: #7f8c8d;
    --dark-gray: #34495e;
    --border-radius: 6px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   LAYOUT: HEADER & NAVBAR
========================================== */
.header {
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 1rem 0;
    text-align: center;
    position: relative;
    z-index: 90; /* ✅ Pastikan di bawah navbar */
}

.header .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header .logo img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    background: var(--white);
    margin-bottom: 0.5rem;
    border: 3px solid var(--light-blue);
}

.header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    margin: 0;
}

.header p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0.3rem 0 0;
}

/* Navbar */
.navbar {
    background-color: var(--blue);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100; /* ✅ Di atas header */
}

.navbar ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 0;
    margin: 0;
}

.navbar li {
    margin: 0;
}

.navbar a {
    color: var(--white);
    padding: 0.6rem 1.1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    display: block;
    text-align: center;
    position: relative; /* ✅ Pastikan bisa diklik */
    z-index: 1;
}

.navbar a:hover,
.navbar a:focus {
    background-color: var(--light-blue);
    color: white;
}

.navbar .btn-admin {
    background-color: var(--accent);
    font-weight: 600;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 102; /* ✅ Paling atas */
}

/* ==========================================
   LAYOUT: SECTIONS & CONTENT
========================================== */
section {
    padding: 2.5rem 0;
    background-color: white;
}

section:nth-child(even) {
    background-color: #fafafa;
}

section h2 {
    color: var(--dark-blue);
    text-align: center;
    margin-bottom: 1.8rem;
    font-weight: 700;
    font-size: 1.8rem;
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--light-blue);
    margin: 0.5rem auto;
    border-radius: 2px;
}

.text-center {
    text-align: center;
}

/* Card Grid (guru, ekskul, galeri) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-img {
    height: 180px;
    width: 100%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 1.2rem;
}

.card h3 {
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card p {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.card .jabatan {
    font-weight: 600;
    color: var(--blue);
    font-size: 0.9rem;
}

/* Galeri khusus */
.galeri-item {
    text-align: center;
}

.galeri-item .card-img {
    height: 200px;
}

.galeri-item .judul {
    font-weight: 600;
    color: var(--dark-blue);
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Berita list */
.berita-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.berita-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    align-items: flex-start;
}

.berita-item img {
    height: 140px;
    width: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.berita-content h3 {
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

.berita-meta {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.7rem;
}

.berita-excerpt {
    color: #555;
}

/* Single berita */
.berita-full .foto {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.berita-full h1 {
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.berita-full .meta {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.berita-full .isi {
    line-height: 1.8;
    color: #444;
}

/* Visi Misi */
.visi-misi {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.visi-box,
.misi-box {
    background: white;
    padding: 1.8rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.visi-box {
    border-left: 5px solid var(--light-blue);
}

.misi-box {
    border-left: 5px solid var(--accent);
}

.visi-box h3,
.misi-box h3 {
    color: var(--dark-blue);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.misi-list {
    padding-left: 1.5rem;
}

.misi-list li {
    margin-bottom: 0.6rem;
    color: #555;
}

/* Alamat & Kontak */
.alamat-content,
.kontak-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.map-container {
    height: 350px;
    background: #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.map-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: white;
    font-weight: 600;
}

.kontak-form .form-group {
    margin-bottom: 1.2rem;
}

.kontak-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--dark-blue);
}

.kontak-form input,
.kontak-form textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
}

.kontak-form textarea {
    height: 120px;
    resize: vertical;
}

.btn {
    display: inline-block;
    background: var(--light-blue);
    color: white;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--accent);
}

.btn-danger:hover {
    background: #c9a29e;
}

/* ==========================================
   ADMIN PANEL (sederhana)
========================================== */
.admin-dashboard {
    background: #f1f5f9;
}

.admin-header {
    background: var(--dark-blue);
    color: white;
    padding: 1rem;
    text-align: center;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.admin-menu {
    background: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.admin-menu ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    padding: 0;
    margin: 0;
}

.admin-menu a {
    background: var(--blue);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.admin-menu a:hover {
    background: var(--light-blue);
}

.admin-content {
    padding: 2rem 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: var(--blue);
    color: white;
}

.admin-table tr:hover td {
    background: #f9fbfd;
}

/* Form Admin */
.form-admin {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
}

.form-admin h3 {
    color: var(--dark-blue);
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-admin .form-group {
    margin-bottom: 1.5rem;
}

.form-admin label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-blue);
}

.form-admin input,
.form-admin textarea,
.form-admin select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.form-admin textarea {
    height: 150px;
    resize: vertical;
}

.form-actions {
    text-align: center;
    margin-top: 1.5rem;
}

/* Alert */
.alert {
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================
   RESPONSIVE DESIGN
========================================== */
@media (max-width: 992px) {
    .visi-misi,
    .alamat-content,
    .kontak-content,
    .berita-item {
        grid-template-columns: 1fr;
    }

    .berita-item img {
        height: 200px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .navbar ul {
        flex-direction: column;
        align-items: center;
        display: none;
        background: var(--blue);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 101; /* ✅ Di atas header (90), di bawah toggle (102) */
    }

    .navbar ul.show {
        display: flex;
    }

    .navbar li {
        width: 100%;
        text-align: center;
    }

    .navbar a {
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }

    section h2 {
        font-size: 1.6rem;
    }

    .form-admin {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .header .logo img {
        width: 70px;
        height: 70px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
        padding: 0.6rem;
        font-size: 0.95rem;
    }
}


/* ==========================================
   FOOTER
========================================== */
.footer {
    background-color: var(--dark-blue);
    color: var(--light);
    padding: 2.5rem 0 1.5rem;
    margin-top: 2rem;
}

.footer .footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: flex-start;
}

.footer .footer-logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    margin-bottom: 0.5rem;
    border: 2px solid var(--light-blue);
}

.footer .footer-logo h3,
.footer .footer-info p,
.footer .footer-social p {
    margin: 0.4rem 0;
    font-size: 0.95rem;
}

.footer .footer-info strong {
    color: var(--light-blue);
}

.footer .footer-social {
    text-align: right;
    flex: 1;
    min-width: 200px;
}

/* Scroll to top */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--light-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

/* Utility */
.text-danger {
    color: var(--accent);
}

.text-center {
    text-align: center;
}

.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* 🔧 SOLUSI DARURAT: FORCE CLICKABILITY */
.menu-toggle,
.navbar,
.navbar *,
.navbar a,
.navbar li {
    pointer-events: auto !important;
}
/* ==========================================
   HERO SECTION (di index.php)
========================================== */
.hero {
    background: url('../images/bghome.png') center / cover no-repeat;
    color: white;
    padding: 0;
    position: relative;
    height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(13, 42, 77, 0.7);
    z-index: 1;
}

.hero .hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin: 0;
}

.hero p {
    font-size: 1.1rem;
    margin: 0.5rem 0 0;
    line-height: 1.6;
}
/* Scroll-to-Top Button */
.scroll-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    background: #0d6efd;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
    z-index: 9999;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: #0b5ed7;
}
