/*
Elementor Custom Styles for Stone Soup Child Theme
Ensures proper integration between Elementor and Stone Soup design system
*/

/* ==========================================================================
   STONE SOUP HERO WIDGET STYLES
   ========================================================================== */

/* Elementor Hero Widget */
.elementor-stonesoup-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Background properties are now controlled by widget settings */
}

/* Hard-coded overlay has been removed from style.css - no override needed */

/* Base overlay styling - positioned overlay div */
.stonesoup-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Allow clicks to pass through to content */
    /* Background will be set via inline styles from widget settings */
}

/* Hide overlay when no-overlay class is present on the hero container */
.elementor-stonesoup-hero.no-overlay .stonesoup-hero-overlay {
    display: none !important;
}

/* Ensure overlay is visible when has-overlay class is present */
.elementor-stonesoup-hero.has-overlay .stonesoup-hero-overlay {
    display: block !important;
}

/* Hero content */
.elementor-stonesoup-hero .stonesoup-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: var(--stonesoup-space-xl);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Hero title */
.elementor-stonesoup-hero h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: bold;
    margin-bottom: var(--stonesoup-space-md);
    line-height: 1.1;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    font-family: Georgia, serif;
    margin-top: 0;
}

/* Hero subtitle */
.elementor-stonesoup-hero .hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: normal;
    margin-bottom: var(--stonesoup-space-lg);
    opacity: 0.95;
    font-style: italic;
    color: white;
}

/* Hero description */
.elementor-stonesoup-hero .hero-description {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.6;
    margin-bottom: var(--stonesoup-space-lg);
    opacity: 0.9;
    color: white;
}

/* Hero CTA button */
.elementor-stonesoup-hero .hero-cta {
    display: inline-block;
    background-color: var(--stonesoup-yellow-light);
    color: var(--stonesoup-text-dark);
    padding: var(--stonesoup-space-sm) var(--stonesoup-space-lg);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-shadow: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    font-family: Georgia, serif;
}

.elementor-stonesoup-hero .hero-cta:hover {
    background-color: white;
    color: var(--stonesoup-orange);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--stonesoup-orange);
}

.elementor-stonesoup-hero .hero-cta:focus {
    outline: 3px solid white;
    outline-offset: 3px;
}

/* Responsive adjustments for hero widget */
@media (max-width: 768px) {
    .elementor-stonesoup-hero {
        height: 50vh;
        min-height: 350px;
    }
    
    .elementor-stonesoup-hero .stonesoup-hero-content {
        padding: var(--stonesoup-space-lg);
    }
    
    .elementor-stonesoup-hero h1 {
        margin-bottom: var(--stonesoup-space-sm);
    }
    
    .elementor-stonesoup-hero .hero-subtitle {
        margin-bottom: var(--stonesoup-space-md);
    }
    
    .elementor-stonesoup-hero .hero-description {
        margin-bottom: var(--stonesoup-space-md);
    }
}

@media (max-width: 480px) {
    .elementor-stonesoup-hero {
        height: 45vh;
        min-height: 300px;
    }
    
    .elementor-stonesoup-hero .hero-cta {
        padding: var(--stonesoup-space-xs) var(--stonesoup-space-md);
        font-size: 1rem;
    }
}

/* Reduced motion support for hero widget */
@media (prefers-reduced-motion: reduce) {
    .elementor-stonesoup-hero .hero-cta {
        transition: none;
    }
    
    .elementor-stonesoup-hero .hero-cta:hover {
        transform: none;
    }
}

/* ==========================================================================
   ELEMENTOR CONTAINER INTEGRATION
   ========================================================================== */

/* Ensure Elementor containers respect our typography */
.elementor-widget-text-editor {
    font-family: Georgia, "Times New Roman", serif;
    font-size: var(--stonesoup-font-base);
    line-height: var(--stonesoup-line-height);
}

.elementor-widget-heading .elementor-heading-title {
    font-family: Georgia, serif;
    color: var(--stonesoup-text-dark);
}

/* Override Elementor's default max-width for full-width sections */
/* Override Elementor's default max-width for full-width sections */
.elementor-section-wrap,
.elementor-container {
    max-width: none;
}

/* Content sections should respect our max-width */
.elementor-section.stonesoup-content .elementor-container {
    max-width: var(--stonesoup-max-width);
    margin: 0 auto;
}

