/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #0056b3;
    --primary-dark: #004494;
    --secondary-color: #ffc107;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --font-main: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

/* Header & Navigation */
header {
    background-color: #1a2b3c;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.school-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--white);
}

.school-area {
    font-size: 0.85rem;
    color: #ccc;
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav>ul>li {
    position: relative;
}

nav>ul>li>a {
    font-weight: 500;
    font-size: 1rem;
    color: var(--white);
    padding: 10px 0;
}

nav>ul>li>a:hover,
nav>ul>li>a.active {
    color: var(--secondary-color);
}

/* Dropdown Menu Container */
.dropdown {
    position: absolute;
    top: 100%;
    /* Position right below the menu item */
    left: 0;
    width: 250px;
    /* Slightly wider for better readability */
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    /* Soft shadow */
    border-radius: 0 0 8px 8px;
    /* Rounded corners only at bottom */
    border-top: 3px solid var(--secondary-color);
    /* Yellow accent line on top */

    /* Animation States (Hidden by default) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;

    /* Layout */
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

/* TRIGGER HOVER (Crucial Fix) */
/* This makes the menu appear when hovering the parent LI */
nav>ul>li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Links Styling */
.dropdown li {
    display: block;
    width: 100%;
}

.dropdown a {
    display: block;
    padding: 12px 20px;
    font-size: 0.95rem;
    color: var(--text-color);
    /* Dark grey text */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    /* Faint separator line */
    transition: all 0.2s ease;
    font-weight: 500;
}

/* Hover effect on the individual links inside dropdown */
.dropdown a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
    padding-left: 25px;
    /* Small slide animation to the right */
    border-left: 3px solid var(--primary-color);
    /* Blue accent on left */
}

/* Remove border from the last item */
.dropdown li:last-child a {
    border-bottom: none;
}

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    /* KUNCI: vh = Viewport Height (Layar Penuh) */
    display: flex;
    align-items: center;
    /* Menengahkan isi secara Vertikal */
    justify-content: center;
    /* Menengahkan isi secara Horizontal */
    text-align: center;
    color: var(--white);

    /* Agar background gambar selalu full dan tidak gepeng */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* Kompensasi Header Sticky (Opsional, sesuaikan jika perlu) */
    margin-top: -80px;
    padding-top: 80px;
}

/* Membuat lapisan gelap (Overlay) agar tulisan putih terbaca jelas */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Gelap transparan 50% */
    z-index: 1;
}

/* Pastikan konten (Tulisan) berada di atas lapisan gelap */
.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.5rem;
    opacity: 0.9;
}

/* Grids */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Principal Section */
.principal-section {
    background: var(--white);
}

.principal-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    align-items: center;
}

.principal-img img {
    border-radius: 10px;
    box-shadow: 20px 20px 0 var(--light-bg), 20px 20px 0 2px var(--primary-color);
}

.principal-text h3 {
    font-size: 2rem;
    color: var(--secondary-color);
    padding-left: 5px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-img {
    height: 200px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img img {
    transform: scale(1.1);
}

.card-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.card-text {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    flex-grow: 1;
}

.btn-read {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 5px;
    font-weight: 500;
    align-self: flex-start;
    margin-top: auto;
}

.btn-read:hover {
    background-color: var(--primary-dark);
}

/* Footer */
footer {
    background: #1a2b3c;
    color: var(--white);
    padding: 80px 0 0;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-widget h3 {
    color: var(--white);
    margin-bottom: 25px;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    display: block;
}

.footer-links a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    color: #ccc;
}

.contact-info i {
    color: var(--secondary-color);
    margin-top: 5px;
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    padding: 20px 0;
    margin-top: 20px;
    color: #888;
    font-size: 0.9rem;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.contact-info-card {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-info-card h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    position: relative;
}

.contact-info-card .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 86, 179, 0.1);
    /* Primary color with opacity */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

.contact-text h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 600;
}

.contact-text p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.map-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    /* Removed min-height from here to avoid percentage height issues on child */
}

.map-container iframe {
    width: 100%;
    min-height: 450px;
    /* Force height on the iframe itself */
    border: none;
    display: block;
}

/* Responsive Contact */
@media (max-width: 992px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .map-container iframe {
        min-height: 350px;
        /* Smaller height on mobile */
    }
}

/* News Detail Page */
.news-detail-wrapper {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 40px;
    align-items: start;
}

.news-content h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    line-height: 1.2;
}

