/*
 Theme Name:   Hestia Child
 Theme URI:    https://themeisle.com/themes/hestia/
 Description:  Child theme for Hestia with sidebar on front page and Elementor compatibility
 Author:       Your Name
 Author URI:   https://yourwebsite.com
 Template:     hestia
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         blog, custom-logo, portfolio, e-commerce, rtl-language-support, post-formats, grid-layout, one-column, two-columns, custom-background, custom-colors, custom-header, custom-menu, featured-image-header, featured-images, flexible-header, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, editor-style, footer-widgets, left-sidebar, right-sidebar, wide-blocks
 Text Domain:  hestia-child

 LICENSE COMPLIANCE STATEMENT:
 This child theme is a legal derivative work created in full compliance with
 the GNU General Public License v2 (GPL v2) under which the Hestia parent
 theme is licensed. This theme does not violate copyright or license terms
 of the Hestia theme. Child themes are explicitly permitted and encouraged
 by the GPL v2 license and WordPress community standards.

 PARENT THEME:
 Theme Name:   Hestia
 Author:       ThemeIsle
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Source:       https://themeisle.com/themes/hestia/

 CHILD THEME LICENSE:
 Hestia Child is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 2 of the License, or
 any later version.

 Hestia Child is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Hestia Child. If not, see http://www.gnu.org/licenses/gpl-2.0.html.

 This child theme respects the original Hestia theme copyright and maintains
 full GPL v2 compliance. All modifications are original code additions that
 follow WordPress child theme development best practices.
*/

/* Front page sidebar styles */
.hestia-front-page-content-wrapper {
    display: flex;
    flex-wrap: wrap;
}

.hestia-front-page-sidebar {
    width: 100%;
}

/* Mobile: Show sidebar before main content */
@media (max-width: 767px) {
    .hestia-front-page-content-wrapper.has-sidebar .hestia-front-page-sidebar {
        order: -1; /* Sidebar first on mobile */
    }
    
    .hestia-front-page-content-wrapper.has-sidebar .hestia-front-page-main-content {
        order: 1; /* Main content after sidebar on mobile */
    }
}

@media (min-width: 768px) {
    /* Default widths - will be overridden by inline styles from Customizer */
    .hestia-front-page-content-wrapper.has-sidebar .hestia-front-page-main-content {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
        order: 1; /* Main content first on desktop (sidebar-right default) */
    }
    
    .hestia-front-page-content-wrapper.has-sidebar .hestia-front-page-sidebar {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        padding-left: 30px;
        order: 2; /* Sidebar second on desktop (sidebar-right default) */
    }
    
    /* Sidebar left layout */
    .hestia-front-page-content-wrapper.has-sidebar.sidebar-left .hestia-front-page-main-content {
        order: 2; /* Main content second when sidebar is on left */
    }
    
    .hestia-front-page-content-wrapper.has-sidebar.sidebar-left .hestia-front-page-sidebar {
        order: 1; /* Sidebar first when sidebar is on left */
        padding-left: 0;
        padding-right: 30px;
    }
}

/* Ensure sections inside main content don't break layout */
.hestia-front-page-main-content > div {
    width: 100%;
}

/* Elementor sidebar styles */
.hestia-child-elementor-sidebar {
    width: 100%;
}

.hestia-child-elementor-sidebar .elementor-section {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.hestia-child-elementor-sidebar .elementor-container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.hestia-child-elementor-sidebar .elementor-column {
    width: 100% !important;
}

/* Elementor section styling */
.hestia-child-elementor-section {
    padding: 60px 0;
}

.hestia-child-elementor-section .container {
    width: 100%;
}

.hestia-child-elementor-content {
    width: 100%;
}

/* Elementor sections compatibility */
.hestia-child-elementor-content .elementor-section {
    width: 100%;
}

/* Ensure Elementor widgets work properly */
.hestia-child-elementor-content .elementor-widget {
    width: 100%;
}

/* Placeholder in customizer */
.hestia-child-elementor-placeholder {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    color: #6c757d;
}

.hestia-child-elementor-placeholder p {
    margin: 0;
    font-size: 16px;
}

/* Full Elementor front page styling */
.hestia-child-elementor-front-page {
    width: 100%;
}

.hestia-child-elementor-front-page .elementor-section {
    width: 100%;
}

.hestia-child-elementor-front-page .elementor-container {
    max-width: 100%;
}

/* Ensure Elementor works properly with Hestia layout */
.hestia-child-elementor-front-page .elementor {
    width: 100%;
}
