/* ==========================================================================
   PUBLIC GALLERY STYLE - SEEDS STARS MONTESSORI (Orange Theme)
   ========================================================================== */
:root {
    --ms-orange: #ff7a00;
    --ms-orange-hover: #e66a00;
    --ms-orange-light: #fff4eb;
    --ms-slate: #1e293b;
}

/* Header Section */
.gallery-header-bg {
    background: linear-gradient(135deg, #fffdfb 0%, #fff5ed 100%);
    border-bottom: 1px solid #ffebe0;
}

.section-subtitle-orange {
    color: var(--ms-orange);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* Grid & Cards Layout */
.gallery-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(30, 41, 59, 0.03);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 122, 0, 0.1);
    border-color: #ffe0cc;
}

/* Image Wrapper with Zoom Effect */
.gallery-img-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: #f8fafc;
}

.gallery-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-card-img {
    transform: scale(1.08);
}

/* Badge Kategori */
.gallery-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--ms-orange-hover);
    backdrop-filter: blur(4px);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Card Body Content */
.gallery-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gallery-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ms-slate);
    line-height: 1.4;
    margin-bottom: 12px;

    /* PENGUNCI MAKSIMAL 2 BARIS (Jika lebih, otomatis jadi ... ) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    /* TAMBAHAN UTAMA: Mencegah kata super panjang tanpa spasi tembus keluar card */
    word-break: break-word;
    overflow-wrap: break-word;

    /* Opsional: Berikan tinggi minimal agar card tetap sejajar meskipun judul hanya 1 baris */
    min-height: 3.2rem;
}

/* Buttons */
.btn-gallery-view {
    background-color: var(--ms-orange);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: none;
    margin-top: auto; /* Memaksa tombol selalu presisi di paling bawah */
    text-align: center;
}

.btn-gallery-view:hover {
    background-color: var(--ms-orange-hover);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(255, 122, 0, 0.25);
}

/* Custom Pagination Styling */
.pagination .page-item.active .page-link {
    background-color: var(--ms-orange) !important;
    border-color: var(--ms-orange) !important;
    color: #ffffff !important;
}
.pagination .page-link {
    color: var(--ms-slate);
    border-radius: 8px;
    margin: 0 3px;
}
.pagination .page-link:hover {
    color: var(--ms-orange-hover);
    background-color: var(--ms-orange-light);
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */
@media (max-width: 767.98px) {
    .gallery-img-wrapper {
        height: 200px;
    }
    .gallery-body {
        padding: 20px;
    }
    .gallery-title {
        font-size: 1.05rem;
    }
}

/* ==========================================================================
   TAMBAHAN UNTUK SEARCH & FILTER UTENSILS (Orange Theme)
   ========================================================================== */

/* Wrapper Pencarian & Filter */
.search-filter-wrapper {
    background: #ffffff;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(30, 41, 59, 0.04);
    border: 1px solid #f1f5f9;
    margin-bottom: 40px;
}

/* Custom Design Input Search */
.search-input-group {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f8fafc;
}
.search-input-group:focus-within {
    border-color: var(--ms-orange);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.15);
    background: #ffffff;
}
.search-input-group .form-control {
    border: none;
    background: transparent;
    padding: 12px 18px;
    font-size: 0.95rem;
    color: var(--ms-slate);
}
.search-input-group .form-control:focus {
    box-shadow: none;
    background: transparent;
}
.search-input-group .btn-search {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0 20px;
    transition: color 0.2s;
}
.search-input-group:focus-within .btn-search {
    color: var(--ms-orange);
}

/* Tombol Filter Kategori (Pill Categories) */
.filter-container {
    display: flex;
    gap: 10px;

    /* DEFAULT UNTUK MOBILE: Berbaris ke samping & bisa di-scroll pakai jempol */
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px; /* Ruang bernapas di bawah tombol */

    /* Sembunyikan scrollbar jelek bawaan browser agar estetik */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}
.filter-container::-webkit-scrollbar {
    display: none;
}

.btn-filter-pill {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

    /* TAMBAHAN UNTUK MOBILE SCROLL */
    flex: 0 0 auto; /* Tombol tidak boleh mengkerut/gepeng */
    white-space: nowrap; /* Tulisan tombol dipaksa tetap 1 baris kesamping */
}
.btn-filter-pill:hover {
    background-color: var(--ms-orange-light);
    color: var(--ms-orange-hover);
    border-color: #ffe0cc;
}
.btn-filter-pill.active {
    background-color: var(--ms-orange);
    color: #ffffff;
    border-color: var(--ms-orange);
    box-shadow: 0 8px 20px rgba(255, 122, 0, 0.25);
}

/* Reset Button Pencarian */
.btn-reset-search {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.btn-reset-search:hover {
    color: #ef4444;
}

@media (min-width: 992px) {
    .filter-container {
        flex-wrap: wrap; /* PC: Biarkan membungkus turun jika penuh */
        overflow-x: visible; /* Matikan fungsi scroll samping */
        padding-bottom: 0;
    }
}

@media (max-width: 575.98px) {
    /* 1. Sesuaikan pembungkus gambar agar tingginya proporsional (lebih pendek) */
    .gallery-img-wrapper {
        height: 140px; /* Di PC 240px, di HP kita ciutkan jadi 140px */
    }

    /* 2. Kurangi padding di dalam bodi card agar hemat ruang */
    .gallery-body {
        padding: 15px; /* Sedikit lebih rapat */
    }

    /* 3. Judul: Ciutkan ukuran teks dan jarak bawahnya */
    .gallery-title {
        font-size: 0.95rem; /* Teks judul lebih kecil */
        min-height: 2.6rem; /* Sesuaikan tinggi minimal pengunci baris */
        margin-bottom: 8px;
        line-height: 1.3;
    }

    /* 4. Badge Kategori: Ciutkan ukurannya agar tidak menutupi gambar */
    .gallery-badge {
        font-size: 0.65rem;
        padding: 4px 10px;
        top: 10px;
        left: 10px;
    }

    /* 5. Tombol Lihat: Ciutkan ukuran teks, ikon, dan padding tombol */
    .btn-gallery-view {
        font-size: 0.8rem;
        padding: 8px 12px;
        border-radius: 8px;
    }
    .btn-gallery-view i {
        font-size: 0.85rem;
        margin-right: 4px !important;
    }
}
