/* =============================================
   Nos Réalisations - Custom Styles
   ============================================= */

/* Breadcrumb Area - Ensure proper stacking */
.tp-breadcrumb__area {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

/* Global container fix for mobile */
#galeries-photos .container,
#galerie-3d .container,
#galeries-videos .container,
#publications .container {
    width: 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 576px) {
    #galeries-photos .container,
    #galerie-3d .container,
    #galeries-videos .container,
    #publications .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    #galeries-photos .container,
    #galerie-3d .container,
    #galeries-videos .container,
    #publications .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    #galeries-photos .container,
    #galerie-3d .container,
    #galeries-videos .container,
    #publications .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    #galeries-photos .container,
    #galerie-3d .container,
    #galeries-videos .container,
    #publications .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    #galeries-photos .container,
    #galerie-3d .container,
    #galeries-videos .container,
    #publications .container {
        max-width: 1320px;
    }
}

/* Newsletter Cards - Portrait with Prominent Cover */
.newsletter-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tp-mission-2__item.portrait-orientation {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.newsletter-card-link:hover .tp-mission-2__item {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.tp-mission-2__single-bg {
    opacity: 0.15 !important; /* Subtle background */
    background-size: cover;
    background-position: center;
}

.newsletter-cover-prominent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.newsletter-cover-prominent img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tp-mission-2__overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    padding: 30px 20px;
    z-index: 2;
    color: white;
}

.tp-mission-2__overlay-content .tp-mission-2__title-sm {
    color: white;
}

.tp-mission-2__overlay-content .tp-mission-2__icon {
    margin-bottom: 10px;
}

.tp-mission-2__overlay-content p {
    color: rgba(255,255,255,0.9);
}

/* Report Cards - Entire Card Clickable */
.report-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.report-card-link:hover {
    transform: translateY(-5px);
}

.report-card-link:hover .tp-feature__wraper {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Swiper Navigation for Galleries - Hide all buttons */
.photo-gallery-slider-wrapper,
.video-gallery-slider {
    position: relative;
    width: 100%;
}

/* Hide all navigation buttons */
.photo-gallery-slider-wrapper .swiper-button-next,
.photo-gallery-slider-wrapper .swiper-button-prev,
.video-gallery-slider .swiper-button-next,
.video-gallery-slider .swiper-button-prev {
    display: none !important;
}

/* Pagination dots styling */
.photo-gallery-pagination,
.video-gallery-slider .swiper-pagination {
    position: relative;
    margin-top: 30px;
    text-align: center;
}

.photo-gallery-pagination .swiper-pagination-bullet,
.video-gallery-slider .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #d1d5db;
    opacity: 1;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.photo-gallery-pagination .swiper-pagination-bullet-active,
.video-gallery-slider .swiper-pagination-bullet-active {
    background: #fbae00;
    transform: scale(1.2);
}

/* Video Gallery Slider */
.video-gallery-slider {
    cursor: grab;
    overflow: hidden;
}

.video-gallery-slider:active {
    cursor: grabbing;
}

/* Video Thumbnail Aspect Ratio */
.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 ratio */
    overflow: hidden;
    border-radius: 8px;
}

.video-thumbnail-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
}

/* Gallery Item Enhancements */
.tp-gallery-3__item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.tp-gallery-3__item:hover {
    transform: scale(1.05);
}

.tp-gallery-3__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tp-gallery-3__item:hover .tp-gallery-3__icon {
    opacity: 1;
}

/* Gallery Grid Styles */
.tp-gallery-3__item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Photo Gallery - Images */
#galeries-photos .tp-gallery-3__item,
#galerie-3d .tp-gallery-3__item {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#galeries-photos .tp-gallery-3__item img,
#galerie-3d .tp-gallery-3__item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}

/* Photo Gallery Slider */
.nos-realisations-photo-gallery-swiper {
    width: 100%;
    overflow: hidden;
    cursor: grab;
}

.nos-realisations-photo-gallery-swiper:active {
    cursor: grabbing;
}

.nos-realisations-photo-gallery-swiper .swiper-slide {
    height: auto;
    width: auto;
}

.nos-realisations-photo-gallery-swiper .tp-gallery-3__item img {
    height: 400px;
    object-fit: cover;
    user-select: none;
}

/* Photo Gallery Grid */
#galeries-photos .row,
#galerie-3d .row {
    margin-left: -15px;
    margin-right: -15px;
}

#galeries-photos .row > [class*='col-'],
#galerie-3d .row > [class*='col-'] {
    padding-left: 15px;
    padding-right: 15px;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .tp-mission-2__item.portrait-orientation {
        aspect-ratio: 4/5;
    }

    #galeries-photos .tp-gallery-3__item img,
    #galerie-3d .tp-gallery-3__item img {
        height: 300px;
    }

    .nos-realisations-photo-gallery-swiper .tp-gallery-3__item img {
        height: 320px;
    }
}

@media (max-width: 767px) {
    .tp-mission-2__item.portrait-orientation {
        aspect-ratio: 1/1;
    }

    .tp-mission-2__overlay-content {
        padding: 20px 15px;
    }

    #galeries-photos .tp-gallery-3__item img {
        height: 320px;
    }

    .nos-realisations-photo-gallery-swiper .tp-gallery-3__item img {
        height: 360px;
    }

    #galeries-photos .row > [class*='col-'],
    #galerie-3d .row > [class*='col-'] {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 20px;
    }

    #galeries-photos .pt-115,
    #galerie-3d .pt-115 {
        padding-top: 60px !important;
    }

    #galeries-photos .pb-90,
    #galerie-3d .pb-90 {
        padding-bottom: 60px !important;
    }
}

@media (max-width: 576px) {
    #galeries-photos .tp-gallery-3__item img,
    #galerie-3d .tp-gallery-3__item img {
        height: 280px;
    }

    .nos-realisations-photo-gallery-swiper .tp-gallery-3__item img {
        height: 320px;
    }

    #galeries-photos .tp-gallery-3__section-title,
    #galerie-3d .tp-gallery-3__section-title {
        padding-bottom: 30px !important;
    }

    .tp-gallery-3__area {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }

    /* Adjust pagination dots on small mobile */
    .photo-gallery-pagination,
    .video-gallery-slider .swiper-pagination {
        margin-top: 20px;
    }

    .photo-gallery-pagination .swiper-pagination-bullet,
    .video-gallery-slider .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 4px;
    }
}
