/* Collage / vision-board builder (assets/js/editor/collageBuilder.js).
   Shared by the editor's Collections modal and the Collections page, so it
   only relies on the site-wide theme tokens from styles.css. */
.cb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; font: 700 13px 'Nunito', sans-serif; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease; }
.cb-btn:hover { border-color: var(--accent); color: var(--accent); }
.cb-btn .material-icons { font-size: 17px; }
.cb-btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.cb-btn-primary:hover { background: var(--accent-hover, var(--accent)); color: #fff; transform: translateY(-1px); }
.cb-btn:disabled { opacity: 0.7; cursor: progress; transform: none; }
.cb-root { display: flex; flex-direction: column; min-height: 0; flex: 1; animation: editor-collection-reveal 0.24s ease both; }
.cb-root.hidden { display: none; }
.cb-head { display: flex; align-items: center; gap: 12px; padding: 14px 24px 10px; flex-wrap: wrap; }
.cb-back { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; }
.cb-back .material-icons { font-size: 16px; }
.cb-heading { margin: 0; flex: 1; min-width: 180px; color: var(--text); font-size: 15px; }
.cb-tabs { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.cb-tabs button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font: 700 12px 'Nunito', sans-serif; }
.cb-tabs button .material-icons { font-size: 16px; }
.cb-tabs button.is-active { background: var(--accent); color: #fff; }
.cb-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; padding: 4px 24px 14px; overflow-y: auto; min-height: 0; }
.cb-options { display: flex; flex-direction: column; gap: 16px; }
.cb-field { display: flex; flex-direction: column; gap: 7px; }
.cb-field > label { display: flex; justify-content: space-between; align-items: baseline; color: var(--text); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.cb-field > label small, .cb-field > label output { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.cb-photos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-height: 196px; overflow-y: auto; padding: 2px; }
.cb-photo { position: relative; padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; aspect-ratio: 1; background: var(--surface2); cursor: pointer; opacity: 0.42; filter: grayscale(0.6); transition: opacity 0.15s ease, border-color 0.15s ease, filter 0.15s ease; }
.cb-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-photo .material-icons { position: absolute; top: 3px; right: 3px; font-size: 13px; padding: 1px; border-radius: 50%; background: var(--accent); color: #fff; opacity: 0; }
.cb-photo.is-selected { opacity: 1; filter: none; border-color: var(--accent); }
.cb-photo.is-selected .material-icons { opacity: 1; }
.cb-hint { margin: 0; color: var(--muted); font-size: 11px; }
.cb-canvas, .cb-title, .cb-custom input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--text); font: 600 13px 'Nunito', sans-serif; }
.cb-custom { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.cb-custom.hidden { display: none; }
.cb-count { width: 100%; accent-color: var(--accent); }
.cb-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; align-content: start; }
.cb-template { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; font-family: 'Nunito', sans-serif; }
.cb-template:hover { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--text) 10%, transparent); }
.cb-template.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.cb-template-frame { display: flex; align-items: center; justify-content: center; height: 230px; border-radius: 8px; background: var(--surface2); overflow: hidden; }
.cb-template canvas { max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.cb-template strong { font-size: 13px; }
.cb-template small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.cb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px 18px; border-top: 1px solid var(--border); }
.cb-note { margin: 0; color: var(--muted); font-size: 12px; }
.cb-note.error { color: #c0392b; font-weight: 700; }
.cb-create { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; }
.cb-create .material-icons { font-size: 18px; }
@media (max-width: 760px) {
  .cb-body { grid-template-columns: 1fr; }
  .cb-template-frame { height: 180px; }
}

/* Modal shell used on the Collections page (the editor reuses its own
   Collections modal instead). */
.cb-modal { width: min(1180px, calc(100vw - 28px)); max-height: min(820px, calc(100vh - 28px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--white, #fff); color: var(--text); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3); animation: editor-collection-reveal 0.24s ease both; font-family: 'Nunito', sans-serif; }
.cb-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.cb-modal-header h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.05rem; color: var(--text); }
.cb-modal-header h3 .material-icons { color: var(--accent); }
.cb-modal-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
@keyframes editor-collection-reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
