/* Gallery Page Styles - Premium Astrophotography Portfolio */

/* CSS Custom Properties - Rich Deep Teal & Forest Theme */
:root {
    /* Core dark backgrounds */
    --space-black: #010a09;
    --space-deep: #011a16;
    --space-dark: #013220;

    /* Rich teal gradient spectrum */
    --nebula-deep: #003333;
    --nebula-primary: #004B49;
    --nebula-glow: #005855;
    --nebula-accent: #007872;
    --nebula-light: #00a89d;
    --nebula-bright: #00d4c8;

    /* Complementary forest greens */
    --forest-deep: #012b1d;
    --forest-primary: #013220;
    --forest-accent: #024d30;
    --jewel-emerald: #015f3d;

    /* Luminous highlights */
    --star-white: #e8f5f4;
    --star-glow: #b8ece8;
    --star-dim: #7fb8b5;

    /* Glass effects with depth */
    --cosmic-glass: rgba(0, 75, 73, 0.15);
    --cosmic-glass-hover: rgba(0, 120, 114, 0.25);
    --cosmic-glass-deep: rgba(0, 51, 51, 0.4);
    --border-subtle: rgba(0, 168, 157, 0.2);
    --border-accent: rgba(0, 120, 114, 0.4);
    --border-glow: rgba(0, 212, 200, 0.5);

    /* Legacy aliases for backward compatibility */
    --nebula-orange: var(--nebula-primary);

    --font-display: 'Orbitron', monospace;
    --font-body: 'Space Grotesk', sans-serif;

    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset for gallery page */
.gallery-page {
    background: var(--space-black);
    color: var(--star-white);
    overflow-x: hidden;
    overflow-y: auto !important;
    min-height: 100vh;
}

/* Pitch Black Void with Subtle Stars */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: #000000;
}

.stars-bg::before,
.stars-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 50px 60px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 120px 140px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 200px 90px, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(1px 1px at 280px 180px, rgba(255, 255, 255, 0.25), transparent),
        radial-gradient(1px 1px at 350px 50px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 420px 200px, rgba(255, 255, 255, 0.2), transparent);
    background-size: 500px 300px;
    animation: subtle-twinkle 12s ease-in-out infinite;
}

.stars-bg::after {
    background-image:
        radial-gradient(1px 1px at 80px 120px, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(1px 1px at 180px 40px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 300px 160px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 400px 80px, rgba(255, 255, 255, 0.12), transparent);
    background-size: 600px 350px;
    animation-delay: -6s;
    opacity: 0.6;
}

@keyframes subtle-twinkle {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

/* Header */
.gallery-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 40px;
    background: transparent;
    transition: all 0.4s var(--transition-smooth);
}

.gallery-header.scrolled {
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 15px 40px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--nebula-light), var(--nebula-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tagline {
    font-family: var(--font-body);
    font-size: 0.75em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--star-dim);
    opacity: 0.8;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--nebula-accent), var(--nebula-primary));
    border: none;
    border-radius: 30px;
    color: var(--star-white);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(45, 90, 74, 0.4);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(45, 90, 74, 0.6);
}

.nav-cta svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s var(--transition-smooth);
}

.nav-cta:hover svg {
    transform: translateX(4px);
}

/* Minimal Hero Section - The Void */
.hero.hero-minimal {
    display: none;
}

/* Gallery Section - Orbital Black Hole Gallery */
.gallery-section {
    position: relative;
    padding: 100px 0 40px;
    z-index: 1;
    display: block;
    overflow: visible;
}

/* Black Hole Center Effect */
.black-hole-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 0;
}

.black-hole-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #000 0%, #000 40%, transparent 70%);
    border-radius: 50%;
    box-shadow:
        0 0 60px 30px rgba(0, 0, 0, 0.9),
        0 0 100px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 30px 10px rgba(0, 0, 0, 1);
}

.black-hole-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border: 2px solid transparent;
    border-radius: 50%;
    background:
        linear-gradient(#000, #000) padding-box,
        linear-gradient(135deg, var(--nebula-accent), transparent, var(--nebula-primary)) border-box;
    animation: ring-pulse 4s ease-in-out infinite;
    opacity: 0.6;
}

