/* ==========================================================
   HOME.CSS — Versão 14.5 Master (Force Hardware Fix)
   * Objetivo: Refinamento visual com toque de rosa e cubo 3D discreto.
   * Ajuste V14.5: Isolation de camada para PC e contenção de texto.
   ========================================================== */

/* RESET DE SEGURANÇA GLOBAL */
* { box-sizing: border-box; }

/* 1. PROGRESS BAR DE LEITURA */
.scroll-progress {
    position: fixed; top: 0; left: 0; width: 0%; height: 4px;
    background: linear-gradient(to right, var(--primary), #ec4899); /* Toque de rosa no final */
    z-index: 99999;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
}

/* ----------------------------------------------------------
   2. HERO AREA PREMIUM (MESH & GLASS)
---------------------------------------------------------- */
.home-hero-premium {
    position: relative;
    padding: 160px 0 100px;
    background: #060b16; /* Fundo Deep Space */
    overflow: hidden;
    display: flex; align-items: center;
    min-height: 650px;
    width: 100%;
    box-sizing: border-box;
}

/* Fundo Vivo (Mesh Blobs - Com toque Rosa) */
.hero-visual-elements {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; pointer-events: none;
}
.mesh-blob {
    position: absolute; filter: blur(90px); opacity: 0.4; border-radius: 50%;
    animation: meshMove 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}
/* [FIX MOBILE] Força opacidade no mobile para não sumir */
.blob-1 { width: 600px; height: 600px; background: var(--primary); top: -200px; right: -150px; }
.blob-2 { width: 500px; height: 500px; background: #ec4899; bottom: -150px; left: -100px; animation-delay: -5s; opacity: 0.3; } /* Rosa */
.blob-3 { width: 300px; height: 300px; background: #00f2fe; top: 40%; left: 40%; opacity: 0.2; animation-delay: -10s; }

@keyframes meshMove {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -50px) scale(1.1); }
}

/* Glass Card Central */
.hero-container { position: relative; z-index: 10; width: 100%; box-sizing: border-box; }

.hero-glass-card {
    background: rgba(255, 255, 255, 0.05); /* [FIX] Mais contraste no fundo */
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 70px 40px; border-radius: 30px;
    max-width: 900px; margin: 0 auto; text-align: center;
    box-sizing: border-box; /* [FIX] Impede que padding estoure a largura */
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900; line-height: 1.1; color: #fff;
    margin-bottom: 25px; text-shadow: 0 5px 20px rgba(0,0,0,0.5);
}
.hero-subtitle {
    font-size: 1.2rem; color: rgba(255,255,255,0.9); /* [FIX] Texto mais claro */
    max-width: 700px; margin: 0 auto 40px; font-weight: 400;
}

/* Botões Hero */
.hero-actions { display: flex; gap: 20px; justify-content: center; }
.btn-hero-primary {
    background: var(--primary); color: #fff; padding: 16px 40px;
    border-radius: 14px; font-weight: 700; font-size: 1.1rem;
    box-shadow: 0 0 25px rgba(13, 110, 253, 0.4);
    transition: 0.3s;
}
.btn-hero-primary:hover { transform: translateY(-4px); box-shadow: 0 0 40px rgba(13, 110, 253, 0.6); }

.btn-hero-secondary {
    background: rgba(255,255,255,0.1); color: #fff; padding: 16px 40px;
    border-radius: 14px; font-weight: 700; border: 1px solid rgba(255,255,255,0.3);
    transition: 0.3s;
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }

/* ----------------------------------------------------------
   3. HIGHLIGHTS (GRID COM TOQUE ROSA)
---------------------------------------------------------- */
.highlights-area { 
    position: relative; 
    z-index: 20; 
    margin-top: -70px; 
    margin-bottom: 60px;
    width: 100%;
    box-sizing: border-box;
}

.highlights-container {
    display: grid; grid-template-columns: 1.6fr 1fr; gap: 30px;
    /* Gradiente sutil Rosa no fundo */
    background: radial-gradient(circle at top right, rgba(236, 72, 153, 0.05), transparent 40%),
                #ffffff; /* [FIX] Fundo branco sólido fallback */
    padding: 30px; border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.08); border: 1px solid rgba(255,255,255,0.6);
    box-sizing: border-box; /* [FIX] Impede vazamento lateral */
    width: 100%;
}

.highlight-main {
    position: relative; border-radius: 20px; overflow: hidden;
    height: 520px; box-shadow: var(--shadow-lg);
}
.thumb-wrapper { width: 100%; height: 100%; position: relative; overflow: hidden; }

