/*
 * mod_clean_latest_articles v1.1.3 — 11.11.2026.
 * The title reveal follows the catalog's original "expand UP over image"
 * pattern (templates/sj_g2shop/css/new_style.css, category product names).
 * All declarations are scoped to this module; no JShopping changes.
 */
.clean-latest-articles,
.clean-latest-articles * {
    box-sizing: border-box;
}

.clean-latest-articles {
    width: 100%;
    min-width: 0;
    margin: 0 auto 30px;
    color: #555;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.clean-latest-articles__heading {
    position: relative;
    margin: 0 0 18px;
    padding: 0 0 13px;
    color: #111;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    text-transform: uppercase;
}
.clean-latest-articles__heading::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 3px;
    background: #548dcc;
}
.clean-latest-articles__heading::after {
    content: '';
    position: absolute;
    left: 70px;
    right: 0;
    bottom: 1px;
    height: 1px;
    background: #e7e7e7;
}

.clean-latest-articles__grid {
    display: grid;
    grid-template-columns: repeat(var(--cla-cols, 5), minmax(0, 1fr));
    gap: var(--cla-gap, 16px);
    width: 100%;
    min-width: 0;
}

.clean-latest-articles__card {
    position: relative;
    z-index: 0;
    isolation: isolate;
    min-width: 0;
    height: 240px;
    padding: 12px;
    overflow: visible;
    background: #f5f5f5;
    border: 1px solid rgba(0, 0, 0, .055);
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
    transition: box-shadow .2s ease, transform .2s ease;
}
.clean-latest-articles__card:hover,
.clean-latest-articles__card:focus-within {
    z-index: 9;
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, .13);
}

.clean-latest-articles__picture {
    display: block;
    width: 100%;
    height: 154px;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
}
.clean-latest-articles__picture img,
.clean-latest-articles__empty-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
    transition: transform .25s ease;
}
.clean-latest-articles__empty-image {
    background: linear-gradient(130deg, #eceff1, #dce3e7);
}
.clean-latest-articles__card:hover .clean-latest-articles__picture img,
.clean-latest-articles__card:focus-within .clean-latest-articles__picture img {
    transform: scale(1.04);
}

/*
 * Article title follows the category-product name reveal:
 * TWO lines at rest; on hover it unfolds UP over the picture.
 * Important: no measured JS height is required for desktop hover.
 * The JS may provide a more precise max-height for smoother timing,
 * but the CSS fallback still reveals a normal full headline.
 * No "pill"/outlined title box, no native title attribute/tooltip.
 */
.clean-latest-articles__title-window {
    position: absolute;
    z-index: 4;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: 40px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #f5f5f5;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    transition: max-height .32s ease;
    will-change: max-height;
}
.clean-latest-articles .clean-latest-articles__title {
    position: static !important;
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    color: #555 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    text-align: left !important;
    text-decoration: none !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
}
.clean-latest-articles .clean-latest-articles__title:hover,
.clean-latest-articles .clean-latest-articles__title:focus {
    color: #555 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    text-decoration: none !important;
}
/* Full title appears in place, growing upward without moving other cards. */
.clean-latest-articles__card:hover .clean-latest-articles__title-window,
.clean-latest-articles__card:focus-within .clean-latest-articles__title-window {
    max-height: var(--cla-reveal-height, 260px);
    background: #f5f5f5;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.clean-latest-articles .clean-latest-articles__title:focus-visible {
    outline: 2px solid #548dcc !important;
    outline-offset: 1px !important;
}

.clean-latest-articles__more {
    position: absolute;
    z-index: 5;
    top: var(--cla-more-top, 29px);
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 19px;
    border: 2px solid #fff;
    border-radius: 8px;
    background: #43ad71;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .18);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 7px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background-color .2s ease;
}
.clean-latest-articles__card:hover .clean-latest-articles__more,
.clean-latest-articles__card:focus-within .clean-latest-articles__more {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
.clean-latest-articles__more:hover,
.clean-latest-articles__more:focus {
    background: #7f7f7f;
    color: #fff !important;
    text-decoration: none !important;
}
.clean-latest-articles__more:focus-visible,
.clean-latest-articles__expand:focus-visible {
    outline: 2px solid #548dcc;
    outline-offset: 2px;
}

/* Mobile-only disclosure. No extra button on desktop. */
.clean-latest-articles__expand {
    display: none;
    position: absolute;
    z-index: 4;
    right: 2px;
    bottom: 2px;
    width: 25px;
    height: 25px;
    padding: 0;
    color: #555;
    background: #e5e5e5;
    border: 0;
    border-radius: 5px;
    font: 700 19px/25px Arial, Helvetica, sans-serif;
    cursor: pointer;
}
.clean-latest-articles__expand[hidden] { display: none !important; }

@media (max-width: 1199px) {
    .clean-latest-articles__grid {
        grid-template-columns: repeat(var(--cla-laptop, 4), minmax(0, 1fr));
    }
}
@media (max-width: 991px) {
    .clean-latest-articles__grid {
        grid-template-columns: repeat(var(--cla-tablet, 3), minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .clean-latest-articles__grid {
        grid-template-columns: repeat(var(--cla-mobile, 2), minmax(0, 1fr));
        gap: 14px;
    }
    .clean-latest-articles__heading {
        font-size: 20px;
        margin-bottom: 14px;
    }
}
@media (max-width: 479px) {
    .clean-latest-articles__grid {
        grid-template-columns: 1fr;
    }
}

/* Touch: button remains visible; a small arrow reveals longer titles.
 * The same upward reveal happens on touch through .is-expanded. */
@media (pointer: coarse), (max-width: 767px) {
    .clean-latest-articles__card:hover,
    .clean-latest-articles__card:focus-within {
        transform: none;
    }
    .clean-latest-articles__more {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0);
    }
    .clean-latest-articles__card:hover .clean-latest-articles__title-window,
    .clean-latest-articles__card:focus-within .clean-latest-articles__title-window {
        max-height: 40px;
    }
    .clean-latest-articles__card.is-expanded .clean-latest-articles__title-window,
    .clean-latest-articles__card.is-expanded:hover .clean-latest-articles__title-window,
    .clean-latest-articles__card.is-expanded:focus-within .clean-latest-articles__title-window {
        max-height: var(--cla-reveal-height, 260px);
    }
    .clean-latest-articles__card.has-long-title .clean-latest-articles__title-window {
        padding-right: 25px;
    }
    .clean-latest-articles__expand:not([hidden]) {
        display: block;
    }
    .clean-latest-articles__card.is-expanded .clean-latest-articles__expand {
        transform: rotate(180deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .clean-latest-articles__card,
    .clean-latest-articles__picture img,
    .clean-latest-articles__title-window,
    .clean-latest-articles__more {
        transition: none;
    }
}
