/* Galeri belirteçleri — etiket çipi, gömme kartı, seçim penceresi.
   Renkler mevcut CSS değişkenlerinden alınır; yeni palet tanımlanmaz. */

/* --- Etiket çipi (satır içi) ---
   Tasarım dili components/list-badges.css > .user-badge-v4 (mention rozeti)
   ile aynı: 22px yükseklik, --site-box-radius köşe, overflow:hidden ile
   sola dayalı kapak, ayraç çizgili bölümler. */

.gallery-ref-chip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    max-width: 100%;
    padding: 0;
    border-radius: var(--site-box-radius, 4px);
    overflow: hidden;
    background: rgba(var(--primary-color-rgb), .18);
    border: 1px solid rgba(var(--primary-color-rgb), .38);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    color: var(--bs-body-color);
    vertical-align: middle;
    line-height: 1;
    font-size: .68rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease-in-out, border-color .2s ease-in-out;
}

.gallery-ref-chip:hover,
.gallery-ref-chip:focus-visible {
    background: rgba(var(--primary-color-rgb), .3);
    border-color: rgba(var(--primary-color-rgb), .55);
    color: var(--bs-body-color);
    text-decoration: none;
}

[data-bs-theme="light"] .gallery-ref-chip {
    background: rgba(var(--primary-color-rgb), .14);
    border-color: rgba(var(--primary-color-rgb), .34);
}

.gallery-ref-chip__thumb {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 0;
    border-right: 1px solid rgba(var(--primary-color-rgb), .3);
    flex-shrink: 0;
    display: block;
}

.gallery-ref-chip__label {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    padding: 0 .4rem;
}

.gallery-ref-chip__icon {
    font-size: .6rem;
    opacity: .75;
    flex-shrink: 0;
}

.gallery-ref-chip__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14em;
}

.gallery-ref-chip__owner {
    padding: 0 .4rem;
    border-left: 1px solid rgba(var(--primary-color-rgb), .3);
    background: rgba(var(--primary-color-rgb), .12);
    font-weight: 500;
    opacity: .85;
    flex-shrink: 0;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    max-width: 10em;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* topic.css içindeki `.topic-content img` ve `.topic-content.ql-editor img`
   kuralları (margin:10px 0; border-radius:4px; box-shadow; cursor:pointer
   !important) çipin kapak görselini şişiriyordu. topic.css mention rozetini
   nasıl kurtardıysa (bkz. `.topic-content a.forum-mention-badge.user-badge-v4`)
   aynı yol: !important ile sabitle. */
.topic-content .gallery-ref-chip__thumb,
.forum-comment-body .gallery-ref-chip__thumb {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 0 !important;
    width: 22px !important;
    height: 22px !important;
    cursor: pointer !important;
}

/* --- Gömme kartı (blok) — gallery.php liste kartıyla aynı dil ---
   Stiller assets/css/pages/gallery.css > .gallery-card ile hizalı;
   konu içeriğinde tek kart genişliği sınırlı tutulur. */

.topic-content .gallery-card--embed,
.forum-comment-body .gallery-card--embed,
.gallery-card.gallery-card--embed {
    display: flex;
    flex-direction: column;
    width: min(100%, 320px);
    margin: 1rem 0;
    border-radius: var(--site-home-radius, var(--site-box-radius, 4px));
    background: color-mix(in srgb, var(--bs-body-bg, #fff) 92%, var(--primary-color, #2aa8c9) 8%);
    border: 1px solid color-mix(in srgb, var(--text-color, #222) 16%, transparent);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--text-color, #222) 6%, transparent);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.topic-content .gallery-card--embed:hover,
.forum-comment-body .gallery-card--embed:hover,
.gallery-card.gallery-card--embed:hover {
    border-color: color-mix(in srgb, var(--primary-color, #2aa8c9) 42%, transparent);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--text-color, #222) 10%, transparent);
}

[data-bs-theme="dark"] .gallery-card.gallery-card--embed {
    background: rgba(255, 255, 255, .03);
    border-color: rgba(255, 255, 255, .14);
    box-shadow: none;
}

.gallery-card--embed .gallery-card__cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--site-home-radius, var(--site-box-radius, 4px)) var(--site-home-radius, var(--site-box-radius, 4px)) 0 0;
    background: rgba(0, 0, 0, .25);
}

.gallery-card--embed .gallery-card__cover img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: cover;
    display: block;
    cursor: zoom-in !important;
}

.gallery-card--embed .gallery-card__count {
    position: absolute;
    right: .5rem;
    bottom: .5rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    z-index: 3;
    pointer-events: none;
}

/* Gömme kartı kaydırıcı — scroll-snap, en fazla 8 görsel */
.gallery-card--embed .gallery-card__slider {
    position: relative;
    aspect-ratio: 3 / 2;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--site-home-radius, var(--site-box-radius, 4px)) var(--site-home-radius, var(--site-box-radius, 4px)) 0 0;
    background: rgba(0, 0, 0, .25);
    user-select: none;
    -webkit-user-select: none;
}

.gallery-card--embed .gallery-card__slider-viewport {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
    scrollbar-width: none;
    outline: none;
    cursor: pointer;
}

.gallery-card--embed .gallery-card__slider-viewport:focus-visible {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary-color, #2aa8c9) 70%, transparent);
}

.gallery-card--embed .gallery-card__slider-viewport::-webkit-scrollbar {
    display: none;
}

.gallery-card--embed .gallery-card__slider-track {
    display: flex;
    height: 100%;
}

.gallery-card--embed .gallery-card__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
}

.gallery-card--embed .gallery-card__slide-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

.gallery-card--embed .gallery-card__slide img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.gallery-card--embed .gallery-card__slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, background .15s ease;
}

.gallery-card--embed .gallery-card__slider:hover .gallery-card__slider-btn,
.gallery-card--embed .gallery-card__slider:focus-within .gallery-card__slider-btn {
    opacity: 1;
}

.gallery-card--embed .gallery-card__slider-btn:hover,
.gallery-card--embed .gallery-card__slider-btn:focus-visible {
    background: rgba(0, 0, 0, .75);
    outline: none;
}

.gallery-card--embed .gallery-card__slider-btn--prev {
    left: .4rem;
}

.gallery-card--embed .gallery-card__slider-btn--next {
    right: .4rem;
}

.gallery-card--embed .gallery-card__slider-dots {
    position: absolute;
    left: 50%;
    bottom: .45rem;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: .28rem;
    align-items: center;
    max-width: calc(100% - 5.5rem);
    padding: .15rem .35rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, .35);
}

.gallery-card--embed .gallery-card__slider-dot {
    width: .42rem;
    height: .42rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
    flex-shrink: 0;
}

.gallery-card--embed .gallery-card__slider-dot.is-active {
    background: #fff;
    width: .55rem;
    height: .55rem;
}

.gallery-card--embed .gallery-card__slider-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

@media (hover: none) {
    .gallery-card--embed .gallery-card__slider-btn {
        opacity: .85;
    }
}

@media (max-width: 575.98px) {
    .gallery-card--embed .gallery-card__slider-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: .75rem;
    }
}