/* ==========================================================================
   ELEMENTOR WIDGET STYLING
   ========================================================================== */

/* Text Editor Widget */
.elementor-text-editor p {
    margin-bottom: var(--stonesoup-space-md);
    font-family: Georgia, "Times New Roman", serif;
    font-size: var(--stonesoup-font-base);
    line-height: var(--stonesoup-line-height);
}

/* Heading Widget */
.elementor-widget-heading .elementor-heading-title {
    margin-bottom: var(--stonesoup-space-sm);
    margin-top: var(--stonesoup-space-lg);
}

/* Button Widget - Stone Soup Style */
.elementor-button-wrapper .elementor-button {
    background-color: var(--stonesoup-yellow-light);
    color: var(--stonesoup-text-dark);
    border: 2px solid transparent;
    border-radius: 50px;
    font-family: Georgia, serif;
    font-weight: bold;
    padding: var(--stonesoup-space-sm) var(--stonesoup-space-lg);
    transition: all 0.3s ease;
    text-decoration: none;
}

.elementor-button-wrapper .elementor-button:hover {
    background-color: white;
    color: var(--stonesoup-orange);
    border-color: var(--stonesoup-orange);
    transform: translateY(-2px);
}

/* Icon Box Widget */
.elementor-icon-box-wrapper {
    text-align: center;
}

.elementor-icon-box-icon {
    margin-bottom: var(--stonesoup-space-md);
}

.elementor-icon-box-content .elementor-icon-box-title {
    color: var(--stonesoup-text-dark);
    font-family: Georgia, serif;
    margin-bottom: var(--stonesoup-space-sm);
}

/* Image Widget */
.elementor-widget-image img {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   ELEMENTOR SECTIONS
   ========================================================================== */

/* Hero Section Style */
.elementor-section.stonesoup-hero-section {
    background: linear-gradient(135deg, var(--stonesoup-ochre), var(--stonesoup-orange));
    color: white;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.elementor-section.stonesoup-hero-section .elementor-heading-title {
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

.elementor-section.stonesoup-hero-section .elementor-text-editor {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Content Sections */
.elementor-section.stonesoup-content {
    padding: var(--stonesoup-space-xl) var(--stonesoup-space-lg);
}

/* Story Section Colors */
.elementor-section.stonesoup-stories {
    border-left: 4px solid var(--stonesoup-orange);
}

.elementor-section.stonesoup-poems {
    border-left: 4px solid var(--stonesoup-blue-green);
}

.elementor-section.stonesoup-reviews {
    border-left: 4px solid var(--stonesoup-ochre);
}

.elementor-section.stonesoup-blog {
    border-left: 4px solid var(--stonesoup-yellow-green);
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/* Focus states for Elementor elements */
.elementor-button:focus,
.elementor-icon:focus,
.elementor-image:focus {
    outline: 3px solid var(--stonesoup-focus-color);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .elementor-button {
        transition: none;
    }
    
    .elementor-button:hover {
        transform: none;
    }
    
    .elementor-animation-grow,
    .elementor-animation-shrink,
    .elementor-animation-pulse,
    .elementor-animation-buzz {
        animation: none !important;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Mobile adjustments */
@media (max-width: 768px) {
    .elementor-section.stonesoup-hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .elementor-section.stonesoup-content {
        padding: var(--stonesoup-space-lg) var(--stonesoup-space-md);
    }
    
    .elementor-button-wrapper .elementor-button {
        padding: var(--stonesoup-space-xs) var(--stonesoup-space-md);
        font-size: 1rem;
    }
}

/* ==========================================================================
   ELEMENTOR EDITOR STYLES
   ========================================================================== */

/* Styles that only apply in the Elementor editor */
.elementor-editor-active .stonesoup-hero-section {
    position: relative;
}

.elementor-editor-active .stonesoup-hero-section::before {
    content: "Stone Soup Hero Section";
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    z-index: 1000;
}

/* ==========================================================================
   PRINT COMPATIBILITY
   ========================================================================== */

@media print {
    .elementor-section,
    .elementor-container,
    .elementor-widget {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .elementor-button {
        border: 1px solid black !important;
        background: white !important;
        color: black !important;
    }
}