/**
 * Mamemyly Widgets — Supplemental CSS
 *
 * Minimal widget-specific styles that supplement the theme.
 * Primarily for Elementor editor preview corrections and widget structure.
 *
 * @package Mamemyly\Widgets
 * @version 1.0.0
 */

/* ==========================================================================
   Section & Layout Foundations
   ========================================================================== */

.mml-section {
    position: relative;
    width: 100%;
}

.mml-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

/* ==========================================================================
   Eyebrow / Kicker
   ========================================================================== */

.mml-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mml-accent, #b8860b);
    margin-bottom: 0.75rem;
}

/* ==========================================================================
   Headings
   ========================================================================== */

.mml-heading {
    font-family: var(--mml-font-heading, 'Playfair Display', serif);
    color: var(--mml-navy, #0a1628);
    line-height: 1.2;
    margin: 0 0 1rem;
}

.mml-subheading {
    font-size: 1.125rem;
    color: var(--mml-text-muted, #4a5568);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.mml-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.mml-btn--primary {
    background: var(--mml-accent, #b8860b);
    color: #fff;
    border-color: var(--mml-accent, #b8860b);
}

.mml-btn--primary:hover {
    background: var(--mml-accent-dark, #96700a);
    border-color: var(--mml-accent-dark, #96700a);
    color: #fff;
    transform: translateY(-1px);
}

.mml-btn--secondary {
    background: transparent;
    color: var(--mml-navy, #0a1628);
    border-color: var(--mml-navy, #0a1628);
}

.mml-btn--secondary:hover {
    background: var(--mml-navy, #0a1628);
    color: #fff;
    transform: translateY(-1px);
}

.mml-btn--ghost {
    background: transparent;
    color: var(--mml-accent, #b8860b);
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
}

.mml-btn--ghost:hover {
    color: var(--mml-accent-dark, #96700a);
}

/* ==========================================================================
   Stars Rating
   ========================================================================== */

.mml-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.mml-star {
    display: inline-flex;
    line-height: 1;
}

.mml-star--filled {
    color: var(--mml-accent, #b8860b);
}

.mml-star--empty {
    color: #d1d5db;
    opacity: 0.5;
}

/* ==========================================================================
   Elementor Editor Preview Corrections
   ========================================================================== */

.elementor-editor-active .mml-section {
    min-height: 60px;
}

.elementor-editor-active .mml-section:empty::after {
    content: attr(data-widget-title);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    font-size: 0.875rem;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
    border-radius: 4px;
    padding: 1rem;
}

/* Prevent editor overlay z-index conflicts */
.elementor-editor-active .mml-section [class*="mml-"] {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Responsive Grid Utilities (used by multiple widgets)
   ========================================================================== */

.mml-grid {
    display: grid;
    gap: 2rem;
}

.mml-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.mml-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.mml-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .mml-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .mml-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mml-grid--2,
    .mml-grid--3,
    .mml-grid--4 {
        grid-template-columns: 1fr;
    }

    .mml-section-header {
        margin-bottom: 2rem;
    }
}

/* ==========================================================================
   Card Base
   ========================================================================== */

.mml-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mml-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Scroll Reveal (re-initialized by widgets-front.js)
   ========================================================================== */

.mml-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.mml-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
