/* ═══════════════════════════════════════
   STORIED FLAVOURS — Shared Creation Shell
   Reusable layout primitives for full-page
   preservation creation flows.

   Used by: celebration-add, and future
   audio-memory-add, heirloom-add flows.
   ═══════════════════════════════════════ */

/* ── Page container ── */
.creation-page {
  max-width: 680px;
  margin: 0 auto;
  /* Reserve space for sticky action bar on small screens */
  padding-bottom: var(--space-20);
}

/* ── Header region ── */
.creation-header {
  margin-bottom: var(--space-8);
}

.creation-header h1 {
  font-size: var(--font-size-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.creation-header p {
  font-size: var(--font-size-base);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 0;
}

/* ── Section card ── */
.creation-section {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}

.creation-section-title {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brown-400);
  margin-bottom: var(--space-5);
}

/* ── Helper text ── */
.creation-helper {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
  margin-top: var(--space-2);
}

/* Block variant — callout with amber left border */
.creation-helper--block {
  background: var(--surface-page);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--color-amber);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  font-style: normal;
  color: var(--text-secondary);
}

/* ── Context preview card ── */
/* Shown when a creation flow is launched from a specific context
   (e.g. calendar day, recipe page). */
.creation-context-card {
  background: var(--color-amber-light);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Message region (success / error) ── */
.creation-message {
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-5);
  display: none;
  line-height: 1.5;
}

.creation-message.visible {
  display: block;
}

.creation-message--success {
  background: var(--color-sage-light);
  border: 1px solid rgba(124, 154, 110, 0.3);
  color: #2d5a27;
}

.creation-message--error {
  background: var(--color-red-light);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--color-red);
}

/* ── Action row ── */
.creation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-6);
}

/* ── Mobile — sticky bottom action bar ── */
@media (max-width: 640px) {
  .creation-page {
    /* Account for sticky bar height + safe area inset on iOS */
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .creation-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-elevated);
    border-top: 1px solid var(--border-light);
    padding: var(--space-3) var(--space-5);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    box-shadow: 0 -2px 12px rgba(62, 39, 35, 0.08);
    justify-content: stretch;
  }

  /* Equal-width buttons in sticky bar */
  .creation-actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .creation-section {
    padding: var(--space-5);
  }
}

/* ── Recorder-safe bottom padding ── */
/* Applied when an audio recorder may appear near the page bottom.
   Prevents overlap with the sticky action bar on narrow screens. */
.creation-page--recorder-safe {
  padding-bottom: calc(var(--space-20) + 120px);
}

@media (max-width: 640px) {
  .creation-page--recorder-safe {
    padding-bottom: calc(80px + 120px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Form Group spacing ── */
.creation-section > .form-group,
.creation-section > div > .form-group {
  margin-bottom: var(--space-5);
}

.creation-section > .form-group:last-child,
.creation-section > div:last-child > .form-group:last-child {
  margin-bottom: 0;
}

/* ── Radio & Checkbox Groups ── */
.creation-section .radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  align-items: center;
  padding-top: var(--space-1);
}

.creation-section .radio-group label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 500;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  cursor: pointer;
}

.creation-section .radio-group input[type="radio"] {
  accent-color: var(--color-amber);
  width: 18px;
  height: 18px;
  margin: 0;
}

.creation-section .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2.5);
  padding-top: var(--space-1);
}

.creation-section .checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 400;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.creation-section .checkbox-group input[type="checkbox"] {
  accent-color: var(--color-amber);
  width: 16px;
  height: 16px;
  margin: 0;
}

/* ── Background decoration matching Collections page ── */
.creation-page--family::before,
.creation-page--circle::before {
  content: '';
  position: fixed;
  top: var(--topbar-height);
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.creation-page--family::before {
  background: url('../assets/collections-family-bg.png') center / cover no-repeat;
}

.creation-page--circle::before {
  background: url('../assets/collections-circle-bg.png') center / cover no-repeat;
}

.creation-page--family > *,
.creation-page--circle > * {
  position: relative;
  z-index: 1;
}


