/**
 * Hurricane Project Gallery Styles
 * Modern, professional styling with smooth animations and masonry layout
 */

:root {
    --hurricane-primary: #ff6b35;
    --hurricane-dark: #1a1a1a;
    --hurricane-overlay: rgba(0, 0, 0, 0.8);
    --hurricane-transition: 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Gallery Container
   ========================================================================== */

.hurricane-gallery-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.hurricane-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Column width controls - set via Elementor */
.hurricane-gallery-item {
    flex: 0 0 auto;
}

/* ==========================================================================
   Gallery Items
   ========================================================================== */

.hurricane-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f5f5f5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all var(--hurricane-transition);
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: fadeInUp var(--hurricane-transition) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered animation delays */
.hurricane-gallery-item:nth-child(1) { animation-delay: 0ms; }
.hurricane-gallery-item:nth-child(2) { animation-delay: 50ms; }
.hurricane-gallery-item:nth-child(3) { animation-delay: 100ms; }
.hurricane-gallery-item:nth-child(4) { animation-delay: 150ms; }
.hurricane-gallery-item:nth-child(5) { animation-delay: 200ms; }
.hurricane-gallery-item:nth-child(6) { animation-delay: 250ms; }
.hurricane-gallery-item:nth-child(7) { animation-delay: 300ms; }
.hurricane-gallery-item:nth-child(8) { animation-delay: 350ms; }
.hurricane-gallery-item:nth-child(9) { animation-delay: 400ms; }
.hurricane-gallery-item:nth-child(10) { animation-delay: 450ms; }
.hurricane-gallery-item:nth-child(11) { animation-delay: 500ms; }
.hurricane-gallery-item:nth-child(12) { animation-delay: 550ms; }
.hurricane-gallery-item:nth-child(n+13) { animation-delay: 600ms; }

.hurricane-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--hurricane-transition);
}

/* ==========================================================================
   Hover Effects
   ========================================================================== */

/* Zoom Effect */
.hover-zoom .hurricane-gallery-item:hover img {
    transform: scale(1.1);
}

.hover-zoom .hurricane-gallery-item:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Lift Effect */
.hover-lift .hurricane-gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Fade Effect */
.hover-fade .hurricane-gallery-item:hover img {
    opacity: 0.85;
}

/* ==========================================================================
   Overlay Content
   ========================================================================== */

.hurricane-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hurricane-overlay);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 30px;
    opacity: 0;
    transition: opacity var(--hurricane-transition);
    z-index: 2;
}

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

.project-content {
    text-align: left;
    width: 100%;
    transform: translateY(20px);
    transition: transform var(--hurricane-transition);
}

.hurricane-gallery-item:hover .project-content {
    transform: translateY(0);
}

.project-product {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.project-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ==========================================================================
   Standard Project Items
   ========================================================================== */

.standard-item .project-image-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.standard-item .project-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Aspect Ratio Options */
.aspect-ratio-1-1 .project-image-wrapper,
.aspect-ratio-1-1 .ba-image-wrapper {
    aspect-ratio: 1 / 1;
}

.aspect-ratio-4-3 .project-image-wrapper,
.aspect-ratio-4-3 .ba-image-wrapper {
    aspect-ratio: 4 / 3;
}

.aspect-ratio-16-9 .project-image-wrapper,
.aspect-ratio-16-9 .ba-image-wrapper {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-21-9 .project-image-wrapper,
.aspect-ratio-21-9 .ba-image-wrapper {
    aspect-ratio: 21 / 9;
}

.aspect-ratio-3-4 .project-image-wrapper,
.aspect-ratio-3-4 .ba-image-wrapper {
    aspect-ratio: 3 / 4;
}

.aspect-ratio-9-16 .project-image-wrapper,
.aspect-ratio-9-16 .ba-image-wrapper {
    aspect-ratio: 9 / 16;
}

/* When aspect ratio is set, images should cover */
[class*="aspect-ratio-"] .project-image,
[class*="aspect-ratio-"] .ba-before-image,
[class*="aspect-ratio-"] .ba-after-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[class*="aspect-ratio-"] .ba-after-image {
    position: absolute;
    top: 0;
    left: 0;
}

/* ==========================================================================
   Before/After Items
   ========================================================================== */

.before-after-item {
    cursor: ew-resize;
}

.before-after-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.ba-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
}

.ba-before-image,
.ba-after-image {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

.ba-after-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: inset(0 50% 0 0);
    transition: clip-path 50ms ease-out;
}

.ba-after-overlay .ba-after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
}

