/*
 * RESRGE Advanced Gallery theme contract (0.2.0+)
 * ------------------------------------------------
 * Gallery consumes RESRGE Community Visual Style Properties / Design Tokens.
 * Stable --nexus-* aliases and nexus-gallery-* DOM hooks remain compatibility
 * identifiers for existing themes, overrides, and browser-side integrations.
 */
.nexus-gallery-page{display:grid;gap:var(--nexus-space-lg,1.25rem)}
.nexus-gallery-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--nexus-space-lg,1.25rem)}
.nexus-gallery-hero-actions{display:flex;gap:var(--nexus-space-sm,.5rem);flex-wrap:wrap}
.nexus-gallery-section{display:grid;gap:var(--nexus-space-md,.875rem)}
.nexus-gallery-section.panel{padding:var(--nexus-space-lg,1.25rem)}
.nexus-gallery-section-head{display:flex;align-items:center;justify-content:space-between;gap:var(--nexus-space-md,.875rem)}
.nexus-gallery-section-head h2{margin:0}
.nexus-gallery-category-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:var(--nexus-space-md,.875rem)}
.nexus-gallery-category{display:grid;gap:var(--nexus-space-xs,.25rem);padding:var(--nexus-space-md,.875rem);border:1px solid var(--nexus-line,var(--line,currentColor));border-radius:var(--nexus-radius-card,var(--nexus-radius,var(--radius,0)));background:var(--nexus-panel-2,var(--panel-2,var(--nexus-panel,var(--panel,transparent))));color:inherit;text-decoration:none}
.nexus-gallery-category:hover{border-color:var(--nexus-accent,var(--gold,currentColor))}
.nexus-gallery-category span,.nexus-gallery-category small,.nexus-gallery-card-copy span{color:var(--nexus-muted,var(--muted,currentColor))}
.nexus-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,14rem),1fr));gap:var(--nexus-space-md,.875rem)}
.nexus-gallery-card{overflow:hidden;padding:0}
.nexus-gallery-thumb{display:block;aspect-ratio:4/3;overflow:hidden;background:var(--nexus-panel-2,var(--panel-2,var(--nexus-panel,var(--panel,transparent))))}
.nexus-gallery-thumb img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .18s ease}
.nexus-gallery-card:hover .nexus-gallery-thumb img{transform:scale(1.02)}
.nexus-gallery-card-copy{display:grid;gap:var(--nexus-space-xs,.25rem);padding:var(--nexus-space-md,.875rem)}
.nexus-gallery-card-copy a{color:inherit;text-decoration:none}
.nexus-gallery-viewer{display:flex;align-items:center;justify-content:center;min-height:16rem;overflow:hidden;padding:var(--nexus-space-md,.875rem);background:var(--nexus-bg-deep,var(--bg-deep,var(--nexus-panel,var(--panel,transparent))))}
.nexus-gallery-viewer img{display:block;max-width:100%;max-height:75vh;object-fit:contain}
.nexus-gallery-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:var(--nexus-space-md,.875rem);padding:var(--nexus-space-lg,1.25rem)}
.nexus-gallery-meta div{display:grid;gap:var(--nexus-space-xs,.25rem)}
.nexus-gallery-meta span{color:var(--nexus-muted,var(--muted,currentColor));font-size:.9em}
.nexus-gallery-description{padding:var(--nexus-space-lg,1.25rem)}
.nexus-gallery-description h2{margin-top:0}
.nexus-gallery-upload-form{display:grid;gap:var(--nexus-space-lg,1.25rem);padding:var(--nexus-space-lg,1.25rem)}
.nexus-gallery-upload-form label{display:grid;gap:var(--nexus-space-sm,.5rem)}
.nexus-gallery-upload-form small{color:var(--nexus-muted,var(--muted,currentColor))}
.nexus-gallery-dropzone{position:relative;display:grid!important;place-items:center;text-align:center;gap:var(--nexus-space-xs,.25rem)!important;padding:clamp(1.5rem,5vw,3.5rem);border:2px dashed var(--nexus-line-2,var(--line-2,var(--nexus-line,var(--line,currentColor))));border-radius:var(--nexus-radius-card,var(--nexus-radius,var(--radius,0)));background:var(--nexus-panel-2,var(--panel-2,var(--nexus-panel,var(--panel,transparent))));cursor:pointer}
.nexus-gallery-dropzone.is-dragging{border-color:var(--nexus-accent,var(--gold,currentColor));background:color-mix(in srgb,var(--nexus-accent,var(--gold,currentColor)) 6%,var(--nexus-panel,var(--panel,transparent)))}
.nexus-gallery-dropzone input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.nexus-gallery-drop-icon{font-size:2rem;line-height:1;color:var(--nexus-accent,var(--gold,currentColor))}
.nexus-gallery-dropzone em{font-style:normal;color:var(--nexus-muted,var(--muted,currentColor))}
.nexus-gallery-form-actions{display:flex;justify-content:flex-end;gap:var(--nexus-space-sm,.5rem);flex-wrap:wrap}
.nexus-gallery-admin-stats{grid-template-columns:repeat(auto-fit,minmax(11rem,1fr))}
.nexus-gallery-admin-section{margin-top:var(--nexus-space-lg,1.25rem)}
.nexus-gallery-admin-form{display:grid;gap:var(--nexus-space-md,.875rem);padding:var(--nexus-space-lg,1.25rem)}
.nexus-gallery-check{display:flex!important;align-items:center;gap:var(--nexus-space-sm,.5rem)!important;min-height:var(--nexus-input-height,2.375rem)}
.nexus-gallery-check-stack{display:grid;align-content:center;gap:var(--nexus-space-xs,.25rem)}
.nexus-gallery-admin-categories{display:grid;gap:var(--nexus-space-sm,.5rem);padding:var(--nexus-space-md,.875rem)}
.nexus-gallery-admin-category{padding:0;overflow:hidden}
.nexus-gallery-admin-category summary{display:flex;align-items:center;justify-content:space-between;gap:var(--nexus-space-md,.875rem);padding:var(--nexus-space-md,.875rem);cursor:pointer;list-style:none;color:var(--nexus-text,var(--text,inherit))}
.nexus-gallery-admin-category summary::-webkit-details-marker{display:none}
.nexus-gallery-admin-category summary span:first-child{display:grid;gap:var(--nexus-space-xs,.25rem)}
.nexus-gallery-admin-category summary small{color:var(--nexus-muted,var(--muted,currentColor))}
.nexus-gallery-admin-category-body{display:grid;gap:var(--nexus-space-md,.875rem);padding:var(--nexus-space-md,.875rem);border-top:1px solid var(--nexus-line,var(--line,currentColor));background:var(--nexus-panel,var(--panel,transparent))}
.nexus-gallery-admin-category-body form{display:grid;gap:var(--nexus-space-md,.875rem)}
.nexus-gallery-admin-category-new summary{background:var(--nexus-panel-2,var(--panel-2,var(--nexus-panel,var(--panel,transparent))))}
@media(max-width:720px){.nexus-gallery-hero{align-items:stretch;flex-direction:column}.nexus-gallery-hero-actions .btn{width:100%;justify-content:center}.nexus-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.nexus-gallery-meta{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:440px){.nexus-gallery-grid{grid-template-columns:1fr}.nexus-gallery-meta{grid-template-columns:1fr}}
