/* ==========================================================================
   Telif Hakkı (c) 2026 Kuvra.com.tr Tüm hakları saklıdır.
   
   Bu yazılım ve kaynak kodları tamamen CHEFF’e aittir. 
   İzinsiz kopyalanması, çoğaltılması, yeniden dağıtılması, ticari amaçla 
   satılması ve kod içerisindeki eklenti imzasının kaldırılması veya 
   değiştirilmesi kesinlikle yasaktır.
   ========================================================================== */
/* Kuvra Gallery: otomatik boyutlandırma (sunucu HTML'i değişmez; yalnızca görünüm) */
.post-body .bb img.bb-image,
.post-body .bb img.bb-attach-full {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, var(--kg-max-w, 100%));
    max-height: var(--kg-max-h, none);
    object-fit: contain;
    border-radius: var(--kg-radius, 10px);
    margin: .6rem 0;
}
.kg-center .post-body .bb img.bb-image,
.kg-center .post-body .bb img.bb-attach-full { margin-inline: auto; }
.kg-shadow .post-body .bb img.bb-image,
.kg-shadow .post-body .bb img.bb-attach-full { box-shadow: 0 6px 22px rgba(15, 12, 40, .14); }

/* Sabit en-boy oranı: resim kutuya oturtulur (orijinali galeride tam görünür) */
.kg-fixed-ratio .post-body .bb img.bb-image,
.kg-fixed-ratio .post-body .bb img.bb-attach-full {
    width: min(100%, var(--kg-max-w, 100%));
    max-height: none;
    aspect-ratio: var(--kg-ratio);
    object-fit: var(--kg-fit, cover);
    background: color-mix(in srgb, currentColor 6%, transparent);
}
.kg-zoom-cursor [data-kg-item] { cursor: zoom-in; }

/* Galeri (slayt gösterisi) */
.kg-open { overflow: hidden; }
.kg { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(8, 8, 14, var(--kg-backdrop, .92)); color: #FFFFFF; opacity: 0; transition: opacity .2s ease; }
.kg.is-on { opacity: 1; }
.kg[hidden] { display: none; }
.kg-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem; font-size: .88rem; }
.kg-counter { margin-right: auto; font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.kg-btn { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #FFFFFF; cursor: pointer; font-size: 1.15rem; text-decoration: none; transition: background .15s ease; }
.kg-btn:hover, .kg-btn:focus-visible { background: rgba(255, 255, 255, .22); outline: none; }
.kg-btn svg { width: 20px; height: 20px; }
.kg-stage { position: relative; overflow: hidden; touch-action: pan-y; }
.kg-slide { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 4.5rem; transition: transform .3s ease, opacity .3s ease; }
.kg-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; transition: transform .25s ease; }
.kg-slide.is-zoomed img { cursor: grab; transition: none; }
.kg.can-zoom .kg-slide:not(.is-zoomed) img { cursor: zoom-in; }
.kg-t-fade .kg-slide { transition: opacity .3s ease; }
.kg-t-none .kg-slide { transition: none; }
.kg-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 3rem; height: 3rem; font-size: 1.8rem; }
.kg-prev { left: .8rem; } .kg-next { right: .8rem; }
.kg-caption { margin: 0; padding: .3rem 1rem .6rem; text-align: center; font-size: .86rem; opacity: .85; min-height: 1.4rem; }
.kg-thumbs { display: flex; gap: .4rem; justify-content: center; padding: 0 1rem 1rem; overflow-x: auto; scrollbar-width: thin; }
.kg-thumbs button { flex: none; width: 4.2rem; height: 3rem; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, .08); cursor: pointer; opacity: .6; transition: opacity .15s, border-color .15s; }
.kg-thumbs button.is-on, .kg-thumbs button:hover { opacity: 1; border-color: #FFFFFF; }
.kg-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.kg-play[aria-pressed="true"] { background: rgba(255, 255, 255, .28); }
@media (max-width: 640px) {
    .kg-slide { padding: 0 .5rem; }
    .kg-nav { display: none; }
    .kg-thumbs button { width: 3.2rem; height: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) { .kg, .kg-slide, .kg-slide img { transition: none; } }
