/**
 * Elessi Custom — Modern Homepage Component System
 * -------------------------------------------------------------
 * Styles the component-based front page (front-page.php + template-parts/home/*).
 * All classes are namespaced `hm-` so nothing leaks into shop/product/cart/
 * checkout, and the theme's own product-card CSS (inside .hm-products__grid)
 * is left untouched. The product-card component (.hm-card) is styled globally
 * in assets/css/style-product-card.css, not here.
 *
 * Inherits the site's brand accent via --hm-accent, which falls back to a
 * calm default but can be themed from a child theme / customizer.
 * -------------------------------------------------------------
 */

.elessi-home {
    --hm-accent: var(--elessi-primary, #1f6feb);
    --hm-accent-ink: #ffffff;
    --hm-ink: #161c26;
    --hm-body: #4a5566;
    --hm-muted: #8a93a3;
    --hm-line: rgba(22, 28, 38, 0.10);
    --hm-surface: #ffffff;
    --hm-surface-2: #f5f7fa;
    --hm-surface-3: #eef1f6;
    --hm-radius: 16px;
    --hm-radius-sm: 12px;
    --hm-radius-lg: 24px;
    --hm-shadow: 0 1px 2px rgba(22, 28, 38, 0.05);
    --hm-shadow-md: 0 10px 30px -14px rgba(22, 28, 38, 0.22);
    --hm-shadow-lg: 0 26px 60px -28px rgba(22, 28, 38, 0.32);
    --hm-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --hm-gap: clamp(20px, 2.4vw, 32px);

    color: var(--hm-body);
    font-feature-settings: "kern" 1, "liga" 1;
}

.elessi-home *,
.elessi-home *::before,
.elessi-home *::after {
    box-sizing: border-box;
}

/* ---- Section rhythm ---------------------------------------- */
.elessi-home .hm-section {
    padding-block: clamp(48px, 6vw, 92px);
}
.elessi-home .hm-section + .hm-section {
    padding-top: 0;
}
.elessi-home .hm-section .container {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 40px);
}

/* ---- Section headings -------------------------------------- */
.elessi-home .hm-section__head {
    max-width: 640px;
    margin: 0 auto clamp(28px, 3.5vw, 48px);
    text-align: center;
}
.elessi-home .hm-section__head--split {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    max-width: none;
    text-align: left;
}
.elessi-home .hm-section__title {
    margin: 0;
    color: var(--hm-ink);
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.elessi-home .hm-section__subtitle {
    margin: 10px 0 0;
    color: var(--hm-muted);
    font-size: 1.02rem;
    line-height: 1.6;
}

/* ---- Buttons ----------------------------------------------- */
.elessi-home .hm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform 0.25s var(--hm-ease), box-shadow 0.25s var(--hm-ease),
                background 0.25s var(--hm-ease), color 0.25s var(--hm-ease);
}
.elessi-home .hm-btn--primary {
    background: var(--hm-accent);
    color: var(--hm-accent-ink);
    box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--hm-accent) 70%, transparent);
}
.elessi-home .hm-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -12px color-mix(in srgb, var(--hm-accent) 75%, transparent);
}
.elessi-home .hm-btn--ghost {
    background: transparent;
    color: var(--hm-ink);
    border-color: var(--hm-line);
}
.elessi-home .hm-btn--ghost:hover {
    transform: translateY(-2px);
    border-color: var(--hm-ink);
    background: var(--hm-surface-2);
}
.elessi-home .hm-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--hm-accent);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: gap 0.25s var(--hm-ease);
}
.elessi-home .hm-link-arrow:hover { gap: 12px; }

.elessi-home .hm-eyebrow {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--hm-surface-3);
    color: var(--hm-ink);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ============================================================
   HERO
   ============================================================ */
