/* ================================================
   Dinçer Erke - Custom Gallery Styles
   Modern, Responsive, Mobile-First Design
   ================================================ */

/* Hide default page title on gallery pages */
.page-id-4827 .page-header,
.page-id-4830 .page-header,
.page-id-4827 .entry-header,
.page-id-4830 .entry-header,
.page-id-4827 header.entry-header,
.page-id-4830 header.entry-header,
.page-id-4827 .elementor-page-title,
.page-id-4830 .elementor-page-title,
.page-id-4827 h1.entry-title,
.page-id-4830 h1.entry-title {
    display: none !important;
}

/* ================================================
   Elementor Gallery Widget Improvements
   ================================================ */

/* Fix Elementor gallery grid */
.elementor-gallery__container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 15px !important;
}

.elementor-gallery-item {
    aspect-ratio: 1 !important;
    width: 100% !important;
    height: auto !important;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.elementor-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.elementor-gallery-item__image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Disable masonry effect for uniform grid */
.elementor-gallery--layout-grid .elementor-gallery__container,
.elementor-gallery--layout-masonry .elementor-gallery__container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

/* Tablet */
@media (max-width: 1024px) {
    .elementor-gallery--layout-grid .elementor-gallery__container,
    .elementor-gallery--layout-masonry .elementor-gallery__container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .elementor-gallery--layout-grid .elementor-gallery__container,
    .elementor-gallery--layout-masonry .elementor-gallery__container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .elementor-gallery-item {
        border-radius: 6px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .elementor-gallery--layout-grid .elementor-gallery__container,
    .elementor-gallery--layout-masonry .elementor-gallery__container {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
}

/* Elementor lightbox improvements */
.elementor-lightbox .dialog-lightbox-widget-content {
    background: rgba(0, 0, 0, 0.95) !important;
}

.elementor-lightbox .dialog-lightbox-close-button {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    width: 48px !important;
    height: 48px !important;
    transition: all 0.3s ease !important;
}

.elementor-lightbox .dialog-lightbox-close-button:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.1);
}

.elementor-lightbox .elementor-swiper-button {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    transition: all 0.3s ease !important;
}

.elementor-lightbox .elementor-swiper-button:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Gallery Container */
.de-gallery {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.de-gallery-title {
    font-family: 'Marcellus', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 50px;
    color: #2c2c2c;
    letter-spacing: 0.1em;
    position: relative;
}

.de-gallery-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #8b7355, transparent);
    margin: 20px auto 0;
}

/* Gallery Grid */
.de-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Gallery Item */
.de-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
    cursor: pointer;
    background: #1a1a1a;
}

.de-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.4s ease;
}

.de-gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.de-gallery-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232c2c2c' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z'/%3E%3C/svg%3E");
    background-size: 30px;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.de-gallery-item:hover img {
    transform: scale(1.08);
}

.de-gallery-item:hover::before {
    opacity: 1;
}

.de-gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Uniform grid - all items same size */
@media (min-width: 768px) {
    .de-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    .de-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

/* Lightbox */
.de-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.de-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.de-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: lightboxZoom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.de-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.de-lightbox-close {
    position: absolute;
    top: -60px;
    right: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.de-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.de-lightbox-close::before,
.de-lightbox-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.de-lightbox-close:hover::before,
.de-lightbox-close:hover::after {
    background: white;
}

.de-lightbox-close::before {
    transform: rotate(45deg);
}

.de-lightbox-close::after {
    transform: rotate(-45deg);
}

.de-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.de-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.de-lightbox-prev {
    left: 30px;
}

.de-lightbox-next {
    right: 30px;
}

.de-lightbox-nav svg {
    width: 28px;
    height: 28px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Arrow icons using CSS */
.de-lightbox-prev::before,
.de-lightbox-next::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-top: 3px solid white;
    border-right: 3px solid white;
    position: absolute;
}

.de-lightbox-prev::before {
    transform: rotate(-135deg);
    margin-left: 4px;
}

.de-lightbox-next::before {
    transform: rotate(45deg);
    margin-right: 4px;
}

.de-lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    letter-spacing: 0.1em;
}

/* ================================================
   Livres Page Styles
   ================================================ */

.de-books {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.de-books-title {
    font-family: 'Marcellus', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 60px;
    color: #2c2c2c;
    letter-spacing: 0.1em;
}

.de-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.de-book-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px;
    background: #fafafa;
    border-radius: 12px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.de-book-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.de-book-cover {
    position: relative;
    margin-bottom: 25px;
    perspective: 1000px;
}

.de-book-cover img {
    max-width: 200px;
    height: auto;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s ease;
    border-radius: 4px;
}

.de-book-item:hover .de-book-cover img {
    transform: rotateY(-15deg);
}

.de-book-info h3 {
    font-family: 'Marcellus', serif;
    font-size: 1.3rem;
    color: #2c2c2c;
    margin-bottom: 10px;
}

.de-book-info p {
    font-family: 'Lato', sans-serif;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .de-gallery {
        padding: 30px 15px;
    }
    
    .de-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .de-gallery-item {
        border-radius: 6px;
    }
    
    .de-gallery-item::after {
        width: 40px;
        height: 40px;
        background-size: 20px;
    }
    
    .de-lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .de-lightbox-prev {
        left: 10px;
    }
    
    .de-lightbox-next {
        right: 10px;
    }
    
    .de-books-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Dark section background */
.de-section-dark {
    background: #1a1a1a;
    padding: 80px 0;
}

.de-section-dark .de-gallery-title {
    color: #f5f5f5;
}

/* Loading animation */
.de-gallery-item img {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.de-gallery-item img.loaded {
    opacity: 1;
}

/* Staggered entrance animation */
.de-gallery-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

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

.de-gallery-item:nth-child(1) { animation-delay: 0.1s; }
.de-gallery-item:nth-child(2) { animation-delay: 0.15s; }
.de-gallery-item:nth-child(3) { animation-delay: 0.2s; }
.de-gallery-item:nth-child(4) { animation-delay: 0.25s; }
.de-gallery-item:nth-child(5) { animation-delay: 0.3s; }
.de-gallery-item:nth-child(6) { animation-delay: 0.35s; }
.de-gallery-item:nth-child(7) { animation-delay: 0.4s; }
.de-gallery-item:nth-child(8) { animation-delay: 0.45s; }
.de-gallery-item:nth-child(9) { animation-delay: 0.5s; }
.de-gallery-item:nth-child(10) { animation-delay: 0.55s; }
.de-gallery-item:nth-child(11) { animation-delay: 0.6s; }
.de-gallery-item:nth-child(12) { animation-delay: 0.65s; }
.de-gallery-item:nth-child(13) { animation-delay: 0.7s; }
.de-gallery-item:nth-child(14) { animation-delay: 0.75s; }
.de-gallery-item:nth-child(15) { animation-delay: 0.8s; }
.de-gallery-item:nth-child(16) { animation-delay: 0.85s; }
