/* gallery.css - the community Gallery tab (#gallery) and the Publish dialog (js/exp/gallery.js). */
.gl-wrap { position: absolute; inset: 0; overflow-y: auto; padding: 28px 16px 48px; box-sizing: border-box; }
.gl-head, .gl-grid, .gl-status, .gl-more-btn { max-width: 1080px; margin-left: auto; margin-right: auto; }
.gl-head h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.gl-head > p { color: var(--muted); margin: 0 0 16px; }
.gl-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.gl-sort { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.gl-sort .vh-btn { border-radius: 999px; border-color: transparent; padding: 5px 14px; }
.gl-sort .vh-btn[aria-pressed="true"] { border-color: var(--accent); }
.gl-search {
  flex: 1 1 220px; max-width: 360px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; color: var(--text); font: inherit; transition: border-color var(--ease);
}
.gl-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(111, 163, 255, 0.25); }

.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; }
.gl-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: visible; transition: border-color var(--ease), opacity var(--ease);
}
.gl-card:hover, .gl-card:focus-within { border-color: #39405a; }
.gl-card.gl-reported { opacity: 0.45; }
.gl-prev { display: block; width: 100%; height: 112px; border-radius: var(--radius) var(--radius) 0 0; background: #080a28; }
.gl-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gl-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gl-title { margin: 0; font-size: 15px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-yours { flex: none; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--glow); border: 1px solid rgba(159, 255, 255, 0.4); border-radius: 999px; padding: 1px 7px; }
.gl-by { display: flex; gap: 8px; justify-content: space-between; color: var(--muted); font-size: 12.5px; min-width: 0; }
.gl-author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gl-by time { flex: none; }
.gl-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.gl-chip { font-size: 11.5px; color: #b8bfd3; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.gl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.gl-like, .gl-dots {
  background: transparent; border: 1px solid var(--line); border-radius: 8px; color: #c8cde0; cursor: pointer; padding: 5px 9px;
  font: inherit; transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.gl-like:hover:not(:disabled), .gl-dots:hover { border-color: var(--muted); }
.gl-like[aria-pressed="true"] { color: #ff8fb1; border-color: rgba(255, 143, 177, 0.45); cursor: default; }
.gl-primary { background: rgba(111, 163, 255, 0.16); border-color: rgba(111, 163, 255, 0.55); color: #fff; }
.gl-primary:hover:not(:disabled) { background: rgba(111, 163, 255, 0.28); border-color: var(--accent); }
.gl-primary:disabled { opacity: 0.6; cursor: progress; }
.gl-open { flex: 1; }
.gl-menu-wrap { position: relative; }
.gl-menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; min-width: 130px; padding: 4px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.gl-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; color: var(--text); padding: 6px 9px; cursor: pointer; font: inherit; }
.gl-menu button:hover:not(:disabled), .gl-menu button:focus-visible { background: rgba(255, 255, 255, 0.06); }
.gl-menu button:disabled { color: var(--muted); cursor: default; }
.gl-confirm { border: 1px solid rgba(255, 120, 120, 0.4); background: rgba(255, 90, 90, 0.07); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }
.gl-confirm p { margin: 0 0 8px; }
.gl-confirm-row { display: flex; gap: 6px; justify-content: flex-end; }
.gl-danger { border-color: rgba(255, 120, 120, 0.6); color: #ffd0d0; }
.gl-danger:hover { background: rgba(255, 90, 90, 0.18); }
.gl-flash { font-size: 12px; color: var(--glow); }

.gl-skel { pointer-events: none; }
.gl-skel-art { height: 112px; border-radius: var(--radius) var(--radius) 0 0; background: #10132a; }
.gl-skel-line { height: 11px; margin: 12px 12px 0; border-radius: 6px; background: var(--surface-2); }
.gl-skel-line.short { width: 45%; margin-bottom: 16px; }
.gl-skel > div { animation: gl-pulse 1.4s ease-in-out infinite; }
@keyframes gl-pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .gl-skel > div { animation: none; } }

.gl-status { text-align: center; color: var(--muted); padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.gl-status b { display: block; color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.gl-status p { margin: 0 0 12px; }
.gl-more-btn { display: block; margin-top: 20px; padding: 8px 22px; }

.gl-field { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.gl-field span { grid-column: 1; }
.gl-field .gl-count { grid-column: 2; grid-row: 1; font-size: 11px; }
.gl-field input {
  grid-column: 1 / -1; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color: var(--text); font: inherit; font-size: 14px;
}
.gl-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(111, 163, 255, 0.25); }
.gl-pub-prev { border-radius: 8px; height: 104px; }
.gl-err { color: #ffb4b4; font-size: 13px; margin: 6px 0 0; }

/* Melody's share box: room for the Publish button on narrow screens */
.mel-sharebox { flex-wrap: wrap; }
.mel-sharebox input { flex-basis: 160px; }

@media (max-width: 460px) {
  .gl-wrap { padding: 18px 12px 40px; }
  .gl-grid { grid-template-columns: minmax(0, 1fr); }
  .gl-search { max-width: none; }
}


/* My songs (owner edit / remove) */
.gl-scope { margin-right: 4px; }
.gl-mine { max-width: 1080px; margin: 0 auto 14px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.gl-mine-note { flex: 1 1 260px; margin: 0; color: var(--muted); font-size: 13px; }
.gl-mine .vh-btn { padding: 4px 12px; font-size: 12.5px; }
.gl-mine-off { color: var(--muted); }
.gl-ask-in, .gl-keys-ta { width: 100%; box-sizing: border-box; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color: var(--text); font: inherit; margin: 6px 0; }
.gl-keys-ta { font-family: ui-monospace, Consolas, monospace; font-size: 12px; resize: vertical; }
.gl-gone { opacity: 0.8; }
