/* ══════════════════════════════════════════
   Site components — shared UI patterns
   ══════════════════════════════════════════ */

html {
  overflow-x: clip;
}
body {
  overflow-x: clip;
  max-width: 100%;
}

/* —— Back to vitrine (icon button) —— */
.back-vitrine {
  --back-accent: var(--page-accent, var(--sage-500));
  --back-border: var(--color-border);
  --back-bg: color-mix(in srgb, var(--color-card) 82%, transparent);
  --back-shadow: var(--shadow-sm);
  --back-ease: var(--ease, cubic-bezier(0.4, 0, 0.2, 1));

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--back-border);
  background: var(--back-bg);
  color: var(--back-accent);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--back-shadow);
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.28s var(--back-ease),
    background 0.28s var(--back-ease),
    border-color 0.28s var(--back-ease),
    box-shadow 0.28s var(--back-ease),
    transform 0.28s var(--back-ease);
}

.back-vitrine svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: transform 0.28s var(--back-ease);
}

.back-vitrine:hover {
  color: var(--back-accent);
  background: var(--color-card);
  border-color: color-mix(in srgb, var(--back-accent) 28%, transparent);
  box-shadow: var(--shadow-md);
  transform: translateX(-2px);
}

.back-vitrine:hover svg {
  transform: translateX(-1px);
}

.back-vitrine:active {
  transform: translateX(-1px) scale(0.97);
  box-shadow: var(--shadow-sm);
}

.back-vitrine:focus-visible {
  outline: 2px solid var(--back-accent);
  outline-offset: 3px;
}

