/**
 * File: css/videos.css
 * Version: 1.2.0
 * Last Modified: 2026-02-27
 *
 * Videos From the Ranch — YouTube video grid page
 * Two sections: landscape videos + Shorts, each newest-first
 * Uses global .qc-play-btn from questionable-choice-spotlight.css
 * Uses global YouTube embed CSS from style.css
 *
 * @package TROQC
 */

/* ============================================================
   POSTERMAT — Beige mat wrapper around white content
   Matches .dispatches-wrapper on the live site
   ============================================================ */
.videos-postermat {
    padding: 36px;
    min-height: 100vh;
}

/* ============================================================
   HEADER PANEL — White panel on the mat
   ============================================================ */
.videos-page-header {
    background: #ffffff;
    padding: 60px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    margin-bottom: 2rem;
    border-top: 4px solid var(--brand-teal);
}

.videos-page-header .sparkle {
    color: var(--brand-teal);
    opacity: 0.35;
    font-size: 1.4rem;
    display: block;
    margin-bottom: 0.5rem;
}

.videos-page-header h1 {
    font-family: var(--font-display);
    font-size: 3.25rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.videos-page-header .subtitle {
    font-family: var(--font-handwritten);
    font-style: normal;
    font-size: 2rem;
    color: rgba(0, 0, 0, 0.55);
    margin-bottom: 1rem;
}

.videos-page-header .description {
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.6);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    line-height: 1.7;
}

/* ============================================================
   CONTENT PANELS — White panels for each section
   ============================================================ */
.videos-content-panel {
    background: #ffffff;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.videos-content-panel + .videos-content-panel {
    margin-top: 2rem;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.videos-section-heading {
    font-family: var(--font-handwritten);
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-teal);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.video-count {
    font-size: 0.6875rem;
    color: rgba(0, 0, 0, 0.55);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
}

/* ============================================================
   VIDEO GRID — Landscape (default)
   ============================================================ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.4rem;
}

/* ============================================================
   VIDEO GRID — Shorts (narrower columns for portrait cards)
   ============================================================ */
.video-grid--shorts {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.2rem;
}

/* ============================================================
   VIDEO CARD — Landscape (default)
   ============================================================ */
.video-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    animation: videoCardFadeIn 0.4s ease both;
}

.video-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--brand-teal);
}

@keyframes videoCardFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-card .thumb-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eee;
}

.video-card .thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

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

/* Play button — reuses global .qc-play-btn from spotlight CSS */
.video-card .qc-play-btn {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.video-card:hover .qc-play-btn {
    opacity: 1;
}

.video-card .duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.03em;
}

.video-card .card-body {
    padding: 0.9rem 1rem 1rem;
}

.video-card .card-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.35;
    color: rgba(0, 0, 0, 0.84);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card .card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.6875rem;
    color: rgba(0, 0, 0, 0.55);
    letter-spacing: 0.02em;
}

.video-card .card-meta .dot {
    width: 3px;
    height: 3px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   VIDEO CARD — Hidden (for show-more pagination)
   ============================================================ */
.video-card--hidden {
    display: none;
}

/* ============================================================
   SHOW MORE BUTTON
   ============================================================ */
.videos-show-more-wrapper {
    text-align: center;
    margin-top: 1.5rem;
}

.videos-show-more-btn {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--brand-teal);
    border: 1px solid rgba(0, 0, 0, 0.14);
    padding: 0.7rem 2rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.videos-show-more-btn:hover {
    background: var(--brand-teal);
    color: #fff;
    border-color: var(--brand-teal);
}

/* ============================================================
   VIDEO CARD — Shorts (portrait, ≤60s)
   ============================================================ */
.video-card--short .thumb-wrap {
    aspect-ratio: 9 / 16;
}

.video-card--short .card-title {
    font-size: 0.8125rem;
}

.video-card--short .card-body {
    padding: 0.7rem 0.75rem 0.85rem;
}

/* ============================================================
   LIGHTBOX — Landscape (default)
   ============================================================ */
.videos-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.videos-lightbox.active {
    display: flex;
    animation: videosLbIn 0.2s ease;
}

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

.videos-lightbox-inner {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.videos-lightbox-inner iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Lightbox — Shorts (portrait) */
.videos-lightbox-inner--short {
    aspect-ratio: 9 / 16;
    max-width: 400px;
    max-height: 85vh;
}

.videos-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.25s ease;
    font-family: var(--font-body);
}

.videos-lightbox-close:hover {
    opacity: 1;
}

/* ============================================================
   LOADING / ERROR STATE
   ============================================================ */
.videos-state-message {
    text-align: center;
    padding: 4rem 1rem;
}

.videos-state-message .spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(0, 0, 0, 0.14);
    border-top-color: var(--brand-teal);
    border-radius: 50%;
    animation: videosSpinner 0.7s linear infinite;
}

@keyframes videosSpinner {
    to { transform: rotate(360deg); }
}

.videos-state-message p {
    color: rgba(0, 0, 0, 0.55);
    font-size: 0.9rem;
    font-style: italic;
}

.videos-state-message.error p {
    color: #a04030;
    font-style: normal;
}

/* ============================================================
   ORIENTATION CROSSLINK
   ============================================================ */
.videos-orientation {
    font-family: var(--font-body);
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.55);
    margin: 0 0 16px;
}

.videos-orientation a {
    color: var(--brand-teal);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.videos-orientation a:hover {
    border-bottom-color: var(--brand-teal);
}

/* Card title hover */
.video-card .card-title:hover {
    color: var(--brand-teal);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .videos-postermat { padding: 24px; }
    .videos-page-header { padding: 40px 24px; }
    .videos-content-panel { padding: 24px; }
}

@media (max-width: 768px) {
    .videos-postermat { border-width: 12px; }
}

@media (max-width: 600px) {
    .videos-postermat { padding: 16px; border-width: 10px; }
    .videos-page-header { padding: 32px 20px; }
    .videos-page-header h1 { font-size: 2rem; }
    .videos-section-heading { font-size: 1.625rem; }
    .videos-content-panel { padding: 20px 16px; }
    .video-grid { grid-template-columns: 1fr; gap: 1rem; }
    .video-grid--shorts { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
}
