/**
 * Page Full - Ebook Section Styles
 * Visual moderno, responsivo e de alta conversão para destaque de E-book.
 */

/* Prevenir rolagem horizontal e definir fundo contínuo na página dedicada */
body.sf-ebook-page-active {
    overflow-x: hidden;
}

/* Reset total de espaçamento e restrições de largura do tema na página de ebook */
body.sf-ebook-page-active .entry-content,
body.sf-ebook-page-active .wp-block-post-content,
body.sf-ebook-page-active main,
body.sf-ebook-page-active .wp-site-blocks,
body.sf-ebook-page-active article,
body.sf-ebook-page-active .wp-block-group {
    max-width: 100% !important;
    width: 100% !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: 0 !important;
}

/* Remover espaço superior do rodapé quando na página de ebook */
body.sf-ebook-page-active .sf-footer,
.sf-ebook-section + .sf-footer,
.sf-ebook-section ~ .sf-footer {
    margin-top: 0 !important;
}

/* Ocultar títulos, cabeçalhos e rodapés nativos do tema na página de ebook */
body.sf-ebook-page-active .wp-block-post-title,
body.sf-ebook-page-active .entry-title,
body.sf-ebook-page-active .page-title,
body.sf-ebook-page-active header.entry-header,
body.sf-ebook-page-active .entry-header,
body.sf-ebook-page-active h1.single-title,
body.sf-ebook-page-active .wp-block-query-title,
body.sf-ebook-page-active footer.wp-block-template-part,
body.sf-ebook-page-active .wp-block-template-part-footer,
body.sf-ebook-page-active footer.site-footer,
body.sf-ebook-page-active .site-footer,
body.sf-ebook-page-active footer.wp-block-group {
    display: none !important;
}

.sf-ebook-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: relative;
    padding: 80px 20px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    color: #ffffff;
    box-sizing: border-box;
}

.sf-ebook-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.sf-ebook-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.sf-ebook-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: center;
}

/* Coluna de Conteúdo */
.sf-ebook-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.sf-ebook-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #f8fafc;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sf-ebook-title {
    font-size: 38px;
    line-height: 1.25;
    font-weight: 800;
    margin: 0 0 20px 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sf-ebook-description {
    font-size: 17px;
    line-height: 1.65;
    margin: 0 0 32px 0;
    max-width: 600px;
    opacity: 0.95;
}

.sf-ebook-description p {
    margin: 0 0 12px 0;
}

.sf-ebook-description p:last-child {
    margin-bottom: 0;
}

/* Ações e Botões */
.sf-ebook-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sf-ebook-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    line-height: 1.3;
    border: 2px solid transparent;
}

.sf-ebook-btn .dashicons,
.sf-ebook-btn i {
    font-size: 18px;
    width: auto;
    height: auto;
    line-height: 1;
    flex-shrink: 0;
}

.sf-ebook-btn--primary {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.sf-ebook-btn--primary:hover {
    filter: brightness(1.12);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.sf-ebook-btn--primary .sf-ebook-btn-arrow {
    transition: transform 0.25s ease;
}

.sf-ebook-btn--primary:hover .sf-ebook-btn-arrow {
    transform: translateX(4px);
}

.sf-ebook-btn--secondary {
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: none;
}

.sf-ebook-btn--secondary:hover {
    filter: brightness(1.15);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Coluna de Mídia / Capa 3D */
.sf-ebook-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sf-ebook-cover-wrapper {
    position: relative;
    perspective: 1000px;
    max-width: 360px;
    width: 100%;
}

.sf-ebook-book-3d {
    position: relative;
    transform: rotateY(-8deg) rotateX(4deg);
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: inline-block;
}

.sf-ebook-book-3d:hover {
    transform: rotateY(0deg) rotateX(0deg) translateY(-8px);
}

.sf-ebook-cover-img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    border-radius: 4px 10px 10px 4px;
    box-shadow: 
        -5px 5px 15px rgba(0, 0, 0, 0.3),
        0 20px 40px rgba(0, 0, 0, 0.45);
    display: block;
}

.sf-ebook-book-shadow {
    position: absolute;
    bottom: -20px;
    left: 5%;
    width: 90%;
    height: 25px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 75%);
    z-index: -1;
    filter: blur(6px);
}

/* Fallback de Capa quando não há imagem */
.sf-ebook-fallback-book {
    position: relative;
    width: 260px;
    height: 360px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px 14px 14px 6px;
    box-shadow: -8px 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    box-sizing: border-box;
    transform: rotateY(-8deg) rotateX(4deg);
    transition: transform 0.4s ease;
}

.sf-ebook-fallback-book:hover {
    transform: rotateY(0deg) rotateX(0deg) translateY(-6px);
}

.sf-ebook-fallback-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sf-ebook-fallback-icon {
    font-size: 56px;
    width: 56px;
    height: 56px;
    color: #e00000;
}

.sf-ebook-fallback-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.sf-ebook-fallback-badge {
    background: rgba(224, 0, 0, 0.2);
    border: 1px solid #e00000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Responsividade */
@media (max-width: 991px) {
    .sf-ebook-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .sf-ebook-content {
        align-items: center;
        text-align: center;
    }

    .sf-ebook-actions {
        justify-content: center;
    }

    .sf-ebook-title {
        font-size: 32px;
    }
}

@media (max-width: 600px) {
    .sf-ebook-section {
        padding: 50px 16px;
    }

    .sf-ebook-title {
        font-size: 26px;
    }

    .sf-ebook-description {
        font-size: 15px;
    }

    .sf-ebook-actions {
        flex-direction: column;
        width: 100%;
    }

    .sf-ebook-btn {
        width: 100%;
        box-sizing: border-box;
    }

    .sf-ebook-fallback-book {
        width: 220px;
        height: 300px;
    }
}