.black-hole-ring::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
            transparent 50%,
            rgba(0, 75, 73, 0.1) 60%,
            rgba(0, 75, 73, 0.05) 80%,
            transparent 100%);
    animation: accretion-disk 20s linear infinite;
}

@keyframes ring-pulse {

    0%,
    100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@keyframes accretion-disk {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Gravitational Lensing Effect */
.gravity-field {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.4) 30%,
            transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* Gallery Loading */
.gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 60px;
    color: var(--star-dim);
    z-index: 10;
}

/* Gallery Carousel Container - Orbital */
.gallery-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 0;
    z-index: 2;
}

/* Gallery Grid - Masonry Columns Layout (No Gaps) */
.gallery-grid {
    column-count: 3;
    column-gap: 20px;
    padding: 20px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* Responsive Columns */
@media (max-width: 1200px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        column-count: 1;
        padding: 15px;
    }
}

/* Carousel Navigation Arrows - Orbital Style */
.carousel-nav {
    display: none;
}

.carousel-nav:hover {
    background: rgba(0, 100, 98, 0.4);
    border-color: var(--nebula-light);
    box-shadow: 0 0 30px rgba(0, 133, 128, 0.4);
}

.carousel-nav svg {
    width: 28px;
    height: 28px;
    color: var(--nebula-light);
    transition: all 0.3s ease;
}

.carousel-nav:hover svg {
    color: var(--star-white);
}

.carousel-nav.prev {
    left: 30px;
}

.carousel-nav.next {
    right: 30px;
}

/* Gallery Card - Masonry Item */
.gallery-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
    opacity: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    border: 3px solid var(--nebula-deep);
    box-shadow:
        inset 0 0 20px rgba(0, 168, 157, 0.1),
        0 0 0 6px var(--space-deep),
        0 0 0 8px var(--nebula-primary),
        0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Inner matte frame overlay */
/* Inner matte frame overlay restored */
.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(0, 168, 157, 0.15);
    pointer-events: none;
    z-index: 5;
}

.gallery-card.visible {
    opacity: 1;
}

/* Removed gravity pull effects */
.gallery-card.gravity-left,
.gallery-card.gravity-right {
    opacity: 1;
    transform: none;
    filter: none;
}

.gallery-card.gravity-center {
    opacity: 1;
    filter: brightness(1);
    transform: none;
    border: none;
    box-shadow: none;
}

.gallery-card:hover {
    transform: scale(1.02);
    border-color: var(--nebula-light);
    box-shadow:
        inset 0 0 30px rgba(0, 212, 200, 0.2),
        0 0 0 8px var(--space-deep),
        0 0 0 12px var(--nebula-light),
        0 15px 40px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.gallery-card-image {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
}

.gallery-card-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background: #000;
    transition: transform 0.8s ease;
}

.gallery-card:hover .gallery-card-image img {
    transform: none;
    filter: none;
}

.gallery-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            transparent 60%,
            rgba(0, 0, 0, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s var(--transition-smooth);
}

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

.view-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.4s var(--transition-bounce);
}

.gallery-card:hover .view-icon {
    transform: scale(1);
    opacity: 1;
}

.view-icon svg {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.9);
}

/* Gallery Card Info - Hidden by default for minimal look */
.gallery-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s var(--transition-smooth);
}

.gallery-card:hover .gallery-card-info {
    opacity: 1;
    transform: translateY(0);
}

.gallery-card-info h3 {
    font-family: var(--font-display);
    font-size: 0.9em;
    font-weight: 400;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.9);
}

.gallery-card-type {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* Explore CTA Section - Minimal Dark */
.explore-cta {
    position: relative;
    padding: 80px 40px;
    text-align: center;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-content h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.1rem;
    color: var(--star-dim);
    margin-bottom: 40px;
    line-height: 1.7;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: transparent;
    border: 2px solid var(--nebula-accent);
    border-radius: 50px;
    color: var(--nebula-light);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.4s var(--transition-smooth);
}

.cta-button:hover {
    background: var(--nebula-accent);
    color: var(--star-white);
    box-shadow: 0 0 40px rgba(45, 90, 74, 0.5);
}

.cta-button svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s var(--transition-smooth);
}

