/*
  ================================================================================
  Elegant & Responsive Stylesheet
  Author: Gemini
  Description: A modern, clean, and responsive redesign for the school website.
  Version: 1.8 (Image Proportions Fix)
  ================================================================================
*/

/* --- Root Variables for Easy Theming --- */
:root {
  --primary-color: #3498db; /* A fresh, modern blue */
  --secondary-color: #2c3e50; /* A deep, elegant slate blue */
  --accent-color: #f1c40f;   /* A vibrant, eye-catching yellow */
  --light-gray-color: #f8f9fa;
  --medium-gray-color: #e9ecef;
  --dark-gray-color: #34495e;
  --text-color: #333;
  --link-hover-color: #2980b9;
  --gradient-bar: linear-gradient(90deg, var(--primary-color) 0%, #8e44ad 100%);
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  --card-hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  --border-radius: 8px;
}

/* --- General Body & Typography --- */
body {
   font-family: 'Poppins', 'Tahoma', Geneva, sans-serif;
   background-color: var(--light-gray-color);
   color: var(--text-color);
   line-height: 1.7;
   font-size: 16px;
   -webkit-tap-highlight-color: transparent; /* Mencegah highlight biru saat disentuh di mobile */
}

a {
   color: var(--primary-color);
   text-decoration: none;
   transition: color 0.3s ease-in-out;
}

a:hover {
   color: var(--link-hover-color);
   text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--secondary-color);
}

/* --- Preloader --- */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preloader .preloader-inner .preloader-icon {
  width: 72px;
  height: 72px;
  display: inline-block;
  position: relative;
}

.preloader .preloader-inner .preloader-icon span {
  position: absolute;
  display: inline-block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: preloader-fx 1.6s linear infinite;
  opacity: 0;
}

.preloader .preloader-inner .preloader-icon span:last-child {
  animation-delay: -0.8s;
}

@keyframes preloader-fx {
  0% { transform: scale(0, 0); opacity: 0.5; }
  100% { transform: scale(1, 1); opacity: 0; }
}

