/* ================================================
   yogakrupual.com — Custom Styles
   ================================================ */

html { scroll-behavior: smooth; }

/* -----------------------------------------------
   Hero
----------------------------------------------- */
.hero-bg {
    background: linear-gradient(135deg, #2D5038 0%, #4A7C59 50%, #3A6347 100%);
    position: relative;
    overflow: hidden;
}
.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* -----------------------------------------------
   Card Effects
----------------------------------------------- */
.card-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.10);
}

.img-zoom { overflow: hidden; }
.img-zoom img {
    transition: transform 0.4s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.img-zoom:hover img { transform: scale(1.07); }

/* -----------------------------------------------
   Section Title Decorator
----------------------------------------------- */
.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #C8884A;
}

/* -----------------------------------------------
   YouTube Responsive Embed
----------------------------------------------- */
.video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 0.75rem 0.75rem 0 0;
}
.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* -----------------------------------------------
   Schedule Badge
----------------------------------------------- */
.badge-open   { display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:500;background:#dcfce7;color:#15803d; }
.badge-full   { display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:500;background:#fee2e2;color:#dc2626; }

/* -----------------------------------------------
   Lightbox
----------------------------------------------- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* -----------------------------------------------
   Gallery Grid
----------------------------------------------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.gallery-grid .gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}
.gallery-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-grid .gallery-item:hover img { transform: scale(1.08); }

/* -----------------------------------------------
   Fade-in animation
----------------------------------------------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeInUp 0.5s ease forwards; }

/* -----------------------------------------------
   Scroll to top button
----------------------------------------------- */
#scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: #4A7C59;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(74,124,89,0.4);
}
#scroll-top.visible { opacity: 1; pointer-events: auto; }
#scroll-top:hover   { background: #3A6347; }

/* -----------------------------------------------
   Line-clamp utilities (fallback)
----------------------------------------------- */
.clamp-2 { display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.clamp-3 { display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden; }

/* -----------------------------------------------
   Gallery Hero Banner
----------------------------------------------- */
.gallery-hero {
    min-height: 320px;
    position: relative;
}
.gallery-hero-mosaic {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}
.gallery-hero-mosaic .mosaic-cell {
    overflow: hidden;
}
.gallery-hero-mosaic .mosaic-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.05);
    filter: blur(1px);
}

/* -----------------------------------------------
   Album Filter Tabs
----------------------------------------------- */
.album-tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: .8rem;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    border: 1.5px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
    text-decoration: none;
}
.album-tab:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}
.album-tab-active {
    background: #fff !important;
    color: #4A7C59 !important;
    border-color: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* -----------------------------------------------
   Album Card Cover
----------------------------------------------- */
.album-card-cover {
    height: 220px;
    background: #f1ede8;
}

/* -----------------------------------------------
   Masonry Gallery Grid
----------------------------------------------- */
.masonry-gallery {
    column-count: 4;
    column-gap: 10px;
}
@media (max-width: 900px)  { .masonry-gallery { column-count: 3; } }
@media (max-width: 600px)  { .masonry-gallery { column-count: 2; } }

.masonry-item {
    break-inside: avoid;
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    display: block;
}
.masonry-item img {
    width: 100%;
    display: block;
    border-radius: 10px;
    transition: transform 0.35s ease;
}
.masonry-item:hover img {
    transform: scale(1.04);
}
.masonry-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    color: #fff;
    font-size: .72rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 0 0 10px 10px;
}
.masonry-overlay {
    position: absolute;
    inset: 0;
    background: rgba(74,124,89,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 10px;
}
.masonry-item:hover .masonry-caption,
.masonry-item:hover .masonry-overlay {
    opacity: 1;
}

/* -----------------------------------------------
   Gallery Lightbox (custom)
----------------------------------------------- */
.gl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.gl-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.gl-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}
.gl-img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.gl-caption {
    color: rgba(255,255,255,.7);
    font-size: .82rem;
    margin-top: 10px;
    text-align: center;
}
.gl-counter {
    color: rgba(255,255,255,.4);
    font-size: .72rem;
    margin-top: 4px;
}
.gl-close {
    position: fixed;
    top: 18px;
    right: 22px;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10000;
}
.gl-close:hover { background: rgba(255,255,255,.25); }
.gl-prev, .gl-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10000;
}
.gl-prev { left: 16px; }
.gl-next { right: 16px; }
.gl-prev:hover, .gl-next:hover { background: rgba(255,255,255,.3); }

/* -----------------------------------------------
   Hero Swiper (Slider ภาพ)
----------------------------------------------- */
.hero-swiper { width:100%; }
.hero-swiper .swiper-slide .slider-img {
    width: 100%;
    height: 88vh;
    min-height: 560px;
    max-height: 860px;
    object-fit: cover;
    object-position: center center;
    display: block;
}
@media (max-width: 768px) {
    .hero-swiper .swiper-slide .slider-img { height: 70vw; min-height: 320px; max-height: 560px; }
}
@media (max-width: 480px) {
    .hero-swiper .swiper-slide .slider-img { height: 80vw; min-height: 260px; max-height: 420px; }
}
.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
    color: #fff;
    background: rgba(0,0,0,0.35);
    border-radius: 50%;
    width: 44px;
    height: 44px;
}
.hero-swiper .swiper-button-prev::after,
.hero-swiper .swiper-button-next::after { font-size: 1.1rem; font-weight: 700; }
.hero-swiper .swiper-pagination-bullet-active { background: #4A7C59; }
