/*
Theme Name:       Brasil Economia
Theme URI:        https://brasileconomia.com.br
Author:           Antigravity
Author URI:       https://brasileconomia.com.br
Description:      Tema WordPress FSE (Full Site Editing) personalizado e exclusivo para o blog Brasil Economia, inspirado no Meu Bolso em Dia. Altamente otimizado para SEO, acessibilidade (WCAG 2.1 AA) e velocidade de carregamento (Core Web Vitals).
Version:          1.0.0
Requires at least: 6.2
Tested up to:     6.7
Requires PHP:     7.4
License:          GNU General Public License v2 or later
License URI:      https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:      brasil-economia-theme
Tags:             block-themes, full-site-editing, one-column, custom-colors, custom-menu, featured-images, translation-ready, accessibility-ready

This theme is designed for Full Site Editing (FSE). All global configurations are defined in theme.json.
*/

/* Reset & Accessibility Helper Classes */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    position: absolute;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   Logo Distortion Prevention
   ========================================================================== */
.wp-block-site-logo,
.wp-block-site-logo a,
.wp-block-site-logo img,
.site-logo img,
header img,
footer img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    display: inline-block;
}

/* ==========================================================================
   Micro-interactions
   ========================================================================== */
.wp-block-navigation .wp-block-navigation-item__label {
    position: relative;
    padding-bottom: 4px;
}

.wp-block-navigation .wp-block-navigation-item a:hover .wp-block-navigation-item__label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--wp--preset--color--accent);
    transform: scaleX(1);
    transition: transform 0.25s ease;
}

.wp-block-button__link {
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.wp-block-button__link:active {
    transform: scale(0.98);
}

/* Styling the Excerpt "Continue lendo" button inside listing grids */
.wp-block-post-excerpt__more-link {
    display: inline-block !important;
    background-color: var(--wp--preset--color--contrast) !important;
    color: var(--wp--preset--color--white) !important;
    padding: 0.6rem 1.5rem !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: var(--wp--preset--font-size--small) !important;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease !important;
    margin-top: 0.75rem !important;
    line-height: 1.2 !important;
}

.wp-block-post-excerpt__more-link:hover {
    background-color: var(--wp--preset--color--primary) !important;
    color: var(--wp--preset--color--white) !important;
}

.wp-block-post-excerpt__more-link:active {
    transform: scale(0.97) !important;
}

/* ==========================================================================
   Slider de Destaques (Hero Slider)
   ========================================================================== */
.brec-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

.brec-slides-wrapper {
    position: relative;
    width: 100%;
    min-height: 480px;
}

.brec-slide {
    display: none;
    opacity: 0;
    width: 100%;
    height: 100%;
    padding: var(--wp--preset--spacing--50) 0;
}

.brec-slide.active {
    display: block;
    opacity: 1;
    animation: brecFadeIn 0.6s ease-in-out forwards;
}

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

/* Controles do Slider */
.brec-slider-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
}

.brec-slider-arrow {
    background: none;
    border: none;
    color: var(--wp--preset--color--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.brec-slider-arrow:hover {
    color: var(--wp--preset--color--accent);
    transform: scale(1.1);
    opacity: 1;
}

.brec-slider-dots {
    display: flex;
    gap: 0.75rem;
}

.brec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.brec-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.brec-dot.active {
    background-color: var(--wp--preset--color--accent);
    transform: scale(1.2);
}

/* ==========================================================================
   Grade de Categoria (3 Colunas) & Carregar Mais
   ========================================================================== */
.brec-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
}

.brec-grid-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.brec-grid-card:hover {
    transform: translateY(-4px);
}

.brec-hidden-card {
    display: none !important;
    opacity: 0;
}

.brec-hidden-card.revealed {
    display: block !important;
    opacity: 1;
    animation: brecFadeIn 0.4s ease-in-out forwards;
}

.brec-load-more-btn:hover {
    color: var(--wp--preset--color--accent) !important;
}

.brec-load-more-btn svg {
    transition: transform 0.2s ease-in-out;
}

.brec-load-more-btn:hover svg {
    transform: rotate(90deg);
}

/* ==========================================================================
   Grade de Web Stories
   ========================================================================== */
.brec-webstories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.brec-webstory-card {
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--wp--preset--color--border);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    background-color: var(--wp--preset--color--primary);
}

.brec-webstory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(3, 208, 124, 0.18);
}

.brec-webstory-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.brec-webstory-card:hover .brec-webstory-image {
    transform: scale(1.05);
}

.brec-webstory-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(28, 40, 33, 0.95) 0%, rgba(28, 40, 33, 0.6) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem 1.25rem;
    box-sizing: border-box;
}

.brec-webstory-category {
    color: var(--wp--preset--color--accent);
    font-size: var(--wp--preset--font-size--extra-small);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.brec-webstory-title {
    color: var(--wp--preset--color--white);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */
@media (max-width: 992px) {
    .brec-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .brec-slides-wrapper {
        min-height: 520px;
    }
    
    .brec-slider-controls {
        bottom: 1.5rem;
    }
    
    .brec-category-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .brec-webstories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}
