/* ═══════════════════════════════════════════════════════════
   Solestra Rental — Auth Gallery
   Shortcode: [solestra_auth_gallery cols="N" images="M"]
   --solestra-gallery-cols CSS değişkeni ile kolon sayısı kontrol edilir.
   ═══════════════════════════════════════════════════════════ */

/* Wrapper — Trousseau'nun kendi qodef-woo-my-account-image-holder class'ını kullanıyoruz.
   Bu sayede tema'nın 2-kolon (position: absolute + 57.3% width) layout'u çalışır.
   Sadece içi sarma için — gallery kendisi içinde düzen kurar. */
.solestra-auth-gallery-wrapper {
    /* Tema position: absolute + width 57.3% atadığı için, gallery içeride doğru boyutta olur.
       Container/wrapper'a ekstra stil gerekmez. */
}

/* Tema'nın eski image'ını (attachment img) bizim wrapper içinde istemiyoruz.
   Ama remove_action zaten kaldırdığı için bu kural sadece emniyet katmanı. */
.solestra-auth-gallery-wrapper > img:not(.solestra-auth-gallery img) {
    display: none;
}

.solestra-auth-gallery {
    display: grid;
    grid-template-columns: repeat(var(--solestra-gallery-cols, 3), 1fr);
    gap: 25px;
    width: 100%;
    margin: 0 auto;
    /* Negative margin'lar için üstten ve alttan breathing alan */
    padding: 50px;
    justify-items: center;
    align-items: start;
}

/* ═══════════════════════════════════════════════════════════
   EDİTORYAL STAGGER — asimetrik yerleşim
   4'lü tekrarlı pattern: +5, -15, -25, -50 → her 4 görsel
   için doğal bir iniş-çıkış ritmi oluşturur.
   ═══════════════════════════════════════════════════════════ */

.solestra-auth-gallery-item:nth-child(4n+1) { margin-top: 50px!important; }
.solestra-auth-gallery-item:nth-child(4n+4) { margin-top: -50px!important; }

/* ═══════════════════════════════════════════════════════════
   GALLERY ITEM
   ═══════════════════════════════════════════════════════════ */

.solestra-auth-gallery-item {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: hidden;
    background: #fafafa;
    aspect-ratio: 3 / 4;
    position: relative;
    transition:
        transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1),
        filter 0.45s ease,
        box-shadow 0.45s ease;
    cursor: pointer;
    will-change: transform, filter;
}

.solestra-auth-gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

/* ═══════════════════════════════════════════════════════════
   BADGE — Kiralık / Satılık (sol üst)
   ═══════════════════════════════════════════════════════════ */

.solestra-auth-gallery-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    display: inline-block;
    padding: 4px 8px;
    font-family: "Muli", sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
    background: rgba(255, 255, 255, 0.95);
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.solestra-auth-gallery-badge--rental {
    color: #6a6a6a;
}

.solestra-auth-gallery-badge--sale {
    color: #000;
    box-shadow: inset 2px 0 0 #000;
    padding-left: 10px;
}

/* ═══════════════════════════════════════════════════════════
   CAPTION (Ürün Adı) — alt kısımda, hover'da slide-up ile belirir
   ═══════════════════════════════════════════════════════════ */

.solestra-auth-gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 40px 14px 14px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.7) 70%,
        rgba(0, 0, 0, 0.85) 100%
    );
    color: #fff;
    z-index: 2;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
        transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
}

/* Hover edilen öğede caption belirir */
.solestra-auth-gallery-item:hover .solestra-auth-gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

.solestra-auth-gallery-title {
    display: block;
    font-family: "Muli", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ═══════════════════════════════════════════════════════════
   HOVER EFEKTLERİ — premium dergi hissi
   ═══════════════════════════════════════════════════════════ */

/* Galeri üzerine hover → tüm öğeler kararır ve hafif küçülür */
.solestra-auth-gallery:hover .solestra-auth-gallery-item {
    transform: scale(0.96);
    filter: brightness(0.55);
}

/* Hover edilen ÖĞE → büyür, parlak kalır, hafif gölge */
.solestra-auth-gallery:hover .solestra-auth-gallery-item:hover {
    transform: scale(1.05);
    filter: brightness(1);
    z-index: 2;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Hover'da resim kendi içinde yavaşça zoom olur */
.solestra-auth-gallery-item:hover img {
    transform: scale(1.1);
}

/* Yan öğelerin hafif slide — parlak olan ortalanır */
.solestra-auth-gallery-item:hover ~ .solestra-auth-gallery-item {
    transform: scale(0.96) translateX(8px);
}

.solestra-auth-gallery-item:has(~ .solestra-auth-gallery-item:hover) {
    transform: scale(0.96) translateX(-8px);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* Mobilde max 2 kolon (daha fazla olsa da) */
@media (max-width: 640px) {
    .solestra-auth-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        padding: 10px 0 20px;
    }

    /* Mobilde stagger'ı biraz yumuşat — büyük negative margin'lar dar ekranda bozuk durur */
    .solestra-auth-gallery-item:nth-child(4n+1) { margin-top: 0; }
    .solestra-auth-gallery-item:nth-child(4n+2) { margin-top: -8px; }
    .solestra-auth-gallery-item:nth-child(4n+3) { margin-top: -12px; }
    .solestra-auth-gallery-item:nth-child(4n+4) { margin-top: -24px; }
}

@media (max-width: 420px) {
    .solestra-auth-gallery {
        gap: 6px;
    }
}

/* Dokunmatikte hover efektleri kaldır */
@media (hover: none) {
    .solestra-auth-gallery:hover .solestra-auth-gallery-item,
    .solestra-auth-gallery:hover .solestra-auth-gallery-item:hover,
    .solestra-auth-gallery-item:hover ~ .solestra-auth-gallery-item,
    .solestra-auth-gallery-item:has(~ .solestra-auth-gallery-item:hover) {
        transform: none !important;
        filter: none !important;
        box-shadow: none !important;
    }
    .solestra-auth-gallery-item:hover img {
        transform: none !important;
    }

    /* Mobilde ürün adı her zaman görünür (hover yok) */
    .solestra-auth-gallery-caption {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobilde badge ve caption daha küçük */
@media (max-width: 640px) {
    .solestra-auth-gallery-badge {
        top: 6px;
        left: 6px;
        padding: 3px 6px;
        font-size: 7px;
        letter-spacing: 0.15em;
    }

    .solestra-auth-gallery-caption {
        padding: 24px 10px 10px;
    }

    .solestra-auth-gallery-title {
        font-size: 9px;
        letter-spacing: 0.1em;
    }
}
