/*
 * Lumina — Magazine Blocks CSS
 * hero-zone, category-strip, editorial-strip, latest-strip
 */

/* ── Общее: карточка ─────────────────────────────────────────────────────── */

.lumina-card {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--wp--preset--color--base-2, #f0ede8);
}

.lumina-card__link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.lumina-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.lumina-card:hover .lumina-card__img {
    transform: scale(1.03);
}

.lumina-card__img--placeholder {
    background: var(--wp--preset--color--base-3, #d8d4cc);
}

/* ── Оверлеи ─────────────────────────────────────────────────────────────── */

.lumina-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem 1.125rem;
    pointer-events: none;
}

.lumina-overlay a {
    pointer-events: auto;
}

/* auto: тёмный градиент снизу */
.lumina-overlay--auto {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.62) 0%,
        rgba(0, 0, 0, 0.18) 50%,
        transparent 100%
    );
}

/* light: светлый полупрозрачный фон */
.lumina-overlay--light {
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 100%
    );
}

/* minimal: только пилюля, без заголовка */
.lumina-overlay--minimal {
    background: none;
    justify-content: flex-start;
    padding: 0.75rem;
}

.lumina-overlay--auto .lumina-overlay__title a,
.lumina-overlay--auto .lumina-overlay__date {
    color: #fff;
}