/* Before/After Divider */
.ba-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: var(--hurricane-primary);
    transform: translateX(-50%);
    z-index: 3;
    transition: left 50ms ease-out;
}

/* Before/After Handle */
.ba-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    background: var(--hurricane-primary);
    border: 3px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: ew-resize;
    transition: all 200ms ease;
}

.ba-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ba-handle svg {
    width: 24px;
    height: 24px;
}

/* Before/After Labels */
.ba-label {
    position: absolute;
    top: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    z-index: 2;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ba-before-label {
    left: 20px;
}

.ba-after-label {
    right: 20px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.hurricane-gallery-grid.loading .hurricane-gallery-item {
    opacity: 0.5;
}

/* ==========================================================================
   Lightbox Cursor
   ========================================================================== */

.hurricane-gallery-item[data-lightbox="true"] {
    cursor: pointer;
}

.hurricane-gallery-item[data-lightbox="true"]:hover::after {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    z-index: 3;
    opacity: 0;
    transition: opacity 300ms ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3Cpath d='M21 3l-7 7'/%3E%3Cpath d='M3 21l7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
}

.hurricane-gallery-item[data-lightbox="true"]:hover::after {
    opacity: 1;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .project-product {
        font-size: 20px;
    }
    
    .project-description {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .hurricane-gallery-overlay {
        padding: 20px;
    }
    
    .project-product {
        font-size: 18px;
    }
    
    .project-description {
        font-size: 12px;
    }
    
    .ba-handle {
        width: 40px;
        height: 40px;
    }
    
    .ba-label {
        font-size: 11px;
        padding: 6px 12px;
        top: 15px;
    }
    
    .ba-before-label {
        left: 15px;
    }
    
    .ba-after-label {
        right: 15px;
    }
}

@media (max-width: 480px) {
    .hurricane-gallery-wrapper {
        padding: 10px 0;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .hurricane-gallery-overlay {
        display: none;
    }
    
    .hurricane-gallery-item {
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.hurricane-gallery-item:focus {
    outline: 3px solid var(--hurricane-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .hurricane-gallery-item,
    .hurricane-gallery-item img,
    .hurricane-gallery-overlay,
    .project-content,
    .ba-handle {
        animation: none;
        transition: none;
    }
}

/* ==========================================================================
   Lightbox Styles
   ========================================================================== */

.hurricane-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.hurricane-lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.hurricane-lightbox-content {
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hurricane-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-before-after {
    width: 100%;
    max-width: 1400px;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-before-after .ba-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #000;
}

.lightbox-before-after .ba-before-image {
    width: 100%;
    height: auto;
    max-height: 85vh;
    display: block;
    object-fit: contain;
}

.lightbox-before-after .ba-after-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: inset(0 50% 0 0);
    transition: clip-path 50ms ease-out;
}

.lightbox-before-after .ba-after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 85vh;
    display: block;
    object-fit: contain;
}

.hurricane-lightbox-caption {
    text-align: center;
    color: #ffffff;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.hurricane-lightbox-caption h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.hurricane-lightbox-caption p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.hurricane-lightbox-close,
.hurricane-lightbox-prev,
.hurricane-lightbox-next {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 300ms ease;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.hurricane-lightbox-close:hover,
.hurricane-lightbox-prev:hover,
.hurricane-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.hurricane-lightbox-close {
    top: 20px;
    right: 20px;
}

.hurricane-lightbox-prev {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.hurricane-lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.hurricane-lightbox-next {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.hurricane-lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
    .hurricane-lightbox-close,
    .hurricane-lightbox-prev,
    .hurricane-lightbox-next {
        width: 40px;
        height: 40px;
    }
    
    .hurricane-lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .hurricane-lightbox-prev {
        left: 10px;
    }
    
    .hurricane-lightbox-next {
        right: 10px;
    }
    
    .hurricane-lightbox-caption h3 {
        font-size: 20px;
    }
    
    .hurricane-lightbox-caption p {
        font-size: 14px;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .hurricane-gallery-item {
        background: #2a2a2a;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}