/* --- Header: Top Bar & Menu Bar --- */
.top-bar {
   background-color: #ffffff;
   padding: 10px 0;
   border-bottom: 1px solid var(--medium-gray-color);
   box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.top-header img {
	max-height: 60px;
	width: auto;
}

.brand {
   font-weight: 700;
   text-transform: uppercase;
   color: var(--secondary-color);
   font-size: 1.4rem;
   line-height: 1.2;
}

.brand a {
    color: var(--secondary-color);
}

.top-right-nav {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	height: 100%;
}

.top-right-nav a {
	color: var(--secondary-color);
	margin: 0 8px;
}

.social-icon-top {
	font-size: 18px;
	transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon-top:hover {
	color: var(--primary-color);
	transform: scale(1.1);
}

.menu-bar {
   text-transform: uppercase;
   font-weight: 600;
   background: var(--gradient-bar);
   padding: 0;
   box-shadow: 0 4px 10px rgba(0,0,0,0.1);
   position: relative;
   z-index: 1001;
}

.sticky.is-sticky {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1002;
    width: 100%;
    animation: slideDown 0.5s ease-out;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* --- Main Menu & Submenu --- */
.sm-clean {
	background: transparent;
	box-shadow: none;
	width: 100%;
	display: flex;
	justify-content: center;
}

.sm-clean a, .sm-clean a:hover, .sm-clean a:focus, .sm-clean a:active {
	padding: 15px 20px;
	color: #ffffff;
}

.sm-clean a.has-submenu {
	padding-right: 35px;
}

.sm-clean a:hover, .sm-clean a:focus, .sm-clean a:active, .sm-clean a.highlighted {
   background: rgba(255, 255, 255, 0.15);
   color: #fff;
}

.sm-clean > li:first-child a i.fa-home {
    font-size: 1.4rem;
    vertical-align: -2px;
}

.sm-clean ul {
	background: #ffffff;
	border-radius: 0 0 var(--border-radius) var(--border-radius);
	box-shadow: var(--card-shadow);
	border: 1px solid var(--medium-gray-color);
}

.sm-clean ul a,
.sm-clean ul a:hover,
.sm-clean ul a:focus,
.sm-clean ul a:active {
	color: var(--secondary-color) !important;
	background: transparent !important;
	font-size: 14px;
	text-transform: none;
	border-left: 3px solid transparent;
	transition: all 0.3s ease;
}

.sm-clean ul a:hover,
.sm-clean ul a:focus,
.sm-clean ul a:active,
.sm-clean ul a.highlighted {
	color: var(--primary-color) !important;
	background-color: var(--light-gray-color) !important;
	border-left: 3px solid var(--primary-color);
}

.sm-clean ul li {
	border-top: 1px solid var(--medium-gray-color);
}
.sm-clean ul li:first-child {
	border-top: 0;
}

/* --- Carousel / Slider (ENHANCED WITH TRON EFFECT) --- */
.carousel {
    overflow: hidden;
    border-radius: var(--border-radius);
    background-color: var(--dark-gray-color);
}

.carousel-item {
    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out; /* Transisi lebih lambat */
    will-change: opacity, transform;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Memastikan gambar menutupi area tanpa distorsi */
    aspect-ratio: 16 / 9; /* Rasio aspek untuk proporsi yang konsisten */
}

.carousel-item.active img {
    animation: kenburns-animation 20s ease-out forwards; /* Durasi animasi lebih lama */
}

.carousel-caption {
   background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
   border-radius: 0;
   padding: 40px 25px 25px 25px;
   bottom: 0;
   left: 0;
   right: 0;
   text-align: left;
   border-left: 4px solid var(--primary-color);
   box-shadow: -10px 0 20px -10px var(--primary-color);
   animation: caption-slide-in 1s ease-out forwards;
}

.carousel-caption p {
   color: #fff;
   font-size: 1.1rem;
   font-weight: 400;
   margin: 0;
   text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.carousel-indicators {
    bottom: 15px;
}

.carousel-indicators li {
   background-color: rgba(255, 255, 255, 0.5);
   border-radius: 2px;
   width: 25px;
   height: 4px;
   margin: 0 5px;
   border: 0;
   transition: all 0.4s ease;
}

.carousel-indicators .active {
   background-color: var(--accent-color);
   width: 40px;
   box-shadow: 0 0 10px var(--accent-color);
}

/* Override Bootstrap's default slide transition */
.carousel-item-next,
.carousel-item-prev,
.carousel-item.active {
  transform: translateX(0);
}

.carousel-item-next.carousel-item-left,
.carousel-item-prev.carousel-item-right {
  transform: translateX(0);
  opacity: 1;
}

.active.carousel-item-left,
.active.carousel-item-right {
  transform: translateX(0);
  opacity: 0;
}

/* --- Page Title --- */
.page-title {
   font-weight: 700;
   color: var(--secondary-color);
   margin-bottom: 25px;
   padding-bottom: 10px;
   position: relative;
   border-bottom: none;
}
.page-title:after {
   content: '';
   position: absolute;
   bottom: 0;
   left: 0;
   width: 60px;
   height: 4px;
   background: var(--primary-color);
   border-radius: 2px;
}

/* --- Cards (for posts, albums, etc.) --- */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card-title a {
    color: var(--secondary-color);
    font-weight: 600;
}

.card-title a:hover {
    color: var(--primary-color);
}

.card-text {
    color: #555;
    margin-bottom: 1rem;
}

/* === PERBAIKAN GAMBAR DI DALAM KONTEN === */
.card-text img {
    max-width: 100%;
    height: auto !important; /* Memaksa tinggi otomatis */
    display: block;
    margin: 15px auto; /* Memberi spasi dan menengahkan gambar */
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    aspect-ratio: auto !important; /* Menghapus rasio aspek yang mungkin diwariskan */
    object-fit: contain; /* Memastikan seluruh gambar terlihat */
}
/* === AKHIR PERBAIKAN === */

.card-meta {
    font-size: 0.85rem;
    color: #888;
    margin-top: 1rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--medium-gray-color);
    padding: 1rem 1.5rem;
}

/* === PERBAIKAN THUMBNAIL POSTINGAN === */
.card-img, .card-img-top {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    object-fit: cover;
    width: 100%;
    aspect-ratio: 16 / 9; /* Menetapkan rasio aspek 16:9 yang konsisten */
    height: auto; /* Hapus tinggi tetap, biarkan rasio aspek yang bekerja */
}

.card-img {
    aspect-ratio: auto; /* Hapus rasio aspek untuk gambar di samping teks */
    height: 100%;
}
/* === AKHIR PERBAIKAN === */

/* --- Buttons --- */
.action-button {
   background-color: var(--primary-color);
   color: #fff;
   border: none;
   border-radius: 5px;
   padding: 10px 22px;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 0.5px;
   transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.action-button:hover {
   background-color: var(--link-hover-color);
   color: #fff;
   transform: translateY(-2px);
   box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Memberi feedback saat tombol disentuh di mobile */
.action-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* --- Sidebar --- */
.sidebar .card {
    box-shadow: none;
    border: 1px solid var(--medium-gray-color);
    margin-bottom: 25px;
}

.sidebar .card-img-top {
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: top;
    height: auto; /* Mengembalikan ke otomatis agar aspect-ratio bekerja */
}

.sidebar .card-body, .sidebar .card-footer {
    padding: 20px;
}

.sidebar .list-group-item {
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    border: 1px solid var(--medium-gray-color);
    transition: all 0.3s ease;
}

.sidebar .list-group-item-action:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateX(5px);
    border-color: var(--primary-color);
}

.sidebar .list-group-item-action:hover small,
.sidebar .list-group-item-action:hover .text-muted {
    color: #fff !important;
}

.sidebar .list-group-item-action:hover .badge {
    background-color: #fff !important;
    color: var(--primary-color) !important;
}

.sidebar .badge {
    background-color: var(--medium-gray-color);
    color: var(--secondary-color);
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 600;
    padding: .4em .6em;
}

/* --- Forms --- */
.form-control, .custom-select {
    border-radius: var(--border-radius) !important;
    border: 1px solid #ced4da;
    padding: .5rem .9rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.form-control:focus, .custom-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}
.form-control-sm {
    padding: .3rem .7rem;
}

/* --- Footer --- */
footer .primary-footer {
   background-color: var(--secondary-color);
   color: rgba(255, 255, 255, 0.8);
   padding: 50px 0 30px;
}

footer .secondary-footer {
   background-color: var(--dark-gray-color);
   padding: 20px 0;
   color: rgba(255, 255, 255, 0.6);
   font-size: 0.9rem;
}

footer a {
   color: #fff;
}

footer a:hover {
   color: var(--accent-color);
}

footer .page-title {
   color: #fff;
   margin-bottom: 20px;
}

footer .page-title:after {
   background: var(--accent-color);
}

.social-icon {
   font-size: 22px;
   margin-right: 15px;
   transition: transform 0.3s ease, color 0.3s ease;
}
.social-icon:hover {
    transform: scale(1.2);
    color: var(--accent-color);
}

/* --- Fullscreen Search --- */
#search_form {
   z-index: 9999;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(30, 39, 46, 0.97);
   transition: all 0.5s ease-in-out;
   transform: scale(0.9);
   opacity: 0;
   visibility: hidden;
}

#search_form.open {
   transform: scale(1);
   opacity: 1;
   visibility: visible;
}

#search_form input[type="search"] {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   width: 90%;
   max-width: 600px;
   color: #fff;
   background: transparent;
   font-size: 2.5rem;
   font-weight: 300;
   text-align: center;
   border: 0;
   border-bottom: 2px solid rgba(255,255,255,0.5);
   padding: 15px;
   outline: none;
}
#search_form input[type="search"]:focus {
    border-bottom-color: var(--primary-color);
}

