/* ============================================================
   fooba.studio — Stories Block
   ============================================================ */

/* ── Strip de avatares ─────────────────────────────────────── */
.fooba-stories-block {
    width    : 100%;
    position : relative; /* contexto para os botões de scroll */
}

.fooba-stories-strip-wrap {
    position : relative;
    width    : 100%;
}

.fooba-stories-strip {
    display   : flex;
    flex-direction: row;
    gap       : 12px;
    overflow-x: auto;
    padding   : 16px 48px; /* espaço lateral para os botões */
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.fooba-stories-strip::-webkit-scrollbar { display: none; }

/* ── Botões de scroll lateral ───────────────────────────────── */
.fooba-stories-scroll-btn {
    position        : absolute;
    top             : 50%;
    transform       : translateY(-50%);
    z-index         : 5;
    width           : 36px;
    height          : 36px;
    border-radius   : 50%;
    border          : none;
    background      : rgba(255,255,255,0.9);
    box-shadow      : 0 2px 8px rgba(0,0,0,0.15);
    color           : #333;
    font-size       : 18px;
    cursor          : pointer;
    display         : flex;
    align-items     : center;
    justify-content : center;
    padding         : 0;
    line-height     : 1;
    transition      : background 0.15s ease, opacity 0.2s ease;
    opacity         : 1;
}
.fooba-stories-scroll-btn:hover  { background: #fff; }
.fooba-stories-scroll-btn--prev  { left : 6px; }
.fooba-stories-scroll-btn--next  { right: 6px; }
.fooba-stories-scroll-btn.hidden { opacity: 0; pointer-events: none; }

/* ── Avatar item ────────────────────────────────────────────── */
.fooba-stories-item {
    display       : flex;
    flex-direction: column;
    align-items   : center;
    gap           : 6px;
    flex-shrink   : 0;
    cursor        : pointer;
    scroll-snap-align: start;
    background    : none;
    border        : none;
    padding       : 0;
    /* width definido via CSS escoped */
}
.fooba-stories-item:focus {
    outline: none; /* borda de foco já vem do ring */
}
.fooba-stories-item:focus .fooba-stories-ring {
    box-shadow: 0 0 0 3px rgba(99,102,241,0.5);
}

/* ── Anel do avatar ─────────────────────────────────────────── */
.fooba-stories-ring {
    border-radius : 50%;
    padding       : 3px;
    box-sizing    : border-box;
    background    : transparent;
    overflow      : hidden;  /* garante que a img não vaze */
    flex-shrink   : 0;
    transition    : transform 0.18s ease, box-shadow 0.18s ease;
    /* border e width: via CSS escoped */
}

/* Imagem dentro do ring precisa de overflow:hidden no pai + border-radius */
.fooba-stories-ring img,
.fooba-stories-ring > div {
    display      : block;
    width        : 100%;
    height       : 100%;
    border-radius: 50%;
    object-fit   : cover;
    overflow     : hidden;
}
.fooba-stories-item:hover .fooba-stories-ring,
.fooba-stories-item:focus .fooba-stories-ring {
    transform: scale(1.06);
}

/* Anel sem posts novos (já visualizado) */
.fooba-stories-item.fooba-stories-seen .fooba-stories-ring {
    border-color: #ccc !important;
}

.fooba-stories-avatar {
    width        : 100%;
    height       : 100%;
    border-radius: 50%;
    object-fit   : cover;
    display      : block;
}

/* Fallback inicial com letra */
.fooba-stories-avatar-fallback {
    width           : 100%;
    height          : 100%;
    border-radius   : 50%;
    display         : flex;
    align-items     : center;
    justify-content : center;
    font-weight     : bold;
    color           : #fff;
    /* background e font-size: inline */
}

/* ── Label (nome do autor) ──────────────────────────────────── */
.fooba-stories-label {
    text-align    : center;
    overflow      : hidden;
    text-overflow : ellipsis;
    white-space   : nowrap;
    /* width, font-size: inline */
}

/* ── VIEWER (overlay fullscreen estilo Instagram) ───────────── */
.fooba-stories-viewer {
    position        : fixed;
    inset           : 0;
    z-index         : 10000;
    background      : #000;
    display         : flex;
    align-items     : center;
    justify-content : center;
    opacity         : 0;
    visibility      : hidden;
    transition      : opacity 0.25s ease, visibility 0.25s ease;
}
.fooba-stories-viewer.fooba-sv-open {
    opacity    : 1;
    visibility : visible;
}

/* Imagem de fundo */
.fooba-sv-bg {
    position    : absolute;
    inset       : 0;
    background-size    : cover;
    background-position: center;
    background-repeat  : no-repeat;
    transition  : background-image 0.2s ease;
}
.fooba-sv-bg::after {
    content    : '';
    position   : absolute;
    inset      : 0;
    background : linear-gradient(
        to bottom,
        rgba(0,0,0,0.35) 0%,
        rgba(0,0,0,0.1)  30%,
        rgba(0,0,0,0.1)  60%,
        rgba(0,0,0,0.75) 100%
    );
}

/* Área de conteúdo (sobre o fundo) */
.fooba-sv-content {
    position : relative;
    z-index  : 2;
    width    : 100%;
    max-width: 480px;
    height   : 100%;
    display  : flex;
    flex-direction: column;
    justify-content: flex-start;
    padding  : 0;
    margin   : 0 auto;
}

/* ── Barra de progresso ────────────────────────────────────── */
.fooba-sv-progress {
    display : flex;
    gap     : 4px;
    padding : 16px 16px 8px;
}
.fooba-sv-bar {
    flex       : 1;
    height     : 2px;
    background : rgba(255,255,255,0.35);
    border-radius: 2px;
    overflow   : hidden;
}
.fooba-sv-bar__fill {
    height     : 100%;
    width      : 0%;
    background : #fff;
    transition : width linear;
}
.fooba-sv-bar--done .fooba-sv-bar__fill  { width: 100%; transition: none; }
.fooba-sv-bar--active .fooba-sv-bar__fill { width: 0%; }

/* ── Cabeçalho: avatar + nome + fechar ────────────────────── */
.fooba-sv-header {
    display     : flex;
    align-items : center;
    gap         : 10px;
    padding     : 0 16px 12px;
    position    : relative;
    z-index     : 2;
}
.fooba-sv-avatar {
    width        : 36px;
    height       : 36px;
    border-radius: 50%;
    object-fit   : cover;
    border       : 2px solid rgba(255,255,255,0.7);
    flex-shrink  : 0;
}
.fooba-sv-author-name {
    color      : #fff;
    font-size  : 14px;
    font-weight: 600;
    flex       : 1;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.fooba-sv-close {
    width           : 36px;
    height          : 36px;
    border-radius   : 50%;
    border          : none;
    background      : rgba(255,255,255,0.15);
    color           : #fff;
    font-size       : 20px;
    cursor          : pointer;
    display         : flex;
    align-items     : center;
    justify-content : center;
    padding         : 0;
    flex-shrink     : 0;
    backdrop-filter : blur(4px);
    transition      : background 0.15s ease;
    line-height     : 1;
}
.fooba-sv-close:hover { background: rgba(255,255,255,0.28); }

/* ── Rodapé: metas + título + botão ────────────────────────── */
.fooba-sv-footer {
    margin-top     : auto;   /* empurra para o fundo do flex container */
    padding        : 16px 20px 32px;
    position       : relative;
    z-index        : 3;
    pointer-events : all;
}
.fooba-sv-meta-top  { margin-bottom: 6px; }
.fooba-sv-meta-bot  { margin-top:    6px; }
.fooba-sv-meta-top,
.fooba-sv-meta-bot {
    display    : flex;
    flex-wrap  : wrap;
    gap        : 6px;
    font-size  : 11px;
    color      : rgba(255,255,255,0.75);
    align-items: center;
}

.fooba-sv-title {
    color      : #fff;
    font-size  : 18px;
    font-weight: bold;
    line-height: 1.3;
    margin     : 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.fooba-sv-readmore {
    display        : flex;
    align-items    : center;
    justify-content: center;
    gap            : 6px;
    margin-top     : 14px;
    padding        : 12px 20px;
    border-radius  : 24px;
    width          : 100%;
    box-sizing     : border-box;
    background     : rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    border         : 1px solid rgba(255,255,255,0.3);
    color          : #fff;
    font-size      : 14px;
    font-weight    : 600;
    text-decoration: none;
    transition     : background 0.15s ease;
    cursor         : pointer;
}
.fooba-sv-readmore:hover,
.fooba-sv-readmore:focus {
    background     : rgba(255,255,255,0.28);
    text-decoration: none;
    color          : #fff;
}

/* ── Botões prev/next laterais ──────────────────────────────── */
.fooba-sv-nav {
    position        : absolute;
    top             : 50%;
    transform       : translateY(-50%);
    z-index         : 3;
    width           : 44px;
    height          : 44px;
    border-radius   : 50%;
    border          : none;
    background      : rgba(255,255,255,0.12);
    color           : #fff;
    font-size       : 22px;
    cursor          : pointer;
    display         : flex;
    align-items     : center;
    justify-content : center;
    padding         : 0;
    backdrop-filter : blur(4px);
    transition      : background 0.15s ease;
    line-height     : 1;
}
.fooba-sv-nav:hover  { background: rgba(255,255,255,0.25); }
.fooba-sv-nav--prev  { left : 8px; }
.fooba-sv-nav--next  { right: 8px; }

/* ── Tap zones (clique L/R para nav dentro do story) ─────── */
/* NÃO cobrem o footer — param antes do rodapé para não bloquear links */
.fooba-sv-tap {
    position : absolute;
    top      : 0;
    bottom   : 180px;  /* deixa o footer livre */
    width    : 40%;
    z-index  : 1;
}
.fooba-sv-tap--left  { left : 0; }
.fooba-sv-tap--right { right: 0; }

/* ── Resumo do post ────────────────────────────────────────── */
.fooba-sv-excerpt {
    color      : rgba(255,255,255,0.8);
    font-size  : 13px;
    line-height: 1.5;
    margin     : 8px 0 0;
    display    : -webkit-box;
    -webkit-line-clamp : 3;
    -webkit-box-orient : vertical;
    overflow   : hidden;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Pontinhos de progresso (topo do viewer) ────────────────── */
.fooba-sv-dots {
    display        : flex;
    justify-content: center;
    align-items    : center;
    gap            : 5px;
    padding        : 10px 20px 6px;
}
.fooba-sv-dot {
    width        : 6px;
    height       : 6px;
    border-radius: 50%;
    background   : rgba(255,255,255,0.35);
    flex-shrink  : 0;
    transition   : background 0.2s ease, transform 0.2s ease;
}
.fooba-sv-dot--done {
    background: rgba(255,255,255,0.9);
}
.fooba-sv-dot--active {
    background: #fff;
    transform : scale(1.35);
}

/* ── Pausa no hover/touch ───────────────────────────────────── */
.fooba-stories-viewer.fooba-sv-paused .fooba-sv-bar--active .fooba-sv-bar__fill {
    transition: none;
}

/* ── Responsivo ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .fooba-sv-content { max-width: 100%; }
    .fooba-sv-nav     { display: none; } /* navegação só por tap no mobile */
}
