/**
 * Promo Banners Section — CSS
 * Noto Sans Armenian font, dashed badge, hover zoom, responsive grid
 *
 * Shortcode: [promo_banners columns="2"][promo_banner ...][/promo_banners]
 */

/* ── Armenian Font ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Armenian:wght@400;500;600;700;800&display=swap');

/* ── Section wrapper ───────────────────────────────────────────────────────── */
.unf-promo-banners-section {
    width: 100%;
    margin: 28px 0;
    font-family: 'Noto Sans Armenian', 'Arial', sans-serif;
}

/* ── Optional section heading ──────────────────────────────────────────────── */
.unf-promo-section-title {
    font-family: 'Noto Sans Armenian', 'Arial', sans-serif;
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 700;
    color: #1a2e1a;
    text-align: center;
    margin: 0 0 20px;
    letter-spacing: 0.02em;
}

/* ── CSS Grid for banners ──────────────────────────────────────────────────── */
.unf-promo-banners-grid {
    display: grid;
    grid-template-columns: repeat(var(--unf-cols, 2), 1fr);
    gap: var(--unf-gap, 20px);
    width: 100%;
}

/* ── Single Banner Item ────────────────────────────────────────────────────── */
.unf-promo-banner-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    /* Aspect ratio: auto-detect from image on desktop, fallback to 1/1 */
    aspect-ratio: var(--unf-ratio, 1 / 1);
    min-height: 260px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.35s ease, transform 0.35s ease;
    background: #1a2e1a;
}

.unf-promo-banner-item:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    transform: translateY(-3px);
}

/* ── Banner Link (covers entire card) ─────────────────────────────────────── */
.unf-promo-banner-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: absolute;
    inset: 0;
    text-decoration: none;
    color: inherit;
    z-index: 2;
    /* above the bg figure */
}

/* ── Background Image with zoom on hover ──────────────────────────────────── */
.unf-promo-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    z-index: 0;
}

.unf-promo-banner-item:hover .unf-promo-bg {
    transform: scale(1.07);
}

/* ── Dark Overlay ──────────────────────────────────────────────────────────── */
.unf-promo-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.unf-promo-banner-item:hover .unf-promo-overlay {
    opacity: 0.55 !important;
}

/* ── Content area (top area with badge) ───────────────────────────────────── */
.unf-promo-content {
    position: relative;
    z-index: 10;
    padding: 18px 18px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* ── Armenian Title Badge (dashed border style matching Artboard examples) ─── */
.unf-promo-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 2.5px dashed #2d6a4f;
    border-radius: 50px;
    background: #ffffff;
    color: #1a3a2a;

    font-family: 'Noto Sans Armenian', 'Arial', sans-serif;
    font-size: clamp(11px, 1.4vw, 15px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: calc(100% - 0px);
    overflow: hidden;
    text-overflow: ellipsis;

    /* Subtle shadow to lift off image */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

    transition: background 0.25s ease, color 0.25s ease;
}

.unf-promo-banner-item:hover .unf-promo-badge {
    background: #2d6a4f;
    color: #ffffff;
    border-color: #ffffff;
}

/* ── Subtitle text ─────────────────────────────────────────────────────────── */
.unf-promo-subtitle {
    font-family: 'Noto Sans Armenian', 'Arial', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
}

/* ── Footer with button ────────────────────────────────────────────────────── */
.unf-promo-footer {
    position: relative;
    z-index: 10;
    padding: 0 18px 18px;
    display: flex;
    align-items: center;
}

/* ── Category Button ───────────────────────────────────────────────────────── */
.unf-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #2d6a4f;
    color: #ffffff;
    border-radius: 50px;

    font-family: 'Noto Sans Armenian', 'Arial', sans-serif;
    font-size: clamp(11px, 1.2vw, 14px);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;

    box-shadow: 0 2px 12px rgba(45, 106, 79, 0.4);
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    pointer-events: none;
    /* clicks handled by parent <a> */
}

.unf-promo-banner-item:hover .unf-promo-btn {
    background: #1d4d38;
    box-shadow: 0 4px 20px rgba(45, 106, 79, 0.55);
    transform: translateX(3px);
}

.unf-promo-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.unf-promo-banner-item:hover .unf-promo-btn svg {
    transform: translateX(3px);
}

