﻿/* Promo Input Pro - Frontend Styles (News Layout) */

:root {
    --pip-primary: #dc2626; /* News red */
    --pip-text-dark: #1f2937;
    --pip-text-muted: #6b7280;
    --pip-bg-card: #ffffff;
    --pip-border: #e5e7eb;
    --pip-radius: 8px;
    --pip-transition: all 0.2s ease-in-out;
}

/* Video Player Styles */
.pip-video-player {
    display: block;
    background: #000;
    cursor: pointer;
}

.pip-video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pip-video-modal-overlay.pip-show {
    display: flex;
}

.pip-video-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 85vh;
}

.pip-video-modal-video {
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 85vh;
    display: block;
    background: #000;
    border-radius: 16px;
}

.pip-video-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    background: none !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
    font-size: 44px;
    font-weight: 200;
    line-height: 1;
    padding: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

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

.pip-promo-image-wrapper video.pip-promo-image,
.pip-promo-image-wrapper video.pip-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.pip-promo-card-only-thumbnail video.pip-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.pip-promo-card-only-thumbnail:hover video.pip-video-player {
    transform: scale(1.06);
}

.pip-promo-container {
    padding: 20px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Grid Layout */
.pip-promo-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 32px;
}

.pip-promo-grid > .pip-promo-card,
.pip-promo-grid > .pip-promo-thumbnail-grid {
    flex: 1 1 100%;
}

.pip-promo-grid > .pip-promo-card-video-only {
    flex: 0 0 auto;
}

/* Card Styling (Horizontal) */
.pip-promo-card {
    display: flex;
    gap: 24px;
    text-decoration: none !important;
    color: inherit;
    transition: var(--pip-transition);
    align-items: flex-start;
    max-width: 100%;
}

/* Image Wrapper for Uniformity */
.pip-promo-image-wrapper {
    flex: 0 0 calc(350px * var(--video-scale, 1)); /* Scalable width */
    height: calc(200px * var(--video-scale, 1));   /* Fixed height for image, auto for video */
    border-radius: var(--pip-radius);
    overflow: hidden;
    background: #f3f4f6;
}

.pip-promo-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures uniform size */
    display: block;
}

/* Content Styling */
.pip-promo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Video Only Modifiers */
.pip-promo-card-video-only .pip-promo-content {
    display: none !important;
}

.pip-promo-title {
    margin: 0 0 12px 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--pip-text-dark);
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.pip-promo-subtitle {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pip-primary);
    text-transform: capitalize;
}

.pip-promo-description {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--pip-text-muted);
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
}

.pip-read-more {
    color: var(--pip-primary);
    font-weight: 600;
    cursor: pointer;
}

/* Carousel Adjustments */
.pip-promo-carousel .pip-promo-card {
    flex-direction: row;
    gap: 24px;
}

.pip-promo-carousel .pip-promo-image-wrapper {
    flex: 0 0 calc(250px * var(--video-scale, 1));
    height: calc(150px * var(--video-scale, 1));
}

/* No Promos Available */
.pip-no-promos {
    text-align: center;
    padding: 60px 20px;
    color: var(--pip-text-muted);
    font-size: 1.25rem;
    font-weight: 500;
    width: 100%;
}

/* Thumbnail Only & Horizontal Layout */
.pip-promo-thumbnail-grid {
    width: 100%;
    margin-bottom: 32px;
}

.pip-promo-card-only-thumbnail {
    display: block;
    text-decoration: none;
    border-radius: var(--pip-radius);
    overflow: hidden;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    background: #f3f4f6;
    aspect-ratio: 16/10;
}

.pip-promo-card-only-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.pip-promo-card-only-thumbnail:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.pip-promo-card-only-thumbnail:hover img {
    transform: scale(1.06);
}

.pip-promo-card-only-thumbnail.pip-flyer-trigger {
    aspect-ratio: 9/16;
}

.pip-promo-card-only-thumbnail.pip-flyer-trigger img {
    height: 100%;
    object-fit: cover;
}

/* Carousel support for thumbnail-only */
.pip-promo-carousel .pip-promo-card-only-thumbnail {
    aspect-ratio: 16/10;
}

.pip-promo-carousel .pip-promo-card-only-thumbnail.pip-flyer-trigger {
    aspect-ratio: 9/16;
}

/* Responsive */
@media (max-width: 768px) {
    .pip-promo-card {
        flex-direction: column;
        gap: 16px;
    }

    .pip-promo-image-wrapper {
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .pip-promo-title {
        font-size: 1.4rem;
    }

    .pip-promo-thumbnail-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        gap: 12px !important;
    }

    /* Flyer grid: always 2 columns on all mobile sizes */
    .pip-promo-thumbnail-grid.pip-flyer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
