/* =============================================================================
   ONHYM Media Gallery — Premium Corporate Design v2
   Shortcode [onhym_media_gallery]
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --omg-primary:        #0f766e;
    --omg-primary-dark:   #0a5c56;
    --omg-accent:         #c8a84b;
    --omg-bg:             #ffffff;
    --omg-radius:         16px;
    --omg-radius-sm:      10px;
    --omg-shadow:         0 2px 12px rgba(0, 0, 0, 0.06);
    --omg-shadow-hover:   0 8px 28px rgba(0, 0, 0, 0.12);
    --omg-gap:            24px;
    --omg-transition:     0.32s cubic-bezier(0.4, 0, 0.2, 1);
    --omg-card-height:    300px;
    --omg-text:           #1e293b;
    --omg-text-muted:     #64748b;
    --omg-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --omg-badge-mining:   #0f766e;
    --omg-badge-hydro:    #1d4ed8;
    --omg-section-gap:    80px;
}

/* ── Wrapper ────────────────────────────────────────────────────────────────── */
.onhym-media-gallery {
    font-family: var(--omg-font);
    color:       var(--omg-text);
    background:  var(--omg-bg);
    padding:     0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FILTER BAR — teal pill style
   ═══════════════════════════════════════════════════════════════════════════════ */
.onhym-filter-bar {
    display:         flex;
    flex-wrap:       wrap;
    gap:             10px;
    align-items:     center;
    justify-content: center;
    margin-bottom:   56px;
    padding:         0;
    background:      transparent;
    box-shadow:      none;
}

.onhym-filter-divider { display: none; }

.onhym-filter-btn {
    display:        inline-flex;
    align-items:    center;
    gap:            6px;
    padding:        10px 26px;
    border:         2px solid var(--omg-primary);
    border-radius:  50px;
    background:     transparent;
    color:          var(--omg-primary);
    font-family:    var(--omg-font);
    font-size:      0.875rem;
    font-weight:    600;
    cursor:         pointer;
    transition:     all var(--omg-transition);
    white-space:    nowrap;
    letter-spacing: 0.01em;
}

.onhym-filter-btn:hover {
    background: var(--omg-primary);
    color:      #fff;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
    transform:  translateY(-1px);
}

.onhym-filter-btn.active {
    background:   var(--omg-primary);
    border-color: var(--omg-primary);
    color:        #fff;
    box-shadow:   0 4px 14px rgba(15, 118, 110, 0.35);
}

.onhym-filter-btn svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════════
   SECTION HEADERS  — "Photo Gallery" split colour
   ═══════════════════════════════════════════════════════════════════════════════ */
.onhym-media-section {
    margin-bottom: var(--omg-section-gap);
    transition:    opacity 0.3s ease;
}

.onhym-media-section.onhym-hidden { display: none; }

.onhym-section-header {
    margin-bottom: 28px;
}

.onhym-section-title {
    display:     block;
    font-family: var(--omg-font);
    font-size:   1.75rem;
    font-weight: 500;
    color:       var(--omg-text);
    margin:      0 0 4px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.onhym-section-title-alt {
    color:       inherit;
    font-weight: inherit;
}

.onhym-section-count { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════════
   GRID — 3 col / 2 tab / 1 mob
   ═══════════════════════════════════════════════════════════════════════════════ */
.onhym-media-grid {
    display:               grid;
    grid-template-columns: repeat(3, 1fr);
    gap:                   var(--omg-gap);
}

@media (max-width: 1024px) {
    .onhym-media-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .onhym-media-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .onhym-filter-bar {
        gap: 8px;
        margin-bottom: 36px;
    }
    .onhym-filter-btn {
        padding:   9px 18px;
        font-size: 0.8rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CARD — full-image, no white box, overlay info inside
   ═══════════════════════════════════════════════════════════════════════════════ */
.onhym-media-card {
    position:      relative;
    border-radius: var(--omg-radius);
    overflow:      hidden;
    box-shadow:    var(--omg-shadow);
    transition:    box-shadow 0.3s ease, transform 0.3s ease;
    background:    transparent;
    display:       block;
    line-height:   0;   /* prevent gap under inline elements */
}

.onhym-media-card:hover {
    box-shadow: var(--omg-shadow-hover);
}

.onhym-media-card.onhym-hidden { display: none; }

/* ── Thumb container ─────────────────────────────────────────────────────────── */
.onhym-card-thumb {
    position:    relative;
    height:      var(--omg-card-height);
    overflow:    hidden;
    display:     block;
    line-height: 0;
}

.onhym-card-thumb > a,
.onhym-card-thumb > button.onhym-video-trigger {
    display:    block;
    width:      100%;
    height:     100%;
    border:     none;
    padding:    0;
    margin:     0;
    background: none;
    cursor:     pointer;
    position:   relative;
    line-height: 0;
}

/* ── Image ───────────────────────────────────────────────────────────────────── */
.onhym-card-thumb img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.onhym-media-card:hover .onhym-card-thumb img {
    transform: scale(1.05);
}

/* ── Gradient scrim — subtle, not a footer ──────────────────────────────────── */
.onhym-card-thumb > a::after,
.onhym-card-thumb > button.onhym-video-trigger::after {
    content:        "";
    position:       absolute;
    bottom:         0;
    left:           0;
    right:          0;
    height:         45%;
    /* use rgba(0,0,0,0) not 'transparent' to avoid browser interpolation artefact */
    background:     linear-gradient(to top, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index:        1;
}

/* ── Info overlay — text directly on image, NO background ───────────────────── */
.onhym-card-overlay {
    position:       absolute;
    bottom:         0;
    left:           0;
    right:          0;
    padding:        14px 16px;
    z-index:        2;
    pointer-events: none;
    display:        flex;
    flex-direction: column;
    gap:            6px;
    background:     none;
}

/* ── Title in overlay ────────────────────────────────────────────────────────── */
.onhym-card-title {
    font-family:        var(--omg-font);
    font-size:          1rem;
    font-weight:        500;
    color:              #fff;
    margin:             0;
    line-height:        1.35;
    text-align:         left;
    display:            -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow:           hidden;
    text-shadow:        0 1px 6px rgba(0, 0, 0, 0.50);
    letter-spacing:     0em;
    background:         none;
}

/* ── Category badge in overlay ───────────────────────────────────────────────── */
.onhym-cat-badge {
    display:        inline-flex;
    align-self:     flex-start;
    padding:        4px 10px;
    border-radius:  20px;
    font-family:    var(--omg-font);
    font-size:      0.72rem;   /* ≈ 11-12px */
    font-weight:    500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color:          #fff;
    background:     var(--omg-primary);
    white-space:    nowrap;
    line-height:    1.4;
}

/* Per-category colours */
.cat-mining .onhym-cat-badge       { background: var(--omg-badge-mining); }
.cat-hydrocarbons .onhym-cat-badge { background: var(--omg-badge-hydro); }

/* ═══════════════════════════════════════════════════════════════════════════════
   PHOTO CARD — zoom icon top-right on hover
   ═══════════════════════════════════════════════════════════════════════════════ */
.onhym-zoom-overlay {
    position:        absolute;
    top:             14px;
    right:           14px;
    width:           36px;
    height:          36px;
    border-radius:   50%;
    background:      rgba(255, 255, 255, 0.18);
    border:          1.5px solid rgba(255, 255, 255, 0.55);
    display:         flex;
    align-items:     center;
    justify-content: center;
    opacity:         0;
    transition:      opacity var(--omg-transition), transform var(--omg-transition);
    pointer-events:  none;
}

.onhym-media-card:hover .onhym-zoom-overlay {
    opacity:   1;
    transform: scale(1.08);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   VIDEO CARD — play button + duration
   ═══════════════════════════════════════════════════════════════════════════════ */
.onhym-play-overlay {
    position:       absolute;
    top:            50%;
    left:           50%;
    transform:      translate(-50%, -50%);
    width:          60px;
    height:         60px;
    pointer-events: none;
    transition:     transform var(--omg-transition);
}

.onhym-play-overlay svg {
    width:  100%;
    height: 100%;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.onhym-media-card:hover .onhym-play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Duration badge — bottom-right corner */
.onhym-duration-badge {
    position:       absolute;
    bottom:         14px;
    right:          14px;
    background:     rgba(0, 0, 0, 0.60);
    color:          #fff;
    font-family:    var(--omg-font);
    font-size:      0.72rem;
    font-weight:    500;
    letter-spacing: 0.04em;
    padding:        3px 8px;
    border-radius:  6px;
    pointer-events: none;
    line-height:    1.4;
    z-index:        2;
}

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.onhym-no-media {
    text-align:  center;
    color:       var(--omg-text-muted);
    padding:     80px 20px;
    font-size:   1.05rem;
    font-family: var(--omg-font);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   VIDEO MODAL (standalone iframe popup)
   ═══════════════════════════════════════════════════════════════════════════════ */
.onhym-video-modal {
    position:        fixed;
    inset:           0;
    z-index:         999999;
    display:         flex;
    align-items:     center;
    justify-content: center;
}

.onhym-video-modal[hidden] { display: none; }

.onhym-modal-overlay {
    position:   absolute;
    inset:      0;
    background: rgba(5, 15, 25, 0.94);
    cursor:     pointer;
}

.onhym-modal-inner {
    position:  relative;
    z-index:   1;
    width:     90vw;
    max-width: 980px;
}

.onhym-modal-close {
    position:        absolute;
    top:             -50px;
    right:           0;
    background:      rgba(255,255,255,0.1);
    border:          1.5px solid rgba(255,255,255,0.3);
    border-radius:   50%;
    width:           42px;
    height:          42px;
    color:           #fff;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    transition:      background var(--omg-transition);
    padding:         0;
}

.onhym-modal-close:hover { background: rgba(255,255,255,0.25); }

.onhym-modal-video-wrap {
    position:       relative;
    padding-bottom: 56.25%;
    height:         0;
    background:     #000;
    border-radius:  var(--omg-radius);
    overflow:       hidden;
    box-shadow:     0 24px 64px rgba(0,0,0,0.6);
}

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

.onhym-video-modal:not([hidden]) .onhym-modal-inner {
    animation: omgFadeIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ═══════════════════════════════════════════════════════════════════════════════
   GALLERY SLIDER — minimal cinematic lightbox
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Overlay ────────────────────────────────────────────────────────────────── */
.omgs-slider {
    position:   fixed;
    inset:      0;
    z-index:    999998;
    font-family: var(--omg-font);
}

.omgs-slider[hidden] { display: none; }

.omgs-backdrop {
    position:   absolute;
    inset:      0;
    background: rgba(0, 0, 0, 0.85);
    cursor:     pointer;
}

/* ── Close button — top-right ───────────────────────────────────────────────── */
.omgs-close {
    position:        fixed;
    top:             20px;
    right:           20px;
    z-index:         10;
    width:           40px;
    height:          40px;
    border-radius:   50%;
    background:      rgba(255, 255, 255, 0.10);
    border:          1.5px solid rgba(255, 255, 255, 0.20);
    color:           #fff;
    display:         flex;
    align-items:     center;
    justify-content: center;
    cursor:          pointer;
    padding:         0;
    transition:      background 0.18s ease, border-color 0.18s ease;
}

.omgs-close:hover {
    background:   rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
}
.omgs-close svg { display: block; }

/* ── Navigation arrows — fixed, vertically centered ─────────────────────────── */
.omgs-nav {
    position:        fixed;
    top:             50%;
    transform:       translateY(-50%);
    z-index:         10;
    width:           46px;
    height:          46px;
    border-radius:   50%;
    background:      rgba(255, 255, 255, 0.15);
    border:          1.5px solid rgba(255, 255, 255, 0.25);
    color:           #fff;
    display:         flex;
    align-items:     center;
    justify-content: center;
    cursor:          pointer;
    padding:         0;
    transition:      background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.omgs-nav:hover {
    background:   rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.50);
    transform:    translateY(-50%) scale(1.07);
}

.omgs-nav svg { display: block; pointer-events: none; }

.omgs-prev { left:  20px; }
.omgs-next { right: 20px; }

/* ── Inner: image + caption + thumbnails — centered column ──────────────────── */
.omgs-inner {
    position:        absolute;
    inset:           0;
    z-index:         1;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             14px;
    padding:         64px 86px 20px;   /* room for fixed arrows (46px) + 20px margin each side */
    overflow:        hidden;
    pointer-events:  none;             /* children opt-in */
}

/* ── Image ───────────────────────────────────────────────────────────────────── */
.omgs-img-wrap {
    display:        flex;
    align-items:    center;
    justify-content: center;
    flex:           0 1 auto;
    min-height:     0;
    pointer-events: auto;
}

.omgs-main-img {
    max-height:    80vh;
    max-width:     100%;
    width:         auto;
    object-fit:    contain;
    border-radius: 12px;
    display:       block;
    transition:    opacity 0.22s ease, transform 0.22s ease;
    transform:     scale(1);
    opacity:       1;
    box-shadow:    0 20px 60px rgba(0, 0, 0, 0.6);
}

.omgs-main-img.omgs-fading {
    opacity:   0;
    transform: scale(0.97);
}

/* ── Caption: badge · title · counter — left-aligned under image ────────────── */
.omgs-caption {
    display:        flex;
    align-items:    center;
    gap:            10px;
    flex-shrink:    0;
    pointer-events: auto;
    max-width:      min(860px, calc(100vw - 160px));
    width:          100%;
}

.omgs-badge {
    display:        inline-flex;
    padding:        3px 10px;
    border-radius:  50px;
    font-size:      0.65rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color:          #fff;
    background:     rgba(255, 255, 255, 0.18);
    white-space:    nowrap;
    flex-shrink:    0;
}

.omgs-badge[style*="none"] { display: none !important; }

.omgs-caption-title {
    color:         rgba(255, 255, 255, 0.82);
    font-size:     0.88rem;
    font-weight:   400;
    overflow:      hidden;
    text-overflow: ellipsis;
    white-space:   nowrap;
    flex:          1 1 auto;
    min-width:     0;
}

.omgs-counter-text {
    color:          rgba(255, 255, 255, 0.42);
    font-size:      0.78rem;
    font-weight:    400;
    white-space:    nowrap;
    letter-spacing: 0.04em;
    flex-shrink:    0;
    margin-left:    auto;
}

/* ── Thumbnail strip ─────────────────────────────────────────────────────────── */
.omgs-thumbnails {
    display:         flex;
    gap:             8px;
    overflow-x:      auto;
    flex-shrink:     0;
    padding:         2px 2px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    pointer-events:  auto;
    max-width:       min(860px, calc(100vw - 160px));
}

.omgs-thumbnails::-webkit-scrollbar        { height: 3px; }
.omgs-thumbnails::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.15); border-radius: 2px; }

.omgs-thumb {
    flex-shrink:   0;
    width:         72px;
    height:        50px;
    border-radius: 6px;
    overflow:      hidden;
    border:        1.5px solid transparent;
    cursor:        pointer;
    padding:       0;
    background:    rgba(255, 255, 255, 0.06);
    transition:    border-color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.omgs-thumb:hover {
    border-color: rgba(255, 255, 255, 0.40);
    transform:    scale(1.05);
}

.omgs-thumb.active {
    border-color: rgba(255, 255, 255, 0.90);
}

.omgs-thumb img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    opacity:    0.60;
    transition: opacity 0.18s ease;
}

.omgs-thumb:hover img,
.omgs-thumb.active img { opacity: 1; }

/* ── Removed elements ────────────────────────────────────────────────────────── */
.omgs-hint,
.omgs-container,
.omgs-topbar,
.omgs-logo,
.omgs-stage { display: none !important; }

/* ── Entrance animation ──────────────────────────────────────────────────────── */
.omgs-slider:not([hidden]) .omgs-inner {
    animation: omgSliderIn 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .omgs-inner   { padding: 56px 64px 20px; gap: 12px; }
    .omgs-prev    { left:  10px; }
    .omgs-next    { right: 10px; }
    .omgs-nav     { width: 38px; height: 38px; }
    .omgs-main-img { max-height: 70vh; }
    .omgs-thumb   { width: 60px; height: 42px; }
    .omgs-caption,
    .omgs-thumbnails { max-width: calc(100vw - 128px); }
}

@media (max-width: 480px) {
    .omgs-inner   { padding: 52px 52px 16px; }
    .omgs-prev    { left:  6px; }
    .omgs-next    { right: 6px; }
    .omgs-nav     { width: 34px; height: 34px; background: rgba(255,255,255,0.18); }
    .omgs-main-img { max-height: 62vh; border-radius: 8px; }
    .omgs-thumb   { width: 52px; height: 36px; }
    .omgs-caption,
    .omgs-thumbnails { max-width: calc(100vw - 104px); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ELEMENTOR LOOP GRID — compatibility
   ═══════════════════════════════════════════════════════════════════════════════ */
.onhym-loop-badge {
    display:        inline-block;
    padding:        4px 12px;
    border-radius:  50px;
    font-size:      0.68rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color:          #fff;
    font-family:    var(--omg-font);
}

.onhym-loop-badge.badge-mining { background: var(--omg-primary); }
.onhym-loop-badge.badge-hydro  { background: var(--omg-accent); color: #1e293b; }

.onhym-elementor-play {
    position:        absolute;
    inset:           0;
    display:         flex;
    align-items:     center;
    justify-content: center;
    pointer-events:  none;
}

.onhym-elementor-play svg {
    width:  64px;
    height: 64px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}