/* Page accents — consume theme tokens */
.back-vitrine--terra   { --back-accent: var(--rose-500); }   /* facial */
.back-vitrine--taupe   { --back-accent: var(--terra-500); }  /* corporal */
.back-vitrine--mineral { --back-accent: var(--mauve-600); }   /* capilar · mauve */
.back-vitrine--sage    { --back-accent: var(--olive-500); }  /* desinflamação */
.back-vitrine--copper  { --back-accent: var(--copper-500, #a17945); } /* currículo */

@media (min-width: 768px) {
  .back-vitrine {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    border-radius: 14px;
  }
  .back-vitrine svg {
    width: 19px;
    height: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-vitrine,
  .back-vitrine svg {
    transition: none;
  }
  .back-vitrine:hover,
  .back-vitrine:hover svg,
  .back-vitrine:active {
    transform: none;
  }
}

/* —— Internal pages footer —— */
.site-footer {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding: clamp(2.25rem, 5vw, 3.25rem) clamp(1.25rem, 4vw, 1.75rem) clamp(2rem, 4.5vw, 2.75rem);
  border-top: 1px solid rgba(122, 110, 98, 0.14);
  background: transparent;
  text-align: center;
}

.site-footer__inner {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.site-footer__meta {
  margin: 0;
  font-family: var(--font-body, Outfit, system-ui, sans-serif);
  font-size: clamp(0.7rem, 2.1vw, 0.75rem);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
}

.site-footer__meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.site-footer__meta a:hover {
  color: var(--color-link);
  border-bottom-color: color-mix(in srgb, var(--sage-400) 40%, transparent);
}

.site-footer__sep {
  margin: 0 0.35em;
  opacity: 0.55;
}

.site-footer__copy {
  margin: 0.85rem 0 0;
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--color-heading);
}

.site-footer__credit {
  margin: 1rem 0 0;
  font-family: var(--font-body, Outfit, system-ui, sans-serif);
  font-size: clamp(0.625rem, 1.8vw, 0.6875rem);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

.site-footer__credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 0.25s ease;
}

.site-footer__credit a:hover {
  color: var(--color-link-hover);
}

@media (max-width: 480px) {
  .site-footer {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }
  .site-footer__inner { gap: 0.35rem; }
  .site-footer__copy { margin-top: 0.7rem; }
  .site-footer__credit { margin-top: 0.85rem; }
}

/* —— Media frames (no stretch, responsive) —— */
.media-frame {
  --mf-ar: 4 / 5;
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  aspect-ratio: var(--mf-ar);
  border-radius: clamp(16px, 3.2vw, 24px);
  background: var(--color-card);
  box-shadow: var(--shadow-sm);
}

.media-frame--hero { --mf-ar: 4 / 5; }
.media-frame--portrait { --mf-ar: 3 / 4; }
.media-frame--gallery { --mf-ar: 4 / 5; }
.media-frame--wide { --mf-ar: 16 / 10; }
.media-frame--mid { --mf-ar: 5 / 4; }
.media-frame--square { --mf-ar: 1 / 1; }

/* Curriculum / profile portrait — premium, never stretched */
.media-frame--profile {
  --mf-ar: 3 / 4;
  width: min(11.5rem, 46vw);
  max-width: 13.5rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.4rem;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(42, 38, 35, 0.06));
}

@media (min-width: 768px) {
  .media-frame--profile {
    width: 13.5rem;
    max-width: 15rem;
    padding: 0.5rem;
  }
  .media-frame--portrait {
    max-width: 22rem;
  }
}

.media-frame > img,
.media-frame img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover !important;
  object-position: center;
  border-radius: calc(clamp(16px, 3.2vw, 24px) - 4px);
}

/* Buttons used as gallery thumbs (lightbox) */
button.media-frame {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: zoom-in;
  padding: 0.375rem;
}

@media (max-width: 360px) {
  .media-frame { border-radius: 14px; }
  .media-frame--profile { width: min(10.5rem, 52vw); }
  .media-frame > img,
  .media-frame img { border-radius: 10px; }
}

/* —— Lightbox gallery (Resultados / Depoimentos) —— */
.lb-gallery .lb-item {
  cursor: zoom-in;
  padding: 0.375rem;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  display: block;
  width: 100%;
}
.lb-gallery .lb-item:focus-visible {
  outline: 2px solid var(--lb-accent, var(--page-accent, var(--sage-500)));
  outline-offset: 3px;
}
.lb-root {
  --lb-accent: var(--page-accent, var(--sage-500));
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  background: rgba(38, 34, 29, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lb-root.is-open { display: flex; }
.lb-root[hidden] { display: none !important; }
.lb-dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lb-stage {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.lb-img {
  max-width: 100%;
  max-height: min(78vh, 860px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: var(--mist-900);
  box-shadow: var(--shadow-lg);
}
.lb-caption {
  margin: 0;
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--mist-50);
  text-align: center;
  letter-spacing: 0.02em;
}
.lb-meta {
  font-family: var(--font-body, Outfit, system-ui, sans-serif);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--mist-50) 62%, transparent);
}
.lb-btn {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--mist-50) 22%, transparent);
  background: color-mix(in srgb, var(--mist-900) 55%, transparent);
  color: var(--mist-50);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover {
  background: color-mix(in srgb, var(--lb-accent, var(--terra-500)) 85%, var(--mist-900));
  border-color: color-mix(in srgb, var(--mist-50) 40%, transparent);
}
.lb-btn svg { width: 20px; height: 20px; display: block; }
.lb-close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 2;
}
.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.lb-prev { left: max(6px, env(safe-area-inset-left)); }
.lb-next { right: max(6px, env(safe-area-inset-right)); }
.lb-root--terra { --lb-accent: var(--rose-500); }
.lb-root--taupe { --lb-accent: var(--terra-500); }

@media (max-width: 640px) {
  .lb-img { max-height: 68vh; border-radius: 8px; }
  .lb-prev,
  .lb-next { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-btn { transition: none; }
}

/* ══════════════════════════════════════════
   Protocol CTAs — páginas internas
   (não afeta index/vitrine)
   Sobrescreve utilitários Tailwind claros
   com tokens do Design System por tema.
   ══════════════════════════════════════════ */

[data-theme]:not([data-theme="vitrine"]) .cta-row > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.3s var(--ease, ease),
    color 0.3s var(--ease, ease),
    border-color 0.3s var(--ease, ease),
    box-shadow 0.3s var(--ease, ease),
    transform 0.3s var(--ease-out, ease);
}

