/* =========================================
   GALLERY CAROUSEL - Swiper Implementation
   Matches Figma Design Pixel-Perfect
   ========================================= */

/* --- Base Gallery Section --- */

.section-gallery {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
    /* Mobile/tablet: prevent overflow */
}
/* --- Swiper Container --- */

.section-gallery .swiper {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    /* Important: allows slides to peek outside */
    position: relative;
}
.section-gallery .swiper-wrapper {
    display: flex;
    align-items: flex-end;
}
.section-gallery .swiper-slide {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    /* All slides visible by default */
}
.section-gallery .gallery-image {
    width: 100%;
    height: 400px;
    height: 14.9375rem;
    object-fit: cover;
    border-radius: 0;
    display: block;
}
.project-image-inner {
    width: 100%;
    height: 400px;
    height: 14.9375rem;
    object-fit: cover;
    border-radius: 0;
    display: block;
}
.section-gallery .gallery-image img {
    clip-path: polygon( 0 0, /* Top Left */
    calc(100% - 3rem) 0, /* Top Edge (Stop 4rem before the right) */
    100% 3rem, /* Right Edge (Start 4rem down from top) */
    100% 100%, /* Bottom Right */
    0 100%/* Bottom Left */
    );
    object-fit: cover;
    height: 100%;
    width: 100%;
}
.project-image-container img {
    clip-path: polygon( 0 0, /* Top Left */
    calc(100% - 3rem) 0, /* Top Edge (Stop 4rem before the right) */
    100% 3rem, /* Right Edge (Start 4rem down from top) */
    100% 100%, /* Bottom Right */
    0 100%/* Bottom Left */
    );
    object-fit: cover;

    width: 100%;
}
.section-gallery .swiper-slide {
    padding-bottom: 0;
    transition: .4s;
}
.section-gallery .swiper-slide.swiper-slide-active {
    padding-bottom: 4.5rem;
}
body .section-projects .gallery-pagination {
    margin-top: -4.5rem;
    padding: 0;
}
.section-gallery .swiper-slide:nth-child(even) {}
/* --- Pagination Controls (Figma Design) --- */

.gallery-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
}
/* --- Dots Navigation --- */

.gallery-dots {
    display: flex;
    gap: 17.8px;
    align-items: center;
}
.gallery-dot {
    width: 8px;
    height: 8px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}
.gallery-dot .dot-inner {
    width: 100%;
    height: 100%;
    border: 2px solid var(--black-seku);
    border-radius: 4px;
    transition: border-width 0.3s ease;
}
.gallery-dot.swiper-pagination-bullet-active .dot-inner {
    border-width: 4px;
}
.gallery-dot:hover .dot-inner {
    opacity: 0.7;
}
.gallery-dot:nth-child(10) ~ .gallery-dot {
    display:none;
}
/* --- Page Counter with Arrows --- */

.gallery-controls {
    border: 1px solid var(--black-seku);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    height: 54px;
    background: var(--white-seku);
}
.gallery-arrow {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease;
}
.gallery-arrow:hover {
    opacity: 0.7;
}
.gallery-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.gallery-arrow img {
    width: 24px;
    height: 24px;
    display: block;
}
.gallery-counter {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    line-height: 1;
    font-family: var(--font-body);
    color: var(--black-seku);
    user-select: none;
}
.gallery-separator {
    color: var(--black-seku);
}
.section-gallery .swiper-wrapper {
    min-height: 326px
}
.section-gallery.section-projects .swiper-wrapper {
    min-height: 685.2px
}
/* =========================================
   TABLET (1280px) GALLERY
   ========================================= */

@media (min-width: 1280px) {
    .section-gallery {
        padding: 152px 32px;
    }
    .section-gallery .gallery-image {
        height: 28.25rem;
        max-width: 70rem;
    }
    .project-image-inner {
        height: 28.25rem;
        max-width: 70rem;
    }
    .gallery-pagination {
        margin: 0 auto;
    }
    .section-gallery .swiper-wrapper {
        min-height: 798px;
    }
    .section-gallery.section-projects .swiper-wrapper {
        min-height: 798px;
    }
}
@media (min-width: 1440px) {
    .section-gallery .gallery-image {
        height: 44.3415rem;
        max-width: 70rem;
    }
    .project-image-inner {
        height: 44.3415rem;
        max-width: 70rem;
    }
}
/* =========================================
   DESKTOP (1440px) GALLERY - Figma Perfect
   Gap: 176px between carousel and pagination
   Padding: 0 160px (handled by container)
   ========================================= */

