/* === Revista Edições — Frontend CSS v2 === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --re-primary:      #155e38;
    --re-primary-dk:   #0d3f26;
    --re-primary-lt:   #1a7a4a;
    --re-green-soft:   #e8f5ee;
    --re-dark:         #1a1a2e;
    --re-ink:          #1e293b;
    --re-muted:        #64748b;
    --re-border:       #e2e8f0;
    --re-bg:           #fdfcfb;
    --re-card-bg:      #ffffff;
    --re-shadow-sm:    0 1px 4px rgba(0,0,0,.08);
    --re-shadow-md:    0 4px 20px rgba(0,0,0,.10);
    --re-shadow-lg:    0 8px 40px rgba(0,0,0,.15);
    --re-radius:       4px;
    --re-font-head:    'Playfair Display', Georgia, serif;
    --re-font-body:    'Inter', system-ui, sans-serif;
    --re-ease:         cubic-bezier(.4,0,.2,1);
}

/* ══════════════════════════════════════════════
   WRAPPER
══════════════════════════════════════════════ */
.re-wrapper {
    font-family: var(--re-font-body);
    color: var(--re-ink);
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ══════════════════════════════════════════════
   HEADER + FILTROS
══════════════════════════════════════════════ */
.re-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.re-titulo {
    font-family: var(--re-font-head);
    font-size: clamp(20px, 2.8vw, 30px);
    font-weight: 900;
    color: var(--re-dark);
    margin: 0;
    letter-spacing: -.4px;
}

/* Barra de filtro estilo Image 2 */
.re-filtros-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--re-primary);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.re-filtros-bar__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--re-muted);
    margin-right: 4px;
    white-space: nowrap;
}

.re-filtro-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1.5px solid var(--re-border);
    background: transparent;
    border-radius: 24px;
    font-family: var(--re-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--re-ink);
    cursor: pointer;
    transition: all .2s var(--re-ease);
    white-space: nowrap;
}

.re-filtro-btn:hover {
    border-color: var(--re-primary);
    color: var(--re-primary);
}

.re-filtro-btn.active {
    background: var(--re-primary);
    border-color: var(--re-primary);
    color: #fff;
    font-weight: 600;
}

.re-filtro-count {
    background: rgba(0,0,0,.12);
    border-radius: 12px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.re-filtro-btn.active .re-filtro-count {
    background: rgba(255,255,255,.25);
}

/* Filtro de ano (separado, menor) */
.re-filtros-bar--ano {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    margin-top: -18px;
    margin-bottom: 24px;
    justify-content: flex-end;
}

.re-filtro-ano-btn {
    padding: 4px 12px;
    border: 1px solid var(--re-border);
    background: transparent;
    border-radius: 3px;
    font-family: var(--re-font-body);
    font-size: 12px;
    color: var(--re-muted);
    cursor: pointer;
    transition: all .2s var(--re-ease);
}

.re-filtro-ano-btn:hover,
.re-filtro-ano-btn.active {
    background: var(--re-primary-dk);
    border-color: var(--re-primary-dk);
    color: #fff;
}

/* ══════════════════════════════════════════════
   GRID DE CARDS
══════════════════════════════════════════════ */
.re-grid {
    display: grid;
    gap: 24px;
}

.re-grid--2col { grid-template-columns: repeat(2, 1fr); }
.re-grid--3col { grid-template-columns: repeat(3, 1fr); }
.re-grid--4col { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
    .re-grid--4col { grid-template-columns: repeat(2, 1fr); }
    .re-grid--3col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .re-grid--4col,
    .re-grid--3col,
    .re-grid--2col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
    .re-grid--4col,
    .re-grid--3col,
    .re-grid--2col { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   CARD — estilo Image 3
══════════════════════════════════════════════ */
.re-card {
    background: var(--re-card-bg);
    border-radius: var(--re-radius);
    box-shadow: var(--re-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--re-border);
    transition: transform .25s var(--re-ease), box-shadow .25s var(--re-ease);
    animation: reFadeIn .35s ease both;
}

.re-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--re-shadow-lg);
}

.re-card.re-hidden { display: none; }

/* Capa do card */
.re-card__capa {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #eee;
    flex-shrink: 0;
}

.re-card__capa img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.re-card:hover .re-card__capa img {
    transform: scale(1.04);
}

.re-card__sem-capa {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    background: linear-gradient(135deg, #f0f7f3 0%, #dceee5 100%);
}

/* Badge de edição — topo esquerdo (como Image 3) */
.re-card__num-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--re-primary);
    color: #fff;
    font-family: var(--re-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 5px 12px;
    z-index: 3;
}

/* Overlay de ação no hover */
.re-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,63,38,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s var(--re-ease);
    z-index: 4;
}

