/* ==========================================================================
   EPIM EN ACTION — PINTEREST MASONRY GALLERY (VIDEOS, REELS, PHOTOS)
   Design System: Bleu Nuit (#0f3b63), Bleu Profond (#0a2844), Or (#d4af37)
   Responsive standards: .98px guards, 0px horizontal overflow guaranteed.
   ========================================================================== */

/* Page Wrapper */
.action-page {
    position: relative;
    width: 100%;
    overflow-x: clip;
    color: var(--bs-body-color, #2d3748);
    background-color: #fbfcfe;
}

/* Common Kicker */
.action-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   1. HERO SECTION
   ========================================================================== */
.action-hero {
    position: relative;
    min-height: min(65vh, 520px);
    display: flex;
    align-items: center;
    color: #ffffff;
    padding: 130px 0 65px;
    background-color: var(--primary-dark, #0a2844);
    background-image:
        linear-gradient(135deg, rgba(10, 40, 68, 0.94) 0%, rgba(15, 59, 99, 0.88) 60%, rgba(10, 40, 68, 0.96) 100%),
        url("/static/img/hero-programmes.webp");
    background-position: center 30%;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

.action-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 55%);
    pointer-events: none;
}

.action-hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
}

.action-hero h1 {
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin: 0 0 1.25rem;
}

