/* ==========================================================
   SCHOOL DIRECTORY
========================================================== */

.school-directory{
    padding:100px 0;
    background:var(--color-bg-light);
}


/* ==========================================================
   HERO
========================================================== */
.section-label{
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 24px;
  background: rgba(25, 26, 83, 0.08);
  padding: 6px 16px;
  border-radius: 10px;
}

.school-hero{
    position:relative;
    overflow:hidden;
    padding:70px;
    margin-bottom:60px;
    border-radius:var(--radius-lg);
    text-align:center;
}

.school-hero h1{
    margin: 0 0 28px;
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -3px;
    color:var(--color-primary);
}

.school-hero p{
    max-width:850px;
    margin:auto;
    color:var(--color-text-secondary);
    font-size:1.1rem;
}


/* ==========================================================
   LAYOUT
========================================================== */

.school-layout{
    display:grid;
    grid-template-columns:320px 1fr;
    gap:40px;
    align-items:start;
}


/* ==========================================================
   SIDEBAR
========================================================== */

.school-sidebar{
    position:sticky;
    top:110px;
}

.sidebar-header h3{
    color:var(--color-primary);
    font-size:1.2rem;
    font-weight:700;
    text-transform:uppercase;

}

.nav-group-title{
    margin-top:12px;
    text-transform:uppercase;
    font-size: 0.75rem;
    letter-spacing: .4rem;
    font-weight: 700;
    color:var(--color-text-secondary);

}
/* ==========================================================
   NAVIGATION
========================================================== */

.school-nav{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.school-nav button{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:15px;
    padding:18px 22px;
    background:transparent;
    border:none;
    border-radius:14px;
    color:#a7a7b3;
    font-weight:600;
    text-align:left;
    cursor:pointer;
    transition:var(--transition-premium);
}

.school-nav button svg{
    width:18px;
    height:18px;
    flex-shrink:0;
}

.school-nav button:hover{
    background:white;
    color:var(--color-primary);
    box-shadow:var(--shadow-sm);
    transform:translateX(6px);
}

.school-nav button.active{
    background:white;
    color:var(--color-primary);
    box-shadow:var(--shadow-premium);
}


/* ==========================================================
   CONTENT
========================================================== */

.school-content-unit {
    min-height: 650px;
    min-width: 0; /* KUNCI UTAMA: Mencegah elemen grid melebar keluar layar */
    width: 100%;
}

/* ==========================================================
   CARD
========================================================== */

.school-card {
    background: white;
    border-radius: 28px;
    padding: 45px;
    box-shadow: var(--shadow-premium);
    animation: fadeCard .45s var(--ease-cinematic);
    transition: var(--transition-premium);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box; /* Memastikan padding tidak menambah lebar */
}

/* ==========================================================
   HEADER
========================================================== */

.school-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:30px;
}

.school-type{
    display:inline-flex;
    align-items:center;
    padding:4px 12px;
    border-radius:4px;
    background:var(--color-secondary-light);
    color:var(--color-primary);
    font-size:.65rem;
    font-weight:600;
    letter-spacing:.08em;
    text-transform:uppercase;
    margin-bottom:10px;

}

.school-header h2{
    font-size:2.3rem;
    color:var(--color-primary);
    line-height:1.1;
    font-weight:700;
    font-size:var(--fs-h2);
}


/* ==========================================================
   SLIDER PREMIUM (Menggantikan .school-cover)
========================================================== */
.slider-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/8; /* Konsisten dengan desain awal */
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 35px;
    background: #ececec;
    box-shadow: var(--shadow-sm);
}

.slides-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05); /* Sedikit zoom saat tersembunyi */
    transition: opacity 0.6s ease-in-out, visibility 0.6s, transform 0.8s ease-in-out;
}

/* Gambar yang sedang aktif */
.slide-image.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Efek hover pada card untuk gambar aktif */
.school-card:hover .slide-image.active {
    transform: scale(1.02);
}

/* Tombol Navigasi Premium bergaya Kaca (Glassmorphism) */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0; /* Sembunyikan panah saat tidak di-hover */
    transition: all 0.3s ease;
    font-size: 18px;
    z-index: 10;
}

/* Panah muncul saat kontainer gambar disentuh kursor */
.slider-container:hover .slider-btn {
    opacity: 1; 
}

.slider-btn:hover {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-50%) scale(1.1);
}

.prev-slide { left: 15px; }
.next-slide { right: 15px; }

