/*
 * Blogum Theme – elementor-widgets.css
 * File: assets/css/elementor-widgets.css
 * Envato-standard styling for all custom Elementor widgets.
 * Isolated from the core theme CSS to reduce main style.css bloat.
 */

/* ==========================================================================
   UI Adjustment: REDUCE RIGHT SIDE SECTIONS SPACING (Split from Root)
   ========================================================================== */

/* 1. Reduce overall padding on the main container */
.blg-feed-container, .blg-feed-container {
    padding-top: clamp(20px, 3vw, 20px) !important;
    padding-bottom: clamp(20px, 3vw, 40px) !important;
}

/* 2. Reduce the huge margin above section headers */
.blg-feed .blg-section-header, 
.blg-feed .blg-featured-header,
.blg-feed-section .blg-section-header {
    margin-top: clamp(25px, 4vw, 45px) !important;
    margin-bottom: clamp(15px, 3vw, 25px) !important;
}

/* 3. Tame Elementor top section gaps if they were manually padded */
.blg-feed .elementor-top-section, 
.blg-feed .elementor-section,
.blg-feed-section {
    margin-top: clamp(25px, 4vw, 40px) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Overriding inline inline styles (WP Native HTML) */
section.blg-feed-section[style*="margin-top: 100px"] {
    margin-top: clamp(25px, 4vw, 45px) !important;
}

/* First section needs no top margin */
.blg-feed .elementor-section:first-child .blg-section-header,
.blg-feed-section:first-child .blg-section-header,
.blg-feed-section:first-child {
    margin-top: 0 !important;
}

/* 4. Tame default spacing of widgets stacked together */
.blg-feed .elementor-widget-wrap > .elementor-widget:not(:last-child) {
    margin-bottom: clamp(15px, 3vw, 25px) !important;
}

/* ==========================================================================
   WIDGET RESPONSIVE FIXES (2026)
   ========================================================================== */

/* Post Grid Condensed */
.blg-post-grid-condensed {
    display: grid;
    grid-template-columns: repeat(var(--blg-grid-cols, 2), 1fr);
    gap: 40px;
}

/* Editorial Row */
.blg-editorial-row {
    display: flex;
    gap: 60px;
    align-items: center;
    padding-block: 60px;
}

.blg-editorial-row--img-right {
    flex-direction: row-reverse;
}

/* Mobile Overrides */
@media (max-width: 768px) {
    .blg-post-grid-condensed {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .blg-editorial-row,
    .blg-editorial-row--img-right {
        flex-direction: column;
        gap: 30px;
        padding-block: 30px;
    }
    
    .blg-editorial-row__img img {
        height: 300px !important;
    }
}

/* ==========================================================================
   WIDGET: BOTTOM POSTS BAR
   ========================================================================== */
.blg-bottom-bar { 
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: var(--blg-bg-color);
    border: 1px solid var(--blg-border-color); 
    overflow: hidden; 
    border-radius: 4px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.02); 
}
.blg-bottom-bar__item {
    flex: 1;
    background: var(--blg-bg-color);
    min-width: 240px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border-inline-end: 1px solid var(--blg-border-color);
    position: relative;
    overflow: hidden;
}
.blg-bottom-bar__item:last-child { border-inline-end: none; }

.blg-bottom-bar__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: clamp(30px, 5vw, 50px);
    padding-inline: 40px;
    height: 100%;
}

.blg-bottom-bar__item:hover { background: var(--blg-text-main) !important; color: var(--blg-bg-color) !important; }
.blg-bottom-bar__item:hover .blg-bb-hover-arrow { opacity: 1 !important; transform: translateInline(0) !important; }
.blg-bottom-bar__item:hover span { color: var(--blg-bg-color) !important; opacity: 0.6; }
.blg-bottom-bar__item:hover h4 { color: var(--blg-bg-color) !important; }

/* Mobile Fixes for Bottom Bar */
@media (max-width: 768px) {
    .blg-bottom-bar {
        flex-direction: column;
    }
    .blg-bottom-bar__item {
        border-inline-end: none;
        border-bottom: 1px solid var(--blg-border-color);
    }
    .blg-bottom-bar__item:last-child {
        border-bottom: none;
    }
    .blg-bottom-bar__link {
        padding-block: 25px;
        padding-inline: 20px;
    }
}

/* ====================================================
   WIDGET ARCHIVAL RESTORATION: FORCED VISIBILITY
   ==================================================== */

/* 1. Mosaic Grid (Hot Places & Spaces) */
.elementor-widget-blg-magazine-4col-mosaic .blg-mc-card > div[style*="position:absolute"],
.blg-mc-card > div[style*="position:absolute"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    z-index: 100 !important;
}