.elessi-home .hm-hero {
    background:
        radial-gradient(120% 90% at 80% -10%, color-mix(in srgb, var(--hm-accent) 12%, transparent), transparent 60%),
        linear-gradient(180deg, var(--hm-surface-2), var(--hm-surface));
}
.elessi-home .hm-hero__inner {
    display: grid;
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}
.elessi-home .hm-hero--has-media { grid-template-columns: 1.1fr 0.9fr; }
.elessi-home .hm-hero--centered {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
}
.elessi-home .hm-hero__title {
    margin: 18px 0 0;
    color: var(--hm-ink);
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.elessi-home .hm-hero__subtitle {
    margin: 18px auto 0;
    max-width: 560px;
    color: var(--hm-body);
    font-size: clamp(1.02rem, 1.6vw, 1.18rem);
    line-height: 1.65;
}
.elessi-home .hm-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}
.elessi-home .hm-hero--centered .hm-hero__actions { justify-content: center; }
.elessi-home .hm-hero__media img {
    width: 100%;
    height: auto;
    border-radius: var(--hm-radius-lg);
    box-shadow: var(--hm-shadow-lg);
}

/* ============================================================
   TRUST BAR
   ============================================================ */
.elessi-home .hm-trust { padding-block: clamp(28px, 3vw, 40px); }
.elessi-home .hm-trust__grid {
    list-style: none;
    margin: 0;
    padding: clamp(16px, 2vw, 22px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: var(--hm-surface);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    box-shadow: var(--hm-shadow-md);
}
.elessi-home .hm-trust__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--hm-radius-sm);
    transition: background 0.25s var(--hm-ease);
}
.elessi-home .hm-trust__item:hover { background: var(--hm-surface-2); }
.elessi-home .hm-trust__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--hm-accent) 12%, transparent);
    color: var(--hm-accent);
    font-size: 1.5rem;
}
.elessi-home .hm-trust__text { display: flex; flex-direction: column; }
.elessi-home .hm-trust__title { color: var(--hm-ink); font-weight: 600; font-size: 0.98rem; }
.elessi-home .hm-trust__sub { color: var(--hm-muted); font-size: 0.85rem; }

/* ============================================================
   CATEGORIES
   ============================================================ */
/* --- Carousel container (reusable .hm-carousel) --- */
.elessi-home .hm-cats__carousel { position: relative; }

/* Pre-init: show a clean single row (no layout shift / no tall stack flash) */
.elessi-home .hm-carousel:not(.slick-initialized) {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: var(--hm-gap);
}
.elessi-home .hm-carousel:not(.slick-initialized) > .hm-cats__slide {
    flex: 0 0 calc((100% - var(--hm-gap) * 4) / 5);
}
.elessi-home .hm-carousel:not(.slick-initialized) > .hm-cats__slide:nth-child(n + 6) { display: none; }

/* Slick base (theme ships Slick JS but no Slick CSS) */
.elessi-home .hm-carousel .slick-list { position: relative; display: block; overflow: hidden; margin: 0 -10px; padding: 0; }
.elessi-home .hm-carousel .slick-track { position: relative; top: 0; left: 0; display: flex; } /* equal-height slides */
.elessi-home .hm-carousel .slick-slide { height: auto; padding: 6px 10px; outline: none; }
.elessi-home .hm-carousel .slick-slide > div { height: 100%; }
.elessi-home .hm-carousel .hm-cats__slide { height: 100%; }

