/*
 * Páginas de arquivo e single: projetos
 * Tema Leia
 */

/* =========================================
   Cabeçalho da página de categoria
   ========================================= */
.arquivo-projetos__header {
    padding-block: clamp(2.5rem, 5vw, 4rem);
    border-bottom: 4px dashed #000000;
    max-width: 960px;
    justify-self: center;
    width: 100%;
    border-image: repeating-linear-gradient(
            to right,
            #7070709e 0 4px,
            /* comprimento de cada traço */ #00000000 4px 12px
                /* espaço entre os traços */
        )
        1;
}

.arquivo-projetos__header .arquivo-projetos__titulo {
    font-family: var(--ff-titulo);
    font-size: var(--fonte-3xl);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.05;
    text-align: center;
}

.arquivo-projetos__descricao {
    font-family: var(--ff-texto);
    font-size: var(--fonte-base);
    line-height: var(--lh-texto);
    max-width: 680px;
    color: #555;
    margin-top: 0.75rem;
}

.arquivo-projetos__vazio {
    font-family: var(--ff-texto);
    font-size: var(--fonte-base);
    color: #888;
    text-align: center;
}

/* =========================================
   Utilitário acessibilidade
   ========================================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   Abas de mídia do card de projeto
   ========================================= */
.projeto-tabs {
    display: flex;
    gap: 0.4rem;
    padding: 0.75rem clamp(1.5rem, 3vw, 2.5rem);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #fafafa;
    justify-content: center;
    flex-wrap: wrap;
}

.projeto-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 100px;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    color: #888;
    font-family: var(--ff-titulo);
    font-size: var(--e-global-typography-59f0fb5-font-size, 0.6875rem);
    font-weight: var(--e-global-typography-59f0fb5-font-weight, 500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    transition:
        color 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

.projeto-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    pointer-events: none;
}

.projeto-tab:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

.projeto-tab--ativo {
    border-color: #000;
    color: #000;
    background: #fff;
}

.projeto-tab__label {
    line-height: 1;
}

/* =========================================
   Destaque: altura padrão 16:9
   ========================================= */

/* O container define a altura; todos os painéis se adaptam */
.projeto-card__destaque {
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: clamp(280px, 55vw, 540px);
    overflow: hidden;
}

/*
 * Quando o painel Instagram está visível, libera a altura para o iframe
 * crescer ao seu tamanho natural (calculado dinamicamente pelo embeds.js).
 * :has() é live — reage ao toggle do atributo hidden feito pelo JS.
 */
.projeto-card__destaque:has(.projeto-painel--instagram:not([hidden])) {
    aspect-ratio: unset;
    height: auto;
    max-height: none;
}

.projeto-card__destaque:has(.projeto-painel--site:not([hidden])) {
    aspect-ratio: unset;
    max-height: none;
    overflow: visible;
}

/* Cada painel ocupa 100% da caixa */
.projeto-painel {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Garante que display:flex nos painéis não sobrescreva o atributo hidden */
.projeto-painel[hidden] {
    display: none !important;
}

/* =========================================
   Painéis de mídia
   ========================================= */

/* Vídeo: todos os filhos diretos e iframes preenchem o painel inteiro */
.projeto-painel--video > * {
    display: block;
    width: 100%;
    height: 100%;
}

.projeto-painel--video iframe,
.projeto-painel--video embed,
.projeto-painel--video object,
.projeto-painel--video .yt-facade {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    margin: 0;
}

/* Spotify: centralizado verticalmente no painel */
.projeto-painel--spotify {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dcdcdc;
    overflow: hidden;
}

.projeto-painel__spotify-wrap {
    width: 100%;
    padding: 0 clamp(1.5rem, 3vw, 2.5rem);
    overflow: hidden;
}

.projeto-painel--spotify iframe {
    display: block;
    border: none;
    width: 100%;
    height: 352px;
    border-radius: 12px;
}

@media (max-width: 600px) {
    /* Player compacto do Spotify em telas pequenas */
    .projeto-painel--spotify iframe {
        height: 152px;
    }
}

/* Painel site: label abaixo da imagem */
.projeto-painel--site {
    display: block;
    height: auto;
    overflow: visible;
}

.projeto-painel__site-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-decoration: none;
    overflow: visible;
}

