/* ==========================================================================
   Media gallery — cards + lightbox (home page section & /media page)
   ========================================================================== */

.media-card {
    display: flex; flex-direction: column;
    width: 100%; height: 100%;
    padding: 0; margin: 0; text-align: left;
    background: #fff;
    border: 1px solid #eceef3;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
    box-shadow: 0 2px 14px rgba(15,23,42,.06);
    transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
}
.media-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px -12px rgba(15,23,42,.22); }
.media-card:focus-visible { outline: 3px solid #0096d6; outline-offset: 3px; }

.media-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f172a;
}
.media-thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.media-thumb .media-thumb-bg {
    position: absolute; inset: -20px;
    width: calc(100% + 40px); height: calc(100% + 40px);
    object-fit: cover; filter: blur(18px) brightness(.6);
}
.media-thumb.is-vertical img.media-thumb-fg { object-fit: contain; }
.media-card:hover .media-thumb img.media-thumb-fg { transform: scale(1.05); }
.media-thumb::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, transparent 35%, transparent 60%, rgba(0,0,0,.45) 100%);
    pointer-events: none;
}

.media-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: rgba(255,255,255,.9);
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 50%),
        linear-gradient(135deg, var(--pc, #334155) 0%, #0f172a 100%);
}

/* Branded placeholders */
.media-ph-tiktok {
    background:
        radial-gradient(circle at 25% 25%, rgba(37,244,238,.45), transparent 45%),
        radial-gradient(circle at 75% 75%, rgba(254,44,85,.45), transparent 45%),
        #111;
    text-shadow: -3px -2px 0 rgba(37,244,238,.8), 3px 2px 0 rgba(254,44,85,.8);
}
.media-ph-facebook  { background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.2), transparent 50%), linear-gradient(135deg, #1877f2, #0b3d91); }
.media-ph-instagram { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 40%, #d6249f 65%, #285aeb 100%); }
.media-ph-drive     { background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.22), transparent 50%), linear-gradient(135deg, #1a73e8, #0f9d58); }
.media-ph-youtube   { background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.2), transparent 50%), linear-gradient(135deg, #ff0033, #8b0019); }

.media-badge {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.95);
    color: #0f172a;
    font-size: .7rem; font-weight: 700; letter-spacing: .3px;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.media-badge i { color: var(--pc); font-size: .85rem; }
.media-format {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    padding: 4px 9px; border-radius: 999px;
    background: rgba(0,0,0,.55); color: #fff;
    font-size: .66rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    backdrop-filter: blur(6px);
}

.media-play {
    position: absolute; left: 50%; top: 50%; z-index: 2;
    width: 64px; height: 64px; margin: -32px 0 0 -32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.55);
    backdrop-filter: blur(8px);
    transition: transform .25s, background .25s;
}
.media-play i { margin-left: 3px; }
.media-play.is-link i { margin-left: 0; }
.media-play::before {
    content: ''; position: absolute; inset: -8px; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.35);
    opacity: 0; transform: scale(.8);
    transition: opacity .3s, transform .3s;
}
.media-card:hover .media-play { transform: scale(1.08); background: var(--pc, #c0392b); border-color: transparent; }
.media-card:hover .media-play::before { opacity: 1; transform: scale(1); animation: media-ping 1.4s ease-out infinite; }
@keyframes media-ping { to { transform: scale(1.35); opacity: 0; } }

.media-body { padding: 16px 18px 6px; flex: 1; }
.media-card, .media-card *, .media-lb, .media-lb * { text-transform: none; }
.media-title {
    font-size: .95rem; font-weight: 700; color: #1a1a2e; line-height: 1.45; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.media-desc {
    font-size: .8rem; color: #667085; line-height: 1.55; margin-top: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.media-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 18px 16px;
    font-size: .74rem; color: #98a2b3;
}
.media-author { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.media-credit { color: #667085; font-weight: 600; }
.media-credit i { color: #c0392b; margin-right: 2px; }
.media-dark .media-credit { color: #b5b5b5; }
.media-lb-title small a { color: #7dd3fc; text-decoration: none; }
.media-lb-title small a:hover { text-decoration: underline; }
.media-lb-title small a i { font-size: .65rem; margin-left: 2px; }
.media-cta { font-weight: 700; color: #c0392b; display: inline-flex; align-items: center; gap: 6px; transition: gap .2s; }
.media-card:hover .media-cta { gap: 10px; }

/* ── Dark variant (home page section) ── */
.media-dark-area { position: relative; overflow: hidden; background: #1a1a1a; }
.media-dark-area::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(600px 300px at 85% 0%, rgba(0,150,214,.14), transparent 70%),
        radial-gradient(500px 300px at 10% 100%, rgba(192,57,43,.12), transparent 70%);
}
.media-dark-area .container { position: relative; z-index: 1; }
/* No media → the two About halves sit together; drop the doubled gap */
#media-section[style*="none"] + .about-continued { padding-top: 0; }
.media-dark .media-card {
    background: #232323;
    border-color: rgba(255,255,255,.07);
    box-shadow: 0 2px 14px rgba(0,0,0,.3);
}
.media-dark .media-card:hover { border-color: rgba(255,255,255,.16); box-shadow: 0 24px 50px -16px rgba(0,0,0,.7); }
.media-dark .media-title { color: #fff; }
.media-dark .media-desc  { color: #a3a3a3; }
.media-dark .media-foot  { color: #8a8a8a; }
.media-dark .media-cta   { color: #ff8a7c; }

/* ── Filter chips (/media page) ── */
.media-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 32px; }
.media-filter {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 999px;
    border: 1px solid #e4e7ec; background: #fff; color: #344054;
    font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: all .2s;
}
.media-filter i { color: var(--pc, #344054); }
.media-filter:hover { border-color: #c9ced8; transform: translateY(-1px); }
.media-filter.active { background: #1a1a2e; border-color: #1a1a2e; color: #fff; }
.media-filter.active i { color: #fff; }
.media-filter .n { font-size: .72rem; opacity: .6; }

/* ── Lightbox ──
   Kept deliberately simple: no backdrop-filter, no transforms, no rounded clipping around
   the iframe. Mobile WebKit paints embedded players under a dim layer / misplaces their
   controls when any ancestor uses those. */
.media-lb {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    background: rgba(5,8,18,.94);
    opacity: 0; visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.media-lb.open { opacity: 1; visibility: visible; }
.media-lb-box { width: 100%; max-width: 980px; }
.media-lb.is-vertical .media-lb-box { max-width: min(420px, calc((100vh - 140px) * 9 / 16)); }
.media-lb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; color: #fff; }
.media-lb-title { flex: 1; min-width: 0; font-size: .95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-lb-title small { display: block; font-size: .74rem; font-weight: 500; color: rgba(255,255,255,.6); }
.media-lb-btn {
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; min-width: 40px; padding: 0 12px;
    border-radius: 10px; border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08); color: #fff !important;
    font-size: .8rem; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background .2s;
}
.media-lb-btn:hover { background: rgba(255,255,255,.18); }
.media-lb-frame {
    position: relative; width: 100%; aspect-ratio: 16 / 9;
    background: #000;
}
.media-lb.is-vertical .media-lb-frame { aspect-ratio: 9 / 16; }
.media-lb.is-folder .media-lb-frame { aspect-ratio: 4 / 3; background: #fff; }
.media-lb-frame video {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; background: #000; display: block; z-index: 1;
}
.media-lb-frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; display: block; z-index: 1; }
.media-lb-loader {
    position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px;
    border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff;
    animation: media-spin .8s linear infinite;
}
.media-lb-frame.is-loaded .media-lb-loader { display: none; }
@keyframes media-spin { to { transform: rotate(360deg); } }
body.media-lb-lock { overflow: hidden; }

/* Desktop only: rounded frame + shadow (safe there) */
@media (min-width: 768px) and (hover: hover) {
    .media-lb-frame { border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
}

/* Phones: edge-to-edge player, compact header */
@media (max-width: 767px) {
    .media-lb { padding: 12px 0; align-items: center; }
    .media-lb-box, .media-lb.is-vertical .media-lb-box { max-width: 100%; }
    .media-lb.is-vertical .media-lb-frame { aspect-ratio: auto; height: calc(100vh - 110px); height: calc(100dvh - 110px); }
    .media-lb-head { padding: 0 12px; margin-bottom: 10px; }
    .media-lb-btn span { display: none; }
    /* Drive embed fallback needs room for Drive's own toolbar/controls */
    .media-lb-frame.is-drive-embed { aspect-ratio: auto; height: calc(100vh - 110px); height: calc(100dvh - 110px); }
}
@media (prefers-reduced-motion: reduce) {
    .media-card, .media-thumb img, .media-play, .media-lb { transition: none; }
    .media-card:hover .media-play::before { animation: none; }
}
