/* ── Shell ── */
.ighe-widget-shell{
    --ighe-stage-max-width: 414px;
    --ighe-track-gap: 12px;
    --ighe-circle-size: 74px;
    --ighe-visible-columns-desktop: 7;
    --ighe-visible-columns-mobile: 4;
    --ighe-ring-solid: #8a919a;
    --ighe-ring-viewed: #b2b8bf;
    position: relative;
    width: 100%;
    overflow: hidden;
    color: #262626;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* ── Track outer: flex row – oklar track'in fiziksel dışında ── */
.ighe-track-outer{
    display: flex;
    align-items: flex-start;
    width: 100%;
}

/* ── Scroll ok butonları ── */
.ighe-scroll-arrow{
    appearance: none;
    border: 0;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: var(--ighe-circle-size);
    color: #9ea5ad;
    opacity: 0.8;
    transition: opacity .15s ease, color .15s ease;
}

.ighe-scroll-arrow:hover{
    opacity: 1;
    color: #444b52;
}

.ighe-scroll-arrow:focus-visible{
    outline: none;
    opacity: 1;
}

.ighe-scroll-arrow[hidden]{
    display: none !important;
}

.ighe-scroll-arrow svg{
    width: 12px;
    height: 12px;
    display: block;
    flex-shrink: 0;
}

/* ── Track sarmalayıcı ── */
.ighe-track-wrap{
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
}

.ighe-track-wrap.is-dragging{
    cursor: grabbing;
    scroll-snap-type: none;
}

.ighe-track-wrap::-webkit-scrollbar{
    display: none;
}

/* ── Track ── */
.ighe-track{
    display: flex;
    align-items: flex-start;
    gap: var(--ighe-track-gap);
    min-width: max-content;
}

/* ── Highlight butonları ── */
.ighe-highlight-button{
    appearance: none;
    border: 0;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    padding: 0;
    cursor: pointer;
    color: inherit;
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max(calc(var(--ighe-circle-size) + 6px), 92px);
    min-width: max(calc(var(--ighe-circle-size) + 6px), 92px);
    scroll-snap-align: start;
    transition: transform .18s ease, opacity .18s ease;
    box-shadow: none !important;
}

.ighe-highlight-button:hover{
    transform: none;
}

.ighe-highlight-button:focus-visible{
    outline: none;
}

.ighe-highlight-button:focus-visible .ighe-highlight-thumb-wrap{
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}

.ighe-highlight-button.is-active .ighe-highlight-thumb-wrap{
    transform: none;
}

/* ── Halka çerçeve ── */
.ighe-highlight-thumb-wrap{
    width: var(--ighe-circle-size);
    height: var(--ighe-circle-size);
    border-radius: 999px;
    padding: 2px;
    background: transparent;
    border: 1px solid var(--ighe-ring-solid);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: border-color .18s ease, background .18s ease;
}

.ighe-highlight-button.is-viewed .ighe-highlight-thumb-wrap{
    background: transparent;
    border-color: var(--ighe-ring-viewed);
}

.ighe-highlight-button.is-active:not(.is-viewed) .ighe-highlight-thumb-wrap{
    border-color: #6f7781;
}

.ighe-highlight-thumb-frame{
    width: 100%;
    height: 100%;
    border-radius: 999px;
    padding: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ighe-highlight-thumb,
.ighe-highlight-thumb-placeholder{
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    object-position: center center;
    background: #eef2f5;
}

.ighe-highlight-thumb{
    transform: scale(1.06);
    transform-origin: center center;
}

.ighe-highlight-thumb-placeholder{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: calc(var(--ighe-circle-size) * .28);
    color: #111827;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

/* ── Etiket: kelime ortadan kesilmez ── */
.ighe-highlight-label{
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    white-space: normal;
    text-overflow: unset;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
    font-size: 12px;
    line-height: 1.22;
    text-align: center;
    letter-spacing: -.01em;
    font-weight: 400;
    min-height: 2.44em;
}

/* ── Scroll kilidi ── */
.ighe-no-scroll{
    overflow: hidden !important;
}

/* ════════════════════════════════════════
   VIEWER
════════════════════════════════════════ */

.ighe-viewer{
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.ighe-viewer.is-open{
    display: block;
}

/* ── Arka plan ── */
.ighe-viewer-backdrop{
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(44, 49, 60, .34), rgba(0, 0, 0, .92) 56%),
        rgba(0, 0, 0, .88);
    backdrop-filter: blur(14px);
}

/* ── Ana layout: flex row, tüm ekran ── */
.ighe-viewer-layout{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 32px;
}

/* ── Merkez kapsayıcı ── */
.ighe-viewer-main{
    position: relative;
    flex-shrink: 0;
}

/* ── Yan panel (masaüstü): varsayılan gizli, media query ile açılır ── */
.ighe-viewer-aside{
    display: none;
    flex-shrink: 0;
    align-items: center;
    gap: 14px;
}

.ighe-aside-prev{
    flex-direction: row; /* [cards] [sol-ok] */
}

.ighe-aside-next{
    flex-direction: row; /* [sağ-ok] [cards] */
}

/* ── Yan panel önizleme kartları ── */
.ighe-aside-cards{
    display: flex;
    gap: 10px;
}

.ighe-aside-card{
    appearance: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    width: 140px;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #111318;
    display: block;
    box-shadow: none !important;
    transition: opacity .15s ease, transform .15s ease;
}

.ighe-aside-card:hover{
    opacity: 0.82;
    transform: scale(0.97);
}

.ighe-aside-card-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.ighe-aside-card-label{
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 52px 12px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .74));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    letter-spacing: -.01em;
}

/* ── Yan panel daire ok butonları ── */
.ighe-aside-nav{
    appearance: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .55);
    background: rgba(0, 0, 0, .18) !important;
    background-color: rgba(0, 0, 0, .18) !important;
    background-image: none !important;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    box-shadow: none !important;
    transition: border-color .15s ease, background .15s ease;
}