/* Arrows */
.elessi-home .hm-carousel__arrow {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--hm-line);
    border-radius: 50%;
    background: var(--hm-surface);
    color: var(--hm-ink);
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: var(--hm-shadow-md);
    transition: transform 0.25s var(--hm-ease), background 0.25s var(--hm-ease), color 0.25s var(--hm-ease), opacity 0.25s var(--hm-ease);
}
.elessi-home .hm-carousel__arrow:hover { background: var(--hm-accent); color: #fff; border-color: var(--hm-accent); }
.elessi-home .hm-carousel__arrow--prev { left: -10px; }
.elessi-home .hm-carousel__arrow--next { right: -10px; }
.elessi-home .hm-carousel__arrow.slick-disabled { opacity: 0; pointer-events: none; }
.elessi-home .hm-carousel:hover .hm-carousel__arrow { }
@media (max-width: 767px) {
    .elessi-home .hm-carousel__arrow { display: none !important; } /* mobile = swipe */
}

/* Grabbing cursor for mouse-drag affordance */
.elessi-home .hm-carousel .slick-list { cursor: grab; }
.elessi-home .hm-carousel .slick-list:active { cursor: grabbing; }

.elessi-home .hm-cats__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--hm-surface);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--hm-shadow);
    transition: transform 0.35s var(--hm-ease), box-shadow 0.35s var(--hm-ease), border-color 0.35s var(--hm-ease);
}
.elessi-home .hm-cats__link:hover {
    transform: translateY(-6px);
    box-shadow: var(--hm-shadow-lg);
    border-color: color-mix(in srgb, var(--hm-accent) 40%, var(--hm-line));
}
.elessi-home .hm-cats__media {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--hm-surface-3);
    overflow: hidden;
}
.elessi-home .hm-cats__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--hm-ease);
}
.elessi-home .hm-cats__link:hover .hm-cats__media img { transform: scale(1.06); }
.elessi-home .hm-cats__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--hm-muted);
    font-size: 2.4rem;
}
.elessi-home .hm-cats__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
}
.elessi-home .hm-cats__name { color: var(--hm-ink); font-weight: 600; font-size: 1.02rem; }
.elessi-home .hm-cats__count { color: var(--hm-muted); font-size: 0.85rem; white-space: nowrap; }

/* ============================================================
   FEATURED PRODUCTS — premium card (.hm-card)
   ============================================================ */
.elessi-home .hm-products__grid { margin-top: 8px; }
.elessi-home .hm-products__grid ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--hm-gap);
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    width: 100%;
}
.elessi-home .hm-products__grid ul.products::before,
.elessi-home .hm-products__grid ul.products::after { content: none !important; display: none !important; }
/* Let each card fill its grid track (override theme's li.product width/float). */
.elessi-home .hm-products__grid ul.products > li.product {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
}


/* ============================================================
   PROMO BAND
   ============================================================ */
