/*
 * Laughtale - Capa & Edição
 * Base 0.1.7
 * Este arquivo estiliza apenas conteúdo específico da capa/edição.
 * A estrutura do leitor e a navegação vivem em style.css/main.js.
 */

:root { --bg-drawer: #f1eee7; }

/* The admin toolbar occupies viewport space while editors preview the cover. */
body.admin-bar .home-magazine-viewport { height: calc(100dvh - 32px); }
@media (max-width: 782px) {
    body.admin-bar .home-magazine-viewport { height: calc(100dvh - 46px); }
}

/* ==========================================================
   VERSO DA CAPA E LOMBADA
   ========================================================== */
.verso-page {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background-size: cover;
    background-position: center;
}

.verso-main-area {
    flex: 1 1 auto;
    min-height: 0;
    margin-right: 16px;
    overflow: auto;
    overscroll-behavior: contain;
    font-size: .84rem;
    line-height: 1.5;
}
.verso-main-area p { margin: 0 0 .8rem; }
.verso-main-area a { color: #ffb703; }
.verso-main-area img { display: block; max-width: 100%; max-height: 260px; margin: .5rem auto; object-fit: contain; }

.book-spine-strip {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 12px;
    height: 100%;
    padding: 1.3rem 0;
    pointer-events: none;
    background: linear-gradient(to right, #050505, #1a1a1a, #080808);
    border-left: 1px solid rgba(255,255,255,.15);
}
.spine-text {
    color: rgba(255,255,255,.72);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: .5rem;
    font-weight: 800;
    letter-spacing: .08em;
    white-space: nowrap;
    writing-mode: vertical-rl;
}

.verso-isbn-box {
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 55px;
    margin-right: 16px;
    padding: 4px 6px;
    background: #fff;
    color: #000;
    border: 1px solid #111;
}
.verso-isbn-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ==========================================================
   CAPA
   ========================================================== */
.cover-page-right {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 50%;
    height: 100%;
    padding: clamp(1rem, 2vw, 1.8rem);
    overflow: hidden;
    background-position: center;
    background-size: cover;
    color: #fff;
}
.cover-page-right::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,.16), transparent 35%, rgba(0,0,0,.32));
}
.cover-page-right > * { position: relative; z-index: 1; }

.cover-top-logo { order: 1; max-width: 92%; flex-shrink: 0; }
.cover-top-logo img { display: block; width: auto !important; max-height: var(--custom-logo-height, 80px) !important; object-fit: contain; }
.cover-logo-text { color: #fff; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.45rem, 2.7vw, 2.2rem); font-weight: 900; letter-spacing: .04em; }

.cover-main-clean,
.cover-callout { display: block; text-decoration: none; transition: transform .18s ease, opacity .18s ease; }
.cover-main-clean:hover,
.cover-callout:hover { transform: translateY(-2px); opacity: .94; }

.main-pos-top { order: 2; margin-top: .5rem; }
.main-pos-bottom { order: 4; margin-top: auto; }
.cover-main-clean { max-width: 96%; }

.cover-callouts-area { order: 3; display: flex; flex-direction: column; min-height: 0; margin: .4rem 0; overflow: hidden; }
.callouts-vpos-top { margin-bottom: auto; }
.callouts-vpos-bottom { margin-top: auto; margin-bottom: .5rem; }
.cover-callout { max-width: 88%; }

.align-esquerda { align-self: flex-start; margin-right: auto; text-align: left; }
.align-centro { align-self: center; margin-right: auto; margin-left: auto; text-align: center; }
.align-direita { align-self: flex-end; margin-left: auto; text-align: right; }
.is-bold { font-weight: 900 !important; }
.is-normal { font-weight: 400 !important; }
.is-italic { font-style: italic !important; }
.has-white-box {
    display: inline-block;
    margin: 0 0 .18rem !important;
    padding: .08rem .45rem !important;
    border-radius: 2px;
    background: rgba(255,255,255,.94);
    color: #111 !important;
}
.cover-callout h3,
.cover-main-clean h2 { margin: 0 0 .35rem !important; line-height: .98 !important; white-space: pre-line; }
.cover-callout p,
.cover-main-clean p { margin: 0 !important; line-height: 1.15 !important; opacity: .96; white-space: pre-line; }

/* ==========================================================
   CONTRACAPA
   ========================================================== */
.home-left-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #0d0d0d;
    background-position: center;
    background-size: cover;
    color: #fff;
}
.backcover-longtext-box {
    z-index: 2;
    max-height: 62%;
    margin: .25rem 0 .75rem;
    padding: 1rem 1.15rem;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #111;
    background: rgba(255,255,255,.95);
    color: #222;
    font-size: .8rem;
    line-height: 1.5;
}
.backcover-longtext-box p { margin: 0 0 .65rem; }