@media (min-width: 1440px) {
    .section-gallery {
        padding: 9.5rem 0;
        /* Figma: 0px 160px 0px 160px */
        gap: 6rem;
        /* Figma exact spacing */
    }
    /* Gallery container - full width within padding */
    .section-gallery .swiper {
        max-width: 100%;
        /* Full width of padded container */
        width: 100%;
        margin: 0;
        padding: 0;
        overflow: visible;
        /* Critical for peek */
    }
    /* Gallery images - 600px height on desktop */
    .section-gallery .gallery-image {
        width: 100%;
        object-fit: cover;
    }
    .project-image-inner img {
        width: 100%;
        object-fit: cover;
    }
    .section-gallery .gallery-image img {
        clip-path: polygon(0 0, calc(100% - 8rem) 0, 100% 8rem, 100% 100%, 0 100%);
    }
    .project-image-container img {
        clip-path: polygon(0 0, calc(100% - 8rem) 0, 100% 8rem, 100% 100%, 0 100%);
    }
    /* Pagination controls - no extra constraints */
    .gallery-pagination {}
}
/* =========================================
   SWIPER CUSTOM OVERRIDES
   ========================================= */

/* Remove default Swiper pagination styles */

.section-gallery .swiper-pagination {
    position: static;
    display: flex;
    gap: 17.8px;
}
/* Smooth transitions */

.section-gallery .swiper-slide {
    transition: opacity 0.4s ease, transform 0.4s ease, padding 0.4s ease;
}
/* Inactive slides slightly faded (optional) */

.section-gallery .swiper-slide:not(.swiper-slide-active) {
    opacity: 0.85;
}
/* Active slide full opacity */

.section-gallery .swiper-slide-active {
    opacity: 1;
}
/* Loading state */

.section-gallery .swiper-slide img {}
/* =========================================
   ACCESSIBILITY
   ========================================= */

/* Focus styles for keyboard navigation */

.gallery-arrow:focus, .gallery-dot:focus {
    outline: 2px solid var(--orange-seku);
    outline-offset: 2px;
}
/* Screen reader only text */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
/* =========================================
   RESPONSIVE FINE-TUNING
   ========================================= */

/* Mobile: Show partial next slide */

@media (max-width: 767px) {
    .section-gallery .swiper {
        /* Show peek of next slide */
    }
    .project-wrapper {
        padding: 0;
    }
}
/* Tablet: Show 2 slides */

@media (min-width: 768px) and (max-width: 1023px) {
    .section-gallery .swiper-slide {}
}
/* Desktop: Show 2.5 slides for better UX */

@media (min-width: 1024px) {
    body .section-projects .gallery-pagination {
        margin-top: 0;
    }
}
@media (min-width: 1440px) {
    .section-gallery .swiper {
        overflow: visible;
    }
}
/* =========================================
   ANIMATIONS
   ========================================= */

/* Smooth slide transitions */

.section-gallery .swiper-wrapper {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
/* Arrow hover animation */

.gallery-arrow {
    transition: transform 0.2s ease, opacity 0.3s ease;
}
.gallery-arrow:hover:not(:disabled) {
    transform: scale(1.1);
}
.gallery-arrow:active:not(:disabled) {
    transform: scale(0.95);
}
/* Dot animation on click */

.gallery-dot:active {
    transform: scale(0.9);
}
/* =========================================
   PROJECT SLIDER (White Controls Variant)
   ========================================= */

/* White Dots */

.project-pagination .gallery-dot .dot-inner {
    border-color: var(--white-seku);
}
.project-pagination .gallery-dot.swiper-pagination-bullet-active .dot-inner {
    background-color: var(--white-seku);
}
/* White Controls Box */

.project-pagination .gallery-controls.white-controls {
    border-color: var(--white-seku);
    background: transparent;
    /* Keep transparent or use specific color */
    color: var(--white-seku);
}
/* White Text in Counter */

.project-pagination .gallery-counter {
    color: var(--white-seku);
}
.project-pagination .gallery-separator {
    color: var(--white-seku);
}
/* Invert Icons for White Theme (if using SVG masks or filters) */

/* Alternatively, imply that the images used are already correct or use filter */

.project-pagination .gallery-arrow img {
    filter: brightness(0) invert(1);
    /* Turns black icons to white */
}
/* Adjust layout for Projects specifically if needed */

.section-projects .gallery-pagination {
    z-index: 10;
    position: relative;
    max-width: var(--site-max-width);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding: 0 32px;
    margin-top: 0;
    /* Mobile Padding */
}
@media (min-width: 1280px) {
    .section-projects .gallery-pagination {
        padding: 0;
        /* Reset on larger screens if handled by container */
    }
}
/* Project Image Sizing in Slider context */

.section-projects .project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Reset styles for Swiper slide to allow Project Layout */

.section-projects .swiper-slide {
    height: auto;
    display: block;
    /* Reset flex from gallery default */
}
.section-projects .swiper-slide .floating-border {
    opacity: 0;
    transition: .4s;
}
.section-projects .swiper-slide.swiper-slide-active .floating-border {
    opacity: 1;
}