.news-meta {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 25px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.news-meta i {
    margin-right: 5px;
    color: var(--secondary-color);
}

.news-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.news-image img {
    width: 100%;
    height: auto;
    display: block;
}

.news-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.news-body p {
    margin-bottom: 20px;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    /* Sticky sidebar when scrolling */
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    color: var(--primary-color);
    position: relative;
    padding-left: 15px;
}

.widget-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 10px;
    width: 4px;
    background: var(--primary-color);
}

.recent-post-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.recent-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-post-img {
    width: 80px;
    height: 60px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}

.recent-post-info {
    flex: 1;
}

.recent-post-info h4 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 0.95rem;
    margin-bottom: 5px;
    line-height: 1.4;
    font-weight: 600;
}

.recent-post-info h4 a {
    color: var(--text-color);
    transition: color 0.2s;
}

.recent-post-info h4 a:hover {
    color: var(--primary-color);
}

.recent-post-date {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Responsive News Detail */
@media (max-width: 992px) {
    .news-detail-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar-widget {
        position: static;
        margin-top: 40px;
    }
}

/* Teacher Page Styles */
.teacher-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
    height: 100%;
    position: relative;
    border-bottom: 4px solid transparent;
}

.teacher-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-bottom: 4px solid var(--secondary-color);
}

.teacher-img-container {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
}

.teacher-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Focus on face usually */
    transition: transform 0.5s ease;
}

.teacher-card:hover .teacher-img-container img {
    transform: scale(1.05);
}

.teacher-info {
    padding: 20px;
}

.teacher-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.teacher-position {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.teacher-nip {
    font-size: 0.8rem;
    color: #999;
    background: #f8f9fa;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Special styling for Principal if needed, though the order handles position */
.principal-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* History Page Styles */
.history-hero {
    background: var(--white);
    border-radius: 20px;
    padding: 50px;
    box-shadow: var(--shadow);
    margin-bottom: 80px;
}

.history-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.history-content h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-content h3 i {
    color: var(--secondary-color);
}

.history-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

.history-image {
    position: relative;
}

.history-image img {
    border-radius: 15px;
    box-shadow: 20px 20px 0 var(--light-bg), 20px 20px 0 2px var(--primary-color);
    width: 100%;
}

/* Timeline Styles */
.timeline-section {
    position: relative;
    padding: 50px 0;
}

.timeline-header {
    text-align: center;
    margin-bottom: 60px;
}

.timeline-header h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.timeline-header p {
    color: #666;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

/* The vertical line */
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #e9ecef;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--white);
    border: 4px solid var(--primary-color);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.right::after {
    left: -10px;
}

.timeline-content {
    padding: 30px;
    background-color: var(--white);
    position: relative;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.timeline-year {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.timeline-desc {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

/* Profile Data Grid */
.profile-data-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.profile-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    border-bottom: 4px solid transparent;
}

.profile-card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--secondary-color);
}

.profile-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 600;
}

.profile-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Responsive Timeline */
@media (max-width: 768px) {

    .history-grid,
    .profile-data-grid {
        grid-template-columns: 1fr;
    }

    .history-image {
        order: -1;
        /* Image on top for mobile */
        margin-bottom: 30px;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::after {
        left: 21px;
    }

    .left::after,
    .right::after {
        left: 21px;
    }

    .right {
        left: 0%;
    }
}

/* Visi Misi Page Styles */
.visi-section {
    max-width: 900px;
    margin: 0 auto 50px;
    text-align: center;
}

.visi-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.visi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.visi-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.visi-text {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #555;
    font-style: italic;
    font-weight: 500;
}

.misi-tujuan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.misi-card,
.tujuan-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    height: 100%;
}

.card-header-custom {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-header-custom h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
}

.card-header-custom i {
    font-size: 1.5rem;
}

.misi-card i {
    color: var(--primary-color);
}

@media (max-width: 992px) {
    .visi-section {
        padding: 0 20px;
    }

    .misi-tujuan-grid {
        gap: 25px;
    }
}

/* HP */
@media (max-width: 768px) {

    /* Grid jadi 1 kolom */
    .misi-tujuan-grid {
        grid-template-columns: 1fr;
    }

    /* Card jadi full width */
    .misi-card,
    .tujuan-card {
        padding: 25px;
    }

    /* Judul Visi */
    .visi-title {
        font-size: 1.6rem;
    }

    /* Text visi lebih nyaman dibaca */
    .visi-text {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    /* Header card */
    .card-header-custom h3 {
        font-size: 1.3rem;
    }
}

/* HP kecil */
@media (max-width: 480px) {

    .visi-card {
        padding: 25px 20px;
    }

    .misi-card,
    .tujuan-card {
        padding: 20px;
    }

    .visi-title {
        font-size: 1.4rem;
    }

    .visi-text {
        font-size: 1rem;
    }
}


.tujuan-card i {
    color: var(--secondary-color);
}

.custom-list {
    list-style: none;
    padding: 0;
}

.custom-list li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
    line-height: 1.6;
    color: #666;
    font-size: 1.05rem;
}

.custom-list li::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
}

.misi-list li::before {
    content: "\f058";
    /* Check circle */
    color: var(--primary-color);
}

.tujuan-list li::before {
    content: "\f005";
    /* Star */
    color: var(--secondary-color);
}

/* Facilities Page Styles */
.facility-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.facility-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.facility-card:hover .facility-img img {
    transform: scale(1.1);
}

.facility-info {
    padding: 25px;
    text-align: center;
}

.facility-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
}

