/* ==========================================================================
   GRID (shortcode + arquivo da categoria/tag)
   ========================================================================== */

.nv-webstories-archive {
    padding: 40px 18px 72px;
}

.nv-webstories-shell {
    max-width: 1080px;
    margin: 0 auto;
}

.nv-webstories-shell h1 {
    margin: 0 0 6px;
    font-size: 34px;
    line-height: 1.1;
}

.nv-webstories-intro {
    margin: 0 0 24px;
    opacity: .7;
}

.nv-webstories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

/* Slider horizontal (layout padrão do shortcode) */
.nv-ws-slider {
    position: relative;
}

.nv-ws-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 2px 2px 10px;
    scrollbar-width: none;
    cursor: grab;
}

.nv-ws-track::-webkit-scrollbar {
    display: none;
}

.nv-ws-track.is-drag {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

.nv-ws-track > .nv-webstory-card {
    flex: 0 0 auto;
    width: 210px;
    scroll-snap-align: start;
}

/* Telas menores: cards proporcionais à tela, rolagem com o dedo */
@media (max-width: 782px) {
    .nv-ws-track > .nv-webstory-card { width: 46vw; max-width: 240px; }
}

@media (max-width: 480px) {
    .nv-ws-track > .nv-webstory-card { width: 66vw; }
}

.nv-webstory-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #10161f;
    aspect-ratio: 9 / 14;
    min-height: 300px;
    box-shadow: 0 8px 24px rgba(15, 25, 40, .20);
    transition: transform .2s ease, box-shadow .2s ease;
}

.nv-webstory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(15, 25, 40, .34);
}

/* Imagem como fundo do link -> imune ao CSS de <img> do tema */
.nv-webstory-card__link {
    position: absolute;
    inset: 0;
    display: block;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none;
    color: #fff;
}

.nv-webstory-card__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .55) 28%, rgba(0, 0, 0, .05) 58%, rgba(0, 0, 0, .28) 100%);
}

.nv-webstory-card__meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 16px;
}

.nv-webstory-kicker {
    display: inline-block;
    color: #ffd21e;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.nv-webstory-card__title {
    display: block;
    color: #fff !important;
    font-size: 18px;
    line-height: 1.16;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}

.nv-webstories-empty {
    padding: 28px;
    text-align: center;
    border: 1px dashed #c7d2de;
    border-radius: 10px;
    opacity: .75;
}

/* ==========================================================================
   VISUALIZADOR IMERSIVO (single)
   ========================================================================== */

body.nv-story-page {
    margin: 0;
    background: #000;
    overflow: hidden;
}

.nv-story {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: radial-gradient(circle at center, #2a2a2e 0%, #050505 75%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------------------
   Blindagem contra o tema.
   Alguns temas aplicam `transition` + cor de destaque em button/a. Como as
   transições têm prioridade ACIMA de !important, a cor do tema "gruda" nos
   botões. Zeramos transição/animação e forçamos aparência/cores.
--------------------------------------------------------------------------- */
.nv-story button,
.nv-story a {
    -webkit-appearance: none;
    appearance: none;
    transition: none !important;
    animation: none !important;
    outline: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    text-decoration: none !important;
    font: inherit;
    cursor: pointer;
}

.nv-story__icon,
.nv-story__side {
    background: rgba(0, 0, 0, .4) !important;
    color: #fff !important;
    border-radius: 50% !important;
}

.nv-story__tap {
    background: transparent !important;
}

.nv-story__site,
.nv-story__title,
.nv-story__author,
.nv-story__caption {
    color: #fff !important;
}

.nv-story__kicker {
    background: #ffd21e !important;
    color: #111 !important;
}

.nv-story__read {
    background: rgba(255, 255, 255, .95) !important;
    color: #111 !important;
    border-radius: 999px !important;
}

.nv-story__cta {
    background: #ffd21e !important;
    color: #111 !important;
    border-radius: 999px !important;
}

/* Grupos = cada webstory (matéria) */
.nv-story__groups {
    position: absolute;
    inset: 0;
}

.nv-story__group {
    position: absolute;
    inset: 0;
    display: none;
}

.nv-story__group.is-active {
    display: block;
}

.nv-story__frame {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 440px;
    max-height: 100vh;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #111;
}

@media (min-width: 800px) {
    .nv-story__frame {
        max-height: 94vh;
        border-radius: 16px;
        box-shadow: 0 24px 70px rgba(0, 0, 0, .7);
    }
}

/* Slides */
.nv-story__stage {
    position: absolute;
    inset: 0;
}

.nv-story__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    background-size: cover;
    background-position: center;
    background-color: #111;
    display: flex;
    align-items: flex-end;
    transition: opacity .35s ease;
}

.nv-story__slide.is-active {
    opacity: 1;
    visibility: visible;
}

.nv-story__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .35) 45%, rgba(0, 0, 0, .12) 75%, rgba(0, 0, 0, .35) 100%);
}