.elementor-widget-blg-magazine-4col-mosaic .blg-mc-card h3,
.elementor-widget-blg-magazine-4col-mosaic .blg-mc-card span {
    color: #ffffff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-weight: 900 !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5) !important;
}

/* 2. Horizontal Gallery (Carousel) */
.elementor-widget-blg-horizontal-gallery .blg-hg-caption,
.blg-hg-caption {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    z-index: 100 !important;
    background: rgba(0,0,0,0.3) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
}

.elementor-widget-blg-horizontal-gallery .blg-hg-card h4,
.elementor-widget-blg-horizontal-gallery .blg-hg-card span {
    color: #ffffff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-weight: 900 !important;
}

/* ====================================================
   FINAL NUCLEAR REPAIR: VISIBILITY & CLICKABILITY
   ==================================================== */

/* 1. Home 2 Widgets Restoration */
.blg-mc-card > div[style*="position:absolute"],
.blg-hg-caption,
.blg-hg-card .blg-hg-caption {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: none !important; /* CRITICAL: Allows clicks to pass through to the <a> link underneath */
    z-index: 9 !important; /* Lower than the <a> tag's z-index but high enough for visibility */
}

/* 2. Link Layer (Ensure it is on top and clickable) */
.blg-mc-card a[style*="position:absolute"],
.blg-hg-card a[style*="position:absolute"] {
    z-index: 10 !important;
    pointer-events: auto !important;
    display: block !important;
}

/* 3. Text Enforcements */
.blg-mc-card h3,
.blg-mc-card span,
.blg-hg-card h4,
.blg-hg-card span {
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* ====================================================
   PREMIUM HOVER EFFECTS: MOSAIC & HORIZONTAL GALLERY
   ==================================================== */

/* --- Shared card base transitions --- */
.blg-mc-card,
.blg-hg-card {
    transition: box-shadow 0.5s cubic-bezier(0.19,1,0.22,1),
                transform 0.5s cubic-bezier(0.19,1,0.22,1);
}

/* --- Image zoom (already partial in widget, enhance here) --- */
.blg-mc-img,
.blg-hg-img {
    transition: transform 0.9s cubic-bezier(0.19,1,0.22,1),
                filter 0.9s ease !important;
    will-change: transform;
}

.blg-mc-card:hover .blg-mc-img,
.blg-hg-card:hover .blg-hg-img {
    transform: scale(1.08) !important;
    filter: brightness(0.85) !important;
}

/* --- Gradient overlay darkens on hover --- */
.blg-mc-card > div[style*="inset-block:0"],
.blg-hg-card > div[style*="inset-block:0"] {
    transition: opacity 0.5s ease;
}

.blg-mc-card:hover > div[style*="inset-block:0"],
.blg-hg-card:hover > div[style*="inset-block:0"] {
    opacity: 1.3; /* Effectively darkens the gradient */
}

/* --- Caption slide up on hover --- */
.blg-hg-caption {
    transform: translateY(6px);
    transition: transform 0.5s cubic-bezier(0.19,1,0.22,1),
                background 0.4s ease,
                box-shadow 0.4s ease !important;
}

.blg-hg-card:hover .blg-hg-caption {
    transform: translateY(0) !important;
    background: rgba(0, 0, 0, 0.45) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
}

/* --- Mosaic title container slide up on hover --- */
.blg-mc-card > div[style*="inset-block-end"] {
    transition: transform 0.5s cubic-bezier(0.19,1,0.22,1),
                opacity 0.4s ease;
    transform: translateY(8px);
    opacity: 0.85;
}

.blg-mc-card:hover > div[style*="inset-block-end"] {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

/* --- Card lift on hover --- */
.blg-mc-card:hover {
    box-shadow: 0 40px 80px rgba(0,0,0,0.28) !important;
    transform: translateY(-3px);
}

.blg-hg-card:hover {
    box-shadow: 0 30px 60px rgba(0,0,0,0.22) !important;
    transform: translateY(-3px);
}

/* --- Category label accent on hover --- */
.blg-mc-card:hover span,
.blg-hg-card:hover .blg-hg-caption span {
    opacity: 1 !important;
    letter-spacing: 5px !important;
    transition: letter-spacing 0.4s ease, opacity 0.3s ease;
}

/* --- Title underline sweep on hover --- */
.blg-mc-card h3,
.blg-hg-card h4 {
    background-image: linear-gradient(var(--blg-accent-color), var(--blg-accent-color));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.4s cubic-bezier(0.19,1,0.22,1);
    padding-block-end: 3px;
}

.blg-mc-card:hover h3,
.blg-hg-card:hover h4 {
    background-size: 60% 2px;
}