/* Gallery Page Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 250px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-text {
    color: var(--white);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-text {
    transform: translateY(0);
}

.gallery-text h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.gallery-text p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation-name: zoom;
    animation-duration: 0.3s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Alumni Page Styles */
.alumni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.alumni-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
    border-top: 5px solid var(--primary-color);
}

.alumni-card:hover {
    transform: translateY(-10px);
}

.alumni-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 4px solid #f0f0f0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.alumni-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alumni-quote {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
}



.alumni-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.alumni-meta {
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.alumni-job {
    font-weight: 600;
    color: var(--text-color);
    background: #f8f9fa;
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Extracurricular Page Styles */
.ekskul-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ekskul-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.ekskul-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.ekskul-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ekskul-card:hover .ekskul-img img {
    transform: scale(1.1);
}

.ekskul-info {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ekskul-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.ekskul-desc {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    padding: 30px;
}

.ekskul-popup-content {
    background: var(--white);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 15px;
    position: relative;
    margin: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: zoom 0.3s ease;
}

.ekskul-popup-info h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.ekskul-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.ekskul-detail-item i {
    width: 25px;
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-top: 3px;
}

.ekskul-detail-item strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
}

.ekskul-detail-item p {
    margin: 0;
    color: #666;
}

.ekskul-description {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ekskul-description strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
}

.ekskul-description p {
    color: #555;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .ekskul-popup-grid {
        grid-template-columns: 1fr;
    }


    .visi-text {
        font-size: 1.1rem;
    }
}

/* Prestasi Page Styles */
.prestasi-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.prestasi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.prestasi-card .card-img {
    position: relative;
    height: 220px;
}

.card-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 5px;
}

.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-color);
    color: #fff;
}

.badge-secondary {
    background: var(--secondary-color);
    color: #333;
}

.student-name {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-name i {
    color: var(--secondary-color);
}

.btn-read-more {
    display: inline-block;
    margin-top: auto;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: padding 0.3s;
}

.btn-read-more:hover {
    padding-left: 5px;
}

/* Prestasi Detail Page */
.prestasi-detail-wrapper {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.prestasi-detail-header {
    text-align: center;
    margin-bottom: 40px;
}

.prestasi-detail-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 15px 0;
}

.prestasi-meta {
    font-size: 1.1rem;
    color: #666;
}

.prestasi-detail-image {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.prestasi-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prestasi-desc-box {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid var(--secondary-color);
    margin-bottom: 30px;
    font-style: italic;
    color: #555;
}

.prestasi-desc-box h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-style: normal;
}

.prestasi-full-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.prestasi-full-content {
    line-height: 1.8;
    color: #333;
    font-size: 1.05rem;
}

@media (max-width: 768px) {
    .prestasi-detail-wrapper {
        padding: 20px;
    }

    .prestasi-detail-image {
        height: 250px;
    }

    .prestasi-detail-header h1 {
        font-size: 1.8rem;
    }
}

/* Homepage Prestasi Buttons */
.btn-read-more-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.btn-read-more-link:hover {
    transform: translateX(5px);
    text-decoration: none;
}

.btn-see-all {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn-see-all:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
    color: #fff;
}

.text-center {
    text-align: center;
}

/* Homepage Gallery Layout */
.gallery-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    height: 400px;
    margin-bottom: 50px;
}

.gallery-featured {
    position: relative;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gallery-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-featured:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 20px;
    color: #fff;
}

.gallery-grid-small {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    height: 100%;
}

.gallery-item-small {
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    box-shadow: var(--shadow);
}

.gallery-item-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item-small:hover img {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .gallery-featured {
        height: 250px;
    }

    .gallery-grid-small {
        height: auto;
        grid-template-rows: 150px 150px;
    }
}

/* Alumni Page Styles */
.alumni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.alumni-card {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
    border-top: 5px solid var(--primary-color);
}

.alumni-card:hover {
    transform: translateY(-5px);
}