/* Tablet: force max 2 columns */
@media (max-width: 1023px) {
    .unf-promo-banners-grid {
        display: grid !important;
        width: 100% !important;
    }

    .unf-promo-banners-grid[data-columns="3"],
    .unf-promo-banners-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ── Mobile: 1 column stack, Elementor compatible ───────────────────────── */
@media (max-width: 767px) {

    /*
     * IMPORTANT: The inline style sets --unf-cols:2 which controls grid columns.
     * On mobile we override it to 1 so grid always shows one column,
     * regardless of how Elementor renders the shortcode widget.
     */
    .unf-promo-banners-grid {
        --unf-cols: 1 !important;
        /* reset inline variable  */
        display: grid !important;
        /* keep grid (not flex)   */
        grid-template-columns: 1fr !important;
        /* force single column    */
        gap: 20px !important;
        width: 100% !important;
    }

    /* Make each banner a proper block so Elementor can measure its height */
    .unf-promo-banner-item {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        aspect-ratio: 1 / 1 !important;
        overflow: hidden !important;
        border-radius: 14px !important;
        margin: 0 !important;
        transform: none !important;
    }

    /* Full image cover — position from top so built-in text is always visible */
    .unf-promo-bg {
        background-size: cover !important;
        background-position: top center !important;
    }

    /*
     * KEY FIX: position content/footer as absolute so they always appear
     * ON TOP of the background image, regardless of Elementor flex chain.
     * The containing block is .unf-promo-banner-link (position:absolute, inset:0)
     * which perfectly fills the banner item.
     */

    /* Badge block — pinned to top of banner */
    .unf-promo-content {
        position: absolute !important;
        top: 14px !important;
        left: 14px !important;
        right: 14px !important;
        z-index: 50 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 0 !important;
        gap: 6px !important;
    }

    /* Button block — pinned to bottom of banner */
    .unf-promo-footer {
        position: absolute !important;
        bottom: 14px !important;
        left: 14px !important;
        right: 14px !important;
        z-index: 50 !important;
        display: flex !important;
        align-items: center !important;
        padding: 0 !important;
    }

    /* Badge styling */
    .unf-promo-badge {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 12px !important;
        padding: 7px 14px !important;
        white-space: normal !important;
        background: #ffffff !important;
        color: #1a3a2a !important;
        border: 2px dashed #2d6a4f !important;
        border-radius: 50px !important;
    }

    /* Button styling */
    .unf-promo-btn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 12px !important;
        padding: 9px 18px !important;
        background: #2d6a4f !important;
        color: #ffffff !important;
        border-radius: 50px !important;
    }

    /* Elementor column compatibility: prevent zero-height collapse */
    .elementor-widget-shortcode .unf-promo-banners-section,
    .elementor-widget-text-editor .unf-promo-banners-section,
    .elementor-widget .unf-promo-banners-section {
        display: block !important;
        width: 100% !important;
        position: relative !important;
        overflow: visible !important;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .unf-promo-banners-grid {
        gap: 16px !important;
    }

    .unf-promo-banner-item {
        border-radius: 12px !important;
    }

    .unf-promo-badge {
        font-size: 11px !important;
        padding: 6px 12px !important;
    }
}

/* ── FIX: Elementor flex-container chain breaks banner height on mobile ─────── */
/*
 * Structure: .e-con[display:flex] > .e-con-inner[display:flex] >
 *            .elementor-widget > .elementor-widget-container >
 *            .elementor-shortcode > .unf-promo-banners-section
 *
 * Each wrapper is a flex-child with no explicit height, so aspect-ratio on
 * .unf-promo-banner-item resolves to 0. We break the flex chain by forcing
 * block display and width:100% on every intermediate wrapper on mobile.
 */
@media (max-width: 767px) {

    /* Force each Elementor wrapper to be a proper block so height flows down */
    .e-con-inner:has(.unf-promo-banners-section),
    .elementor-widget:has(.unf-promo-banners-section),
    .elementor-widget-container:has(.unf-promo-banners-section),
    .elementor-shortcode:has(.unf-promo-banners-section) {
        display: block !important;
        width: 100% !important;
        min-height: 0 !important;
    }

    /* The section itself must also be block */
    .unf-promo-banners-section {
        display: block !important;
        width: 100% !important;
    }
}

/* ── Reduced motion accessibility ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    .unf-promo-bg,
    .unf-promo-banner-item,
    .unf-promo-btn,
    .unf-promo-badge {
        transition: none;
    }
}