.elessi-home .hm-promo__inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: clamp(28px, 4vw, 56px);
    padding: clamp(32px, 4vw, 56px);
    border-radius: var(--hm-radius-lg);
    background:
        radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--hm-accent) 16%, transparent), transparent 55%),
        var(--hm-ink);
    color: #fff;
}
.elessi-home .hm-promo__title {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.12;
    color: #fff;
}
.elessi-home .hm-promo__text {
    margin: 16px 0 26px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 46ch;
}
.elessi-home .hm-promo .hm-btn--primary {
    background: #fff;
    color: var(--hm-ink);
    box-shadow: none;
}
.elessi-home .hm-promo .hm-btn--primary:hover { transform: translateY(-2px); background: var(--hm-surface-2); }
.elessi-home .hm-promo__stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 18px;
}
.elessi-home .hm-promo__stat {
    padding: 20px 24px;
    border-radius: var(--hm-radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.elessi-home .hm-promo__stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.elessi-home .hm-promo__stat-label { color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.elessi-home .hm-testimonials { background: var(--hm-surface-2); }
.elessi-home .hm-testimonials__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--hm-gap);
}
.elessi-home .hm-testimonials__item {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px;
    background: var(--hm-surface);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    box-shadow: var(--hm-shadow);
    transition: transform 0.35s var(--hm-ease), box-shadow 0.35s var(--hm-ease);
}
.elessi-home .hm-testimonials__item:hover { transform: translateY(-5px); box-shadow: var(--hm-shadow-md); }
.elessi-home .hm-stars { color: #f5a623; font-size: 1rem; letter-spacing: 2px; }
.elessi-home .hm-testimonials__quote {
    margin: 0;
    color: var(--hm-ink);
    font-size: 1.05rem;
    line-height: 1.65;
    font-style: normal;
    quotes: none;
}
.elessi-home .hm-testimonials__author {
    color: var(--hm-muted);
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 600;
    margin-top: auto;
}

/* ============================================================
   BLOG PREVIEW
   ============================================================ */
.elessi-home .hm-blog__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--hm-gap);
}
.elessi-home .hm-blog__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--hm-surface);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--hm-shadow);
    transition: transform 0.35s var(--hm-ease), box-shadow 0.35s var(--hm-ease);
}
.elessi-home .hm-blog__link:hover { transform: translateY(-6px); box-shadow: var(--hm-shadow-lg); }
.elessi-home .hm-blog__media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--hm-surface-3);
}
.elessi-home .hm-blog__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--hm-ease);
}
.elessi-home .hm-blog__link:hover .hm-blog__media img { transform: scale(1.05); }
.elessi-home .hm-blog__body { display: flex; flex-direction: column; gap: 8px; padding: 20px; }
.elessi-home .hm-blog__meta { color: var(--hm-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.elessi-home .hm-blog__heading { color: var(--hm-ink); font-size: 1.1rem; font-weight: 600; line-height: 1.35; }
.elessi-home .hm-blog__excerpt { color: var(--hm-body); font-size: 0.95rem; line-height: 1.6; }
.elessi-home .hm-blog__more { margin-top: 4px; color: var(--hm-accent); font-weight: 600; font-size: 0.9rem; }

/* ============================================================
   NEWSLETTER
   ============================================================ */
.elessi-home .hm-newsletter__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(24px, 4vw, 48px);
    padding: clamp(32px, 4vw, 56px);
    border-radius: var(--hm-radius-lg);
    background: var(--hm-surface-2);
    border: 1px solid var(--hm-line);
}
.elessi-home .hm-newsletter__title {
    margin: 0;
    color: var(--hm-ink);
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.elessi-home .hm-newsletter__subtext { margin: 12px 0 0; color: var(--hm-body); line-height: 1.65; max-width: 46ch; }
.elessi-home .hm-newsletter__row { display: flex; gap: 10px; flex-wrap: wrap; }
.elessi-home .hm-newsletter__row input[type="email"] {
    flex: 1 1 220px;
    min-width: 0;
    padding: 14px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--hm-line);
    background: var(--hm-surface);
    font-size: 1rem;
    transition: border-color 0.25s var(--hm-ease), box-shadow 0.25s var(--hm-ease);
}
.elessi-home .hm-newsletter__row input[type="email"]:focus {
    outline: none;
    border-color: var(--hm-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--hm-accent) 18%, transparent);
}
.elessi-home .hm-newsletter__note { margin: 10px 0 0; color: var(--hm-muted); font-size: 0.85rem; }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.elessi-home a:focus-visible,
.elessi-home button:focus-visible,
.elessi-home input:focus-visible {
    outline: 2px solid var(--hm-accent);
    outline-offset: 3px;
    border-radius: 6px;
}
.elessi-home .screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ============================================================
   SCROLL REVEAL (paired with home-modern.js)
   ============================================================ */
.elessi-home .hm-reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--hm-ease), transform 0.7s var(--hm-ease); }
.elessi-home .hm-reveal.hm-in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .elessi-home .hm-products__grid ul.products { grid-template-columns: repeat(3, 1fr) !important; }
    .elessi-home .hm-hero--has-media { grid-template-columns: 1fr; text-align: center; }
    .elessi-home .hm-promo__inner,
    .elessi-home .hm-newsletter__inner { grid-template-columns: 1fr; }
}

@media (max-width: 782px) {
    .elessi-home .hm-trust__grid { grid-template-columns: repeat(2, 1fr); }
    .elessi-home .hm-testimonials__grid,
    .elessi-home .hm-blog__grid { grid-template-columns: repeat(2, 1fr); }
    .elessi-home .hm-products__grid ul.products { grid-template-columns: repeat(2, 1fr) !important; }
    .elessi-home .hm-section__head--split { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 520px) {
    .elessi-home .hm-testimonials__grid,
    .elessi-home .hm-blog__grid { grid-template-columns: 1fr; }
    .elessi-home .hm-products__grid ul.products { grid-template-columns: repeat(2, 1fr) !important; gap: 14px; }
    .elessi-home .hm-hero__actions { flex-direction: column; }
    .elessi-home .hm-hero__actions .hm-btn { width: 100%; }
    .elessi-home .hm-newsletter__row .hm-btn { width: 100%; }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
    .elessi-home *,
    .elessi-home *::before,
    .elessi-home *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
    .elessi-home .hm-reveal { opacity: 1; transform: none; }
}