.nv-story__copy {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 22px 20px 92px;
    color: #fff;
    box-sizing: border-box;
}

.nv-story__kicker {
    display: inline-block;
    background: #ffd21e;
    color: #111;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 10px;
}

.nv-story__title {
    margin: 0;
    font-size: clamp(24px, 6vw, 34px);
    line-height: 1.08;
    font-weight: 900;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

.nv-story__author {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(0, 0, 0, .55);
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.nv-story__caption {
    font-size: clamp(22px, 5.6vw, 30px);
    line-height: 1.14;
    font-weight: 900;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nv-story__caption a {
    color: #ffd21e;
}

/* Linha de ações (Ler matéria + CTA opcional), fixa no rodapé do story */
.nv-story__cta-row {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    z-index: 6;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    flex-wrap: wrap;
}

.nv-story__cta,
.nv-story__read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    padding: 11px 18px;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
}

.nv-story__cta {
    background: #ffd21e;
    color: #111;
}

.nv-story__read {
    background: rgba(255, 255, 255, .95);
    color: #111;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
}

/* Botões laterais de navegação (sempre visíveis) */
.nv-story__side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .4);
    color: #fff;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
}

.nv-story__side--prev { left: 10px; }
.nv-story__side--next { right: 10px; }

.nv-story__side:hover { background: rgba(0, 0, 0, .65); }

/* Barras de progresso */
.nv-story__progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    gap: 4px;
    padding: 10px 12px 0;
}

.nv-story__bar {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .35);
    overflow: hidden;
}

.nv-story__bar > i {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: 3px;
}

/* Topo: marca + ações */
.nv-story__top {
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.nv-story__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

.nv-story__logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.nv-story__site {
    font-size: 14px;
    font-weight: 700;
}

.nv-story__actions {
    display: flex;
    gap: 6px;
}

.nv-story__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.nv-story__icon.is-copied {
    background: #2ecc71;
}

/* Zonas de toque (mobile) */
.nv-story__tap {
    position: absolute;
    top: 60px;
    bottom: 0;
    width: 32%;
    z-index: 4;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nv-story__tap--prev { left: 0; }
.nv-story__tap--next { right: 0; width: 68%; }

/* Setas (desktop, fora do frame) */
.nv-story__arrow {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease;
}

.nv-story__arrow:hover {
    background: rgba(255, 255, 255, .28);
}

@media (max-width: 799px) {
    .nv-story { gap: 0; }
    .nv-story__arrow { display: none; }
}


/* ==========================================================================
   FORMATOS DOS CARDS (shape): portrait = padrão acima | square | round
   ========================================================================== */

.nv-ws-shape-square .nv-webstory-card {
    aspect-ratio: 1 / 1;
    min-height: 0;
}

.nv-ws-shape-round .nv-webstory-card {
    aspect-ratio: auto;
    min-height: 0;
    overflow: visible;
    background: none;
    box-shadow: none;
    padding: 8px 8px 58px;
}

.nv-ws-shape-round .nv-webstory-card:hover {
    box-shadow: none;
}

.nv-ws-shape-round .nv-webstory-card__link {
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px #ffd21e;
}

.nv-ws-shape-round .nv-webstory-card__scrim,
.nv-ws-shape-round .nv-webstory-kicker {
    display: none;
}

.nv-ws-shape-round .nv-webstory-card__meta {
    top: 100%;
    bottom: auto;
    left: -6px;
    right: -6px;
    padding: 14px 0 0;
    text-align: center;
}

.nv-ws-shape-round .nv-webstory-card__title {
    color: inherit !important;
    text-shadow: none;
    font-size: 13px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nv-ws-shape-round .nv-ws-track > .nv-webstory-card {
    width: 112px;
}

.nv-ws-shape-round.nv-webstories-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 16px 12px;
}
