@import url('https://fonts.googleapis.com/css2?family=Sofia&family=Satisfy&family=Lora:wght@600&family=Montserrat:wght@600;800&family=Open+Sans:wght@400;600&family=Poppins:wght@400;600&display=swap');

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Global Styles */
body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #344E41;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    overflow-x: hidden;
    width: 100%;
    padding-top: 0;
}

h1,
h2,
h3,
.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo {
    text-decoration: none;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-1 {
    max-width: 200px;
    height: auto;
    margin-bottom: -10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: 5px;
}

h1 {
    font-size: 3.0rem;
    margin-bottom: 5px;
    margin-top: 0;
    font-weight: 800;
}

h3 {
    font-family: 'Lora', sans-serif;
    font-weight: 600;
}

#home {
    height: 100vh;
    width: 100%;
    position: relative;
    background: transparent;
    margin: 0;
    padding: 0;
}

#home p {
    font-family: 'Sofia', cursive;
    font-size: 1.7rem;
    letter-spacing: 1px;
    margin-top: 10px;
    max-width: 800px;
    font-style: italic;
}

.home-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    pointer-events: none;
    margin-top: 0;
}

.home-content p {
    margin-top: 0;
}

section:not(#home) {
    position: relative;
    z-index: 10;
}

.spacer {
    height: 60vh;
    background: rgba(255, 255, 255, 0.6) !important;
    position: relative;
    z-index: 1;
}

section:not(.spacer):not(#home) {
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    padding: 80px 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60vh;
    justify-content: center;
    position: relative;
    z-index: 10;
}

header {
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 2000;
    background-color: #344E41;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.header-container {
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: 10px 15px;
    box-sizing: border-box;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: 0.3s;
}

nav a:hover {
    color: #C8E6C9;
}

section {
    padding: 80px 20px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    max-width: 1100px;
    /* Sedikit diperlebar agar 3 kolom galeri lebih leluasa */
    width: 100%;
}

section:nth-child(even):not(.spacer):not(#home) {
    background: linear-gradient(180deg, #DAD7CD 0%, #c4e6c7 100%) !important;
}

section:nth-child(odd):not(.spacer):not(#home) {
    background: linear-gradient(180deg, #e8f5e9 0%, #DAD7CD 100%) !important;
}

h2 {
    font-family: 'Satisfy', sans-serif;
    font-weight: 600;
    font-size: 2.2rem;
    color: #1B5E20;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

h2::after {
    content: '';
    width: 50px;
    height: 4px;
    background: #4CAF50;
    display: block;
    margin: 10px auto;
    border-radius: 2px;
}

/* --- INTEGRASI LOGIKA GALERI BARU --- */

.grid-galeri {
    display: grid;
    /* Desktop: 3 kolom tetap sejajar */
    grid-template-columns: repeat(3, 1fr);
    /* grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); */
    gap: 25px;
    width: 100%;
    align-items: start;
    /* Mengikuti tinggi konten masing-masing */
}

.card-galeri {
    padding: 15px;
    border-radius: 15px;
    background: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    min-width: 320px;
    /* Mencegah konten TikTok terpotong */
    height: auto;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    /* new */
    height: auto !important;
    overflow: visible !important;
    min-height: min-content !important;
}

.card-galeri:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.media-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #fdfdfd;
    height: auto;
    min-height: 100px;
    /* overflow: visible; */
}

/* Memastikan TikTok dan IG mengisi lebar card sepenuhnya */
.tiktok-embed,
.instagram-media {
    width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    /* height: fit-content; */
}

.instagram-media {
    margin: 0 !important;
    padding: 0 !important;
    /* width: 100% !important; */
    /* min-width: 100% !important; */
    /* position: relative !important; */
    /* height: max-content !important; */
    min-height: 650px !important;
}

.embed-caption {
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
    opacity: 0.8;
    font-style: italic;
    color: #344E41;
}

/* --- AKHIR INTEGRASI GALERI --- */

.grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    width: 100%;
}

.card {
    padding: 30px;
    border-radius: 15px;
    background: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
    /* new */
    height: fit-content;
}

.card:hover {
    transform: translateY(-5px);
    transform: scale(1.05);
}

#about {
    padding: 100px 20px;
    background: linear-gradient(180deg, #DAD7CD 0%, #e8f5e9 100%);
}

#about .container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

#about h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #3A5A40;
}

