/* Botão "Inscrições abertas" no header-actions (ícone + contador + tooltip) */
.header-open-admissions {
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

.header-open-admissions summary {
    list-style: none;
    overflow: visible;
    position: relative;
}

.header-open-admissions summary::-webkit-details-marker {
    display: none;
}

.header-open-admissions .open-admissions-count {
    align-items: center;
    background: #ffcd07;
    border-radius: 999px;
    color: #071d41;
    display: inline-flex;
    font-size: 10px;
    font-weight: 700;
    height: 16px;
    justify-content: center;
    min-width: 16px;
    padding: 0 4px;
    position: absolute;
    right: -2px;
    top: -2px;
}

.header-open-admissions summary[data-tooltip]::after {
    background: #071d41;
    border-radius: 4px;
    color: #fff;
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 500;
    left: 50%;
    opacity: 0;
    padding: 4px 8px;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 6px);
    transform: translateX(-50%);
    transition: opacity 0.15s ease;
    white-space: nowrap;
    z-index: 1001;
}

.header-open-admissions summary:hover::after,
.header-open-admissions summary:focus-visible::after {
    opacity: 1;
}

.header-open-admissions[open] summary::after {
    display: none;
}

.header-open-admissions .br-list {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 360px;
    z-index: 1000;
}

.header-open-admissions .br-list .br-item {
    display: block;
    padding: 10px 16px;
}

.open-admissions-deadline {
    font-weight: 600;
}

.open-admissions-deadline.urgent {
    color: #e52207;
}

/* Trilho de stories (cards 9:16) */
.stories-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stories-header h2 {
    color: #1351b4;
}

.stories-track {
    display: grid;
    gap: 16px;
    grid-auto-columns: calc((100% - 48px) / 4.3);
    grid-auto-flow: column;
    list-style: none;
    margin: 0;
    overflow-x: auto;
    padding: 0 0 8px;
    scroll-snap-type: x mandatory;
}

.stories-track li {
    margin: 0;
    max-width: 260px;
    scroll-snap-align: start;
}

.story-card {
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    color: #fff;
    display: block;
    overflow: hidden;
    position: relative;
    transition: transform 0.15s ease;
}

.story-card:hover,
.story-card:focus-visible {
    color: #fff;
    text-decoration: none;
    transform: translateY(-4px);
}

.story-card img,
.story-slide img {
    background: #fff;
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.story-card-auto {
    background: linear-gradient(160deg, #1351b4 0%, #071d41 100%);
}

/* Alto-falante decorativo centralizado na parte de cima dos cards sem imagem */
.story-card-auto::before {
    color: rgba(255, 255, 255, 0.14);
    content: "\f0a1";
    font-family: "Font Awesome 5 Free";
    font-size: 96px;
    font-weight: 900;
    left: 50%;
    line-height: 1;
    position: absolute;
    top: 14%;
    transform: translateX(-50%);
}

.story-slide.story-card-auto::before {
    font-size: 220px;
    top: 16%;
}

.story-card-body {
    background: linear-gradient(transparent, rgba(7, 29, 65, 0.92) 45%);
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    left: 0;
    padding: 48px 14px 16px;
    position: absolute;
    right: 0;
    z-index: 1;
}

.story-card-group {
    align-self: flex-start;
    background: #ffcd07;
    border-radius: 999px;
    color: #071d41;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    text-transform: uppercase;
}

.story-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.story-card-deadline {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.story-card-deadline.urgent {
    background: #e52207;
    border-radius: 4px;
    padding: 2px 6px;
    align-self: flex-start;
}

.story-card-cta {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
    font-weight: 700;
    padding-top: 8px;
}

/* Visualizador em tela cheia */
body.story-open {
    overflow: hidden;
}

.story-viewer {
    align-items: center;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 2000;
}

.story-viewer[hidden] {
    display: none;
}

.story-viewer-frame {
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    height: min(92vh, 860px);
    overflow: hidden;
    position: relative;
}

.story-slide {
    color: #fff;
    display: none;
    inset: 0;
    position: absolute;
}

.story-slide.active {
    display: block;
}

.story-slide-body {
    background: linear-gradient(transparent, rgba(7, 29, 65, 0.95) 35%);
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    left: 0;
    padding: 80px 24px 28px;
    position: absolute;
    right: 0;
    z-index: 3;
}

.story-slide-body .story-card-deadline {
    font-size: 14px;
    margin: 0;
}

.story-slide-body h3 {
    color: #fff;
    font-size: 22px;
    line-height: 1.25;
    margin: 0;
}

.story-slide-body .br-button {
    width: 100%;
}

.story-slide-body .story-secondary {
    background: transparent;
    border-color: #fff;
    color: #fff;
}

.story-progress {
    display: flex;
    gap: 4px;
    left: 12px;
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 4;
}

.story-progress span {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    flex: 1;
    height: 3px;
    overflow: hidden;
}

.story-progress i {
    background: #fff;
    display: block;
    height: 100%;
    width: 0;
}

.story-close {
    color: #fff !important;
    position: absolute;
    right: 8px;
    top: 24px;
    z-index: 5;
}

.story-nav {
    background: transparent;
    border: 0;
    bottom: 40%;
    cursor: pointer;
    position: absolute;
    top: 60px;
    width: 40%;
    z-index: 2;
}

.story-prev {
    left: 0;
}

.story-next {
    right: 0;
}

@media (max-width: 575px) {
    .stories-track {
        grid-auto-columns: 62%;
    }

    .story-viewer-frame {
        border-radius: 0;
        height: 100%;
        width: 100%;
        aspect-ratio: auto;
    }
}

.stories-header h2 {
    font-weight: 600;
}

.story-card-subgroup {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.85;
    text-transform: uppercase;
}

/* Arte da Ascom que já contém texto: só a faixa do botão */
.story-card-body-cta-only {
    background: linear-gradient(transparent, rgba(7, 29, 65, 0.85) 60%);
    padding-top: 32px;
}

.story-card-body-cta-only .story-card-cta {
    border-top: 0;
    padding-top: 0;
}

/* Garante contraste das barras de progresso e do botão fechar sobre artes claras */
.story-viewer-frame::before {
    background: linear-gradient(rgba(0, 0, 0, 0.45), transparent);
    content: "";
    height: 90px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 3;
}