/* ==========================================================
   ÍNDICE / EXPEDIENTE
   ========================================================== */
.home-right-index {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.15rem 1.45rem !important;
    overflow: hidden;
    background: var(--bg-drawer);
}
.index-custom-topbar { display: flex; flex: 0 0 auto; align-items: stretch; justify-content: space-between; min-height: 54px; margin-bottom: .6rem; }
.index-top-left-box { display: flex; align-items: center; justify-content: center; width: 58%; gap: .85rem; padding: .35rem .55rem; border: 1px solid #111; }
.index-top-logo { display: block; width: auto !important; max-height: 40px !important; object-fit: contain; }
.index-edition-square-badge { display: flex; flex: 0 0 44px; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid currentColor; border-radius: 3px; line-height: 1; }
.index-edition-square-badge .edition-number { font-family: 'Playfair Display', Georgia, serif; font-size: .96rem; font-weight: 900; font-style: italic; }
.index-edition-square-badge .edition-date { margin-top: 2px; font-size: .48rem; font-weight: 800; text-transform: uppercase; }
.index-top-right-box-clean { display: flex; align-items: center; justify-content: flex-end; width: 40%; overflow: hidden; }
.index-expediente-text-right { width: 100%; color: #333; font-size: .52rem; line-height: 1.2; text-align: right; }

.index-editorial-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-right: .25rem; }
.index-highlights-list { display: flex; flex-direction: column; gap: .55rem; }
.index-highlight-item.no-border { display: flex; align-items: center; gap: .75rem; padding-bottom: .25rem; }
.index-highlight-item.img-pos-direita { flex-direction: row-reverse; }
.index-highlight-thumb-large { flex: 0 0 80px; width: 80px; height: 80px; overflow: hidden; border: 1px solid #111; }
.index-highlight-thumb-large img { width: 100%; height: 100%; object-fit: cover; }
.index-highlight-content { min-width: 0; flex: 1; }
.index-highlight-content a { display: block; color: #111; text-decoration: none; }
.index-highlight-content h3 { margin: 0 0 .15rem !important; line-height: 1.12; }
.index-highlight-content p { margin: 0; color: #444; line-height: 1.25; }
.index-divider { height: 1px; margin: .6rem 0; background: #111; }
.index-section-title { margin: 0 0 .3rem; font-family: 'Playfair Display', Georgia, serif; font-size: .8rem; }
.index-recent-posts-list ul { margin: 0; padding: 0; list-style: none; }
.index-recent-posts-list li { margin-bottom: .22rem; padding-bottom: .16rem; border-bottom: 1px dotted #c7c1b7; font-size: .72rem; }
.index-recent-posts-list .post-date { margin-right: .35rem; color: var(--accent-red); font-size: .62rem; font-weight: 800; }
.index-recent-posts-list a { color: #111; text-decoration: none; font-weight: 650; }

.index-bottom-footer-menu { flex: 0 0 auto; margin-top: .45rem; padding-top: .4rem; border-top: 1px solid #111; }
.index-menu-two-columns ul { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .6rem; margin: 0; padding: 0; list-style: none; }
.index-menu-two-columns a { color: #111; text-decoration: none; font-size: .62rem; font-weight: 800; text-transform: uppercase; }

/* ==========================================================
   MOBILE: nesta primeira base a capa prioriza a frente e a
   página Edição prioriza o índice. O verso/contracapa será
   transformado em páginas navegáveis numa etapa posterior.
   ========================================================== */
@media (max-width: 900px) {
    .home-magazine-viewport .verso-page { display: none; }
    .home-magazine-viewport .cover-page-right { display: flex; width: 100%; }
    .edicao-magazine-viewport .home-left-page { display: none; }
    .edicao-magazine-viewport .home-right-index { display: flex; width: 100%; }
    .book-spine-strip { display: none; }
    .cover-main-clean,
    .cover-callout { max-width: 94%; }
}