.cta-button:hover svg {
    transform: rotate(360deg);
}

/* Footer */
.gallery-footer {
    position: relative;
    padding: 60px 40px 30px;
    border-top: 1px solid var(--border-subtle);
    z-index: 1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--nebula-orange);
    display: block;
    margin-bottom: 10px;
}

.footer-brand p {
    color: var(--star-dim);
    font-size: 0.9em;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--star-dim);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--nebula-orange);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-subtle);
}

.footer-bottom p {
    color: var(--star-dim);
    font-size: 0.85em;
    opacity: 0.7;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--transition-smooth);
}

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

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 10, 0.97);
    backdrop-filter: blur(10px);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--nebula-accent);
    border-color: var(--nebula-accent);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    color: var(--star-white);
}

.lightbox-close:hover svg {
    color: var(--space-black);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(45, 90, 74, 0.3);
    border-color: var(--nebula-accent);
}

.lightbox-nav svg {
    width: 28px;
    height: 28px;
    color: var(--star-white);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: all 0.4s var(--transition-smooth);
}

.lightbox.active .lightbox-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition-delay: 0.1s;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transition: opacity 0.3s ease;
}

.lightbox-info {
    margin-top: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.lightbox-info h2 {
    font-family: var(--font-display);
    font-size: 1.5em;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--nebula-orange);
}

.lightbox-info #lightbox-type {
    font-size: 0.9em;
    color: var(--star-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lightbox-info #lightbox-counter {
    font-size: 0.8em;
    color: var(--star-dim);
    opacity: 0.6;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .gallery-grid {
        padding: 50px calc(50vw - 240px);
        gap: 40px;
    }

    .gallery-card {
        flex: 0 0 480px;
        min-width: 480px;
        max-width: 480px;
    }

    .black-hole-container {
        width: 150px;
        height: 150px;
    }

    .black-hole-core {
        width: 60px;
        height: 60px;
    }

    .black-hole-ring {
        width: 140px;
        height: 140px;
    }

    .gravity-field {
        width: 300px;
        height: 300px;
    }

    .carousel-nav {
        width: 50px;
        height: 50px;
    }

    .carousel-nav.prev {
        left: 20px;
    }

    .carousel-nav.next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-header {
        padding: 15px 20px;
    }

    .gallery-header.scrolled {
        padding: 12px 20px;
    }

    .logo-text {
        font-size: 1.1em;
    }

    .nav-cta {
        padding: 10px 18px;
        font-size: 0.75em;
    }

    .nav-cta span {
        display: none;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 15px;
        padding: 25px 40px;
        border-radius: 20px;
    }

    .stat-divider {
        width: 60px;
        height: 1px;
    }

    .gallery-section {
        padding: 60px 0 40px;
    }

    .black-hole-container {
        width: 100px;
        height: 100px;
        opacity: 0.5;
    }

    .black-hole-core {
        width: 40px;
        height: 40px;
    }

    .black-hole-ring {
        width: 90px;
        height: 90px;
    }

    .gravity-field {
        width: 200px;
        height: 200px;
    }

    .gallery-carousel-wrapper {
        padding: 0;
    }

    .gallery-grid {
        padding: 40px calc(50vw - 140px);
        gap: 25px;
    }

    .gallery-card {
        flex: 0 0 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .gallery-card-image {
        aspect-ratio: 16/10;
    }

    .carousel-nav {
        width: 44px;
        height: 44px;
    }

    .carousel-nav.prev {
        left: 10px;
    }

    .carousel-nav.next {
        right: 10px;
    }

    .carousel-nav svg {
        width: 20px;
        height: 20px;
    }

    .explore-cta {
        padding: 80px 20px;
    }

    .cta-button {
        padding: 15px 30px;
        font-size: 0.9em;
    }

    .lightbox-nav {
        width: 45px;
        height: 45px;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .title-line.accent {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .gallery-card-info {
        padding: 15px;
    }

    .gallery-card-info h3 {
        font-size: 1em;
    }
}