.projeto-painel__site-link .projeto-destaque__img {
    display: block;
    width: 100%;
    height: clamp(280px, 55vw, 540px);
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.35s ease;
}

.projeto-painel__site-link:hover .projeto-destaque__img {
    transform: scale(1.02);
}

.projeto-painel__site-label {
    position: static;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 0.75rem 1rem;
    font-family: var(--ff-titulo);
    font-weight: var(--e-global-typography-59f0fb5-font-weight, 500);
    font-size: var(--e-global-typography-59f0fb5-font-size, 0.6875rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 0;
    line-height: 0px;
}

.projeto-painel__site-label svg {
    width: 14px;
    height: 14px;
}

.projeto-painel__site-sem-imagem {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f4f4f4;
    padding: 2rem;
}

/* =========================================
   Carrossel de posts do Instagram
   ========================================= */

/*
 * Painel Instagram: cresce com a altura natural do iframe.
 * height: auto permite que o conteúdo dite o tamanho do destaque.
 */
.projeto-painel--instagram {
    height: auto;
    overflow: hidden;
    background: #dcdcdc;
}

.ig-carousel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.25rem clamp(1rem, 3vw, 2rem);
}

.ig-carousel__pista {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.ig-carousel__trilha {
    display: flex;
    gap: 1rem;
    transition: transform 0.35s ease;
}

/* 2 posts por linha no desktop */
.ig-carousel__item {
    flex: 0 0 calc(50% - 0.5rem);
    min-width: 0;
}

/* Post único: mesma largura que no layout de 2 posts, centralizado */
.ig-carousel--single .ig-carousel__trilha {
    justify-content: center;
}

.ig-carousel--single .ig-carousel__item {
    flex: 0 0 calc(50% - 0.5rem);
}

/* Força o embed a ocupar a largura do item */
.ig-carousel__item .instagram-media,
.ig-carousel__item iframe {
    margin: 0 !important;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
}

/* Botões de navegação — posicionados sobre a área */
.ig-carousel__btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #000;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.ig-carousel__btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.ig-carousel__btn:hover:not(:disabled) {
    background: #000;
    color: #fff;
}

.ig-carousel__btn:disabled {
    opacity: 0.3;
    cursor: default;
}

@media (max-width: 768px) {
    .ig-carousel__item {
        flex: 0 0 100%;
    }

    .ig-carousel__btn {
        width: 36px;
        height: 36px;
    }

    .ig-carousel {
        padding: 0 0.75rem;
    }
}

/* =========================================
   Mídia destaque do projeto
   ========================================= */

/* Wrapper genérico */
.projeto-destaque {
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
    overflow: hidden;
}

/* Vídeo embed (oEmbed / iframe) — mantém proporção 16:9 */
.projeto-destaque--video iframe,
.projeto-destaque--video embed,
.projeto-destaque--video object {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Imagem panel: <a> deve preencher o painel inteiro */
.projeto-painel--imagem a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Imagens dentro de painéis: preenchem a caixa sem distorção */
.projeto-painel--site .projeto-destaque__img,
.projeto-painel--imagem .projeto-destaque__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: unset; /* cancela min-height do estilo global */
}

/* YouTube Lite Facade — substitui o iframe pesado por thumbnail + play */
.yt-facade {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    padding: 0;
    background: #000;
}

.yt-facade__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.yt-facade:hover .yt-facade__thumb {
    opacity: 0.8;
}

.yt-facade__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.yt-facade__play svg {
    width: 68px;
    height: 48px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    transition: transform 0.15s ease;
}

.yt-facade:hover .yt-facade__play svg {
    transform: scale(1.1);
}

/* Fallback: thumbnail + botão play quando oEmbed falha */
.projeto-destaque__link-video {
    display: block;
    position: relative;
    text-decoration: none;
}

.projeto-destaque__link-video .projeto-destaque__img {
    width: 100%;
    height: auto;
    display: block;
}

.projeto-destaque__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    transition: background var(--transicao);
}

.projeto-destaque__play::after {
    content: "";
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E")
        center / 26px no-repeat;
    flex-shrink: 0;
}

