/**
 * Homepage Videos — YouTube Carousel
 * Split from homepage.css for performance
 *
 * @package MyChooz_Aesthetic
 */

/* ═══════════════════════════════════════════════════════════════
   YOUTUBE VIDEOS CAROUSEL - Island
   ═══════════════════════════════════════════════════════════════ */

.hp-videos {
    background: var(--hp-island-bg);
    border-top: 1px solid var(--hp-island-border);
    border-bottom: 1px solid var(--hp-island-border);
    box-shadow: var(--hp-island-shadow);
    padding: 16px;
    margin: 0 0 var(--hp-section-gap);
}

.hp-videos .hp-container {
    padding: 0;
}

.hp-videos__row {
    display: grid;
    /* Hero чуть шире — чтобы 16/9 совпал по высоте с 2×2 small-grid (gap-компенсация) */
    grid-template-columns: 1.02fr 1fr;
    gap: 12px;
    align-items: start;
}

.hp-videos__small-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}

.hp-video-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all var(--hp-transition-normal);
}

.hp-video-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Hero 16/9 — не растягивается, align-items: start на row */
.hp-video-card--hero .hp-video-card__thumb {
    aspect-ratio: 16/9;
    height: auto;
}

.hp-video-card__thumb {
    position: relative;
    background: var(--mca-text);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.hp-video-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--hp-transition-slow);
}

.hp-video-card:hover .hp-video-card__thumb img {
    transform: scale(1.05);
}

.hp-video-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: var(--hp-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all var(--hp-transition-normal);
}

.hp-video-card:hover .hp-video-card__play {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.hp-video-card__play::after {
    content: '';
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent white;
    margin-left: 3px;
}

.hp-video-card__body {
    padding: 12px;
}

.hp-video-card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--hp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-video-card__meta {
    font-size: 12px;
    color: var(--hp-muted);
    margin-top: 4px;
}

.hp-video-card--small .hp-video-card__play {
    width: 36px;
    height: 36px;
}

.hp-video-card--small .hp-video-card__play::after {
    border-width: 6px 0 6px 10px;
    margin-left: 2px;
}

.hp-video-card--small .hp-video-card__body {
    padding: 8px;
}

.hp-video-card--small .hp-video-card__title {
    font-size: 11px;
}

/* Video card overlay with title and views */
.hp-video-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hp-video-card__overlay .hp-video-card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: white;
}

.hp-video-card--hero .hp-video-card__overlay .hp-video-card__title {
    font-size: 16px;
    -webkit-line-clamp: 3;
}

.hp-video-card__views {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.hp-video-card--small .hp-video-card__overlay {
    padding: 24px 8px 8px;
}

.hp-video-card--small .hp-video-card__overlay .hp-video-card__title {
    font-size: 11px;
    -webkit-line-clamp: 2;
}

.hp-video-card--small .hp-video-card__views {
    font-size: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .hp-video-card--hero {
        flex: 0 0 300px;
    }
}

@media (min-width: 769px) {
    .hp-videos {
        border: 1px solid var(--hp-island-border);
        border-radius: var(--hp-island-radius);
        padding: var(--hp-island-padding);
        margin: 0 20px var(--hp-section-gap);
        max-width: calc(1200px - 40px);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {

    .hp-videos__row {
        grid-template-columns: 1fr;
    }

    .hp-video-card--hero {
        flex: none;
        width: 100%;
    }

    .hp-video-card--hero .hp-video-card__thumb {
        aspect-ratio: 16/9;
        height: auto;
    }

    .hp-videos__small-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hp-videos__scroll {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .hp-videos__small-grid {
        grid-template-columns: 1fr;
    }
}