.alumni-img {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.alumni-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alumni-quote {
    font-style: italic;
    color: #555;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    /* Fix for text overflow */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.alumni-name {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.alumni-meta {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.alumni-job {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Override for News Detail Text Overflow */
.news-content h1,
.recent-post-info h4 {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

/* Override for Card Text Overflow */
.card-title,
.card-text {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

/* Fix for Grid Layout Regression */
.news-content {
    min-width: 0;
}

/* Override for News Body Text Overflow */
.news-body,
.news-body p {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

/* Override for Teacher Card Text Overflow */
.teacher-name,
.teacher-position,
.teacher-nip {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

/* Comprehensive Text Overflow Fix for All Pages */
.timeline-year,
.timeline-title,
.timeline-desc,
.profile-value,
.history-text,
.alumni-quote,
.alumni-name,
.alumni-job,
.ekskul-title,
.ekskul-desc,
.ekskul-popup-info h3,
.ekskul-detail-item p,
.visi-title,
.visi-text,
.misi-card li,
.tujuan-card li,
.student-name,
.prestasi-detail-header h1 {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

/* Facility Page Styles */
.facility-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.facility-card:hover {
    transform: translateY(-5px);
}

.facility-img {
    height: 220px;
    width: 100%;
    overflow: hidden;
}

.facility-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.facility-card:hover .facility-img img {
    transform: scale(1.1);
}

.facility-info {
    padding: 20px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.facility-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
}


/* Global Animations */
.animate-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays for cards */
.grid-3 .card:nth-child(2),
.grid-4 .teacher-card:nth-child(2) {
    transition-delay: 0.1s;
}

.grid-3 .card:nth-child(3),
.grid-4 .teacher-card:nth-child(3) {
    transition-delay: 0.2s;
}

.grid-4 .teacher-card:nth-child(4) {
    transition-delay: 0.3s;
}


/* --- Fix: Mobile Navigation & Responsive Issues --- */

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        /* Panel width */
        max-width: 300px;
        height: 100vh;
        background-color: #1a2b3c;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 80px 20px 40px;
        transition: right 0.3s ease-in-out;
        z-index: 999;
        overflow-y: auto;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    nav>ul>li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav>ul>li>a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
        font-size: 1.1rem;
    }

    /* Dropdown on Mobile */
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        /* Slightly lighter dark bg */
        border-top: none;
        display: none;
        /* Hidden by default */
        padding-left: 15px;
        width: 100%;
        border-radius: 0;
    }

    nav>ul>li.open .dropdown {
        display: flex;
    }

    .dropdown a {
        color: #ccc;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 12px 0;
    }

    /* Fix Grid Overflow on Small Mobile */
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Very Small Screen Fixes */
@media (max-width: 400px) {

    .grid-3,
    .grid-4,
    .alumni-grid {
        grid-template-columns: 1fr;
        /* Single column force */
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }
}

/* Fix: Footer Responsiveness */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-widget {
        text-align: left;
        /* Keep left aligned for readability or center if preferred */
    }

    /* Prevent logo text overlapping if space is tight */
    .footer-widget .logo {
        flex-wrap: wrap;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    color: #333;
    transform: translateY(-5px);
}

/* Fix: Principal Section Mobile */
@media (max-width: 768px) {
    .principal-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .principal-img {
        margin: 0 auto;
        max-width: 200px;
        /* Reduced from 350px */
    }

    .principal-text h3 {
        padding-left: 0;
        margin-top: 10px;
        margin-bottom: 20px;
        /* Keep title/name centered */
    }

    .principal-text p {
        text-align: left;
        /* Align body text to left */
        /* Optional: text-align: justify; if they want it blocked */
    }

    /* Fix: News/Grid Spacing on Mobile */
    .grid-3,
    .grid-4,
    .alumni-grid,
    .news-detail-wrapper,
    .gallery-grid {
        padding: 0 25px;
        /* Increased spacing to narrow the content */
    }

    /* Force 2 columns for teachers (grid-4) on mobile */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
        /* Reduce gap slightly for 2 cols */
    }
}

/* UI Polish: Framed Images (Padding + Radius) */
/* Applies to News, Teachers, Ekskul, Facilities, etc. (Except Gallery) */
.card-img,
.teacher-img-container,
.ekskul-img,
.facility-img {
    padding: 15px 15px 0 15px;
    background: transparent;
}

/* Ensure the inner image has rounded corners */
.card-img img,
.teacher-img-container img,
.ekskul-img img,
.facility-img img {
    border-radius: 10px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 404 Error Page Styles */
.error-page {
    min-height: 50vh;
    /* Takes up half screen height minimum */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 50px;
    padding-bottom: 80px;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
}

.error-title {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.error-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}