.ighe-aside-nav:hover{
    border-color: rgba(255, 255, 255, .88);
    background: rgba(255, 255, 255, .1) !important;
    background-color: rgba(255, 255, 255, .1) !important;
}

.ighe-aside-nav:focus-visible{
    outline: none;
    border-color: rgba(255, 255, 255, .88);
}

.ighe-aside-nav svg{
    width: 20px;
    height: 20px;
    display: block;
}

/* ── Progress bar ── */
.ighe-viewer-top{
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    padding: 0 14px;
    z-index: 4;
}

.ighe-progress{
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
}

.ighe-progress-segment{
    position: relative;
    flex: 1 1 0;
    height: 3px;
    background: rgba(255, 255, 255, .22);
    border-radius: 999px;
    overflow: hidden;
}

.ighe-progress-fill{
    position: absolute;
    inset: 0;
    background: #fff;
    transform-origin: left center;
    transform: scaleX(0);
    will-change: transform;
}

/* ── Meta (avatar + başlık + aksiyonlar) ── */
.ighe-viewer-meta{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
}

.ighe-viewer-title-wrap{
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ighe-viewer-avatar{
    width: 32px;
    height: 32px;
    border-radius: 999px;
    padding: 0;
    overflow: hidden;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.ighe-viewer-avatar img,
.ighe-viewer-avatar span{
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1115;
    color: #fff;
    object-fit: cover;
    font-weight: 700;
    border: 0;
}

.ighe-viewer-title{
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.01em;
}

.ighe-viewer-actions{
    display: flex;
    align-items: center;
    gap: 8px;
}

.ighe-sound-toggle,
.ighe-close{
    appearance: none;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    box-shadow: none;
    backdrop-filter: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}

.ighe-viewer .ighe-close{
    width: 24px;
    height: 24px;
    border-radius: 0;
    font-size: 28px;
    box-shadow: none !important;
    backdrop-filter: none;
}

.ighe-sound-toggle svg{
    width: 18px;
    height: 18px;
    display: block;
}

.ighe-sound-toggle[hidden]{
    display: none !important;
}

/* ── Stage ── */
.ighe-viewer-stage{
    position: relative;
    width: min(100%, var(--ighe-stage-max-width));
    aspect-ratio: 9 / 16;
    border-radius: 32px;
    overflow: hidden;
    background: #050505;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
}

.ighe-viewer-stage::before{
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .56) 0%, rgba(0, 0, 0, .14) 18%, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, 0) 72%, rgba(0, 0, 0, .18) 100%);
    z-index: 2;
    pointer-events: none;
}

