/* =================================================================
   Inline owner editor — applied only when populate.js adds
   body.is-owner-editor (the signed-in owner viewing their own /i/<slug>).
   Guests never load any of these styles' effects because the classes
   are never added for them.
   Mobile-first; touch targets >= 44px.
   ================================================================= */

/* Leave room for the fixed toolbar so it never covers content/back button. */
body.has-uv-toolbar { padding-top: 56px; }

/* ---------------- Floating toolbar ---------------- */
.uv-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 56px;
  box-sizing: border-box;
  background: rgba(28, 22, 16, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fdf8ec;
  font-family: 'General Sans', system-ui, sans-serif;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}
.uv-toolbar__brand {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.uv-toolbar__status {
  font-size: 12px;
  color: #b9a98f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}
.uv-toolbar__status.is-dirty { color: #f4c66a; }
.uv-toolbar__spacer { flex: 1 1 auto; }

.uv-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  min-height: 40px;
  min-width: 44px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.uv-btn--save {
  background: #c4912b;
  color: #1c1610;
}
.uv-btn--save:disabled {
  background: #5a4d38;
  color: #9b8c70;
  cursor: default;
}
.uv-btn--publish {
  background: #3f9d6a;
  color: #fff;
}
.uv-btn--ghost {
  background: transparent;
  color: #d9cbb2;
  border: 1px solid rgba(217, 203, 178, 0.4);
}

/* ---------------- Editable text affordance ---------------- */
/* Persistent "edit me" cue: editable text gets a subtle hover/focus tint +
   ring, and a pencil badge in the corner on hover so owners can tell at a
   glance what they can change. Only active in owner-editor mode. */
body.is-owner-editor .uv-editable {
  position: relative;
  cursor: text;
  border-radius: 4px;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
body.is-owner-editor .uv-editable:hover,
body.is-owner-editor .uv-editable:focus {
  background-color: rgba(255, 220, 100, 0.12);
  box-shadow: 0 0 0 2px rgba(196, 145, 43, 0.35);
  outline: none;
}
body.is-owner-editor .uv-editable::after {
  content: '\270E';
  position: absolute;
  top: -10px;
  right: -14px;
  font-size: 11px;
  color: rgba(212, 167, 106, 0.9);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.6;
  transition: opacity 150ms ease;
  pointer-events: none;
}
body.is-owner-editor .uv-editable:hover::after,
body.is-owner-editor .uv-editable:focus::after { opacity: 1; }

/* Draft mode (anonymous, instant-edit): mobile-first affordance.
   Always show a soft ring + persistent pencil cue so first-time visitors
   immediately see what's tappable. No hover dependency. */
body.uv-mode-draft .uv-editable {
  box-shadow: 0 0 0 1px rgba(196, 145, 43, 0.28);
  background-color: rgba(255, 220, 100, 0.06);
}
body.uv-mode-draft .uv-editable::after { opacity: 1; }
body.uv-mode-draft .uv-editable:hover,
body.uv-mode-draft .uv-editable:focus {
  background-color: rgba(255, 220, 100, 0.18);
  box-shadow: 0 0 0 2px rgba(196, 145, 43, 0.55);
}

/* In owner mode, reveal every section immediately so the owner can reach all
   editable fields without scrolling through the full cinematic intro. */
body.is-owner-editor .section {
  opacity: 1;
  transform: none;
}

/* ---------------- Sticky bottom save bar (mobile) ---------------- */
.uv-floatbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100000;
  display: none;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(28, 22, 16, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}
.uv-floatbar .uv-btn--lg { width: 100%; min-height: 48px; font-size: 16px; }
.uv-btn--lg { min-height: 48px; }
/* Secondary row under the primary floatbar CTA. Quiet "Save for later" /
   "Start over" links keep the big button loud. */
.uv-floatbar__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}
.uv-floatbar__quiet {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(217, 203, 178, 0.75);
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  min-height: 32px;
  cursor: pointer;
}
.uv-floatbar__quiet:hover,
.uv-floatbar__quiet:focus { color: #fff; outline: none; }
.uv-floatbar__quiet:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.uv-floatbar__sep { color: rgba(217, 203, 178, 0.4); font-size: 13px; }
.uv-btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
@media (max-width: 640px) {
  body.is-owner-editor.uv-dirty .uv-floatbar { display: block; }
  /* Draft mode — always show "Get it live" immediately. */
  body.uv-mode-draft .uv-floatbar { display: block; }
}

/* ---------------- First-time tour overlay ---------------- */
.uv-tour {
  position: fixed; inset: 0;
  z-index: 100001;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(20, 14, 8, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.uv-tour__card {
  background: #fdf8ec;
  color: #2a2018;
  width: 100%; max-width: 320px;
  border-radius: 16px;
  padding: 22px 22px 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  font-family: 'General Sans', system-ui, sans-serif;
}
.uv-tour__title {
  margin: 0 0 14px;
  font-size: 20px; line-height: 1.25; font-weight: 700;
}
.uv-tour__list {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.uv-tour__list li {
  position: relative;
  padding-left: 28px;
  font-size: 14px; line-height: 1.45; color: #5a4a3a;
}
.uv-tour__list li::before {
  content: '\2713';
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(196, 145, 43, 0.18);
  color: #b07f1f; font-size: 12px; font-weight: 700;
}
.uv-tour__go { width: 100%; min-height: 46px; font-size: 15px; }

/* ---------------- Save success toast ---------------- */
.uv-toast {
  position: fixed;
  left: 50%; top: 64px;
  transform: translateX(-50%);
  z-index: 100002;
  width: calc(100% - 24px); max-width: 420px;
  box-sizing: border-box;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #24301f;
  color: #f3f0e6;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
  font-family: 'General Sans', system-ui, sans-serif;
  font-size: 14px;
}
.uv-toast__msg { flex: 1 1 100%; font-weight: 600; }
.uv-toast__btn {
  -webkit-appearance: none; appearance: none;
  border: 0; border-radius: 999px;
  padding: 0 14px; min-height: 36px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.uv-toast__btn--primary { background: #4fae7a; color: #0c160f; }
.uv-toast__btn--ghost { background: transparent; color: #d9cbb2; border: 1px solid rgba(217, 203, 178, 0.4); }
.uv-toast__close {
  margin-left: auto;
  -webkit-appearance: none; appearance: none;
  background: transparent; border: 0; color: #b9a98f;
  font-size: 18px; line-height: 1; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
}

/* Narrow phones: keep the toolbar usable at 390px and below. */
@media (max-width: 420px) {
  .uv-toolbar { gap: 6px; padding: 6px 8px; }
  .uv-toolbar__brand { display: none; }
  .uv-btn { padding: 0 12px; font-size: 13px; min-height: 36px; }
  .uv-toolbar__status { display: none; }
}

/* ============================================================
   Countdown empty-state (Sprint 7.2 T3)
   Shown in owner / draft mode when no event date is set.
   HAW palette: cream card (#fffdf6), honey-gold border (#c8973c).
   ============================================================ */
.haw-countdown-empty {
  margin: 0 auto;
  max-width: 420px;
  background: #fffdf6;
  border: 1px solid #c8973c;
  border-radius: 18px;
  padding: 28px 24px 24px;
  text-align: center;
  font-family: 'General Sans', system-ui, sans-serif;
}
.haw-countdown-empty h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #3a2c18;
}
.haw-countdown-empty p {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: #6a5438;
  line-height: 1.5;
}
.haw-empty-cta {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  padding: 11px 22px;
  background: linear-gradient(135deg, #e8a93d, #c8973c);
  color: #1c1408;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.haw-empty-cta:hover,
.haw-empty-cta:focus-visible {
  filter: brightness(1.07);
  transform: translateY(-1px);
  outline: 2px solid #c8973c;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .haw-empty-cta { transition: none; }
}
/* In owner/draft mode: more prominent ring to signal action. */
body.is-owner-editor .haw-countdown-empty,
body.uv-mode-draft .haw-countdown-empty {
  border-color: #c8973c;
  border-width: 2px;
  box-shadow:
    0 0 0 3px rgba(200, 151, 60, 0.18),
    0 6px 20px rgba(60, 44, 20, 0.10);
}
/* Draft mode: skip reveal delay so the owner sees the prompt immediately. */
body.uv-mode-draft .haw-countdown-empty {
  animation: none;
  opacity: 1;
  transform: none;
}

/* ============================================================
   Registry repeater cards (Sprint 7.2 T4)
   HAW palette: cream cards (#fffdf6), honey-gold left border.
   Brand-specific border colours applied inline by populate.js.
   ============================================================ */
.haw-registry {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.haw-reg-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 18px 22px;
  background: #fffdf6;
  border: 1px solid rgba(200, 151, 60, 0.28);
  border-left: 4px solid #c8973c; /* overridden inline per brand */
  border-radius: 12px;
  text-decoration: none;
  box-shadow:
    0 2px 8px rgba(60, 44, 20, 0.05),
    0 8px 24px rgba(60, 44, 20, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}
.haw-reg-card::before {
  content: attr(data-index);
  position: absolute;
  top: 9px;
  left: 8px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1rem;
  color: #c8973c;
  opacity: 0.5;
  line-height: 1;
}
.haw-reg-card:hover,
.haw-reg-card:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 4px 14px rgba(60, 44, 20, 0.10),
    0 16px 36px rgba(60, 44, 20, 0.12);
  outline: 2px solid #c8973c;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .haw-reg-card { transition: none; }
  .haw-reg-card:hover { transform: none; }
}
.haw-reg-card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding-left: 16px; /* clear the ::before numeral */
}
.haw-reg-card__name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: 1.1rem;
  color: #2a1e10;
  line-height: 1.2;
}
.haw-reg-card__cta {
  font-family: 'General Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: #c8973c;
  letter-spacing: 0.04em;
}
.haw-reg-card__note {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.88rem;
  color: #5a4530;
  margin-top: 1px;
}
@media (max-width: 600px) {
  .haw-registry { gap: 10px; }
  .haw-reg-card { padding: 14px 16px 14px 18px; }
}

/* ---------------- Drawer field → canvas highlight pulse (T2) ---------------- */
@keyframes uvHighlightPulse {
  0%   { box-shadow: 0 0 0 0   rgba(212, 167, 106, 0.5); }
  50%  { box-shadow: 0 0 0 12px rgba(212, 167, 106, 0.0); }
  100% { box-shadow: 0 0 0 0   rgba(212, 167, 106, 0.0); }
}
.uv-highlight-pulse {
  animation: uvHighlightPulse 1.4s ease-out;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .uv-highlight-pulse { animation: none; outline: 2px solid currentColor; outline-offset: 4px; }
}
