/*
 * CROMMELINS — Video Listing Element
 * File: assets/css/video-listing-element.css
 *
 * Matches the live site style at crommelins.com.au/videos/
 * — thumbnail grid, play-circle overlay, date/time meta, title
 * — full-screen popup lightbox
 */

/* ============================================================
   WRAPPER
   ============================================================ */
.crommelins-video-listing {
    width: 100%;
    box-sizing: border-box;
}

.crommelins-vl-heading {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: #1a1a1a;
}

/* ============================================================
   GRID
   ============================================================ */
.crommelins-vl-grid {
    display: grid;
    gap: 2rem 1.5rem;
    width: 100%;
}

.crommelins-vl-cols-2 { grid-template-columns: repeat(2, 1fr); }
.crommelins-vl-cols-3 { grid-template-columns: repeat(3, 1fr); }
.crommelins-vl-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .crommelins-vl-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .crommelins-vl-cols-3,
    .crommelins-vl-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .crommelins-vl-cols-2,
    .crommelins-vl-cols-3,
    .crommelins-vl-cols-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   ITEM CARD
   ============================================================ */
.crommelins-vl-item {
    display: flex;
    flex-direction: column;
}

/* ============================================================
   THUMBNAIL BUTTON (reset all button styles)
   ============================================================ */
.crommelins-vl-thumb-btn {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* ============================================================
   THUMBNAIL WRAP — aspect ratio 16:9
   ============================================================ */
.crommelins-vl-thumb-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #1a1a1a;
}

.crommelins-vl-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.crommelins-vl-thumb--no-img {
    position: absolute;
    inset: 0;
    background: #333;
}

/* Zoom on hover */
.crommelins-vl-thumb-btn:hover .crommelins-vl-thumb,
.crommelins-vl-thumb-btn:focus-visible .crommelins-vl-thumb {
    transform: scale(1.05);
    filter: brightness(0.75);
}

/* ============================================================
   PLAY OVERLAY — circular play button (matches live site)
   ============================================================ */
.crommelins-vl-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.crommelins-vl-play-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, background 0.25s ease;
}

.crommelins-vl-play-circle svg {
    width: 28px;
    height: 28px;
    fill: #1a1a1a;
    display: block;
    margin-left: 3px; /* optical centering for play icon */
}

.crommelins-vl-thumb-btn:hover .crommelins-vl-play-circle,
.crommelins-vl-thumb-btn:focus-visible .crommelins-vl-play-circle {
    transform: scale(1.12);
    background: #ffffff;
}

/* ============================================================
   META ROW — date / time (matches live site small grey text)
   ============================================================ */
.crommelins-vl-meta {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crommelins-vl-date {
    font-size: 0.78rem;
    color: #888;
    font-family: inherit;
    line-height: 1.4;
}

/* ============================================================
   TITLE (bold, matching live site)
   ============================================================ */
.crommelins-vl-title {
    margin: 0.35rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: #1a1a1a;
    font-family: inherit;
}

/* ============================================================
   NOTICE (empty state)
   ============================================================ */
.crommelins-vl-notice {
    padding: 1rem;
    background: #f5f5f5;
    border-left: 4px solid #ccc;
    color: #666;
    font-style: italic;
}

/* ============================================================
   POPUP OVERLAY — full-screen dark backdrop
   ============================================================ */
.crommelins-vl-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    animation: crom-vl-fade-in 0.2s ease;
}

.crommelins-vl-popup-overlay.is-active {
    display: flex;
}

@keyframes crom-vl-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   POPUP CONTAINER — responsive 16:9 video box
   ============================================================ */
.crommelins-vl-popup-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    animation: crom-vl-slide-up 0.25s ease;
}

@keyframes crom-vl-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ============================================================
   CLOSE BUTTON
   ============================================================ */
.crommelins-vl-popup-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
    z-index: 1;
}

.crommelins-vl-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.crommelins-vl-popup-close svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    display: block;
}

/* ============================================================
   POPUP TITLE (above player)
   ============================================================ */
.crommelins-vl-popup-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    text-align: left;
    line-height: 1.4;
    opacity: 0.9;
}

/* ============================================================
   POPUP PLAYER — 16:9 ratio
   ============================================================ */
.crommelins-vl-popup-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    overflow: hidden;
}

.crommelins-vl-popup-player iframe,
.crommelins-vl-popup-player video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
