/* Gregade Client Galleries — shared tokens and controls */
@import url('https://fonts.googleapis.com/css2?family=Gilda+Display&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --ink: #1d1322;          /* plum-black text */
  --plum: #4b2163;         /* studio purple (overridden from settings) */
  --gold: #b88a2e;         /* studio gold (overridden from settings) */
  --paper: #ffffff;
  --stone: #f6f4f7;        /* quiet panels */
  --mist: #e9e4ec;         /* lines */
  --muted: #6f6577;
  --danger: #a3272f;
  --ok: #2f6b45;
  --display: 'Gilda Display', 'Times New Roman', serif;
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --shadow-pop: 0 18px 50px rgba(29, 19, 34, .22);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--ui); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--plum); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; letter-spacing: .005em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .94rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--plum); color: #fff; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: color-mix(in srgb, var(--plum) 86%, black); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: #1d1322; }
.btn-gold:hover { background: color-mix(in srgb, var(--gold) 88%, black); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--mist); }
.btn-line:hover { background: var(--stone); border-color: #d8d0dd; }
.btn-quiet { background: transparent; color: var(--ink); padding: 0 .7rem; }
.btn-quiet:hover { background: var(--stone); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, white); }
.btn-danger:hover { background: #fbf0f1; }
.btn-sm { min-height: 36px; padding: 0 .9rem; font-size: .86rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0;
  background: transparent; color: inherit; cursor: pointer; position: relative;
}
.icon-btn:hover { background: rgba(29, 19, 34, .06); }
.icon-btn svg, .btn svg { width: 20px; height: 20px; flex: none; }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: #1d1322; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* Forms */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field > span { font-size: .86rem; font-weight: 600; }
.field small { color: var(--muted); font-size: .8rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: .6rem .8rem; border: 1px solid #d9d2de; border-radius: var(--r-sm);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px color-mix(in srgb, var(--plum) 18%, transparent); }
.check { display: flex; gap: .65rem; align-items: flex-start; margin-bottom: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--plum); flex: none; }
.check small { display: block; color: var(--muted); }
.row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.error-text { color: var(--danger); font-size: .88rem; margin: .25rem 0 .75rem; }

/* Dialogs & drawers */
.scrim { position: fixed; inset: 0; background: rgba(20, 12, 24, .5); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.dialog {
  background: #fff; border-radius: 14px; width: min(480px, 100%); max-height: calc(100dvh - 2rem); overflow: auto;
  padding: 1.5rem; box-shadow: var(--shadow-pop); animation: pop .18s ease-out;
}
.dialog h2 { font-size: 1.6rem; margin-bottom: .4rem; }
.dialog p { margin: 0 0 1rem; color: var(--muted); }
.dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(20, 12, 24, .45); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #fff; z-index: 61;
  display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: slidein .22s ease-out;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem .75rem .75rem 1.25rem; border-bottom: 1px solid var(--mist); }
.drawer-head h2 { font-size: 1.45rem; }
.drawer-body { flex: 1; overflow: auto; padding: 1.25rem; }
.drawer-foot { border-top: 1px solid var(--mist); padding: 1rem 1.25rem; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; max-width: calc(100% - 2rem);
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; box-shadow: var(--shadow-pop);
  animation: pop .18s ease-out;
}
.toast.err { background: var(--danger); }

.progress { height: 6px; border-radius: 3px; background: var(--mist); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--plum); transition: width .2s; }

.spinner { width: 28px; height: 28px; border: 2.5px solid var(--mist); border-top-color: var(--plum); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
