/* Project panel (overlay) and photo lightbox */
html.has-overlay { overflow: hidden; }

.project-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.project-overlay[hidden] { display: none; }
.project-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.25); animation: overlay-fade 0.2s ease-out; }
.project-dialog {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: #fff;
    color: #222;
    border-radius: 10px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.25);
    padding: 24px 32px 40px;
    outline: none;
    animation: overlay-in 0.22s ease-out;
}
@keyframes overlay-fade { from { opacity: 0; } }
@keyframes overlay-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
@media (prefers-reduced-motion: reduce) { .project-backdrop, .project-dialog { animation: none; } }

.project-nav { display: flex; justify-content: space-between; align-items: center; margin: 0 0 16px; }
.project-nav-btn {
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    padding: 4px 10px;
    border: 0;
    border-radius: 4px;
    background: #fff;
    color: #000;
    cursor: pointer;
    opacity: 0.95;
    transition: opacity 0.15s;
}
.project-nav-btn:hover:not([disabled]) { opacity: 1; text-decoration: underline; }
.project-nav-btn[disabled] { opacity: 0.4; cursor: default; }
.project-close {
    font: inherit;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    padding: 2px 10px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #222;
    cursor: pointer;
}
.project-close:hover { opacity: 0.7; }
.project-loading { padding: 60px 0; text-align: center; color: #888; }

.panel-hero { margin: 0 0 24px; }
.panel-hero img { width: 100%; border-radius: 8px; }
.panel-video { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #111; }
.panel-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.panel-title { margin: 0 0 4px; font-size: 24px; line-height: 1.3; font-family: var(--heading-font, inherit); }
.panel-meta { margin: 0 0 16px; font-size: 14px; color: #666; }
.panel-meta span + span::before { content: " • "; margin: 0 4px; }
.panel-body p { margin: 0 0 0.7em; }
.panel-gallery { margin: 16px 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.panel-gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.panel-gallery a:hover img { opacity: 0.85; }
.panel-credits { margin-top: 32px; padding: 20px 22px; background: #f7f7f7; border: 1px solid #e5e5e5; border-radius: 8px; }
.panel-credits h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; color: #111; }
.panel-credits p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.45; color: #444; }
.panel-share { display: flex; gap: 14px; justify-content: flex-end; align-items: center; margin-top: 14px; padding-top: 6px; font-size: 12px; letter-spacing: 0.02em; color: rgba(0, 0, 0, 0.45); }
.panel-share button { font: inherit; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
.panel-share button:hover, .panel-share button:focus-visible { color: #000; text-decoration: underline; outline: none; }

@media (max-width: 800px) {
    .project-overlay { padding: 0; align-items: stretch; }
    .project-dialog { max-height: none; height: 100%; border-radius: 0; padding: 12px 16px 32px; }
    .panel-title { font-size: 21px; }
}

/* Photo lightbox */
.lightbox { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(3px); }
.lightbox-image { position: relative; max-width: 90vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); }
.lightbox-controls { position: relative; margin-top: 16px; display: flex; align-items: center; gap: 28px; color: #fff; }
.lightbox-controls button { background: none; border: 0; color: #fff; font-size: 32px; line-height: 1; padding: 6px 10px; cursor: pointer; opacity: 0.8; }
.lightbox-controls button:hover { opacity: 1; }
.lightbox-controls button[hidden] { display: none; }
.lightbox-count { font-size: 14px; opacity: 0.8; min-width: 3em; text-align: center; }