/* Responsif untuk Layar HP */
@media(max-width: 768px) {
    .slider-container {
        aspect-ratio: 16/10; /* Menyesuaikan style HP yang ada di CSS Anda */
    }
    .slider-btn {
        opacity: 1; /* Di HP panah selalu tampil karena tidak ada efek hover kursor */
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/*==========================================================
   DESCRIPTION
========================================================== */

.school-description{
    margin-bottom:45px;
}

.school-description p{
    color:var(--color-text-secondary);
    line-height:1.9;
}

/*==========================================================
   PROGRAMS
========================================================== */
.school-programs h3 {
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
    font-size: var(--fs-h3);
    font-weight:700;
}

.school-programs{
    margin-bottom:45px;
}

.school-programs p{
    color:var(--color-text-secondary);
    line-height:1.9;
}

/* ==========================================================
   CONTACT (Responsive Grid & Word Break)
========================================================== */
.school-contact {
    margin-bottom: 40px;
}

.school-contact h3 {
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
    font-size: var(--fs-h3);
    font-weight:700;
}

.contact-list {
    display: grid;
    gap: 18px;
}

.contact-item {
    display: flex;
    border-radius: var(--radius-md);
    padding: 12px 22px;
    align-items: flex-start;
    transition: var(--transition-premium);
    gap: 18px;
    /* Mencegah item memanjang keluar batas */
    max-width: 100%; 
    overflow: hidden; 
}

.contact-icon{
    width:52px;
    height:52px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    border-radius:16px;
    background:var(--color-bg-light-gold);
    color:var(--color-secondary-dark);
    transition:var(--transition-premium);
}

.contact-item:hover{
    transform:translateY(-2px);
    box-shadow:var(--shadow-premium);
}

.contact-item:hover .contact-icon{
    background:var(--color-secondary-light);
    color:var(--color-secondary-dark);
    transform:translateY(-2px);
}

.contact-icon svg{
    width:22px;
    height:22px;
    transition:var(--transition-premium);
}

.contact-item:hover .contact-icon svg{
    transform:scale(1.1);
    fill:var(--color-primary);
}

.contact-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Memastikan kontainer teks tidak memicu overflow */
    min-width: 0; 
}

.contact-value {
    color: var(--color-text-secondary);
    /* Mencegah link panjang (URL) merusak layout di layar kecil */
    word-break: break-word; 
    overflow-wrap: break-word;
}

.contact-label{
    font-size:.75rem;
    font-weight:700;
    color:#999;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.school-cover,
.school-map {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.school-map iframe {
    width: 100% !important; /* Memaksa iframe mengikuti lebar parent */
    max-width: 100%;
    display: block;
}

/* ==========================================================
   MAP
========================================================== */

.school-map{
    overflow:hidden;
    border-radius:20px;
    box-shadow:var(--shadow-sm);
}

.school-map iframe{
    width:100%;
    height:400px;
    border:none;
}


/* ==========================================================
   ANIMATION
========================================================== */

@keyframes fadeCard{
from{
opacity:0;
transform:translateY(25px);
}

to{

    opacity:1;
transform:none;

}

}

/* ==========================================================
   LOGO STYLING
========================================================== */

/* Logo di Sidebar */
.sidebar-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm); /* Membuat logo bulat */
    object-fit: cover;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

/* Wrapper identitas di Header Konten */
.school-identity {
    display: flex;
    align-items: center; /* Menyelaraskan logo dan teks di tengah vertikal */
    gap: 20px;
}

/* Logo di Header Konten */
.header-school-logo {
    width: 100px;
    height: 100px;
    border-radius: 16px; /* Kotak dengan sudut membulat bergaya modern */
    object-fit: cover;
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition:var(--transition-premium) !important;
    flex-shrink: 0;
}

/* ==========================================================
   SKELETON LOADING (SHIMMER EFFECT)
========================================================== */

/* Animasi background berjalan */
.skeleton {
    background-color: #e2e5e7; /* Warna abu-abu dasar */
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.5) 20%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    position: relative;
    overflow: hidden;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Kondisi awal gambar (transparan) */
.img-lazy {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

/* Saat gambar selesai di-load */
.img-lazy.loaded {
    opacity: 1;
}

/* ==========================================================
   MAP SKELETON & TRANSITION
========================================================== */
.school-map {
    overflow: hidden;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    /* Tinggi minimal agar skeleton terlihat sebelum iframe muncul */
    min-height: 400px; 
    background-color: #e2e5e7; /* Fallback warna skeleton */
}

/* Kondisi awal Iframe (Transparan) */
.school-map iframe {
    width: 100%;
    height: 400px;
    border: none;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

/* Saat Iframe selesai diload */
.school-map iframe.loaded {
    opacity: 1;
}

/* ==========================================================
   RESPONSIVE REFINEMENTS
========================================================== */
@media(max-width: 992px) {
    .school-layout {
        grid-template-columns: 1fr;
    }
    
    .school-sidebar {
        position: relative;
        top: auto;
        margin-bottom: 30px;
    }
    
    /* 1. Sembunyikan Teks Nama Sekolah */
    .school-name {
        display: none;
    }
    
    /* 2. Ubah Navigasi menjadi Deretan Ikon */
    .school-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap; 
        gap: 12px;
    }
    
    /* 3. Bentuk ulang tombol menjadi kotak */
    .school-nav button {
        flex: 0 0 auto; /* Tombol tidak lagi memanjang */
        min-width: unset; 
        width: auto;
        padding: 12px; /* Jarak proporsional untuk kotak */
        border-radius: 16px;
        justify-content: center;
    }
    
    /* 4. Perbesar sedikit logo di mobile agar mudah ditekan jari */
    .sidebar-logo {
        width: 38px;
        height: 38px;
    }
    
    .nav-group-title {
        width: 100%;
        margin: 15px 0 5px 0;
    }
}

/* Penyesuaian khusus untuk Handphone (Layar kecil) */
@media(max-width: 768px) {
    .school-directory {
        padding: 60px 0;
    }
    
    .school-hero {
        padding: 45px 25px;
        margin-bottom: 40px;
    }
    
    .school-card {
        padding: 30px 24px;
        border-radius: 20px;
    }
    
    .school-header h2 {
        font-size: 1.6rem;
    }
    
    .school-type {
        display: none;
    }

    .slide-image {
        aspect-ratio: 16/10;
        margin-bottom: 25px;
    }
    
    .school-map,
    .school-map iframe {
        min-height: 300px;
        height: 300px;
    }

    /* Penyesuaian tombol ikon di layar HP */
    .school-nav button {
        padding: 10px;
        border-radius: 14px;
    }

    .sidebar-logo {
        width: 34px;
        height: 34px;
    }
}

/* Penyesuaian untuk Handphone sangat kecil (< 480px) */
@media(max-width: 480px) {
    .school-card {
        padding: 24px 18px;
    }
    
    .school-identity {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    /* Turunkan ukuran agar ikon bisa muat banyak dalam 1 baris */
    .school-nav button {
        padding: 8px;
        gap: 0;
    }
    
    .sidebar-logo {
        width: 32px;
        height: 32px;
    }
}

/* --- MOBILE STANDARD (< 768px) --- */
@media(max-width: 768px) {
    .school-directory {
        padding: 60px 0;
    }
    .school-hero {
        padding: 45px 25px;
        margin-bottom: 40px;
        border-radius: 20px;
    }
    .school-hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }
    .school-card {
        padding: 30px 24px;
        border-radius: 20px;
    }
    
    /* Penyesuaian Identitas dan Logo */
    .school-identity {
        gap: 15px;
    }
    .header-school-logo {
        width: 70px;
        height: 70px;
        border-radius: 12px;
    }
    .school-header h2 {
        font-size: 1.6rem;
    }
    
    /* Penyesuaian Cover dan Map */
    .slide-image {
        aspect-ratio: 16/10;
        border-radius: 16px;
        margin-bottom: 25px;
    }
    .school-map iframe,
    .school-map {
        min-height: 300px;
        height: 300px;
    }
}

/* --- MOBILE KECIL (< 480px) --- */
@media(max-width: 480px) {
    .school-card {
        padding: 24px 18px;
    }
    
    /* Logo dan teks ditumpuk (vertikal) agar tidak terlalu sempit */
    .school-identity {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .header-school-logo {
        width: 60px;
        height: 60px;
    }
    .school-header h2 {
        font-size: 1.4rem;
    }
    
    /* Ubah kontak agar ikon ada di atas teks untuk menghemat ruang */
    .contact-item {
        padding: 12px 15px;
        gap: 12px;
    }
    .contact-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
    .contact-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================================
   HIGHLIGHT BUTTON (SPMB)
========================================================== */
.btn-highlight.wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 10px 20px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    transition: var(--transition-premium, all 0.3s ease);
    flex-shrink: 0;
}

.btn-highlight.wa-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(116, 115, 115, 0.3);
    background-color: var(--color-primary);
    color: white;
}

.btn-highlight.wa-btn svg {
    width: 18px;
    height: 18px;
}

/* Responsif untuk Layar Handphone */
@media(max-width: 768px) {
    .school-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-highlight.wa-btn {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
}