#about p {
    text-align: justify;
    line-height: 1.8;
    color: #444;
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding: 0 10px;
}

#about p:first-of-type {
    font-style: italic;
    color: #1B5E20;
    border-left: 4px solid #4CAF50;
    padding-left: 20px;
}

.kontak-lokasi-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    width: 100%;
}

.kontak-box,
.lokasi-box {
    flex: 1 1 400px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.kontak-box h3,
.lokasi-box h3 {
    text-align: center;
}

iframe {
    width: 100% !important;
    max-width: 100%;
    border-radius: 12px;
    margin-top: 15px;
    filter: grayscale(10%) contrast(90%);
    height: 300px;
}

.btn-wa {
    display: inline-block;
    background-color: #344E41;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-wa:hover {
    background-color: #25d366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    color: #344E41;
}

footer {
    background: #3A5A40;
    color: white;
    padding: 10px;
    text-align: center;
    font-style: italic;
    font-size: 0.8rem;
}

.social-media {
    margin-top: 10px;
    text-align: left;
}

.socmed-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-right: 15px;
    font-weight: 600;
    transition: 0.3s;
    font-size: 0.9rem;
}

.fb {
    color: #1877F2;
}

.ig {
    color: #E4405F;
}

.yt {
    color: #FF0000;
}

.socmed-link i {
    margin-right: 8px;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    font-size: 0.9rem;
}

.socmed-link:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

.icons-wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 15px;
}

.garis-pembatas {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 10px 0;
    width: 100%;
}

#backToTopBtn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 99;
    background: goldenrod;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    overflow: hidden;
}

#backToTopBtn:hover {
    background: #2E7D32;
}

#backToTopBtn:hover img {
    filter: invert(1);
}

#backToTopBtn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.menu-toggle {
    display: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .grid-galeri {
        grid-template-columns: repeat(2, 1fr);
        /* 2 kolom di tablet */
    }
    
    .instagram-media {
    /*margin: 0 !important;*/
    /*padding: 0 !important;*/
    /*width: 100% !important; */
    /*min-width: 100% !important; */
    /* position: relative !important; */
    /*height: max-content !important; */
    /*min-height: 900px !important;*/
    /*max-height: 300px !important;*/
    }
    
    .card {
    /*padding: 30px;*/
    /*border-radius: 15px;*/
    /*background: white;*/
    /*box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);*/
    /*border: 1px solid rgba(0, 0, 0, 0.03);*/
    /*transition: transform 0.3s ease;*/
    /* new */
    /*height: fit-content;*/
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .logo-1 {
        max-width: 140px;
    }

    #home p {
        font-size: 1.2rem;
        text-align: center;
        left: 50%;
    }
    
    .instagram-media {
        /*min-height: 70px !important;*/
    }

    .grid-galeri {
        grid-template-columns: 1fr;
        /* 1 kolom di HP */
    }

    .card-galeri {
        min-width: unset;
        /* Izinkan mengecil di HP */
        /*min-height: 700px !important;*/
    }

    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #344E41;
        position: fixed;
        top: 60px;
        left: 0;
        padding: 20px 0;
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1999;
    }

    nav.active {
        display: flex;
    }

    nav a {
        padding: 10px 0;
        display: block;
    }

    footer p {
        font-size: 0.85rem;
        font-style: italic;
        padding: 0 15px;
        line-height: 1.4;
    }
}

/* ===== FIX INSTAGRAM EMBED AGAR FLEXIBLE HEIGHT ===== */

/* Bungkus media harus fleksibel */
.media-container {
    /* display: flex;
    flex-direction: column;
    align-items: stretch; */
}

/* Paksa Instagram mengikuti tinggi konten */
.instagram-media {
    /* max-width: 100% !important; */
    /* width: 100% !important; */
    /* min-width: unset !important; */
    /* height: auto !important; */
}

/* Paksa iframe di dalam IG agar tidak terkunci */
.instagram-media iframe {
    width: 100% !important;
    min-height: 600px;
    /* aman untuk video vertikal */
    /* height: auto !important; */
    /* height: 100% !important; */
}

.instagram-media iframe {
    aspect-ratio: 9 / 16;
    /* height: auto !important; */
}