/**
 * Homepage Styles - Blog Parceiros iFood
 * 
 * Estilos específicos para a homepage customizada
 * Usa componentes globais do design system
 * 
 * @version 1.0.0
 */

/* ========================================
   CONTAINER PRINCIPAL DA HOMEPAGE
   ======================================== */

.ifp-homepage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    contain: layout style;
    will-change: auto;
}

/* Garante box-sizing para todos elementos da homepage */
.ifp-homepage * {
    box-sizing: border-box;
}

/* ========================================
   SEÇÕES DA HOMEPAGE
   ======================================== */

.ifp-homepage-section {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    contain: layout;
}

/* Padding padrão para todas as seções (60px top/bottom) */
.ifp-homepage-section--jornadas,
.ifp-homepage-section--recentes,
.ifp-homepage-section--banner {
    padding: 60px 20px;
}

/* Seções com fundo bege claro */
.ifp-homepage-section--hero {
    background-color: var(--ifp-mcolor-begeclaro);
    padding: 60px 20px;
    margin: 0 0 30px;
    min-height: 600px;
    contain: layout style;
    will-change: auto;
}

.ifp-homepage-section--recentes {
    background-color: var(--ifp-mcolor-begeclaro);
    padding: 60px 20px;
}

/* Seção de jornadas com fundo branco */
.ifp-homepage-section--jornadas {
    background-color: #FFFFFF;
}

/* Seção de banner flexível (sem padding fixo) */
.ifp-homepage-section--banner {
    padding: 30px 20px 20px;
    background-color: var(--ifp-color-creme);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========================================
   TÍTULOS DAS SEÇÕES
   ======================================== */

.ifp-homepage-section__title {
    font-family: "Tipo iFood Titulos", var(--ifp-font-primary);
    font-size: 38px;
    font-weight: 700;
    color: var(--ifp-color-primary);
    text-align: center;
    margin: 0 0 60px 0;
    line-height: 1.2;
    text-align: left;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */

@media (max-width: 1024px) {
    .ifp-homepage-section__title {
        font-size: 38px;
        margin-bottom: 0;
    }
    
    .ifp-homepage-section--jornadas,
    .ifp-homepage-section--recentes,
    .ifp-homepage-section--banner {
        padding: 50px 20px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 768px) {
    .ifp-homepage-section__title {
        font-size: 28px;
        margin-bottom: 0;
        padding: 0;
    }
    
    .ifp-homepage-section--hero {
        padding: 20px 20px 60px;
    }
    
    .ifp-homepage-section--jornadas {
        padding: 40px 20px;
    }
    
    .ifp-homepage-section--banner {
        padding: 40px 20px;
    }
    
    .ifp-homepage-section--recentes {
        padding: 60px 20px 60px;
    }
}

/* ========================================
   INTEGRAÇÃO COM SHORTCODES EXISTENTES
   ======================================== */

/* 
 * Os shortcodes já possuem seus próprios estilos.
 * Esta seção é para ajustes específicos da homepage se necessário.
 */

/* Hero Section na homepage */
.ifp-homepage-section--hero .ifp-hero-section {
    /* Herda estilos do shortcode */
}

/* Jornadas na homepage */
.ifp-homepage-section--jornadas .ifp-jornadas-section {
    /* Herda estilos do shortcode */
}

/* Posts recentes na homepage */
.ifp-homepage-section--recentes .ifp-simple-posts {
    /* Herda estilos do shortcode */
}

/* Banner na homepage */
.ifp-homepage-section--banner .ifp-banner-container {
    /* Herda estilos do sistema de banners */
}

/* ========================================
   MELHORIAS DE PERFORMANCE
   ======================================== */

/* Otimizações para pintura e layout */
.ifp-homepage-section {
    contain: layout style;
}

/* Preparação para animações futuras */
.ifp-homepage-section {
    transform: translateZ(0);
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */

/* Focus visible para navegação por teclado */
.ifp-homepage a:focus-visible,
.ifp-homepage button:focus-visible {
    outline: 2px solid var(--ifp-color-primary);
    outline-offset: 2px;
}

/* Movimento reduzido para usuários sensíveis */
@media (prefers-reduced-motion: reduce) {
    .ifp-homepage-section {
        transform: none;
    }
}

/* ========================================
   ESTADOS DE CARREGAMENTO
   ======================================== */

/* Placeholder para quando shortcodes estão carregando */
.ifp-homepage-section:empty::before {
    content: "";
    display: block;
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, 
        rgba(166, 166, 166, 0.1) 25%, 
        rgba(166, 166, 166, 0.2) 50%, 
        rgba(166, 166, 166, 0.1) 75%
    );
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}