/* ============================================================
   VIDEOS PAGE STYLES
   Uses the same design tokens as the rest of the site
   (gold #B8892B, dark #1B1B1B, Playfair Display + Inter)
   ============================================================ */


/* ============================================================
   1. BANNER (gold accent line when no image is set)
   ============================================================ */
.videos-banner {
    background-image: linear-gradient(135deg, #1B1B1B 0%, #2A2A2A 55%, #3a2f17 100%);
}

.videos-banner::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 80px;
    height: 3px;
    background: var(--color-primary);
    transform: translateX(-50%);
    z-index: 2;
}


/* ============================================================
   2. SECTION + GRID
   ============================================================ */
.videos-section {
    background-color: var(--color-light);
    padding: var(--space-2xl) 0;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}


/* ============================================================
   3. VIDEO CARD
   ============================================================ */
.video-card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.video-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    border: 0;
    background-color: var(--color-dark);
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.video-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.video-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
    opacity: 0.85;
    transition: opacity 0.35s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.06);
}

.video-card:hover .video-thumb::after {
    opacity: 1;
}

.video-thumb:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: -3px;
}

/* ---------- Play button ---------- */
.video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    color: var(--color-white);
    background-color: var(--color-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.video-play::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(184, 137, 43, 0.55);
    border-radius: 50%;
    animation: videoPulse 2.2s ease-out infinite;
}

.video-play svg {
    width: 26px;
    height: 26px;
    margin-left: 3px;
}

.video-card:hover .video-play {
    background-color: var(--color-primary-dark);
    transform: translate(-50%, -50%) scale(1.1);
}

@keyframes videoPulse {
    0%   { transform: scale(0.9); opacity: 0.9; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- Info ---------- */
.video-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    padding: 20px 22px 22px;
}

.video-title {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-yt-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary);
    transition: color 0.2s ease, gap 0.2s ease;
}

.video-yt-link:hover {
    color: var(--color-primary-dark);
    gap: 10px;
}


/* ============================================================
   4. EMPTY STATE
   ============================================================ */
.videos-empty {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    color: var(--color-gray);
}

.videos-empty svg {
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}


/* ============================================================
   5. POPUP PLAYER
   ============================================================ */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.video-modal.is-open {
    display: flex;
    animation: videoFade 0.25s ease;
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.92);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.video-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(960px, 100%, calc((100vh - 140px) * 16 / 9));
}

.video-modal-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(184, 137, 43, 0.4);
}

.video-modal-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-modal-title {
    margin-top: 14px;
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    line-height: 1.4;
    color: var(--color-white);
    text-align: center;
}

.video-modal-close {
    position: absolute;
    top: -52px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.video-modal-close:hover,
.video-modal-close:focus-visible {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: rotate(90deg);
    outline: none;
}

@keyframes videoFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body.video-modal-open {
    overflow: hidden;
}


/* ============================================================
   6. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .videos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .videos-section {
        padding: var(--space-xl) 0;
    }

    .video-play {
        width: 56px;
        height: 56px;
    }

    .video-play svg {
        width: 22px;
        height: 22px;
    }

    .video-info {
        padding: 16px 18px 18px;
    }
}

@media (max-width: 600px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .video-modal {
        padding: 12px;
    }

    .video-modal-close {
        top: -50px;
    }
}

/* Phones in landscape: keep the player inside the screen */
@media (max-height: 500px) and (orientation: landscape) {
    .video-modal-dialog {
        width: min(960px, 100%, calc((100vh - 70px) * 16 / 9));
    }

    .video-modal-title {
        display: none;
    }

    .video-modal-close {
        top: -46px;
        width: 36px;
        height: 36px;
    }
}

@media (hover: none) {
    .video-card:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-play::before { animation: none; }
    .video-card,
    .video-thumb img,
    .video-modal.is-open { transition: none; animation: none; }
}