/* Essencial Cloro — estilos dos blocos do builder (render público + editor).
   Herda os tokens do tema (app.css): --brand, --foreground, --muted, --gradient-brand, etc.
   Classes prefixadas .ec-* para não colidir com utilitários do Tailwind compilado. */

/* ---- Layout ---- */
.ec-contained {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: max(1rem, calc((100% - 80rem) / 2 + 1rem));
}
@media (min-width: 640px) { .ec-contained { padding-inline: max(1.5rem, calc((100% - 80rem) / 2 + 1.5rem)); } }
@media (min-width: 1024px) { .ec-contained { padding-inline: max(2rem, calc((100% - 80rem) / 2 + 2rem)); } }
.ec-fullwidth { width: 100%; }
.ec-section { position: relative; }

/* Suavização premium entre seções adjacentes (hairline central).
   Não aplica antes de seções escuras/marca (onde a linha clara some). */
.ec-section + .ec-section:not(.ec-sec-brand):not(.ec-sec-dark)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 3rem));
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in oklab, var(--brand) 22%, transparent) 24%,
    color-mix(in oklab, var(--brand) 22%, transparent) 76%,
    transparent
  );
}

/* Leve fade no topo de seções claras que seguem outra seção (continuidade). */
.ec-section + .ec-section.ec-sec-muted::after,
.ec-sec-muted + .ec-section:not(.ec-sec-brand):not(.ec-sec-dark)::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  pointer-events: none;
  background: linear-gradient(180deg, color-mix(in oklab, var(--brand) 5%, transparent), transparent);
}
.ec-pad-sm { padding-block: 2rem; }
.ec-pad-md { padding-block: 3.5rem; }
.ec-pad-lg { padding-block: 5rem; }
.ec-pad-xl { padding-block: 7rem; }
.page-builder main > .ec-section:first-child {
  scroll-margin-top: 6rem;
}
.page-builder main > .ec-section:first-child:not([class*="ec-pad-"]) {
  padding-top: clamp(7rem, 10vw, 8.5rem);
}
.page-builder main > .ec-section:first-child.ec-pad-sm {
  padding-top: clamp(7rem, 10vw, 8.5rem);
}
.page-builder main > .ec-section:first-child.ec-pad-md {
  padding-top: clamp(7.5rem, 10vw, 9rem);
}
.page-builder main > .ec-section:first-child.ec-pad-lg {
  padding-top: clamp(8rem, 10vw, 9.5rem);
}
.page-builder main > .ec-section:first-child.ec-pad-xl {
  padding-top: clamp(8.5rem, 10vw, 10rem);
}
@media (max-width: 640px) {
  .ec-pad-sm { padding-block: 1.5rem; }
  .ec-pad-md { padding-block: 2.25rem; }
  .ec-pad-lg { padding-block: 3rem; }
  .ec-pad-xl { padding-block: 4rem; }
  .page-builder main > .ec-section:first-child:not([class*="ec-pad-"]),
  .page-builder main > .ec-section:first-child.ec-pad-sm,
  .page-builder main > .ec-section:first-child.ec-pad-md,
  .page-builder main > .ec-section:first-child.ec-pad-lg,
  .page-builder main > .ec-section:first-child.ec-pad-xl {
    padding-top: 6.75rem;
  }
}
.ec-sec-muted { background: var(--muted); }
.ec-sec-brand { background: var(--gradient-brand); }
.ec-sec-dark { background: var(--brand-deep, #0b2530); }
.ec-sec-custom { background: #fff; }
.ec-sec-brand, .ec-sec-dark, .ec-sec-brand .ec-h, .ec-sec-dark .ec-h,
.ec-sec-brand .ec-card-title, .ec-sec-dark .ec-card-title { color: #fff; }
.ec-sec-brand .ec-prose, .ec-sec-dark .ec-prose { color: rgba(255, 255, 255, .85); }
.ec-sec-dark .ec-empty, .ec-sec-brand .ec-empty {
  color: rgba(255, 255, 255, .75);
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .06);
}

/* ---- Grid (12 colunas, responsivo via --col-d/t/m) ---- */
.ec-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.ec-gap-sm { gap: .75rem; }
.ec-gap-md { gap: 1.5rem; }
.ec-gap-lg { gap: 2.5rem; }
.ec-rowalign-start { align-items: start; }
.ec-rowalign-center { align-items: center; }
.ec-rowalign-stretch { align-items: stretch; }
.ec-col { grid-column: span var(--col-d, 12); min-width: 0; }
@media (max-width: 1024px) { .ec-col { grid-column: span var(--col-t, 12); } }
@media (max-width: 640px) { .ec-col { grid-column: span var(--col-m, 12); } }
.ec-colalign-left { text-align: left; }
.ec-colalign-center { text-align: center; }
.ec-colalign-right { text-align: right; }

.ec-row > .ec-empty,
.ec-row > .ec-empty-col { grid-column: 1 / -1; }
/* Conteúdo solto dentro de linha (erro comum no editor) ocupa largura total */
.ec-row > :not(.ec-col)[data-node-id] { grid-column: 1 / -1; }

/* ---- Tipografia ---- */
.ec-heading { margin: 0; }
.ec-heading + .ec-heading, .ec-text + .ec-heading { margin-top: 1rem; }
.ec-eyebrow {
  display: inline-block; font-family: var(--font-mono, monospace);
  text-transform: uppercase; letter-spacing: .08em; font-size: .78rem;
  color: var(--brand); margin-bottom: .5rem;
}
.ec-h { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; line-height: 1.1; color: var(--foreground); margin: 0; }
.ec-h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.ec-h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
.ec-h3 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }
.ec-h4 { font-size: 1.15rem; }
.ec-text-left { text-align: left; }
.ec-text-center { text-align: center; }
.ec-text-right { text-align: right; }

.ec-prose { color: var(--muted-foreground); line-height: 1.7; }
.ec-prose-lg { font-size: 1.125rem; }
.ec-prose p { margin: 0 0 1rem; }
.ec-prose p:last-child { margin-bottom: 0; }
.ec-prose a { color: var(--brand); text-decoration: underline; }
.ec-prose ul { margin: 0 0 1rem; padding-left: 1.25rem; list-style: disc; }
.ec-prose h2, .ec-prose h3 { font-family: "Bricolage Grotesque", system-ui, sans-serif; color: var(--foreground); margin: 1.5rem 0 .75rem; }

/* ---- Botões ---- */
.ec-button-wrap { display: flex; flex-wrap: wrap; gap: .75rem; }
.ec-colalign-center .ec-button-wrap, .ec-text-center .ec-button-wrap { justify-content: center; }
.ec-colalign-right .ec-button-wrap { justify-content: flex-end; }
.ec-btn {
  display: inline-flex; align-items: center; gap: .5rem; border-radius: .85rem;
  font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background-color .2s; white-space: nowrap;
}
.ec-btn-md { height: 2.75rem; padding-inline: 1.25rem; font-size: .95rem; }
.ec-btn-lg { height: 3.25rem; padding-inline: 1.75rem; font-size: 1.05rem; }
.ec-btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: var(--shadow-brand); }
.ec-btn-primary:hover { transform: translateY(-2px); }
.ec-btn-secondary { background: var(--card, #fff); color: var(--foreground); border-color: var(--border); }
.ec-btn-secondary:hover { background: var(--accent); }
.ec-btn-ghost { background: transparent; color: var(--foreground); }
.ec-btn-ghost:hover { background: var(--accent); }

/* ---- Imagem ---- */
.ec-image { margin: 0; overflow: hidden; }
.ec-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ec-ratio-auto img { height: auto; }
.ec-ratio-16-9 { aspect-ratio: 16 / 9; }
.ec-ratio-4-3 { aspect-ratio: 4 / 3; }
.ec-ratio-1-1 { aspect-ratio: 1 / 1; }
.ec-round-lg { border-radius: 1rem; }
.ec-round-none { border-radius: 0; }
.ec-round-full { border-radius: 9999px; }
.ec-image-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; min-height: 160px; background: var(--muted); color: var(--muted-foreground);
  border: 1px dashed var(--border); border-radius: 1rem; font-size: .9rem;
}

/* ---- Espaçador ---- */
.ec-spacer-sm { height: 1rem; }
.ec-spacer-md { height: 2.5rem; }
.ec-spacer-lg { height: 4rem; }
.ec-spacer-xl { height: 6rem; }

/* ---- Linha divisória ---- */
.ec-divider { height: 1px; margin-block: 1.5rem; background: var(--border); }
.ec-divider-soft { background: linear-gradient(90deg, transparent, var(--border), transparent); }
.ec-divider-accent { height: 2px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.ec-divider-short { max-width: 18rem; }
.ec-divider-center { max-width: 18rem; margin-inline: auto; }

/* ---- Card ---- */
.ec-card { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 1.25rem; padding: 1.75rem; height: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.ec-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: .85rem; background: var(--accent); color: var(--brand); margin-bottom: 1rem; }
.ec-card-title { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: 1.2rem; margin: 0 0 .5rem; color: var(--foreground); }
.ec-card-body { color: var(--muted-foreground); margin: 0; line-height: 1.6; }

/* ---- Depoimento, números, vídeo e galeria ---- */
.ec-testimonial {
  margin: 0;
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--card, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.ec-testimonial-avatar { width: 3.25rem; height: 3.25rem; border-radius: 999px; object-fit: cover; }
.ec-testimonial blockquote { margin: 0; color: var(--foreground); font-size: 1.1rem; line-height: 1.65; }
.ec-testimonial figcaption { display: grid; gap: .1rem; color: var(--muted-foreground); }
.ec-testimonial figcaption strong { color: var(--foreground); }

.ec-stats { display: grid; gap: 1.25rem; }
.ec-stats-title,
.ec-gallery-title { margin: 0; color: var(--foreground); font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.1; }
.ec-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.ec-stat {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card, #fff);
}
.ec-stat strong { display: block; color: var(--brand); font-size: 2rem; line-height: 1; }
.ec-stat span { display: block; margin-top: .55rem; color: var(--muted-foreground); line-height: 1.45; }

/* ===== Bloco: Hero com imagem (B) ===== */
.ec-heroimg {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  isolation: isolate;
}
.ec-heroimg--md { min-height: 22rem; }
.ec-heroimg--lg { min-height: 30rem; }
.ec-heroimg--xl { min-height: 38rem; }
.ec-heroimg-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.ec-heroimg-bg--empty { background: var(--gradient-brand, linear-gradient(135deg, #1f6b86, #0b2530)); }
.ec-heroimg-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, rgba(8, 24, 38, .82) 0%, rgba(8, 24, 38, .45) 55%, rgba(8, 24, 38, .25) 100%);
}
.ec-heroimg-inner {
  max-width: 38rem;
  padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem);
  color: #fff;
}
.ec-heroimg--center { justify-content: center; text-align: center; }
.ec-heroimg--center .ec-heroimg-inner { margin: 0 auto; }
.ec-heroimg-eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--aqua, #5edbd2);
  margin-bottom: .75rem;
}
.ec-heroimg-title { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.05; font-weight: 700; color: #fff; }
.ec-heroimg-sub { margin-top: 1rem; font-size: 1.05rem; line-height: 1.6; color: rgba(255, 255, 255, .88); }
.ec-heroimg-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.5rem;
  padding: .85rem 1.5rem;
  border-radius: .85rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-brand, linear-gradient(135deg, #1f6b86, #0b2530));
  box-shadow: var(--shadow-brand, 0 10px 30px -10px rgba(0, 0, 0, .4));
}

/* ---- Hero: imagem ao lado do texto (layout=side) ---- */
.ec-heroimg--side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  overflow: visible;
  align-items: center;
}
.ec-heroimg--side .ec-heroimg-text { padding: clamp(1rem, 3vw, 2rem) 0; }
.ec-heroimg--side.ec-heroimg--imgleft .ec-heroimg-text { order: 2; }
.ec-heroimg--side.ec-heroimg--imgleft .ec-heroimg-media { order: 1; }
/* No modo lado o fundo é claro: texto volta a ser escuro. */
.ec-heroimg--side .ec-heroimg-title { color: var(--foreground, #0b2530); }
.ec-heroimg--side .ec-heroimg-sub { color: var(--muted-foreground, #475569); }
.ec-heroimg--side .ec-heroimg-eyebrow { color: var(--brand, #1f6b86); }
.ec-heroimg--side .ec-heroimg-media {
  align-self: stretch;
  min-height: 18rem;
  display: flex;
}
.ec-heroimg--side .ec-heroimg-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.25rem;
}
.ec-heroimg--side .ec-heroimg-media--empty {
  width: 100%;
  border-radius: 1.25rem;
  background: var(--gradient-brand, linear-gradient(135deg, #1f6b86, #0b2530));
}
.ec-heroimg--side.ec-heroimg--center { text-align: left; }
@media (max-width: 768px) {
  .ec-heroimg--side { grid-template-columns: 1fr; }
  .ec-heroimg--side.ec-heroimg--imgleft .ec-heroimg-text,
  .ec-heroimg--side.ec-heroimg--imgleft .ec-heroimg-media { order: initial; }
}

/* ===== Bloco: Aplicações em chips (B) ===== */
.ec-appchips-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: 1.25rem; }
.ec-appchips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .85rem;
}
.ec-appchip {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .9rem 1.05rem;
  border-radius: .9rem;
  background: var(--card, #fff);
  border: 1px solid color-mix(in oklab, var(--brand) 12%, white);
  font-weight: 600;
  color: var(--foreground);
}
.ec-appchip-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .65rem;
  color: var(--brand-deep, #0b2530);
  background: color-mix(in oklab, var(--aqua) 22%, white);
}
.ec-sec-brand .ec-appchip, .ec-sec-dark .ec-appchip { color: var(--foreground); }

.ec-video { margin: 0; display: grid; gap: .65rem; }
.ec-video iframe,
.ec-video-empty {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 1.25rem;
  background: var(--brand-deep, #0b2530);
}
.ec-video-empty {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .8);
  font-weight: 700;
}
.ec-video figcaption { color: var(--muted-foreground); font-size: .92rem; }

.ec-gallery { display: grid; gap: 1rem; }
.ec-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}
.ec-gallery-2 .ec-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ec-gallery-4 .ec-gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ec-gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1rem;
  background: var(--muted);
}

@media (max-width: 760px) {
  .ec-stats-grid,
  .ec-gallery-grid,
  .ec-gallery-2 .ec-gallery-grid,
  .ec-gallery-4 .ec-gallery-grid { grid-template-columns: 1fr; }
}

/* ---- CTA ---- */
.ec-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; background: var(--gradient-brand); color: #fff; border-radius: 1.5rem; padding: 2.5rem; }
.ec-cta-title { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; color: #fff; }
.ec-cta-sub { margin: .5rem 0 0; color: rgba(255, 255, 255, .85); }
.ec-cta .ec-btn-primary { background: #fff; color: var(--brand); box-shadow: none; }

/* ---- FAQ ---- */
.ec-faq-title, .ec-bloglist-title, .ec-list-title { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1.5rem; color: var(--foreground); }
.ec-faq-list { display: flex; flex-direction: column; gap: .75rem; }
.ec-faq-item { border: 1px solid var(--border); border-radius: 1rem; background: var(--card, #fff); overflow: hidden; }
.ec-faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.4rem; cursor: pointer; font-weight: 600; color: var(--foreground); list-style: none; }
.ec-faq-item summary::-webkit-details-marker { display: none; }
.ec-faq-caret { transition: transform .2s; flex-shrink: 0; }
.ec-faq-item[open] .ec-faq-caret { transform: rotate(180deg); }
.ec-faq-item .ec-prose { padding: 0 1.4rem 1.2rem; }

/* ---- Lista do blog ---- */
.ec-bloglist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.ec-post-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 1.25rem; overflow: hidden; background: var(--card, #fff); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.ec-post-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .2); }
.ec-post-cover img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ec-post-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.ec-post-body h3 { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: 1.1rem; margin: 0; color: var(--foreground); }
.ec-post-body p { margin: 0; color: var(--muted-foreground); font-size: .95rem; line-height: 1.5; }
.ec-post-meta { font-family: var(--font-mono, monospace); font-size: .75rem; color: var(--brand); }

/* ---- Listas dinâmicas simples ---- */
.ec-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.ec-list-card {
  display: flex; flex-direction: column; gap: .6rem; min-height: 100%;
  border: 1px solid var(--border); border-radius: 1rem; padding: 1.25rem;
  background: var(--card, #fff); color: inherit; text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.ec-list-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -18px rgba(0, 0, 0, .35); }
.ec-list-card strong { font-family: "Bricolage Grotesque", system-ui, sans-serif; color: var(--foreground); font-size: 1.1rem; line-height: 1.2; }
.ec-list-card span { color: var(--muted-foreground); line-height: 1.45; }
.ec-list-kicker { font-family: var(--font-mono, monospace); font-size: .75rem; color: var(--brand) !important; text-transform: uppercase; }

/* ---- Placeholder (só no editor) ---- */
.ec-empty { padding: 1.5rem; text-align: center; color: var(--muted-foreground); border: 1px dashed var(--border); border-radius: .75rem; font-size: .9rem; }

/* ---- Barra flutuante de edição (página pública, só para editores) ---- */
.ec-editbar {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 1rem; padding: .6rem .6rem .6rem 1.1rem;
  background: var(--foreground); color: var(--background); border-radius: 9999px;
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, .45);
}
.ec-editbar-tag { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 500; }
.ec-editbar-btn {
  display: inline-flex; align-items: center; background: var(--gradient-brand); color: #fff;
  text-decoration: none; font-weight: 600; font-size: .85rem; padding: .5rem 1.1rem; border-radius: 9999px;
}
