/* Google Drive stays embedded; its complete iframe gets a bounded viewport. */
.media-external-link[hidden] { display: none !important; }
.media-container.drive-inline { width: 100% !important; max-width: 100% !important; height: auto !important; max-height: none !important; padding: 0 !important; margin: 0 !important; aspect-ratio: auto !important; overflow: visible !important; }
.drive-player { display: flex; flex-direction: column; width: 100%; min-width: 0; background: #000; border-radius: 12px; }
.media-container.drive-inline iframe { position: absolute !important; top: 0 !important; left: 0 !important; display: block; width: var(--drive-canvas-width, 800px) !important; max-width: none !important; height: var(--drive-canvas-height, 600px) !important; min-height: 0 !important; max-height: none !important; aspect-ratio: auto !important; border: 0 !important; border-radius: 0 !important; transform: scale(var(--drive-canvas-scale, 1)) !important; transform-origin: top left !important; }
.drive-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 8px 12px; background: #101723; border-top: 1px solid #28374a; flex: 0 0 auto; }
.drive-status { flex: 1; min-width: 0; color: #c8d3e0; font-size: 14px; line-height: 1.4; }
.drive-toolbar button { font: inherit; font-size: 14px; color: #fff; background: #182738; border: 1px solid #53657b; border-radius: 8px; padding: 8px 12px; min-height: 44px; cursor: pointer; }
.drive-toolbar button[hidden] { display: none; }
.drive-toolbar button:focus-visible { outline: 2px solid #00efff; outline-offset: 2px; }
.modal.drive-expanded .modal-wrapper { transform: none !important; overflow: visible; }
.modal.drive-expanded .modal-card { backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible !important; }
.modal.drive-expanded .close-modal { visibility: hidden; }
.drive-player.is-expanded { position: fixed; inset: 0; z-index: 2200; width: 100%; height: var(--drive-viewport-height, 100dvh); box-sizing: border-box; border-radius: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.drive-viewport { position: relative; width: 100%; height: var(--drive-frame-height, 300px); min-height: 0; overflow: hidden; flex: 0 0 auto; }
.drive-player.is-expanded .drive-viewport { flex: 1 1 0; height: 0; }
.media-container.drive-inline iframe:fullscreen { width: 100vw !important; height: 100vh !important; transform: none !important; }
@media (max-width: 767px), (max-width: 1024px) and (max-height: 600px) {
    #projectModal, #projectModal .modal-wrapper, #projectModal .modal-card { height: var(--drive-viewport-height, 100dvh) !important; max-height: var(--drive-viewport-height, 100dvh) !important; }
    #projectModal .modal-wrapper { width: 100% !important; margin: 0 !important; border-radius: 0 !important; }
    #projectModal .modal-card { width: 100% !important; overscroll-behavior: contain; overflow-y: auto !important; overflow-x: hidden !important; padding-bottom: env(safe-area-inset-bottom); border: 0; border-radius: 0 !important; }
    #projectModal .modal-grid { display: flex !important; flex-direction: column !important; min-height: 0 !important; }
    #projectModal .modal-media-side { padding: calc(64px + env(safe-area-inset-top)) 0 12px !important; border-right: 0 !important; }
    #projectModal .drive-player { border-radius: 0; }
    #projectModal .modal-info-side { padding: 24px !important; }
    #projectModal.drive-expanded .modal-card { overflow: visible !important; }
}

/* The whole card is one hit target: thumbnail, title, tags and empty padding. */
#portfolio-grid { touch-action: pan-y pinch-zoom; }
#portfolio-track .project-card { cursor: pointer; }
#portfolio-track .project-card * { pointer-events: none; }
#portfolio-track .project-card:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -3px; }