/* Primário — fundo sólido do tema + texto branco */
[data-theme]:not([data-theme="vitrine"]) .cta-row > a[class*="bg-"] {
  background: var(--color-cta-bg) !important;
  color: var(--color-cta-text, #ffffff) !important;
  border: 1px solid transparent;
  box-shadow:
    0 8px 22px color-mix(in srgb, var(--color-cta-bg) 28%, transparent);
}

[data-theme]:not([data-theme="vitrine"]) .cta-row > a[class*="bg-"]:hover {
  background: var(--color-cta-bg-hover) !important;
  color: var(--color-cta-text, #ffffff) !important;
  box-shadow:
    0 12px 28px color-mix(in srgb, var(--color-cta-bg) 34%, transparent);
  transform: translateY(-1px);
}

[data-theme]:not([data-theme="vitrine"]) .cta-row > a[class*="bg-"]:active {
  background: var(--color-btn-primary-bg-active, var(--color-cta-bg)) !important;
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Secundário — outline (sem bg-* utilitário) */
[data-theme]:not([data-theme="vitrine"]) .cta-row > a:not([class*="bg-"]) {
  background: transparent !important;
  color: var(--page-accent-deep) !important;
  border: 1px solid color-mix(in srgb, var(--page-accent-deep) 42%, transparent) !important;
  box-shadow: none;
}

[data-theme]:not([data-theme="vitrine"]) .cta-row > a:not([class*="bg-"]):hover {
  background: var(--page-accent-soft) !important;
  color: var(--page-accent-deep) !important;
  border-color: var(--page-accent-deep) !important;
  transform: translateY(-1px);
}

[data-theme]:not([data-theme="vitrine"]) .cta-row > a:not([class*="bg-"]):active {
  transform: translateY(0);
  background: var(--color-active, var(--page-accent-soft)) !important;
}

/* Secundário sobre fundo escuro (ex.: seção deep) */
[data-theme]:not([data-theme="vitrine"]) .bg-deep .cta-row > a:not([class*="bg-"]),
[data-theme]:not([data-theme="vitrine"]) [class*="bg-deep"] .cta-row > a:not([class*="bg-"]) {
  color: var(--mist-50) !important;
  border-color: color-mix(in srgb, var(--mist-50) 45%, transparent) !important;
}

[data-theme]:not([data-theme="vitrine"]) .bg-deep .cta-row > a:not([class*="bg-"]):hover,
[data-theme]:not([data-theme="vitrine"]) [class*="bg-deep"] .cta-row > a:not([class*="bg-"]):hover {
  background: color-mix(in srgb, var(--mist-50) 12%, transparent) !important;
  color: var(--mist-50) !important;
  border-color: color-mix(in srgb, var(--mist-50) 70%, transparent) !important;
}

[data-theme]:not([data-theme="vitrine"]) .cta-row > a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Personalidades leves por protocolo */
[data-theme="facial"] .cta-row > a[class*="bg-"] {
  letter-spacing: 0.06em;
  box-shadow:
    0 10px 28px color-mix(in srgb, var(--rose-700) 22%, transparent);
}

[data-theme="corporal"] .cta-row > a[class*="bg-"] {
  letter-spacing: 0.035em;
}

[data-theme="capilar"] .cta-row > a[class*="bg-"] {
  letter-spacing: 0.05em;
  border-radius: 999px;
  box-shadow:
    0 6px 20px color-mix(in srgb, var(--mauve-900) 22%, transparent);
}

[data-theme="desinflamacao"] .cta-row > a[class*="bg-"] {
  letter-spacing: 0.04em;
}

[data-theme="curriculo"] .cta-row > a[class*="bg-"] {
  letter-spacing: 0.05em;
}

@media (max-width: 480px) {
  [data-theme]:not([data-theme="vitrine"]) .cta-row > a {
    width: 100%;
    max-width: 22rem;
    padding-inline: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-theme]:not([data-theme="vitrine"]) .cta-row > a {
    transition: none;
  }
  [data-theme]:not([data-theme="vitrine"]) .cta-row > a:hover {
    transform: none;
  }
}