.gallery-card--embed .gallery-card__body {
    padding: .65rem .75rem .75rem;
}

.gallery-card--embed .gallery-card__title {
    margin: 0 0 .4rem;
    font-size: .95rem;
    line-height: 1.3;
}

.gallery-card--embed .gallery-card__title a {
    color: inherit;
    text-decoration: none;
}

.gallery-card--embed .gallery-card__title a:hover {
    text-decoration: underline;
}

.gallery-card--embed .gallery-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .5rem;
    align-items: center;
    font-size: .78rem;
    opacity: .9;
}

.gallery-card--embed .gallery-card__author {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.gallery-card--embed .gallery-card__author span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-card--embed .gallery-card__avatar-wrap {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
}

.gallery-card--embed .gallery-card__avatar {
    width: 24px !important;
    height: 24px !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    object-fit: cover;
}

.gallery-card--embed .gallery-card__author-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-card--embed .gallery-card__badges {
    max-width: 100%;
    overflow: hidden;
}

.gallery-card--embed .gallery-card__badges .user-badge-v4 {
    flex-shrink: 0;
}

.gallery-card--embed .gallery-card__footer {
    display: flex;
    align-items: stretch;
    gap: .4rem;
    margin-top: .55rem;
}

.gallery-card--embed .gallery-card__stats {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-around;
    gap: .15rem;
    min-width: 0;
    padding: .28rem .4rem;
    border-radius: var(--site-home-radius, var(--site-box-radius, 4px));
    border: 1px solid color-mix(in srgb, var(--text-color, #222) 14%, transparent);
    background: color-mix(in srgb, var(--bs-body-bg, #fff) 88%, var(--text-color, #222) 12%);
    font-size: .74rem;
    line-height: 1.2;
}

[data-bs-theme="dark"] .gallery-card--embed .gallery-card__stats {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
}

.gallery-card--embed .gallery-card__stat {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    opacity: .9;
    white-space: nowrap;
}

.gallery-card--embed .gallery-card__stat i {
    font-size: .72rem;
    opacity: .75;
}

.gallery-card--embed .gallery-card__share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    flex: 0 0 auto;
    margin: 0;
    padding: .28rem .55rem;
    border-radius: var(--site-home-radius, var(--site-box-radius, 4px));
    border: 1px solid color-mix(in srgb, var(--primary-color, #2aa8c9) 38%, transparent);
    background: color-mix(in srgb, var(--primary-color, #2aa8c9) 10%, transparent);
    color: inherit;
    font-size: .74rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.gallery-card--embed .gallery-card__share:hover,
.gallery-card--embed .gallery-card__share:focus-visible {
    background: color-mix(in srgb, var(--primary-color, #2aa8c9) 22%, transparent);
    border-color: color-mix(in srgb, var(--primary-color, #2aa8c9) 55%, transparent);
    outline: none;
}

.gallery-card--embed .gallery-card__share.is-copied {
    border-color: color-mix(in srgb, #2e9e5b 55%, transparent);
    background: color-mix(in srgb, #2e9e5b 16%, transparent);
}

.gallery-card--embed .gallery-card__share-label {
    font-weight: 500;
}

@media (max-width: 399.98px) {
    .gallery-card--embed .gallery-card__share-label {
        display: none;
    }

    .gallery-card--embed .gallery-card__share {
        padding: .28rem .45rem;
    }
}

@media (max-width: 575.98px) {
    .topic-content .gallery-card--embed,
    .forum-comment-body .gallery-card--embed,
    .gallery-card.gallery-card--embed {
        width: min(100%, 280px);
    }
}

/* --- Seçim penceresi ---
   z-index 10060: lightbox (10050) dahil tüm site katmanlarının üstünde. */

/* position ve inset !important:
   layout/base.css içinde şu kural var —
     body > *:not(#wowBgCanvas):not(#mainNavbar):not(.fancybox__container)
            :not(.glightbox-container):not(.modal):not(.modal-backdrop) { position: relative; }
   İçindeki :not(#id) seçicileri kurala id düzeyinde özgüllük kazandırıyor ve
   sınıf seçicimizi yeniyor. Overlay body'nin doğrudan çocuğu olduğu için
   position: relative dayatılıyor, inset etkisiz kalıyor ve pencere sayfanın
   en altına düşüp görünmez oluyordu. Fancybox ve .modal o listede muaf
   tutulmuş; biz paylaşılan dosyayı değiştirmek yerine burada sabitliyoruz. */
.gallery-picker-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10060;
    background: rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.gallery-picker {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1rem;
    border-radius: var(--site-box-radius, 4px);
    background: var(--bs-card-bg, #161a20);
    border: 1px solid rgba(255, 255, 255, .12);
}

[data-bs-theme="light"] .gallery-picker {
    background: var(--lm-card-bg, #fff);
    border-color: var(--lm-card-border, rgba(0, 0, 0, .15));
}

.gallery-picker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.gallery-picker__tabs {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    min-width: 0;
}

.gallery-picker__tab {
    padding: .35rem .7rem;
    border-radius: var(--site-box-radius, 4px);
    font-size: .82rem;
    border: 1px solid rgba(var(--text-color-rgb), .18);
    background: rgba(var(--text-color-rgb), .05);
    color: inherit;
    cursor: pointer;
}

.gallery-picker__tab.is-active {
    background: var(--wow-section-header-bg, #2a3a4d);
    color: var(--wow-section-header-text, #fff);
    font-weight: 600;
}

.gallery-picker__close {
    border: 0;
    background: none;
    color: inherit;
    opacity: .7;
    cursor: pointer;
    padding: .25rem .4rem;
    flex-shrink: 0;
}

.gallery-picker__close:hover {
    opacity: 1;
}

.gallery-picker__list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.gallery-picker__item {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .45rem;
    border: 0;
    border-radius: var(--site-box-radius, 4px);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.gallery-picker__item:hover {
    background: rgba(var(--text-color-rgb), .08);
}

.gallery-picker__thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--site-box-radius, 4px);
    object-fit: cover;
    flex-shrink: 0;
}

.gallery-picker__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gallery-picker__title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-picker__meta {
    font-size: .78rem;
    opacity: .7;
}

.gallery-picker__empty {
    padding: 1.5rem .5rem;
    text-align: center;
    opacity: .75;
    margin: 0;
}

/* Araç çubuğu düğmesi Quill ikonlarıyla aynı ölçüde dursun */
.ql-toolbar button.ql-gallery-picker {
    width: 28px;
    height: 24px;
    padding: 3px 5px;
}

@media (max-width: 575.98px) {
    .gallery-picker {
        max-height: 88vh;
    }
}
