.ehn-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    aspect-ratio: var(--ehn-aspect-d, 16/9);
    min-height: var(--ehn-min-h-d, 0px);
    max-height: var(--ehn-max-h-d, none);
    padding: var(--ehn-pad-d, 28px);
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    text-decoration: none !important;
    border: var(--ehn-border-w, 0px) var(--ehn-border-style, solid) var(--ehn-border-color, transparent);
    border-radius: var(--ehn-radius, 14px);
    box-shadow: var(--ehn-shadow, none);
    background: var(--ehn-bg-color, #1f2328);
    transform: translateY(0);
    transition: transform var(--ehn-transition, 350ms) ease, box-shadow var(--ehn-transition, 350ms) ease;
    color: inherit;
}

a.ehn-tile { cursor: pointer; }

.ehn-tile:focus-visible {
    outline: 3px solid var(--ehn-focus-color, #3452ff);
    outline-offset: 3px;
}

.ehn-tile__background,
.ehn-tile__overlay {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
}

.ehn-tile__background {
    z-index: -3;
    background-color: var(--ehn-bg-color, #1f2328);
    background-image: var(--ehn-bg-image, none);
    background-size: cover;
    background-position: var(--ehn-bg-position, center center);
    background-repeat: no-repeat;
    transform: scale(1);
    transition: transform var(--ehn-transition, 350ms) ease;
}

.ehn-tile__overlay {
    z-index: -2;
    background: var(--ehn-overlay, rgba(5,6,7,.42));
    transition: background var(--ehn-transition, 350ms) ease, opacity var(--ehn-transition, 350ms) ease;
}

.ehn-tile:hover {
    transform: translateY(calc(var(--ehn-hover-lift, 0px) * -1));
}

.ehn-tile:hover .ehn-tile__background {
    transform: scale(var(--ehn-hover-zoom, 1.05));
}

.ehn-tile:hover .ehn-tile__overlay {
    background: var(--ehn-overlay-hover, rgba(5,6,7,.52));
}

.ehn-tile__content {
    position: absolute;
    z-index: 2;
    inset: var(--ehn-pad-d, 28px);
    pointer-events: none;
}

.ehn-tile__position {
    position: absolute;
    width: max-content;
    max-width: 100%;
    box-sizing: border-box;
}

.ehn-tile__content-stack {
    display: flex;
    flex-direction: column;
}

/* Backward-compatible fallback for stale cached v1.0.5 markup while caches
   are being refreshed after an update. */
.ehn-tile__content:not(.ehn-tile__content--paired):not(.ehn-tile__content--split) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.ehn-tile__content:not(.ehn-tile__content--paired):not(.ehn-tile__content--split) > .ehn-tile__subtitle {
    margin-top: var(--ehn-subtitle-mt, 10px);
}

.ehn-tile__position--left-top { top: 0; left: 0; text-align: left; }
.ehn-tile__position--center-top { top: 0; left: 50%; transform: translateX(-50%); text-align: center; }
.ehn-tile__position--right-top { top: 0; right: 0; text-align: right; }
.ehn-tile__position--left-center { top: 50%; left: 0; transform: translateY(-50%); text-align: left; }
.ehn-tile__position--center-center { top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.ehn-tile__position--right-center { top: 50%; right: 0; transform: translateY(-50%); text-align: right; }
.ehn-tile__position--left-bottom { bottom: 0; left: 0; text-align: left; }
.ehn-tile__position--center-bottom { bottom: 0; left: 50%; transform: translateX(-50%); text-align: center; }
.ehn-tile__position--right-bottom { right: 0; bottom: 0; text-align: right; }

.ehn-tile__content-stack.ehn-tile__position--left-top,
.ehn-tile__content-stack.ehn-tile__position--left-center,
.ehn-tile__content-stack.ehn-tile__position--left-bottom { align-items: flex-start; }
.ehn-tile__content-stack.ehn-tile__position--center-top,
.ehn-tile__content-stack.ehn-tile__position--center-center,
.ehn-tile__content-stack.ehn-tile__position--center-bottom { align-items: center; }
.ehn-tile__content-stack.ehn-tile__position--right-top,
.ehn-tile__content-stack.ehn-tile__position--right-center,
.ehn-tile__content-stack.ehn-tile__position--right-bottom { align-items: flex-end; }

.ehn-tile__title,
.ehn-tile__subtitle {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.ehn-tile__title {
    margin: 0;
    padding: 0;
    font-family: var(--ehn-title-font, inherit);
    font-size: var(--ehn-title-size-d, 34px);
    font-weight: var(--ehn-title-weight, 700);
    line-height: var(--ehn-title-lh, 1.1);
    letter-spacing: var(--ehn-title-ls, 0px);
    color: var(--ehn-title-color, #fff);
}

.ehn-tile__subtitle {
    margin: 0;

    font-family: var(--ehn-subtitle-font, inherit);
    font-size: var(--ehn-subtitle-size-d, 18px);
    font-weight: var(--ehn-subtitle-weight, 400);
    line-height: var(--ehn-subtitle-lh, 1.35);
    color: var(--ehn-subtitle-color, #fff);
}

.ehn-tile__content-stack > .ehn-tile__subtitle {
    margin-top: var(--ehn-subtitle-mt, 10px);
}

/* A corner used by title/subtitle is reserved on desktop. The badge remains in
   the DOM/data and returns automatically on tablet/mobile where content is
   intentionally centered again. */
.ehn-tile--content-occupies-tl .ehn-tile__badges--tl,
.ehn-tile--content-occupies-tr .ehn-tile__badges--tr,
.ehn-tile--content-occupies-bl .ehn-tile__badges--bl,
.ehn-tile--content-occupies-br .ehn-tile__badges--br { display: none; }

.ehn-tile__badges {
    position: absolute;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: var(--ehn-badge-gap, 6px);
    max-width: calc(50% - var(--ehn-badge-offset, 14px) - 6px);
    pointer-events: none;
}

.ehn-tile__badges--tl { top: var(--ehn-badge-offset, 14px); left: var(--ehn-badge-offset, 14px); align-items: flex-start; }
.ehn-tile__badges--tr { top: var(--ehn-badge-offset, 14px); right: var(--ehn-badge-offset, 14px); align-items: flex-end; }
.ehn-tile__badges--bl { bottom: var(--ehn-badge-offset, 14px); left: var(--ehn-badge-offset, 14px); align-items: flex-start; }
.ehn-tile__badges--br { bottom: var(--ehn-badge-offset, 14px); right: var(--ehn-badge-offset, 14px); align-items: flex-end; }

.ehn-tile__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    padding: var(--ehn-badge-py, 6px) var(--ehn-badge-px, 10px);
    border: var(--ehn-badge-border-w, 0px) solid var(--ehn-badge-border-color, #fff);
    border-radius: var(--ehn-badge-radius, 999px);
    background: var(--ehn-badge-bg, #fff);
    color: var(--ehn-badge-color, #050607);
    font-family: var(--ehn-badge-font, inherit);
    font-size: var(--ehn-badge-size-d, 12px);
    font-weight: var(--ehn-badge-weight, 700);
    line-height: 1.1;
    white-space: normal;
    text-align: left;
    box-sizing: border-box;
}

.ehn-tile__badge-icon {
    display: block;
    width: var(--ehn-badge-icon-size, 16px);
    height: var(--ehn-badge-icon-size, 16px);
    max-width: none;
    flex: 0 0 auto;
    object-fit: contain;
}

.ehn-tile__badge-text { min-width: 0; }

.ehn-tiles-grid {
    display: grid;
    grid-template-columns: repeat(var(--ehn-cols-d, 3), minmax(0, 1fr));
    gap: var(--ehn-group-gap-d, 20px);
    width: 100%;
    min-width: 0;
}

.ehn-tiles-carousel {
    position: relative;
    width: 100%;
    min-width: 0;
}

.ehn-tiles-carousel__viewport {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ehn-tiles-carousel__viewport::-webkit-scrollbar { display: none; }

.ehn-tiles-carousel__track {
    display: flex;
    align-items: stretch;
    gap: var(--ehn-group-gap-d, 20px);
    width: 100%;
}

.ehn-tiles-carousel__slide {
    flex: 0 0 calc((100% - (var(--ehn-visible-d, 3) - 1) * var(--ehn-group-gap-d, 20px)) / var(--ehn-visible-d, 3));
    min-width: 0;
    scroll-snap-align: start;
}

.ehn-tiles-carousel__slide > .ehn-tile { height: 100%; }

.ehn-tiles-carousel__arrow {
    position: absolute;
    z-index: 8;
    top: 50%;
    width: var(--ehn-arrow-size, 42px);
    height: var(--ehn-arrow-size, 42px);
    margin: 0;
    padding: 0;
    border: var(--ehn-arrow-border-w, 0px) solid var(--ehn-arrow-border-color, #fff);
    border-radius: var(--ehn-arrow-radius, 999px);
    background: var(--ehn-arrow-bg, #fff);
    color: var(--ehn-arrow-color, #050607);
    font: inherit;
    font-size: 30px;
    line-height: 1;
    box-shadow: 0 6px 22px rgba(0,0,0,.14);
    transform: translateY(-50%);
    cursor: pointer;
}

.ehn-tiles-carousel__arrow--prev { left: 12px; }
.ehn-tiles-carousel__arrow--next { right: 12px; }
.ehn-tiles-carousel__arrow[disabled] { opacity: .35; cursor: default; }

.ehn-tiles-carousel__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
}

.ehn-tiles-carousel__dot {
    width: var(--ehn-dot-size, 8px);
    height: var(--ehn-dot-size, 8px);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ehn-dot-color, currentColor);
    opacity: .28;
    cursor: pointer;
}

.ehn-tiles-carousel__dot.is-active { background: var(--ehn-dot-active-color, var(--ehn-dot-color, currentColor)); opacity: .9; transform: scale(1.15); }

@media (max-width: 1000px) {
    .ehn-tile {
        aspect-ratio: var(--ehn-aspect-t, 4/3);
        min-height: var(--ehn-min-h-t, 0px);
        max-height: var(--ehn-max-h-t, none);
        padding: var(--ehn-pad-t, 24px);
    }
    .ehn-tile__content {
        position: relative;
        inset: auto;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        text-align: center;
    }
    .ehn-tile__position,
    .ehn-tile__content-stack {
        position: static;
        width: 100%;
        max-width: 100%;
        transform: none;
        text-align: center;
    }
    .ehn-tile__content-stack { display: flex; flex-direction: column; align-items: center !important; }
    .ehn-tile__content--split > .ehn-tile__subtitle { margin-top: var(--ehn-subtitle-mt, 10px); }
    .ehn-tile--content-occupies-tl .ehn-tile__badges--tl,
    .ehn-tile--content-occupies-tr .ehn-tile__badges--tr,
    .ehn-tile--content-occupies-bl .ehn-tile__badges--bl,
    .ehn-tile--content-occupies-br .ehn-tile__badges--br { display: flex; }
    .ehn-tile__title { font-size: var(--ehn-title-size-t, 30px); }
    .ehn-tile__subtitle { font-size: var(--ehn-subtitle-size-t, 17px); }
    .ehn-tile__badge { font-size: var(--ehn-badge-size-t, 12px); }
    .ehn-tiles-grid { grid-template-columns: repeat(var(--ehn-cols-t, 2), minmax(0, 1fr)); gap: var(--ehn-group-gap-t, 16px); }
    .ehn-tiles-carousel__track { gap: var(--ehn-group-gap-t, 16px); }
    .ehn-tiles-carousel__slide {
        flex-basis: calc((100% - (var(--ehn-visible-t, 2) - 1) * var(--ehn-group-gap-t, 16px)) / var(--ehn-visible-t, 2));
    }
}

@media (max-width: 690px) {
    .ehn-tile {
        aspect-ratio: var(--ehn-aspect-m, 1/1);
        min-height: var(--ehn-min-h-m, 0px);
        max-height: var(--ehn-max-h-m, none);
        padding: var(--ehn-pad-m, 20px);
    }
    .ehn-tile__title { font-size: var(--ehn-title-size-m, 26px); }
    .ehn-tile__subtitle { font-size: var(--ehn-subtitle-size-m, 16px); }
    .ehn-tile__badge { font-size: var(--ehn-badge-size-m, 11px); }
    .ehn-tiles-grid { grid-template-columns: repeat(var(--ehn-cols-m, 1), minmax(0, 1fr)); gap: var(--ehn-group-gap-m, 12px); }
    .ehn-tiles-carousel__track { gap: var(--ehn-group-gap-m, 12px); }
    .ehn-tiles-carousel__slide {
        flex-basis: calc((100% - (var(--ehn-visible-m, 1) - 1) * var(--ehn-group-gap-m, 12px)) / var(--ehn-visible-m, 1));
    }
    .ehn-tiles-carousel__arrow { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
    .ehn-tile,
    .ehn-tile__background,
    .ehn-tile__overlay { transition: none !important; }
    .ehn-tile:hover { transform: none; }
    .ehn-tile:hover .ehn-tile__background { transform: none; }
    .ehn-tiles-carousel__viewport { scroll-behavior: auto; }
}

/* Random-post placeholders keep the final tile dimensions stable while the
   uncached source is selected and rendered. */
.ehn-tile--random-loading {
    pointer-events: none;
}

.ehn-tile__random-loader {
    position: relative;
    z-index: 3;
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: rgba(255,255,255,.95);
    border-radius: 50%;
    animation: ehn-tile-random-spin .75s linear infinite;
}

.ehn-tile--random-error .ehn-tile__random-loader {
    display: none;
}

@keyframes ehn-tile-random-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ehn-tile__random-loader { animation: none; opacity: .65; }
}

/* v1.0.10 fade layer. Kept deliberately small so the established carousel
   geometry remains in charge of sizing, arrows, dots and responsive behavior. */
.ehn-tiles-carousel__fade-ghost {
    position: absolute;
    z-index: 6;
    box-sizing: border-box;
    margin: 0;
    opacity: 1;
    overflow: hidden !important;
    pointer-events: none !important;
    will-change: opacity, transform;
}

.ehn-tiles-carousel__fade-ghost::-webkit-scrollbar { display: none; }
.ehn-tiles-carousel__fade-ghost { scrollbar-width: none; }

.ehn-tiles-carousel--fade .ehn-tiles-carousel__viewport {
    overflow-x: hidden;
    scroll-snap-type: none;
    touch-action: pan-y;
}