.lumina-overlay--light .lumina-overlay__title a,
.lumina-overlay--light .lumina-overlay__date {
    color: var(--wp--preset--color--contrast, #111);
}

.lumina-overlay__title {
    font-size: var(--wp--preset--font-size--sm, 0.875rem);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin: 0 0 0.3rem;
}

.lumina-overlay__title a {
    text-decoration: none;
}

.lumina-overlay--auto .lumina-overlay__title a {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.lumina-overlay__date {
    font-size: var(--wp--preset--font-size--xs, 0.75rem);
    opacity: 0.7;
}

/* ── Заголовок секции (strip-header) ─────────────────────────────────────── */

.lumina-strip-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.25rem 0.625rem;
}

.lumina-strip-label {
    font-size: var(--wp--preset--font-size--xs, 0.75rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--contrast-3);
    white-space: nowrap;
}

.lumina-strip-line {
    flex: 1;
    height: 0.5px;
    background: var(--wp--preset--color--base-3, rgba(0, 0, 0, 0.1));
}

.lumina-strip-all {
    font-size: var(--wp--preset--font-size--xs, 0.75rem);
    color: var(--wp--preset--color--contrast-3);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.lumina-strip-all:hover {
    color: var(--wp--preset--color--contrast);
}

/* ── Hero Zone ───────────────────────────────────────────────────────────── */

.lumina-hero-zone {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1px;
    background: var(--wp--preset--color--base-3, rgba(0, 0, 0, 0.08));
    height: var(--lumina-hero-height, 480px);
}

.lumina-hero-zone--accent-right {
    grid-template-columns: 1fr 3fr;
}

.lumina-hero-zone__accent {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.lumina-hero-zone__secondary {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.lumina-hero-zone--accent-right .lumina-hero-zone__secondary {
    order: -1;
}

/* Слот внутри hero */
.lumina-hero-slot {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Карточки внутри слота */
.lumina-hero-card {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: none;
}

.lumina-hero-card.is-active {
    display: block;
}

.lumina-hero-card__img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.lumina-hero-card__img--placeholder {
    background: var(--wp--preset--color--base-3, #d0ccc5);
}

/* Overlay внутри hero (крупный текст) */
.lumina-hero-zone__accent .lumina-overlay__title {
    font-size: var(--wp--preset--font-size--lg, 1.25rem);
}

/* Навигационные точки */
.lumina-hero-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.375rem;
    z-index: 10;
}

.lumina-hero-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lumina-hero-dot.is-active {
    background: #fff;
    transform: scale(1.25);
}

/* ── Category Strip / Latest Strip ──────────────────────────────────────── */

.lumina-category-strip,
.lumina-latest-strip {
    padding-bottom: 1.25rem;
}

.lumina-strip-grid {
    display: grid;
    grid-template-columns: repeat(var(--lumina-cols, 4), 1fr);
    gap: 1px;
    background: var(--wp--preset--color--base-3, rgba(0, 0, 0, 0.08));
    margin: 0 1.25rem;
    border-radius: 6px;
    overflow: hidden;
}

/* ── Editorial Strip ─────────────────────────────────────────────────────── */

.lumina-editorial-strip {
    padding-bottom: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Editorial wrap — общий контейнер
   Ключевой принцип: высота задаётся на контейнере через clamp().
   Все дочерние карточки занимают 100% высоты через height:100%.
   object-fit:cover обеспечивает минимальный кроп без деформации.
   ═══════════════════════════════════════════════════════════════════════════ */

.lumina-editorial-wrap {
    display: flex;
    gap: 1px;
    background: var(--wp--preset--color--base-3, rgba(0,0,0,0.08));
    margin: 0 1.25rem;
    border-radius: 6px;
    overflow: hidden;

    /* Высота: адаптивно, ~38% ширины viewport, в рамках разумного */
    height: clamp(260px, 38vw, 480px);
}

/* Модификаторы высоты */
.lumina-editorial-wrap--short { height: clamp(200px, 28vw, 340px); }
.lumina-editorial-wrap--tall  { height: clamp(320px, 50vw, 600px); }

/* ── Акцентный режим ─────────────────────────────────────────────────────── */

.lumina-editorial-accent {
    /* Занимает ~60% ширины (flex-grow + shrink 0 не нужны, т.к. flex:2) */
    flex: 2 0 0;
    min-width: 0;
}

.lumina-editorial-wrap--accent-right .lumina-editorial-accent {
    order: 2;
}

.lumina-editorial-secondary {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--wp--preset--color--base-3, rgba(0,0,0,0.08));
}

.lumina-editorial-wrap--accent-right .lumina-editorial-secondary {
    order: 1;
}

.lumina-editorial-secondary__item {
    flex: 1 0 0;
    min-height: 0;
}

/* ── Безакцентный режим ──────────────────────────────────────────────────── */

.lumina-editorial-wrap--flat {
    /* gap между равными карточками */
}

.lumina-editorial-flat__item {
    flex: 1 0 0;
    min-width: 0;
}

/* ── Карточки внутри editorial — заполняют контейнер целиком ─────────────── */

.lumina-editorial-wrap .lumina-card {
    /* Переопределяем aspect-ratio (если он был задан) — здесь высота от контейнера */
    aspect-ratio: unset;
    height: 100%;
    width: 100%;
}

.lumina-editorial-wrap .lumina-card__img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* ── Адаптивность ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .lumina-hero-zone {
        grid-template-columns: 1fr;
    }

    .lumina-hero-zone__secondary {
        grid-template-rows: none;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .lumina-strip-grid {
        grid-template-columns: repeat(2, 1fr);
        margin: 0 0.75rem;
    }

    /* Editorial: стопка на мобильных */
    .lumina-editorial-wrap {
        flex-direction: column;
        height: auto;
        margin: 0 0.75rem;
    }

    .lumina-editorial-wrap--accent-right .lumina-editorial-accent,
    .lumina-editorial-wrap--accent-right .lumina-editorial-secondary {
        order: unset;
    }

    .lumina-editorial-accent,
    .lumina-editorial-flat__item {
        flex: none;
        width: 100%;
        height: clamp(200px, 55vw, 320px);
    }

    .lumina-editorial-secondary {
        flex: none;
        width: 100%;
        flex-direction: row;
        height: clamp(140px, 35vw, 220px);
    }

    .lumina-editorial-secondary__item {
        flex: 1 0 0;
        min-width: 0;
    }

    .lumina-editorial-wrap .lumina-card {
        height: 100%;
    }

    .lumina-hero-zone__secondary {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    .lumina-strip-grid {
        grid-template-columns: 1fr;
    }

    .lumina-hero-zone__secondary {
        grid-template-columns: 1fr;
    }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .lumina-card__img {
        transition: none;
    }
}
