/*
 * Página do studio (views/landing/page.ejs). Celular primeiro; no computador vira duas colunas.
 * Cor do studio entra por variáveis no .sp (--c, --c-fill, --c-on, --c-ink, --c-dark, --c-soft,
 * --c-line, vindas do brandTokens). Estilos fechados por [data-style]: atelie, noite, revista.
 */

.sp, .sp-bar {
  --bg: #faf7f4;
  --surface: #ffffff;
  --ink: #1d1b22;
  --text: #3a3540;
  --muted: #6e6775;
  --line: #ebe5e8;
  --accent-text: var(--c-ink);
  --serif: 'Bodoni Moda', 'Didot', Georgia, serif;
  --sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --r-lg: 22px;
  --r-md: 16px;
  --gutter: 20px;
}
.sp[data-style="noite"], .sp-bar[data-style="noite"] {
  --bg: #131115;
  --surface: #1c191f;
  --ink: #f4eff6;
  --text: #d9d2dd;
  --muted: #a39aa9;
  --line: #2b2630;
  --accent-text: var(--c-dark);
}
.sp[data-style="revista"], .sp-bar[data-style="revista"] { --bg: #ffffff; --surface: #ffffff; --line: #ece8ea; }

body:has(.sp) { background: #faf7f4 !important; }
body:has(.sp[data-style="noite"]) { background: #131115 !important; }
body:has(.sp[data-style="revista"]) { background: #ffffff !important; }

.sp *, .sp *::before, .sp *::after, .sp-bar * { box-sizing: border-box; }
.sp { min-height: 100svh; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.sp h1, .sp h2, .sp p, .sp ul, .sp dl, .sp dd, .sp figure { margin: 0; padding: 0; }
.sp ul { list-style: none; }
.sp a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.sp img { display: block; image-orientation: from-image; }
.sp :focus-visible, .sp-bar :focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 10px; }
.sp .grow { flex: 1; min-width: 0; }

/* ── Topo ──────────────────────────────────────────────────────────────── */
.sp-cover { margin: 12px 12px 0; height: 212px; border-radius: var(--r-lg); overflow: hidden; background: var(--c-soft); }
.sp-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.sp-id { position: relative; padding: 28px var(--gutter) 0; }
.sp-hero.has-cover .sp-id { margin-top: -44px; padding-top: 0; }
.sp-logo {
  position: relative; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--surface); border: 4px solid var(--bg); box-shadow: 0 6px 18px rgba(20, 14, 24, .12);
  font-family: var(--serif); font-size: 30px; color: var(--accent-text);
}
/* Mesmo enquadramento do editor (Minha página): capa centralizada + zoom/posição salvos */
.sp-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transform-origin: center; }
.sp-name { margin-top: 14px; font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.04; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.sp-line { margin-top: 8px; font-size: 17px; color: var(--text); max-width: 34ch; }
.sp-meta { margin-top: 10px; display: flex; gap: 6px; font-size: 14px; color: var(--muted); }
.sp-meta i { color: var(--accent-text); }
.sp-meta span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.sp-actions { padding: 20px var(--gutter) 4px; display: grid; gap: 10px; }
.sp .sp-btn, .sp-bar .sp-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 20px;
  border-radius: var(--r-md); background: var(--c-fill); color: var(--c-on); font: 600 17px/1.2 var(--sans);
  text-decoration: none; box-shadow: 0 8px 20px -10px var(--c-fill); transition: transform .15s ease, filter .15s ease;
}
.sp-btn:active { transform: scale(.985); filter: brightness(.95); }
.sp-quick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.sp-quick a {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink);
}
.sp-quick i { font-size: 16px; color: var(--accent-text); }

/* Revista: capa grande com o nome sobre a foto (só quando há foto) */
.sp[data-style="revista"] .sp-hero.has-cover { position: relative; }
.sp[data-style="revista"] .has-cover .sp-cover { margin: 0; height: min(58svh, 500px); border-radius: 0 0 28px 28px; position: relative; }
.sp[data-style="revista"] .has-cover .sp-cover::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(to top, rgba(12, 9, 14, .78), rgba(12, 9, 14, 0)); }
.sp[data-style="revista"] .has-cover .sp-id { position: absolute; left: 0; right: 0; top: 0; margin: 0; padding: 0 var(--gutter) 24px; height: min(58svh, 500px); display: flex; flex-direction: column; justify-content: flex-end; }
.sp[data-style="revista"] .has-cover .sp-logo { width: 56px; height: 56px; border-width: 2px; border-color: rgba(255, 255, 255, .9); font-size: 20px; }
.sp[data-style="revista"] .has-cover .sp-name { color: #fff; font-size: 40px; }
.sp[data-style="revista"] .has-cover .sp-line, .sp[data-style="revista"] .has-cover .sp-meta, .sp[data-style="revista"] .has-cover .sp-meta i { color: rgba(255, 255, 255, .88); }
.sp[data-style="revista"] .sp-name { text-transform: none; }

/* ── Navegação das partes ──────────────────────────────────────────────── */
.sp-nav {
  position: sticky; top: 0; z-index: 20; margin-top: 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.sp-nav-track { display: flex; gap: 6px; overflow-x: auto; padding: 10px var(--gutter); scrollbar-width: none; }
.sp-nav-track::-webkit-scrollbar { display: none; }
.sp-nav a { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s; }
.sp-nav a.is-active { background: var(--ink); color: var(--bg); }

/* ── Partes ────────────────────────────────────────────────────────────── */
.sp-sec { padding: 28px var(--gutter) 4px; scroll-margin-top: 60px; }
.sp-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.sp-head h2 { font-family: var(--serif); font-weight: 600; font-size: 25px; line-height: 1.1; color: var(--ink); }
.sp-count { font-size: 13px; font-weight: 600; color: var(--muted); }

.sp-svcs { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.sp-svcs li + li { border-top: 1px solid var(--line); }
.sp-svcs li.is-more { display: none; }
.sp-sec.is-open .sp-svcs li.is-more { display: block; }
.sp-svcs a { display: flex; align-items: center; gap: 12px; padding: 15px 14px 15px 16px; min-height: 64px; }
.sp-svcs a:active { background: var(--c-soft); }
.sp-svc-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sp-svc-n { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.sp-svc-d { font-size: 13px; color: var(--muted); }
.sp-svc-p { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-svcs .bi-chevron-right { font-size: 13px; color: var(--muted); }
.sp-more {
  width: 100%; margin-top: 10px; min-height: 46px; border-radius: 14px; border: 1px solid var(--line);
  background: transparent; color: var(--accent-text); font: 600 15px var(--sans); cursor: pointer;
}
.sp-sec.is-open .sp-more { display: none; }

.sp-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
.sp-rail::-webkit-scrollbar { display: none; }
.sp-rail > * { scroll-snap-align: start; flex: none; }
.sp-photos figure { width: 74%; max-width: 320px; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--c-soft); }
.sp-photos img, .sp-grid img { width: 100%; height: 100%; object-fit: cover; }

.sp-team { gap: 14px; }
.sp-member { width: 76px; display: grid; justify-items: center; gap: 8px; }
.sp-avatar { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--c-soft); color: var(--accent-text); font: 600 26px var(--serif); border: 1px solid var(--c-line); }
.sp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sp-member-n { font-size: 14px; font-weight: 600; color: var(--ink); text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }

.sp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 18px; overflow: hidden; }
.sp-grid figure { aspect-ratio: 1; background: var(--c-soft); }

.sp-review { width: 82%; max-width: 340px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.sp-stars { display: flex; gap: 3px; color: var(--accent-text); font-size: 14px; }
.sp-review p { font-size: 15px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.sp-review-who { font-size: 13px; font-weight: 600; color: var(--muted); }

.sp-amen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp-amen li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.25; }
.sp-amen i { font-size: 17px; color: var(--accent-text); }

.sp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.sp-row { display: flex; align-items: flex-start; gap: 14px; padding: 15px 16px; }
.sp-row + .sp-row { border-top: 1px solid var(--line); }
a.sp-row { align-items: center; }
a.sp-row:active { background: var(--c-soft); }
.sp-row > .bi:first-child { font-size: 18px; color: var(--accent-text); line-height: 1.4; }
.sp-row > .bi-arrow-up-right { font-size: 14px; color: var(--muted); }
.sp-row-t { display: block; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.sp-row-s { display: block; font-size: 13px; color: var(--muted); }
.sp-hours dl { display: grid; gap: 4px; font-size: 14px; }
.sp-hours dl > div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.sp-hours dt { font-weight: 500; }
.sp-hours dd { font-variant-numeric: tabular-nums; }
.sp-hours dl > div.is-today { color: var(--ink); font-weight: 600; }
.sp-hours dl > div.is-today dt::after { content: ' · hoje'; color: var(--accent-text); font-weight: 600; }

.sp-foot { display: grid; gap: 2px; padding: 36px var(--gutter) calc(112px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--muted); }
.sp-foot span:first-child { font-family: var(--serif); font-size: 18px; color: var(--ink); }

/* ── Barra de agendar (celular) ────────────────────────────────────────── */
.sp-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); font-family: var(--sans);
  transform: translateY(0); transition: transform .25s ease;
}
.sp-bar.is-hidden { transform: translateY(110%); }
.sp-bar .sp-btn { flex: 1; min-height: 52px; box-shadow: none; }
.sp-bar-wa { flex: none; width: 52px; display: grid; place-items: center; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 21px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .sp *, .sp-bar { transition: none !important; scroll-behavior: auto !important; }
}

/* ── Computador: identidade fixa à esquerda, conteúdo à direita ─────────── */
@media (min-width: 960px) {
  .sp-shell { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 40px; padding: 28px 32px 0; align-items: start; }
  .sp-hero { position: sticky; top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; padding-bottom: 20px; }
  .sp-cover { margin: 10px 10px 0; height: 260px; }
  .sp[data-style="revista"] .has-cover .sp-cover, .sp[data-style="revista"] .has-cover .sp-id { height: 460px; }
  .sp[data-style="revista"] .has-cover .sp-cover { border-radius: 0; }
  .sp-logo { border-color: var(--surface); }
  .sp-main { max-width: 680px; }
  .sp-nav { margin-top: 0; border-radius: 0 0 16px 16px; }
  .sp-sec { padding-left: 4px; padding-right: 4px; }
  .sp-rail { margin: 0; padding: 0 0 6px; scroll-padding: 0; }
  .sp-photos figure { width: 260px; }
  .sp-review { width: 320px; }
  .sp-amen { grid-template-columns: repeat(3, 1fr); }
  .sp-foot { padding: 40px 4px 48px; }
  .sp-bar { display: none; }
}