.highlight-img-main {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.highlight-main:hover .highlight-img-main { transform: scale(1.08); }

.thumb-gradient {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 80%;
    background: linear-gradient(to top, #000 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    pointer-events: none; z-index: 1;
}

.highlight-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 40px; color: #fff; z-index: 2;
}
.highlight-content .title {
    font-size: 2.2rem; font-weight: 800; margin-bottom: 12px;
    line-height: 1.15; text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.highlight-meta {
    display: flex; gap: 15px; font-size: 0.9rem; opacity: 0.9; margin-bottom: 15px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}

.highlights-sidebar { display: flex; flex-direction: column; gap: 20px; justify-content: space-between; }
.highlight-side-item {
    background: #fff; padding: 15px; border-radius: 16px;
    display: flex; align-items: center; gap: 15px;
    transition: 0.3s; border: 1px solid rgba(0,0,0,0.03);
}
.highlight-side-item:hover {
    transform: translateX(5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--primary);
}
.side-thumb img { width: 100px; height: 75px; object-fit: cover; border-radius: 10px; }
.side-title { font-size: 1rem; line-height: 1.4; color: #1e293b; /* [FIX] Cor escura forçada */ }

.cat-badge {
    position: absolute; top: 20px; left: 20px; z-index: 5;
    background: var(--primary); color: #fff;
    padding: 6px 14px; border-radius: 8px;
    font-weight: 700; text-transform: uppercase; font-size: 0.75rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ----------------------------------------------------------
   4. POST CARDS
---------------------------------------------------------- */
.posts-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 35px;
    width: 100%;
}

.post-card {
    background: #fff; border-radius: 18px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
    display: flex; flex-direction: column;
}
.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.card-thumb {
    position: relative; height: 220px; overflow: hidden;
    border-radius: 18px 18px 0 0;
}
.card-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s ease;
}
.post-card:hover .card-img { transform: scale(1.1); }

.card-badge {
    position: absolute; top: 15px; left: 15px;
    background: rgba(255,255,255,0.95); color: #1e293b; /* [FIX] Cor escura */
    padding: 5px 12px; border-radius: 6px;
    font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 5;
}

.card-badge-trend {
    position: absolute; top: 15px; right: 15px;
    background: #ef4444; color: #fff;
    padding: 4px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 700;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    animation: pulseRed 2s infinite; z-index: 5;
}

.card-indicator-audio {
    position: absolute; bottom: 15px; right: 15px;
    width: 36px; height: 36px;
    background: rgba(13, 110, 253, 0.9); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.6); z-index: 5;
}

.card-overlay-play {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    background: rgba(0,0,0,0.6); border: 2px solid #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; z-index: 4; opacity: 0.9;
}

.card-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.card-meta {
    display: flex; gap: 15px; font-size: 0.8rem; color: #94a3b8;
    margin-bottom: 12px; font-weight: 500;
}
.card-meta i { color: var(--primary); }
.card-title {
    font-size: 1.25rem; margin-bottom: 10px; line-height: 1.35;
    font-weight: 700; color: #1e293b; /* [FIX] Cor escura */
}
.card-title a { transition: color 0.2s; color: inherit; }
.card-title a:hover { color: var(--primary); }
.card-excerpt { font-size: 0.95rem; color: #64748b; line-height: 1.6; margin-bottom: 0; }

.card-tag-recipe {
    display: inline-block; background: #fff7ed; color: #ea580c;
    padding: 4px 8px; border-radius: 4px; font-size: 0.75rem;
    font-weight: 700; border: 1px solid #ffedd5; margin-right: 5px;
}

/* ----------------------------------------------------------
   5. CUBE 3D (MICRO ANÚNCIO - 120px)
   * FIX OBRIGATÓRIO PARA DESKTOP: Diferença de renderização GPU
---------------------------------------------------------- */
.ad-3d-section {
    padding: 20px 0;
    overflow: visible;
    perspective: 1200px;
    position: relative;
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.ad-3d-section.hidden { display: none !important; }

.ad-scene {
    width: 120px; height: 120px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
}

/* Botão Fechar (X) Pequeno */
.btn-close-ad {
    position: absolute;
    top: -20px; right: -20px;
    width: 20px; height: 20px; font-size: 12px;
    background: rgba(0,0,0,0.1); border: none; border-radius: 50%;
    color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.3s; z-index: 100;
}
.btn-close-ad:hover { background: #ef4444; color: #fff; }

.ad-cube {
    width: 100%; height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transform: translateZ(-60px); 
    animation: spinCube 20s infinite linear;
}

.ad-face {
    position: absolute;
    width: 120px; height: 120px;
    border: 1px solid rgba(13, 110, 253, 0.15);
    background: #ffffff !important; /* [ATUALIZAÇÃO] Branco sólido corrigido */
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 0 !important; /* [ATUALIZAÇÃO] Remove paddings que descentralizam o conteúdo */
    box-shadow: inset 0 0 10px rgba(13, 110, 253, 0.05);
    backface-visibility: hidden; /* [FIX OBRIGATÓRIO] Desktop GPU flattening */
    transform-style: preserve-3d;
}

/* Faces Geométricas (120px width -> 60px offset) */
.ad-face-front { transform: rotateY(0deg) translateZ(60px); }
.ad-face-back  { transform: rotateY(180deg) translateZ(60px); }
.ad-face-right { transform: rotateY(90deg) translateZ(60px); }
.ad-face-left  { transform: rotateY(-90deg) translateZ(60px); }

/* Conteúdo Micro */
.ad-face h3 { 
    font-size: 0.75rem; margin: 5px 0; 
    color: #1e293b !important; 
    line-height: 1.1; font-weight:800; 
}

/* [FIX PC] Centralização absoluta e redução de salto para 5px */
.ad-content {
    transform: translateZ(5px); /* [ATUALIZAÇÃO] Mínimo de 5px para não saltar 1cm */
    transform-style: preserve-3d;
    backface-visibility: hidden;
    width: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: absolute; top: 0; left: 0; bottom: 0; right: 0; /* [ATUALIZAÇÃO] Força centralização na face */
    margin: auto;
    z-index: 10;
}

.ad-face p { display: none; } 
.ad-label { font-size: 0.6rem; padding: 2px 6px; }

.btn-ad-cta {
    background: #1e293b; color: #fff; padding: 4px 10px; font-size: 0.65rem;
    border-radius: 50px; font-weight: 700; border: none; cursor: pointer; transition: 0.3s;
}
.btn-ad-cta:hover { background: var(--primary); transform: scale(1.05); }

@keyframes spinCube {
    0% { transform: translateZ(-60px) rotateY(0deg); }
    100% { transform: translateZ(-60px) rotateY(-360deg); }
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ----------------------------------------------------------
   6. BOTÃO CARREGAR MAIS (GHOST STYLE)
---------------------------------------------------------- */
.load-more-container { text-align: center; margin-top: 60px; width: 100%; }

.btn-load-more {
    background: #fff; /* [FIX MOBILE] Fundo sólido */
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 40px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex; align-items: center; gap: 10px;
    position: relative; overflow: hidden;
}

.btn-load-more i { transition: transform 0.4s ease; }

.btn-load-more:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.3);
    transform: translateY(-3px);
}

.btn-load-more:hover i { transform: rotate(180deg); }
.btn-load-more:active { transform: translateY(-1px); }
.btn-load-more.disabled { opacity: 0.7; cursor: not-allowed; border-color: #cbd5e1; color: #94a3b8; }

/* ----------------------------------------------------------
   7. RESPONSIVIDADE
---------------------------------------------------------- */
@media (max-width: 992px) {
    .highlights-container { grid-template-columns: 1fr; }
    .highlight-main { height: 400px; }
    .highlights-sidebar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
    .highlight-side-item { flex-direction: column; text-align: center; }
    .side-thumb img { width: 100%; height: 100px; }
}

@media (max-width: 768px) {
    /* [FIX HERO MOBILE] Padding ajustado e alinhamento */
    .home-hero-premium { padding: 140px 0 80px; min-height: auto; align-items: flex-start; }
    
    /* [FIX] Box-Sizing impede vazamento de largura */
    .hero-glass-card { padding: 40px 20px; box-sizing: border-box; }
    .hero-title { font-size: 2.5rem; }
    
    /* [FIX BUTTONS] Trava a largura em 90% para não tocar as bordas */
    .hero-actions { 
        flex-direction: column; 
        gap: 15px;
        width: 100%;
        align-items: center;
        padding: 0;
    }
    
    .btn-hero-primary, .btn-hero-secondary {
        display: block; /* Garante comportamento de bloco */
        width: 90%; /* Deixa 5% de respiro de cada lado */
        max-width: 320px; 
        padding: 14px 20px; 
        box-sizing: border-box;
        margin-left: auto !important; /* Força centralização */
        margin-right: auto !important; /* Força centralização */
    }
    
    .highlights-container {
        padding: 15px; 
        width: 100%;
        box-sizing: border-box; /* [FIX] Impede vazamento do grid */
        margin: 0 !important;
    }

    .highlights-sidebar { grid-template-columns: 1fr; width: 100%; }
    .highlight-side-item { flex-direction: row; text-align: left; }
    .side-thumb img { width: 90px; height: 90px; }

    /* [FIX CUBO MOBILE] Força centralização e remove conflitos */
    .ad-3d-section { display: flex !important; justify-content: center; margin: 40px 0; }
    .ad-scene { transform: scale(0.9); }
}
