/*!
 * Orange Vending YouTube — frontend styles
 * Uses an orange accent that matches orangevending.net brand tone.
 */

:root {
    --ovy-orange:        #f57c00;
    --ovy-orange-dark:   #e65100;
    --ovy-text:          #1f2937;
    --ovy-muted:         #6b7280;
    --ovy-card-bg:       #ffffff;
    --ovy-card-shadow:   0 6px 16px rgba(15, 23, 42, 0.10);
    --ovy-card-shadow-h: 0 14px 28px rgba(15, 23, 42, 0.18);
    --ovy-radius:        12px;
}

.ovy-hero,
.ovy-feed,
.ovy-gallery {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1rem;
    color: var(--ovy-text);
    font-family: inherit;
}

/* ---------- Hero ---------- */

.ovy-hero__header {
    text-align: center;
    margin-bottom: 1.25rem;
}
.ovy-hero__title {
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    margin: 0 0 0.4rem;
    color: var(--ovy-text);
}
.ovy-hero__subtitle {
    margin: 0;
    color: var(--ovy-muted);
    font-size: 1.05rem;
}
.ovy-hero__player {
    border-radius: var(--ovy-radius);
    overflow: hidden;
    box-shadow: var(--ovy-card-shadow);
    background: #000;
}
.ovy-aspect {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
}
.ovy-aspect iframe,
.ovy-aspect img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.ovy-hero__meta {
    margin-top: 1rem;
    text-align: center;
}
.ovy-hero__video-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--ovy-text);
}
.ovy-hero__date {
    margin: 0.25rem 0 0;
    color: var(--ovy-muted);
    font-size: 0.95rem;
}

/* ---------- Feed / Gallery header ---------- */

.ovy-feed__title,
.ovy-gallery__title {
    text-align: center;
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    margin: 0 0 0.5rem;
}
.ovy-gallery__channel {
    text-align: center;
    color: var(--ovy-muted);
    margin: 0 0 1.5rem;
}
.ovy-gallery__header {
    margin-bottom: 1.5rem;
}

/* ---------- Grid ---------- */

.ovy-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ovy-grid--cols-1 { grid-template-columns: 1fr; }
.ovy-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ovy-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ovy-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ovy-grid--cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ovy-grid--cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 900px) {
    .ovy-grid,
    .ovy-grid--cols-3,
    .ovy-grid--cols-4,
    .ovy-grid--cols-5,
    .ovy-grid--cols-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 540px) {
    .ovy-grid,
    .ovy-grid--cols-2,
    .ovy-grid--cols-3,
    .ovy-grid--cols-4,
    .ovy-grid--cols-5,
    .ovy-grid--cols-6 {
        grid-template-columns: 1fr;
    }
}

/* ---------- Card ---------- */

.ovy-card {
    background: var(--ovy-card-bg);
    border-radius: var(--ovy-radius);
    overflow: hidden;
    box-shadow: var(--ovy-card-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ovy-card:hover,
.ovy-card:focus-within {
    transform: translateY(-3px);
    box-shadow: var(--ovy-card-shadow-h);
}

.ovy-card__play {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
    display: block;
}
.ovy-card__play:focus-visible {
    outline: 3px solid var(--ovy-orange);
    outline-offset: 2px;
}

.ovy-card__thumb-wrap {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 56.25%;
    background: #111;
    overflow: hidden;
}
.ovy-card__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.ovy-card__play:hover .ovy-card__thumb {
    transform: scale(1.04);
}

.ovy-card__play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, opacity 0.18s ease;
    opacity: 0.9;
}
.ovy-card__play:hover .ovy-card__play-icon {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 1;
}
.ovy-card__play-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ovy-card__duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

.ovy-card__body {
    display: block;
    padding: 0.85rem 1rem 1rem;
}
.ovy-card__title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--ovy-text);
    /* Two-line clamp without breaking older browsers */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ovy-card__date {
    display: block;
    color: var(--ovy-muted);
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

/* ---------- Lightbox ---------- */

.ovy-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 16, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
.ovy-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}
.ovy-lightbox__inner {
    position: relative;
    width: min(100%, 1100px);
    background: #000;
    border-radius: var(--ovy-radius);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.ovy-lightbox__close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--ovy-orange);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    z-index: 2;
    transition: background 0.15s ease;
}
.ovy-lightbox__close:hover,
.ovy-lightbox__close:focus-visible {
    background: var(--ovy-orange-dark);
}
.ovy-lightbox__frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    /* Fallback for browsers without aspect-ratio */
    position: relative;
}
.ovy-lightbox__frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ovy-empty {
    text-align: center;
    color: var(--ovy-muted);
    padding: 1rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ovy-card,
    .ovy-card__thumb,
    .ovy-card__play-icon,
    .ovy-lightbox {
        transition: none;
    }
}