.action-hero h1 .text-highlight-gold {
    color: var(--gold, #d4af37);
    background: linear-gradient(135deg, #ffe082 0%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.action-hero .action-hero-lede {
    font-size: clamp(1.05rem, 1.35vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 2rem;
    max-width: 720px;
}

/* Quick Bar Indicators */
.action-hero-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.action-hero-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.action-hero-stat i {
    font-size: 1.25rem;
    color: var(--gold, #d4af37);
}

/* ==========================================================================
   2. FILTER TOOLBAR & CONTROLS
   ========================================================================== */
.action-toolbar-section {
    position: sticky;
    top: 72px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 59, 99, 0.08);
    box-shadow: 0 4px 16px rgba(10, 40, 68, 0.03);
    padding: 14px 0;
}

.action-toolbar-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
}

.action-filter-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 2px;
    flex: 1;
    min-width: 0;
}

.action-filter-pills::-webkit-scrollbar {
    display: none;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    background: #edf2f7;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.action-pill:hover {
    color: var(--primary-color, #0f3b63);
    background: #e2e8f0;
}

.action-pill.active {
    color: #ffffff;
    background: var(--primary-color, #0f3b63);
    border-color: var(--primary-color, #0f3b63);
    box-shadow: 0 4px 12px rgba(15, 59, 99, 0.2);
}

.action-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 240px;
}

.action-search-input {
    width: 100%;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #cbd5e0;
    font-size: 0.875rem;
    color: #2d3748;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.action-search-input:focus {
    border-color: var(--primary-color, #0f3b63);
    box-shadow: 0 0 0 3px rgba(15, 59, 99, 0.12);
    outline: none;
}

/* ==========================================================================
   3. PINTEREST MASONRY GRID
   ========================================================================== */
.action-gallery-section {
    padding: 3rem 0 5rem;
}

.action-masonry {
    column-count: 4;
    column-gap: 22px;
    width: 100%;
}

.action-card {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 22px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(15, 59, 99, 0.08);
    box-shadow: 0 6px 20px rgba(10, 40, 68, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    position: relative;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(10, 40, 68, 0.12);
    border-color: rgba(15, 59, 99, 0.2);
}

/* Media Holder */
.action-card-media {
    position: relative;
    width: 100%;
    background-color: #0a2844;
    overflow: hidden;
}

.action-card-media img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.action-card:hover .action-card-media img {
    transform: scale(1.04);
}

/* Aspect ratio helpers */
.action-card[data-ratio="vertical"] .action-card-media {
    aspect-ratio: 9 / 16;
}

.action-card[data-ratio="vertical"] .action-card-media img {
    height: 100%;
    object-fit: cover;
}

.action-card[data-ratio="horizontal"] .action-card-media {
    aspect-ratio: 16 / 9;
}

.action-card[data-ratio="square"] .action-card-media {
    aspect-ratio: 1 / 1;
}

.action-card[data-ratio="tall"] .action-card-media {
    aspect-ratio: 3 / 4;
}

/* Play / Zoom Overlay */
.action-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 40, 68, 0.15) 0%, rgba(10, 40, 68, 0.65) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.25s ease;
}

.action-card:hover .action-card-overlay {
    opacity: 1;
    background: linear-gradient(180deg, rgba(10, 40, 68, 0.25) 0%, rgba(10, 40, 68, 0.8) 100%);
}

.action-play-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-dark, #0a2844);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.action-card[data-type="reel"] .action-play-btn {
    background: linear-gradient(135deg, #ffd54f 0%, #d4af37 100%);
    color: #0a2844;
}

.action-card:hover .action-play-btn {
    transform: scale(1.12);
}

/* Card Badges */
.action-badge-type {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    backdrop-filter: blur(6px);
}

.action-badge--reel {
    background: rgba(212, 175, 55, 0.92);
    color: #0a2844;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.action-badge--video {
    background: rgba(220, 53, 69, 0.9);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-badge--image {
    background: rgba(10, 40, 68, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-badge-featured {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: rgba(10, 40, 68, 0.85);
    color: var(--gold, #d4af37);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Card Content Body */
.action-card-body {
    padding: 1.25rem 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
}

.action-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.775rem;
}

.action-card-cat {
    font-weight: 700;
    color: var(--primary-color, #0f3b63);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-card-date {
    color: #a0aec0;
}

.action-card-title {
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark, #0a2844);
    line-height: 1.35;
    margin: 0 0 0.5rem;
}

.action-card-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4a5568;
    margin: 0 0 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.action-card-cta {
    font-weight: 700;
    font-size: 0.825rem;
    color: var(--primary-color, #0f3b63);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    transition: color 0.2s ease, gap 0.2s ease;
}

.action-card:hover .action-card-cta {
    color: var(--gold, #d4af37);
    gap: 8px;
}

/* Empty State */
.action-empty {
    text-align: center;
    padding: 5rem 1.5rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px dashed #cbd5e0;
}

.action-empty i {
    font-size: 3rem;
    color: #a0aec0;
    margin-bottom: 1rem;
    display: block;
}

.action-empty h3 {
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark, #0a2844);
    margin-bottom: 0.5rem;
}

.action-empty p {
    color: #718096;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   4. LIGHTBOX / MODAL VIEWER
   ========================================================================== */
.action-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 40, 68, 0.88);
    backdrop-filter: blur(10px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.action-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.action-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    max-width: 960px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.action-modal-backdrop.show .action-modal-dialog {
    transform: scale(1);
}

.action-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(10, 40, 68, 0.7);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.action-modal-close:hover {
    background: var(--primary-dark, #0a2844);
    transform: scale(1.08);
}

.action-modal-media {
    position: relative;
    width: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    max-height: 65vh;
}

.action-modal-media img {
    max-height: 65vh;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.action-modal-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.action-modal-video-wrap iframe,
.action-modal-video-wrap video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Vertical Reel Mockup Phone inside Modal */
.action-modal-reel-wrap {
    position: relative;
    width: min(340px, 90vw);
    height: min(580px, 60vh);
    margin: 16px auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    background: #000000;
}

.action-modal-reel-wrap iframe,
.action-modal-reel-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.action-modal-info {
    padding: 1.5rem 1.75rem;
    background: #ffffff;
    overflow-y: auto;
}

.action-modal-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
}

.action-modal-info h2 {
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark, #0a2844);
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.action-modal-info p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
    margin: 0;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (.98px Guards)
   ========================================================================== */
@media (max-width: 1399.98px) {
    .action-masonry {
        column-count: 3;
    }
}

@media (max-width: 991.98px) {
    .action-hero {
        padding: 110px 0 50px;
        min-height: auto;
    }
    .action-toolbar-section {
        top: 60px;
    }
    .action-masonry {
        column-count: 2;
        column-gap: 16px;
    }
    .action-card {
        margin-bottom: 16px;
    }
}

@media (max-width: 575.98px) {
    .action-hero h1 {
        font-size: 1.85rem;
    }
    .action-masonry {
        column-count: 1;
    }
    .action-toolbar-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .action-search-form {
        width: 100%;
    }
    .action-modal-dialog {
        border-radius: 14px;
        max-height: 96vh;
    }
    .action-modal-info {
        padding: 1.25rem 1rem;
    }
}