.projeto-destaque__link-video:hover .projeto-destaque__play {
    background: rgba(0, 0, 0, 0.5);
}

/* Imagem com link */
.projeto-destaque--imagem a {
    display: block;
}

.projeto-destaque__img {
    width: 100%;
    object-fit: cover;
    min-height: clamp(280px, 50vw, 600px);
    display: block;
}

/* Spotify embed */
.projeto-destaque--spotify iframe {
    display: block;
    border: none;
    width: 100%;
    border-radius: 12px;
}

/* Variação no contexto de item (grid) */
.projeto-destaque--item {
    margin-bottom: 0;
}

/* =========================================
   Arquivo (categoria / tag): fundo de tela
   ========================================= */
.arquivo-projetos,
.arquivo-tag {
    min-height: 100vh;
    transition: background-color 300ms ease;
}

.arquivo-tag {
    background-color: #f8f8f8;
}

/* =========================================
   Card de projeto — layout unificado
   (single, arquivo de categoria e de tag)
   ========================================= */

/* Containers dos arquivos: coluna sem gap, separador via <hr> */
.arquivo-projetos .container--wide,
.arquivo-tag__lista {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0;
    padding-block: clamp(2.5rem, 5vw, 4rem);
}

/* Card */
.projeto-card {
    border: 1px solid #bdbdbd;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    max-width: 960px;
}

/* Destaque: sem margem, sangra até o border-radius */
.projeto-card__destaque .projeto-destaque {
    margin-bottom: 0;
}

/* Corpo */
.projeto-card__corpo {
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

/* Categoria (breadcrumb) */
.projeto-card__categoria {
    font-family: var(--ff-titulo);
    font-size: var(--fonte-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
    margin-bottom: 0.5rem;
}

.projeto-card__categoria a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transicao);
}

.projeto-card__categoria a:hover {
    opacity: 1;
    color: #000;
}

