/* ===== Gallery Page ===== */

html:has(.gallery-page),
.gallery-page {
    height: auto;
    min-height: 100%;
    background: #0D8E8E;
}

/* ===== Scroll Navbar ===== */
.scroll-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: transparent;
    transform: translateY(-100%);
    transition: transform 0.5s ease;
}

.scroll-navbar.visible {
    transform: translateY(0);
}

/* Logo */
.gallery-page .hero-logo {
    position: fixed;
    top: 24px;
    left: 32px;
    z-index: 501;
    width: 180px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transform: translateY(-200%);
    transition: transform 0.5s ease;
}

.gallery-page .hero-logo.visible {
    transform: translateY(0);
}

/* ===== Gallery Hero ===== */
.gallery-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #87CEEB 0%, #B0DEFF 40%, #D6ECFF 70%, #0D8E8E 100%);
}

/* Sun doodle */
.gallery-sun {
    position: absolute;
    top: 12%;
    right: 15%;
    z-index: 15;
    width: 110px;
    height: auto;
    animation: galSunRotate 20s linear infinite, galSunGlow 3s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 12px rgba(245, 185, 24, 0.6));
}

@keyframes galSunRotate {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes galSunGlow {
    0%   { filter: drop-shadow(0 0 10px rgba(245, 185, 24, 0.4)); }
    100% { filter: drop-shadow(0 0 25px rgba(245, 185, 24, 0.8)); }
}

/* Birds — bigger */
.gbird {
    position: absolute;
    z-index: 15;
}

.gbird--1 {
    width: 50px;
    top: 20%;
    left: 10%;
    animation: gbirdFly1 14s linear infinite;
}

.gbird--2 {
    width: 42px;
    top: 30%;
    left: 40%;
    animation: gbirdFly2 18s linear infinite;
}

.gbird--3 {
    width: 55px;
    top: 15%;
    left: 65%;
    animation: gbirdFly1 16s linear 3s infinite;
}

.gbird--4 {
    width: 38px;
    top: 35%;
    left: 20%;
    animation: gbirdFly2 20s linear 5s infinite;
}

.gbird--5 {
    width: 46px;
    top: 25%;
    left: 80%;
    animation: gbirdFly1 17s linear 7s infinite;
}

@keyframes gbirdFly1 {
    0%   { transform: translateX(0) translateY(0); }
    25%  { transform: translateX(10vw) translateY(-15px); }
    50%  { transform: translateX(20vw) translateY(8px); }
    75%  { transform: translateX(30vw) translateY(-10px); }
    100% { transform: translateX(40vw) translateY(0); opacity: 0; }
}

@keyframes gbirdFly2 {
    0%   { transform: translateX(0) translateY(0); }
    25%  { transform: translateX(-8vw) translateY(-12px); }
    50%  { transform: translateX(-16vw) translateY(6px); }
    75%  { transform: translateX(-24vw) translateY(-8px); }
    100% { transform: translateX(-32vw) translateY(0); opacity: 0; }
}

.gallery-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 24px;
}

.gallery-heading {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    min-height: 120px;
    margin-bottom: 24px;
    width: 100%;
    overflow: visible;
}

.gallery-heading svg {
    display: block;
    overflow: visible;
}

.gallery-tagline {
    font-family: 'Zen Dots', cursive;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--navy);
    line-height: 1.8;
}

.tagline-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px);
}

/* Scroll indicator */
.scroll-indicator {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 3px solid rgba(255, 255, 255, 0.5);
    border-bottom: 3px solid rgba(255, 255, 255, 0.5);
    transform: rotate(45deg);
    animation: bounceArrow 2s ease-in-out infinite;
}

@keyframes bounceArrow {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.5; }
    50%      { transform: rotate(45deg) translateY(10px); opacity: 1; }
}

/* ===== Gallery Section ===== */
.gallery-section {
    padding: 80px 24px 120px;
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #0D8E8E 0%, #0D8E8E 80%, #0a7a7a 100%);
}

/* ===== Masonry Grid ===== */
.gallery-masonry {
    max-width: 1200px;
    margin: 0 auto;
    columns: 3;
    column-gap: 20px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.5s ease;
}

/* Shimmer sweep */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    z-index: 3;
    transition: left 0.6s ease;
    pointer-events: none;
}

.gallery-item:hover::before {
    left: 100%;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35),
                0 0 20px rgba(234, 95, 92, 0.15);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1),
                filter 0.5s ease;
    filter: saturate(0.9);
}

.gallery-item:hover img {
    transform: scale(1.08);
    filter: saturate(1.15) brightness(1.05);
}

/* Overlay with label */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-label {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-label {
    transform: translateY(0);
}

/* Coral accent corners */
.gallery-item::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 40px;
    height: 40px;
    border: 3px solid #EA5F5C;
    border-right: none;
    border-bottom: none;
    border-radius: 6px 0 0 0;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.4s ease, width 0.4s ease, height 0.4s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
    width: 55px;
    height: 55px;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(10px);
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    position: relative;
    text-align: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox.open .lightbox-img {
    transform: scale(1);
}

.lightbox-caption {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 16px;
    letter-spacing: 1px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease, color 0.3s ease;
    line-height: 1;
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.2);
    color: #EA5F5C;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: #EA5F5C;
    border-color: #EA5F5C;
    transform: translateY(-50%) scale(1.1);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .gallery-masonry { columns: 2; }
}

@media (max-width: 768px) {
    .gallery-page .hero-logo { width: 140px; }
    .gallery-heading { min-height: 80px; }
    .gallery-tagline { font-size: 0.85rem; }
    .gallery-sun { width: 80px; }
    .gbird--4, .gbird--5 { display: none; }
    .gallery-section { padding: 60px 16px 80px; }
    .gallery-masonry { columns: 2; column-gap: 14px; }
    .gallery-item { margin-bottom: 14px; }
    .gallery-overlay { opacity: 1; }
    .gallery-label { transform: translateY(0); }
    .gallery-item::after { opacity: 0.5; }
}

@media (max-width: 580px) {
    .scroll-navbar { padding: 10px 16px; }
    .gallery-hero { height: 80vh; }
    .gallery-page .hero-logo { width: 120px; top: 14px; left: 14px; }
    .gallery-heading { min-height: 60px; }
    .gallery-tagline { font-size: 0.78rem; }
    .gallery-sun { width: 60px; top: 8%; right: 6%; }
    .gbird--1 { width: 35px; }
    .gbird--2 { width: 30px; }
    .gbird--3 { width: 38px; }
    .gallery-masonry { columns: 1; max-width: 450px; }
    .gallery-section { padding: 40px 16px 60px; }
    .lightbox-prev { left: 8px; width: 40px; height: 40px; font-size: 1.2rem; }
    .lightbox-next { right: 8px; width: 40px; height: 40px; font-size: 1.2rem; }
}