/* ── Medya host ── */
.ighe-media-host{
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
}

.ighe-story-image,
.ighe-story-video{
    width: 100%;
    height: 100%;
    display: block;
    background: #050505;
    animation: igheFadeIn .22s ease both;
    object-position: center center;
}

.ighe-story-image{
    object-fit: contain;
}

.ighe-story-video{
    object-fit: contain;
}

/* ── Yükleniyor / Hata ── */
.ighe-loading,
.ighe-error{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, .92);
    background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .06));
    z-index: 1;
}

.ighe-loading::before{
    content: "";
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .18);
    border-top-color: #fff;
    animation: igheSpin .9s linear infinite;
}

.ighe-error{
    background: rgba(255, 255, 255, .04);
}

.ighe-error::before{
    display: none;
}

/* ── Stage içi nav (story item ileri/geri) ── */
.ighe-nav{
    appearance: none;
    border: 0;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 3;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    cursor: pointer;
    padding: 0;
    display: block;
    transition: none;
}

.ighe-nav:hover,
.ighe-nav:focus-visible{
    background: none !important;
    outline: none;
}

.ighe-nav-prev{
    left: 0;
}

.ighe-nav-next{
    right: 0;
}

/* ── Boş durum ── */
.ighe-empty-state{
    padding: 16px;
    border: 1px dashed #d1d5db;
    border-radius: 14px;
    color: #4b5563;
    font-size: 14px;
}

/* ════════════════════════════════════════
   ANİMASYONLAR
════════════════════════════════════════ */

@keyframes igheFadeIn{
    from{
        opacity: .38;
        transform: scale(1.015);
    }
    to{
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes igheSpin{
    to{
        transform: rotate(360deg);
    }
}

/* ════════════════════════════════════════
   MASAÜSTÜ — yan önizleme paneli
════════════════════════════════════════ */

@media (min-width: 768px){

    /* Stage: yükseklik viewport'a sığsın, max-width'den büyük olmasın */
    .ighe-viewer-stage{
        height: min(calc(100vh - 80px), calc(var(--ighe-stage-max-width) * 16 / 9));
        width: auto; /* aspect-ratio'dan hesaplanır */
    }

    /* Yan paneller görünür */
    .ighe-viewer-aside{
        display: flex;
    }
}

/* ════════════════════════════════════════
   MOBİL
════════════════════════════════════════ */

@media (max-width: 767px){

    /* Track okları gizle */
    .ighe-scroll-arrow{
        display: none !important;
    }

    .ighe-track-wrap{
        cursor: default;
    }

    .ighe-highlight-button{
        width: max(calc(var(--ighe-circle-size) + 4px), 86px);
        min-width: max(calc(var(--ighe-circle-size) + 4px), 86px);
    }

    .ighe-highlight-label{
        font-size: 11px;
        min-height: 2.4em;
    }

    /* Viewer: tam ekran */
    .ighe-viewer-layout{
        padding: 0;
        gap: 0;
        align-items: stretch;
    }

    .ighe-viewer-aside{
        display: none !important;
    }

    .ighe-viewer-main{
        flex: 1;
        min-height: 100dvh;
        width: 100%;
    }

    .ighe-viewer-stage{
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        aspect-ratio: auto;
    }

    .ighe-viewer-top{
        top: max(12px, env(safe-area-inset-top));
        left: 0;
        right: 0;
        padding: 0 10px;
    }

    .ighe-nav{
        width: 50%;
    }
}

/* ════════════════════════════════════════
   AZALTILMIŞ HAREKET
════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce){
    .ighe-highlight-button,
    .ighe-highlight-thumb-wrap,
    .ighe-story-image,
    .ighe-story-video,
    .ighe-aside-card{
        transition: none;
        animation: none;
    }
}
