/* P3D shared-site stylesheet: compact cards, 2026-11-19 */
/* Project-specific layout. Shared typography, forms, header, footer, and button styles come from bringolf/site.css. */
.p3d-page { width:100%; max-width:1200px; margin:16px auto 40px; padding:0 18px; flex:1; }
.p3d-page .page-head {display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 20px}
.p3d-page .page-head h1{margin:8px 0 4px}
.p3d-page .muted{color:#687586}
.p3d-page .small{font-size:13px}
.p3d-page .actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:12px 0}
.p3d-page .btn{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:4px 12px;margin:0;border:1px solid #269ce9;border-radius:4px;background:#269ce9;color:#000;text-decoration:none;font:700 13px Arial,sans-serif;cursor:pointer;width:auto}
.p3d-page .btn:hover{background:#70b9e8;color:#000;text-decoration:none}
.p3d-page .btn.secondary{background:#fff;border-color:#b9c9d6;color:#164b79}
.p3d-page .btn.secondary:hover{background:#eaf3ff}
.p3d-page .btn.danger{background:#a32835;border-color:#a32835;color:white}
.p3d-page .projects-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(255px,1fr));gap:18px}
.p3d-page .tile,.p3d-page .photo-card{background:#fff;border:1px solid #dce4ec;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px #13253b0b}
.p3d-page .tile-cover{display:block;aspect-ratio:4/3;overflow:hidden;background:#e6ebf0;position:relative}
.p3d-page .tile-cover img{display:block;width:100%;height:100%;object-fit:cover}
.p3d-page .placeholder{display:grid;place-items:center;width:100%;height:100%;color:#8694a4}
.p3d-page .tile-info{padding:15px}
.p3d-page .tile-info h2{margin:7px 0}
.p3d-page .tile-info p{overflow-wrap:anywhere}
.p3d-page .description{background:#fff;padding:18px;border:1px solid #dce4ec;border-radius:8px;margin:18px 0;white-space:normal}
.p3d-page .form-panel{width:100%;max-width:760px;margin:14px 0;padding:20px;background:white;border:1px solid #dce4ec;border-radius:8px;display:grid;gap:12px}
.p3d-page .form-panel input,.p3d-page .form-panel textarea{width:100%}
.p3d-page .form-panel button{justify-self:start}
.p3d-page .photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(245px,1fr));gap:18px}
.p3d-page .photo-card{margin:0}
.p3d-page .photo-card img{display:block;width:100%;aspect-ratio:4/3;object-fit:contain;background:#eef2f5}
.p3d-page .photo-card figcaption,.p3d-page .photo-meta{padding:14px;overflow-wrap:anywhere}
.p3d-page .photo-meta form{margin-top:10px}
.p3d-page .dropzone{border:3px dashed #89a6c1;background:#edf5fc;border-radius:12px;text-align:center;padding:10px 12px;cursor:pointer;margin:16px 0}
.p3d-page .dropzone.over,.p3d-page .dropzone:focus{border-color:#1766aa;background:#dceeff;outline:none}
.p3d-page .dropzone.working{opacity:.6;pointer-events:none}
.p3d-page .dropzone .big{font-size:42px;line-height:1;color:#1766aa}
.p3d-page .danger-link{background:none;border:0;padding:7px 0;color:#b02b37;cursor:pointer;font:inherit}
.p3d-page .delete-section{margin-top:45px;padding-top:20px;border-top:1px solid #ddd}
.p3d-page .success,.p3d-page .error,.p3d-page .empty{padding:12px 16px;border-radius:7px;margin:12px 0}
.p3d-page .empty{background:#fff;border:1px solid #dce4ec}
.p3d-page .success{background:#e4f5e8;color:#216a36}
.p3d-page .error{background:#ffebec;color:#a21e2c}
.p3d-page .video-label{position:absolute;bottom:10px;left:10px;background:#142a45e8;color:white;border-radius:6px;padding:4px 9px;font-size:13px;font-weight:700}
@media(max-width:600px){.p3d-page{padding:0 12px}.p3d-page .projects-grid,.p3d-page .photo-grid{grid-template-columns:1fr}}

/* Project drag-and-drop sorting */
.sort-list{list-style:none;padding:0;margin:20px 0;max-width:820px;display:grid;gap:10px;counter-reset:sort}
.sort-item{display:flex;align-items:center;gap:14px;padding:10px 15px;background:#fff;border:1px solid #dce4ec;border-radius:10px;min-height:84px;box-shadow:0 2px 7px #13253b0a;cursor:grab;touch-action:pan-y}
.sort-item.dragging{opacity:.55;border:2px dashed #1766aa}
.drag-handle{font-size:24px;color:#6e7e90;user-select:none}
.sort-number{font-weight:700;color:#66758a;min-width:26px;text-align:center}
.sort-thumb{width:74px;height:60px;object-fit:cover;background:#e6ebf0;border-radius:5px;flex-shrink:0}
.sort-no-photo{display:grid;place-items:center;color:#8190a0;font-size:11px;text-align:center}
.sort-title{display:grid;gap:3px;min-width:0;flex:1;overflow-wrap:anywhere}
.sort-arrows{display:flex;gap:5px}
.sort-arrows button{border:1px solid #cbd6e2;background:#fff;border-radius:6px;padding:7px 12px;cursor:pointer;font:inherit;font-weight:700}
.sort-arrows button:disabled{opacity:.3;cursor:default}
@media(max-width:600px){.sort-item{gap:8px;padding:9px}.sort-thumb{width:55px;height:50px}.sort-arrows{flex-direction:column}.sort-arrows button{padding:2px 10px}}

/* MP4 videos in the same project media grid */
.photo-card video{display:block;width:100%;aspect-ratio:4/3;object-fit:contain;background:#10151b}

/* Shared MP4 thumbnail on videos and video-only project covers */
.tile-cover{position:relative}
.video-label{position:absolute;bottom:10px;left:10px;border-radius:6px;background:#142a45e8;color:white;padding:4px 10px;font-size:13px;font-weight:700}

/* Always constrain video poster/thumbnail dimensions, including production. */
.tile-cover { overflow: hidden; }
.tile-cover > img { display:block; width:100%; height:100%; max-width:100%; max-height:100%; object-fit:cover; }
.photo-card video { display:block; width:100%; max-width:100%; height:auto; aspect-ratio:4/3; object-fit:contain; }
.sort-thumb { display:block; width:74px; height:60px; max-width:74px; max-height:60px; object-fit:cover; }
@media(max-width:600px){.sort-thumb{width:55px;height:50px;max-width:55px;max-height:50px}}


/* Compact media thumbnails — prevent a lone project or photo from filling the page. */
.p3d-page .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 275px));
    gap: 16px;
    justify-content: start;
}
.p3d-page .tile {
    width: 100%;
    max-width: 275px;
}
.p3d-page .tile-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.p3d-page .tile-cover > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.p3d-page .photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 275px));
    justify-content: start;
    gap: 16px;
}
.p3d-page .photo-card {
    width: 100%;
    max-width: 275px;
}
.p3d-page .photo-card img,
.p3d-page .photo-card video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
}
@media (max-width: 600px) {
    .p3d-page .projects-grid,
    .p3d-page .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    }
    .p3d-page .tile,
    .p3d-page .photo-card {
        max-width: 275px;
    }
}
