.media-gallery { min-width:0; width:100%; color:var(--text, #26396e); }
[data-media-gallery]:not(.media-gallery) { display:block; aspect-ratio:16/9; min-height:200px; background:var(--bg-subtle, #e5eef8); border-radius:20px; }
.media-gallery .gallery-frame { position:relative; aspect-ratio:16/9; min-height:200px; width:100%; overflow:hidden; background:var(--bg-subtle, #e5eef8); border-radius:20px; }
.media-gallery .gallery-frame > img,.media-gallery .gallery-frame > iframe,.media-gallery .gallery-video-cover { position:absolute; inset:0; width:100%; height:100%; max-height:none; border:0; object-fit:contain; }
.media-gallery .gallery-frame > img { object-position:center; }
.media-gallery .gallery-video-cover { padding:0; background:transparent; cursor:pointer; }
.media-gallery .gallery-video-cover img { width:100%; height:100%; object-fit:contain; }
.gallery-play { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); background:#c90020; color:white; padding:12px 25px; border-radius:16px; font-size:30px; }
.gallery-video-loading { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:16px; background:var(--bg-subtle, #e5eef8); pointer-events:none; }
.gallery-video-loading img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; opacity:.35; }
.gallery-video-loading span { position:relative; padding:10px 14px; border-radius:10px; background:#26396e; color:white; font-size:1rem; text-align:center; }
.gallery-video-loading.is-ready { align-items:flex-start; background:transparent; }
.media-gallery .gallery-thumbnails { display:flex; gap:8px; overflow-x:auto; padding:8px 4px; }
.media-gallery .gallery-thumb { position:relative; flex:0 0 76px; height:58px; padding:2px; border:2px solid transparent; border-radius:8px; background:transparent; cursor:pointer; }
.gallery-thumb img { width:100%; height:100%; object-fit:cover; border-radius:4px; }
.gallery-thumb span { position:absolute; left:30px; top:18px; color:white; text-shadow:0 1px 4px black; }
.media-gallery .gallery-thumb[aria-pressed=true] { border-color:var(--primary, #26396e); }
.gallery-controls { display:flex; align-items:center; justify-content:center; gap:18px; margin-top:8px; }
.gallery-arrow { min-width:44px; min-height:44px; border:1px solid currentColor; border-radius:50%; background:transparent; color:inherit; font-size:24px; cursor:pointer; }
.gallery-arrow:disabled { opacity:.35; cursor:default; }
.media-gallery .gallery-caption { margin:12px 8px 4px; font-size:1rem; white-space:pre-wrap; overflow-wrap:anywhere; }
.gallery-external { display:block; margin:8px; text-align:center; }
.gallery-error { display:block; margin:12px auto; padding:12px; color:inherit; background:transparent; border:1px solid; border-radius:8px; cursor:pointer; }
.media-gallery :focus-visible { outline:3px solid #e78d36; outline-offset:3px; }
.media-gallery [hidden],[data-gallery-section][hidden],.media-gallery[hidden] { display:none!important; }
.program-card > .media-gallery { align-self:start; }
.gallery-manage { display:block; margin:10px 12px 10px auto; padding:10px 16px; min-height:44px; max-width:calc(100% - 24px); border:1px solid currentColor; border-radius:24px; color:var(--primary, #26396e); background:white; font:inherit; font-weight:700; cursor:pointer; }
.gallery-empty { padding:24px; text-align:center; background:var(--bg-subtle, #e5eef8); border-radius:20px; }
.gallery-editor { position:fixed; inset:0; width:min(1040px, calc(100vw - 24px)); height:calc(100dvh - 32px); max-width:none; max-height:none; margin:auto; padding:0; border:1px solid #cdd7e6; border-radius:16px; background:#f5f7fb; color:#26396e; overflow:hidden; }
.gallery-editor[open] { display:flex; flex-direction:column; }
.gallery-editor::backdrop { background:rgb(18 29 57 / 55%); }
.gallery-editor-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:12px 16px; border-bottom:1px solid #dce3ee; background:white; }
.gallery-editor-toolbar strong { margin-right:auto; }
.gallery-editor-toolbar a { color:inherit; font-size:14px; }
.gallery-editor-close { min-height:44px; padding:8px 12px; border:1px solid #26396e; border-radius:10px; background:white; color:inherit; font:inherit; cursor:pointer; }
.gallery-editor-close:disabled { opacity:.5; cursor:wait; }
.gallery-editor-loading { padding:12px 16px; }
.gallery-editor-frame { display:block; flex:1; min-height:0; width:100%; border:0; background:#f5f7fb; }
.gallery-editor :focus-visible { outline:3px solid #e78d36; outline-offset:2px; }
@media (max-width:480px) { .gallery-editor { width:100%; height:100dvh; border:0; border-radius:0; } .gallery-editor-toolbar { padding:8px; gap:8px; } }