/* Título: tamanho definido pela tag HTML */
.projeto-card__titulo {
    font-family: var(--ff-titulo);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

/* H1 no single e H2 nos arquivos — mesmo tamanho */
.projeto-card h1.projeto-card__titulo,
.projeto-card h2.projeto-card__titulo {
    font-size: var(--fonte-2xl);
}

.projeto-card__titulo-link {
    text-decoration: none;
    color: inherit;
    transition: color var(--transicao);
}

.projeto-card__titulo-link:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Conteúdo */
.projeto-card__conteudo {
    font-family: var(--ff-texto);
    font-size: var(--fonte-base);
    line-height: var(--lh-texto);
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.projeto-card__conteudo p {
    margin-bottom: 0.75em;
}

.projeto-card__conteudo p:last-child {
    margin-bottom: 0;
}

/* Meta: Período / Parceiros / Produto */
.projeto-card__meta {
    display: flex;
    flex-direction: column;
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.projeto-card__meta-item {
    font-family: var(--ff-texto);
    font-size: var(--fonte-base);
    line-height: var(--lh-texto);
    margin-bottom: 0.1em;
}

.projeto-card__meta-item dt {
    display: inline;
    font-weight: 600;
}

.projeto-card__meta-item dt::after {
    content: ": ";
}

.projeto-card__meta-item dd {
    display: inline;
}

/* Link externo */
.projeto-card__link {
    display: inline-flex;
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

/* Tags */
.projeto-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

/* Label acima das tags */
.projeto-tags-label {
    font-family: var(--ff-titulo);
    font-size: var(--fonte-base);
    font-weight: 600;
    text-transform: uppercase;
    color: #000;
    margin-top: clamp(1.25rem, 3vw, 2rem);
}

/* Tags */
.projeto-bloco__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
}

.projeto-item__tag a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    box-sizing: border-box;
    border-radius: var(--raio-sm);
    overflow: hidden;
    text-decoration: none;
    transition: border-color var(--transicao);
    background: #fafafa;
}

.projeto-item__tag a:hover {
    opacity: 1;
    box-sizing: border-box;
    border: 1.5px solid #000;
}

.projeto-item__tag-icone {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.projeto-item__tag-nome {
    font-family: var(--ff-titulo);
    font-size: var(--e-global-typography-59f0fb5-font-size, 0.6875rem);
    font-weight: var(--e-global-typography-59f0fb5-font-weight, 500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #000;
    padding: 0.35rem;
    text-align: center;
    line-height: 1.2;
}

/* =========================================
   Página única do projeto
   ========================================= */
.projeto-single {
    padding-block: clamp(2.5rem, 5vw, 4rem);
    justify-self: center;
}

/* O single usa o mesmo .projeto-card — sem estilos extras necessários */

/* =========================================
   Cabeçalho da tag (arquivo-tag)
   Mesmo padrão do layout oqf-tag:
   imagem 390×390 à esquerda, título + descrição à direita
   ========================================= */
.arquivo-tag__cabecalho {
    display: flex;
    flex-direction: column;
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
    border-bottom: 4px dashed;
    border-image: repeating-linear-gradient(
            to right,
            #7070709e 0 4px,
            #00000000 4px 12px
        )
        1;
    max-width: 960px;
}

.arquivo-tag__arte {
    width: 100%;
    background-color: var(--tag-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    margin-top: 40px;
}

.arquivo-tag__arte-img {
    display: block;
    width: 250px;
    height: auto;
    object-fit: cover;
}

.arquivo-tag__info {
    padding-block: clamp(1.5rem, 3vw, 2.5rem);
    padding-inline: clamp(1.5rem, 3vw, 2.5rem);
}

.arquivo-tag__titulo {
    font-family: var(--ff-titulo);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    text-align: left;
}

.arquivo-tag__descricao {
    font-family: var(--ff-texto);
    font-size: var(--fonte-base);
    line-height: var(--lh-texto);
    color: var(--cor-texto);
}

.arquivo-tag__lista {
    padding-block: clamp(2.5rem, 5vw, 4rem);
}

.arquivo-tag__vazio {
    font-family: var(--ff-texto);
    font-size: var(--fonte-base);
    color: #888;
    text-align: center;
}

/* .projetos-grid e .projeto-item não são mais usados nos templates —
   removidos para evitar conflito. Os cards usam .projeto-card. */

/* =========================================
   Separador serrilhado entre projetos
   ========================================= */
.separador-projetos {
    width: 100%;
    max-width: 960px;
    border: none;
    border-top: 4px dashed;
    border-image: repeating-linear-gradient(
            to right,
            #7070709e 0 4px,
            #00000000 4px 12px
        )
        1;
    margin-block: clamp(1.5rem, 3vw, 2.5rem);
}

/* =========================================
   Responsividade
   ========================================= */
@media (max-width: 768px) {
    /* Cards ocupam toda a largura: sangram o padding do container */
    .projeto-card {
        border-radius: 0;
        margin-inline: -1.25rem;
    }

    .arquivo-tag__arte {
        border-radius: 0px;
        margin-top: 0px;
    }

    /* Instagram: padding zero, itens ocupam 100% da pista via flex-basis */
    .ig-carousel {
        padding: 0;
    }

    .ig-carousel__item {
        width: 100%;
    }

    .arquivo-tag__cabecalho {
        padding-inline: unset;
    }

    .arquivo-tag__descricao {
        text-align: center;
    }

    .projeto-card__tags {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .projeto-item__tag a {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .separador-projetos {
        margin-inline: -1.25rem;
    }

    .projeto-painel__site-link .projeto-destaque__img {
        height: clamp(180px, 50vw, 260px);
    }
}

/* =========================================
   Paginação das páginas de arquivo
   ========================================= */
.arquivo-paginacao {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-block: clamp(2rem, 4vw, 3rem);
}

.arquivo-paginacao .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding-inline: 0.75rem;
    font-family: var(--ff-titulo);
    font-size: var(--fonte-sm);
    font-weight: 600;
    text-decoration: none;
    color: #000;
    border: 1px solid #000000;
    border-radius: 100px;
    transition: background-color var(--transicao), border-color var(--transicao);
}

.arquivo-paginacao .page-numbers:hover {
    background-color: #6cfe7b;
}

.arquivo-paginacao .page-numbers.current {
    background-color: #000;
    color: #fff;
}

.arquivo-paginacao .page-numbers.dots {
    pointer-events: none;
}