.re-card:hover .re-card__overlay { opacity: 1; }

/* Info do card */
.re-card__info {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-top: 1px solid var(--re-border);
}

.re-card__titulo {
    font-family: var(--re-font-head);
    font-size: 15px;
    font-weight: 700;
    color: var(--re-dark);
    margin: 0;
    line-height: 1.3;
}

.re-card__data {
    font-size: 12px;
    color: var(--re-muted);
    display: block;
}

.re-card__destaque {
    font-size: 12px;
    color: var(--re-primary);
    font-weight: 600;
    margin: 0;
    font-style: italic;
}

.re-card__descricao {
    font-size: 12.5px;
    color: var(--re-muted);
    line-height: 1.55;
    margin: 0;
}

.re-card__acoes {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.re-sem-conteudo {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
}

/* ══════════════════════════════════════════════
   BOTÕES
══════════════════════════════════════════════ */
.re-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--re-radius);
    font-family: var(--re-font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s var(--re-ease);
    text-decoration: none;
    border: none;
    outline: none;
    letter-spacing: .2px;
}

.re-btn--primario {
    background: var(--re-primary);
    color: #fff;
}
.re-btn--primario:hover { background: var(--re-primary-lt); color: #fff; }

.re-btn--contorno {
    background: transparent;
    color: var(--re-primary-dk);
    border: 1.5px solid var(--re-primary-dk);
}
.re-btn--contorno:hover {
    background: var(--re-primary-dk);
    color: #fff;
}

.re-btn--download {
    background: transparent;
    color: var(--re-ink);
    border: 1.5px solid var(--re-border);
}
.re-btn--download:hover {
    background: var(--re-ink);
    color: #fff;
    border-color: var(--re-ink);
}

.re-btn--pdf {
    background: var(--re-primary);
    color: #fff;
}
.re-btn--pdf:hover { background: var(--re-primary-lt); color: #fff; }

.re-btn--ler {
    background: var(--re-primary-dk);
    color: #fff;
}
.re-btn--ler:hover { background: #071e12; color: #fff; }

.re-btn--lg {
    padding: 13px 28px;
    font-size: 15px;
    border-radius: 3px;
}

/* ══════════════════════════════════════════════
   ÚLTIMA EDIÇÃO — home (estilo Image 1)
══════════════════════════════════════════════ */
.re-ultima-edicao {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--re-font-body);
}

/* Capa com borda de magazine */
.re-ultima__capa-wrap {
    position: relative;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 0 0 8px #fff,
        0 0 0 10px #e2e8f0,
        var(--re-shadow-lg);
    border-radius: 2px;
    overflow: visible;
    display: block;
}

.re-ultima__img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

.re-ultima__sem-capa {
    width: 100%;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    background: linear-gradient(135deg, #f0f7f3 0%, #d0e8da 100%);
    border-radius: 2px;
}

/* Badge de edição sobre a capa */
.re-ultima__badge {
    position: absolute;
    top: 16px;
    left: -6px;
    background: var(--re-primary);
    color: #fff;
    padding: 6px 16px 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--re-font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .4px;
    box-shadow: 2px 2px 8px rgba(0,0,0,.25);
    z-index: 5;
}

/* pequena aba inferior (efeito ribbon) */
.re-ultima__badge::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    border-left: 6px solid transparent;
    border-right: 0 solid transparent;
    border-top: 5px solid var(--re-primary-dk);
}

.re-ultima__badge-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    opacity: .8;
}

.re-ultima__badge-sep { opacity: .5; }

.re-ultima__badge-num {
    font-size: 16px;
    font-weight: 900;
    font-family: var(--re-font-head);
}

/* Botões abaixo da capa */
.re-ultima__botoes {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Info abaixo da capa (opcional) */
.re-ultima__info {
    margin-top: 20px;
    text-align: center;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.re-ultima__cats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.re-ultima__cat-tag {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 2px;
}

.re-ultima__titulo {
    font-family: var(--re-font-head);
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 900;
    color: var(--re-dark);
    margin: 0;
    line-height: 1.25;
}

.re-ultima__data {
    font-size: 13px;
    color: var(--re-muted);
}

.re-ultima__destaque {
    font-size: 13.5px;
    color: var(--re-primary);
    font-weight: 600;
    font-style: italic;
    margin: 0;
    padding: 8px 0;
    border-top: 1px solid var(--re-border);
    border-bottom: 1px solid var(--re-border);
}

.re-ultima__descricao {
    font-size: 14px;
    line-height: 1.65;
    color: #4a5568;
    margin: 0;
}

/* Layout horizontal (quando há info ao lado) */
.re-ultima-edicao--horizontal {
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
}

.re-ultima-edicao--horizontal .re-ultima__capa-wrap {
    flex: 0 0 auto;
    width: clamp(200px, 30%, 340px);
}

.re-ultima-edicao--horizontal .re-ultima__info {
    text-align: left;
    margin-top: 0;
    padding-top: 8px;
    flex: 1;
}

.re-ultima-edicao--horizontal .re-ultima__cats  { justify-content: flex-start; }
.re-ultima-edicao--horizontal .re-ultima__botoes {
    margin-top: 0;
    justify-content: flex-start;
}

/* Responsivo */
@media (max-width: 680px) {
    .re-ultima-edicao--horizontal {
        flex-direction: column;
        align-items: center;
    }
    .re-ultima-edicao--horizontal .re-ultima__capa-wrap { width: clamp(180px, 65%, 300px); }
    .re-ultima-edicao--horizontal .re-ultima__info { text-align: center; }
    .re-ultima-edicao--horizontal .re-ultima__cats,
    .re-ultima-edicao--horizontal .re-ultima__botoes { justify-content: center; }
}

/* ══════════════════════════════════════════════
   PAGINAÇÃO
══════════════════════════════════════════════ */
.re-paginacao {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.re-paginacao .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid var(--re-border);
    border-radius: 3px;
    font-family: var(--re-font-body);
    font-size: 13px;
    color: var(--re-ink);
    text-decoration: none;
    transition: all .2s var(--re-ease);
}

.re-paginacao .page-numbers.current,
.re-paginacao .page-numbers:hover {
    background: var(--re-primary);
    border-color: var(--re-primary);
    color: #fff;
}

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.re-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.re-modal.open { display: flex; }

.re-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.re-modal-box {
    position: relative;
    background: var(--re-bg);
    border-radius: 6px;
    width: 90vw;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    overflow: hidden;
    animation: reSlideUp .25s ease;
}

@keyframes reSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.re-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 3px solid var(--re-primary);
    background: var(--re-primary-dk);
    color: #fff;
    flex-shrink: 0;
}

.re-modal-header-info { display: flex; flex-direction: column; gap: 3px; }

.re-modal-header h3 {
    font-family: var(--re-font-head);
    font-size: 19px;
    font-weight: 700;
    margin: 0;
}

#re-modal-meta {
    font-size: 12px;
    color: rgba(255,255,255,.6);
}

.re-modal-fechar {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.re-modal-fechar:hover { background: rgba(255,255,255,.3); }

.re-modal-body {
    overflow-y: auto;
    padding: 28px 32px;
    flex: 1;
    font-family: var(--re-font-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--re-ink);
}
.re-modal-body h1,.re-modal-body h2,.re-modal-body h3 { font-family: var(--re-font-head); color: var(--re-dark); }
.re-modal-body img { max-width: 100%; height: auto; border-radius: 3px; }
.re-modal-body a { color: var(--re-primary); }

/* ══════════════════════════════════════════════
   LOADING / EMPTY
══════════════════════════════════════════════ */
.re-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px;
    color: var(--re-muted);
}

.re-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--re-border);
    border-top-color: var(--re-primary);
    border-radius: 50%;
    animation: reSpin .7s linear infinite;
}

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

.re-sem-edicoes,.re-nenhum-resultado {
    text-align: center;
    color: var(--re-muted);
    font-style: italic;
    padding: 40px;
    grid-column: 1 / -1;
}
.re-nenhum-resultado { display: none; }

/* ══════════════════════════════════════════════
   ANIMAÇÕES
══════════════════════════════════════════════ */
@keyframes reFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.re-card:nth-child(1) { animation-delay: .04s; }
.re-card:nth-child(2) { animation-delay: .08s; }
.re-card:nth-child(3) { animation-delay: .12s; }
.re-card:nth-child(4) { animation-delay: .16s; }
.re-card:nth-child(5) { animation-delay: .20s; }
.re-card:nth-child(6) { animation-delay: .24s; }