/* --- Return to Top Button --- */
#return-to-top {
   position: fixed;
   bottom: 20px;
   right: 20px;
   background: var(--primary-color);
   width: 45px;
   height: 45px;
   display: none;
   text-decoration: none;
   border-radius: 50%;
   text-align: center;
   z-index: 1000;
   transition: all 0.3s ease;
   box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
#return-to-top i {
   color: #fff;
   line-height: 45px;
   font-size: 20px;
}
#return-to-top:hover {
   background: var(--link-hover-color);
   transform: translateY(-3px);
}

/* --- Keyframe Animations for Slider --- */
@keyframes kenburns-animation {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.1) translate(-2%, 2%);
  }
}

@keyframes caption-slide-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Design --- */
@media (max-width: 991.98px) {
	.sm-clean {
		justify-content: flex-start;
	}
    .brand {
        font-size: 1.2rem;
    }
}

/* ================================================================================
  MOBILE STYLES (767.98px and below)
  ================================================================================
*/
@media (max-width: 767.98px) {
    body {
        font-size: 15px; /* Sedikit memperkecil font agar lebih pas */
        line-height: 1.6;
    }

    .content {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .top-bar .row {
   	    justify-content: center;
		align-items: center;
		text-align: center;
    }
	.top-right-nav {
		display: none;
	}
    .top-header {
       justify-content: center;
    }
    .brand {
       font-size: 1.1rem;
       text-align: center;
       margin-top: 5px;
    }
    .top-header img {
   	 max-height: 50px;
    }
	.menu-bar {
		padding: 5px 0;
		min-height: 60px;
		display: flex;
		align-items: center;
	}
	.menu-bar .container {
		position: relative;
	}

    .navbar-toggler {
        border: 1px solid rgba(255,255,255,0.6);
		border-radius: 5px;
        color: white !important;
        font-size: 20px;
        padding: .25rem .75rem;
        transition: transform 0.3s ease;
    }
    .navbar-toggler:active {
        transform: scale(0.95); /* Efek tekan */
    }
	.navbar-toggler:focus {
		outline: none;
        box-shadow: 0 0 5px rgba(255,255,255,0.5);
	}

    .mobile-nav-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-home-icon {
        color: #fff;
        font-size: 24px;
        padding: .25rem .75rem;
    }
    
    .navbar-collapse {
        background: var(--secondary-color);
        padding: 10px 0;
        border-radius: var(--border-radius);
        margin-top: 10px;
        border: 1px solid rgba(255,255,255,0.1);
		box-shadow: var(--card-shadow);
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		z-index: 1001;
        /* Animasi slide-down untuk menu */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }
    .navbar-collapse.show {
        max-height: 500px; /* Nilai yang cukup besar untuk menampung semua item menu */
    }
	.sm-clean {
		flex-direction: column;
		width: 100%;
	}
	.sm-clean > li {
		display: block;
		width: 100%;
	}
	.sm-clean a, .sm-clean a:hover, .sm-clean a:focus, .sm-clean a:active {
		padding: 12px 20px;
	}
	.sm-clean ul {
		box-shadow: none;
		border-radius: 0;
		border: 0;
		background: rgba(0,0,0,0.15);
		position: static;
	}
	.sm-clean ul a, .sm-clean ul a:hover, .sm-clean ul a:focus, .sm-clean ul a:active {
		border-left: 0 !important;
		color: #fff !important;
		padding-left: 35px;
	}
	.sm-clean ul a:hover, .sm-clean ul a:focus, .sm-clean ul a:active {
		background: rgba(0,0,0,0.25) !important;
	}
    #search_form input[type="search"] {
        font-size: 1.8rem;
    }
    .footer .text-md-right {
        text-align: center !important;
        margin-top: 10px;
    }
    .card-body {
        padding: 1.2rem; /* Padding lebih kecil di mobile */
    }
    .card-title {
        font-size: 1.15rem; /* Ukuran judul lebih kecil */
    }
    .page-title {
        font-size: 1.5rem;
    }
    /* Menyesuaikan form di mobile */
    .form-group.row .col-form-label {
        text-align: left;
        margin-bottom: 5px;
    }
    .form-group.row .offset-sm-3 {
        margin-left: 0;
    }