/* Shared visual editor overlay styles (edit mode only) — used by every editor-enabled
   theme. Accent color is one variable (--obt-accent / --obt-accent-2) so each theme
   just sets it once; everything else here is intentionally theme-agnostic.
   Each theme's OWN stylesheet still needs a couple of lines pushing its header down
   below the fixed toolbar — that part can't be generic since header markup varies:
     body.is-editable .site-header { top: 44px; }               (position:fixed headers)
     body.is-editable { padding-top: 44px; }                     (position:static/sticky headers)
*/
:root {
  --obt-accent: #ff5a1f;
  --obt-accent-2: #ffb703;
}

body.is-editable { padding-top: 44px; }

/* Strips default <button> chrome (margin, background, border, font
   inheritance) before a more specific class styles it — was applied to the
   settings-save button but never actually defined anywhere, so that button
   rendered as a bare unstyled browser button. */
.btn-reset { margin: 0; padding: 0; background: none; border: none; font: inherit; color: inherit; text-align: inherit; cursor: pointer; }

.obt-editor-toolbar {
  position: fixed; top: 0; left: 0; right: 0; height: 44px; z-index: 200;
  background: #14171b; border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center;
}
.obt-editor-toolbar-inner {
  width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: nowrap;
  /* overflow-x:auto without an explicit overflow-y silently computes overflow-y
     to auto too — the done button's shake animation rotates it, momentarily
     growing its bounding box past the toolbar's height, which was popping a
     vertical scrollbar on the whole bar. Locking overflow-y closed fixes that. */
  overflow-x: auto; overflow-y: hidden;
}
.obt-editor-label { color: #fff; font-size: 0.85rem; white-space: nowrap; font-family: 'Inter', sans-serif; }
.obt-editor-badge {
  background: rgba(255,183,3,0.15); color: #ffb703; border: 1px solid rgba(255,183,3,0.35);
  font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.65rem; border-radius: 999px; white-space: nowrap;
}
.obt-editor-status { color: rgba(255,255,255,0.5); font-size: 0.78rem; white-space: nowrap; margin-left: auto; }
.obt-editor-status.is-saving { color: #ffb703; }
.obt-done-wrap { position: relative; flex-shrink: 0; }
.obt-editor-done {
  display: inline-block;
  color: #fff; background: linear-gradient(135deg, var(--obt-accent), var(--obt-accent-2)); text-decoration: none; font-size: 0.82rem; font-weight: 800;
  padding: 0.45rem 1rem; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 4px 14px -4px rgba(255,90,31,0.6); transition: box-shadow 0.15s ease;
  animation: obtDoneGlow 3s ease-in-out infinite, obtDoneShake 6s ease-in-out infinite;
}
.obt-editor-done:hover { animation-play-state: paused; transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(255,90,31,0.75); }
@keyframes obtDoneGlow {
  0%, 100% { box-shadow: 0 4px 14px -4px rgba(255,90,31,0.6); }
  50% { box-shadow: 0 6px 24px -2px rgba(255,144,20,0.95); }
}
@keyframes obtDoneShake {
  0%, 91%, 100% { transform: translateX(0) rotate(0deg); }
  92.5% { transform: translateX(-2px) rotate(-2deg); }
  94% { transform: translateX(2px) rotate(2deg); }
  95.5% { transform: translateX(-2px) rotate(-1deg); }
  97% { transform: translateX(1px) rotate(1deg); }
  98.5% { transform: translateX(0) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .obt-editor-done { animation: none; }
}

/* ---------- "done" nudge callout ---------- */
.obt-done-hint {
  /* Fixed (not absolute) — the toolbar's own inner wrapper has overflow-x:auto,
     which silently clips an absolutely-positioned child the moment it extends
     past the toolbar's 44px height. Fixed positioning escapes that entirely. */
  position: fixed; top: 54px; right: 1.25rem; z-index: 210; display: none;
  background: #fff; color: #14171b; border-radius: 14px; padding: 1rem 1.25rem; width: 260px;
  box-shadow: 0 24px 50px -16px rgba(0,0,0,0.5); font-family: 'Inter', sans-serif;
}
.obt-done-hint.is-open { display: block; animation: obtDoneHintIn 0.3s ease; }
.obt-done-hint::before {
  content: ''; position: absolute; top: -6px; right: 22px; width: 12px; height: 12px;
  background: #fff; transform: rotate(45deg);
}
@keyframes obtDoneHintIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.obt-done-hint strong { display: block; font-size: 0.92rem; margin-bottom: 0.3rem; }
.obt-done-hint p { margin: 0; font-size: 0.85rem; color: #5c6270; line-height: 1.5; }
.obt-done-hint-close {
  position: absolute; top: 0.5rem; right: 0.6rem; background: none; border: none;
  font-size: 1.3rem; line-height: 1; color: #a8adb8; cursor: pointer;
}
@media (max-width: 640px) {
  .obt-done-hint { top: auto; bottom: 1rem; left: 1rem; right: 1rem; width: auto; }
}
.obt-editor-settings-btn {
  color: #fff; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.8rem; font-weight: 700; padding: 0.35rem 0.85rem; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0; cursor: pointer; font-family: inherit;
}
.obt-editor-settings-btn:hover { background: rgba(255,255,255,0.18); }

/* ---------- editable text ---------- */
[data-edit-key] {
  cursor: pointer; border-radius: 4px; outline-offset: 4px;
  transition: outline 0.15s ease, background 0.15s ease;
}
[data-edit-key]:hover {
  outline: 2px dashed color-mix(in srgb, var(--obt-accent) 60%, transparent);
  background-color: color-mix(in srgb, var(--obt-accent) 8%, transparent);
}
[data-edit-key].obt-editing {
  outline: 2px solid var(--obt-accent);
  background-color: color-mix(in srgb, var(--obt-accent) 10%, transparent);
  cursor: text;
}
[data-edit-key].obt-pulse {
  animation: obtEditPulse 1.4s ease-in-out 2;
}
@keyframes obtEditPulse {
  0%, 100% { outline: 2px dashed color-mix(in srgb, var(--obt-accent) 60%, transparent); }
  50% { outline: 3px solid var(--obt-accent); background-color: color-mix(in srgb, var(--obt-accent) 16%, transparent); }
}

/* ---------- editable images ---------- */
[data-edit-slot] { position: relative; cursor: pointer; }
/* Always-visible badge, not a hover-only reveal — a hover affordance is
   invisible to non-technical users and doesn't exist at all on touch devices,
   so nobody would ever discover a photo is even clickable without it. */
[data-edit-slot]::after {
  content: "📷 Change Photo";
  position: absolute; bottom: 0.65rem; right: 0.65rem; z-index: 5;
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(10,10,10,0.75); color: #fff; font-weight: 700; font-size: 0.78rem;
  white-space: nowrap;
  padding: 0.4rem 0.75rem; border-radius: 999px;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,0.6);
  pointer-events: none; transition: transform 0.15s ease, background 0.15s ease;
}
[data-edit-slot]:hover::after { background: rgba(10,10,10,0.92); transform: scale(1.05); }
[data-edit-slot].obt-pulse { animation: obtEditPulse 1.4s ease-in-out 2; }

/* ---------- tutorial overlay ---------- */
.obt-tutorial-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10,10,10,0.65); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.obt-tutorial-card {
  background: #fff; border-radius: 18px; padding: 2.25rem; max-width: 420px; width: 100%;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.5); font-family: 'Inter', sans-serif; text-align: center;
}
.obt-tutorial-badge {
  display: inline-block; background: rgba(255,183,3,0.15); color: #a8460f; border: 1px solid rgba(255,183,3,0.4);
  font-size: 0.72rem; font-weight: 700; padding: 0.3rem 0.75rem; border-radius: 999px; margin-bottom: 0.75rem;
}
.obt-tutorial-card h2 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; margin: 0 0 0.75rem; color: #14171b;
}
.obt-tutorial-card p { color: #5c6270; font-size: 0.95rem; line-height: 1.6; margin: 0 0 1.5rem; }
.obt-tutorial-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.obt-tutorial-primary {
  display: inline-block; width: 100%; border: none; cursor: pointer; font-family: inherit;
  color: #fff; background: linear-gradient(135deg, var(--obt-accent), var(--obt-accent-2));
  font-size: 0.95rem; font-weight: 800; padding: 0.85rem 1.5rem; border-radius: 999px;
  box-shadow: 0 8px 22px -8px rgba(255,90,31,0.6); transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.obt-tutorial-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -6px rgba(255,90,31,0.75); }
.obt-tutorial-skip {
  background: none; border: none; color: #5c6270; font-size: 0.88rem; cursor: pointer;
  text-decoration: underline; padding: 0.4rem;
}

/* ---------- guided setup tour callout ---------- */
.obt-tour-callout {
  position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 310; display: none;
  background: #14171b; color: #fff; border-radius: 16px; padding: 1.25rem 1.5rem;
  max-width: 320px; box-shadow: 0 24px 60px -18px rgba(0,0,0,0.6); font-family: 'Inter', sans-serif;
}
.obt-tour-callout.is-open { display: block; animation: obtTourIn 0.3s ease; }
@keyframes obtTourIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.obt-tour-step {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--obt-accent-2); display: block; margin-bottom: 0.4rem;
}
.obt-tour-callout h4 { margin: 0 0 0.4rem; font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; }
.obt-tour-callout p { margin: 0 0 1rem; font-size: 0.88rem; line-height: 1.5; color: rgba(255,255,255,0.75); }
.obt-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.obt-tour-skip {
  background: none; border: none; color: rgba(255,255,255,0.5); font-size: 0.8rem; cursor: pointer;
  text-decoration: underline; padding: 0.3rem;
}
@media (max-width: 640px) {
  .obt-tour-callout { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
}

/* ---------- image picker modal ---------- */
.obt-image-picker {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(10,10,10,0.65); align-items: center; justify-content: center; padding: 1.5rem;
}
.obt-image-picker.is-open { display: flex; }
.obt-image-picker-card {
  background: #fff; border-radius: 18px; padding: 1.5rem; max-width: 640px; width: 100%; max-height: 80vh;
  display: flex; flex-direction: column; box-shadow: 0 30px 70px -20px rgba(0,0,0,0.5); font-family: 'Inter', sans-serif;
}
.obt-image-picker-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.obt-image-picker-header h3 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; color: #14171b; }
.obt-image-picker-close { background: none; border: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: #5c6270; }
.obt-image-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); align-items: start; gap: 0.75rem;
  overflow-y: auto; padding: 0.25rem;
}
.obt-image-picker-grid button {
  display: flex; flex-direction: column; width: 100%; border: 2px solid transparent; border-radius: 10px;
  overflow: hidden; padding: 0; cursor: pointer; background: none; transition: border-color 0.15s ease;
}
.obt-image-picker-grid button:hover { border-color: var(--obt-accent); }
.obt-image-picker-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.obt-image-caption {
  font-size: 0.72rem; color: #5c6270; padding: 0.3rem 0.15rem; text-align: center; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.obt-image-picker-footer {
  margin: 1rem 0 0; padding-top: 0.9rem; border-top: 1px solid #ececef;
  font-size: 0.82rem; color: #5c6270; text-align: center;
}
.obt-image-picker-footer a { color: var(--obt-accent); font-weight: 600; }

@media (max-width: 640px) {
  .obt-editor-label, .obt-editor-badge { display: none; }
  .obt-editor-status { margin-left: 0; }
}

/* ---------- services add/remove ---------- */
.obt-service-toggle {
  background: #14171b; color: #fff; border: none; border-radius: 999px; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 0.72rem; padding: 0.35rem 0.75rem;
}
.obt-service-toggle:hover { background: var(--obt-accent); }
.obt-service-inactive { opacity: 0.4; }
.obt-service-inactive .obt-service-toggle { background: var(--obt-accent); }

/* ---------- section hide/show toggle ---------- */
.obt-section-toggle {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  margin: 0 auto 2rem; padding: 0.6rem 1rem; max-width: fit-content;
  background: color-mix(in srgb, var(--obt-accent) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--obt-accent) 50%, transparent); border-radius: 10px;
  font-family: 'Inter', sans-serif;
}
.obt-section-toggle-note { color: #a8460f; font-size: 0.85rem; font-weight: 700; }
.obt-section-toggle-btn {
  background: var(--obt-accent); color: #fff; border: none; border-radius: 999px; font-weight: 700;
  font-size: 0.82rem; padding: 0.4rem 0.9rem; cursor: pointer; font-family: inherit;
}
.obt-section-toggle-btn:hover { filter: brightness(0.9); }
.obt-section-hidden { opacity: 0.55; }

/* ---------- misc small editor controls ---------- */
.obt-stat-preset {
  display: block; margin: 0.75rem auto 0; font-family: 'Inter', sans-serif; font-size: 0.8rem;
  color: #14171b; background: #fff; border: 1.5px solid rgba(255,255,255,0.3); border-radius: 8px;
  padding: 0.35rem 0.5rem; cursor: pointer; max-width: 220px;
}

/* ---------- settings panel ---------- */
.obt-settings-panel {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(10,10,10,0.65); align-items: center; justify-content: center; padding: 1.5rem;
}
.obt-settings-panel.is-open { display: flex; }
.obt-settings-card {
  background: #fff; border-radius: 18px; padding: 1.75rem; max-width: 460px; width: 100%; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 30px 70px -20px rgba(0,0,0,0.5); font-family: 'Inter', sans-serif;
}
.obt-settings-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.obt-settings-header h3 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; color: #14171b; }
.obt-settings-close { background: none; border: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: #5c6270; }
.obt-settings-intro { color: #5c6270; font-size: 0.88rem; margin: 0 0 1.25rem; }
.obt-settings-field { display: block; margin-bottom: 1.1rem; }
.obt-settings-field span { display: block; font-weight: 700; font-size: 0.85rem; color: #14171b; margin-bottom: 0.35rem; }
.obt-settings-field input {
  width: 100%; padding: 0.65rem 0.8rem; border: 1.5px solid #e7e3da; border-radius: 10px;
  font-size: 0.95rem; font-family: inherit; color: #14171b; background: #fff;
}
.obt-settings-field input:focus { outline: none; border-color: var(--obt-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--obt-accent) 15%, transparent); }
.obt-settings-field small { display: block; color: #8a8f99; font-size: 0.75rem; margin-top: 0.3rem; }
.obt-color-swatches { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.obt-color-swatch {
  width: 36px; height: 36px; border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  padding: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.obt-color-swatch.is-active { border-color: #14171b; box-shadow: 0 0 0 3px rgba(20,23,27,0.15); }
.obt-settings-error { color: #c0293d; font-size: 0.85rem; margin: -0.25rem 0 1rem; }
.obt-settings-save {
  display: inline-block; width: 100%; border: none; cursor: pointer; font-family: inherit;
  color: #fff; background: linear-gradient(135deg, var(--obt-accent), var(--obt-accent-2));
  font-size: 0.95rem; font-weight: 800; padding: 0.85rem 1.5rem; border-radius: 999px;
  box-shadow: 0 8px 22px -8px rgba(255,90,31,0.6); transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.obt-settings-save:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -6px rgba(255,90,31,0.75); }
