:root {
  --html-text-max-width: 1219px;
  --html-text-content-width: 1060px;
  --html-text-offset-left: 132px;
}

/* ==========================================================================
   HTML TEXT BLOCK
   ========================================================================== */

.html-text-block {
  font-family: var(--body-400-font-family-400, var(--nexo-font-family));
  color: var(--txt-primary, #001339);
  font-weight: 400;
  line-height: var(--body-400-line-height-400, 24px);
  max-width: var(--html-text-content-width);
  margin-left: var(--html-text-offset-left);
  margin-right: auto;
  margin-top: 70px;
  margin-bottom: 96px;
  text-wrap: initial;
}

/* Alineaciones opcionales del componente */
.html-text-block.html-text-block--left {
  margin-left: var(--html-text-offset-left);
  margin-right: auto;
}

.html-text-block.html-text-block--center {
  margin-left: auto;
  margin-right: auto;
}

.html-text-block.html-text-block--right {
  margin-left: auto;
  margin-right: var(--html-text-offset-left);
}

/* ==========================================================================
   TÍTULOS
   ========================================================================== */

.html-text-block h1 {
  color: var(--txt-primary, #001339);
  font-family: var(--title-600-font-family-600, var(--nexo-font-family));
  font-weight: var(--font-weight-normal, 400);
  --min: 40;
  --max: 60;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.15;
}

.html-text-block h2 {
  color: var(--txt-primary, #001339);
  font-family: var(--title-500-font-family-500, var(--nexo-font-family));
  font-weight: var(--font-weight-normal, 400);
  --min: 30;
  --max: 40;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.25;
}

.html-text-block h3 {
  color: var(--txt-primary, #001339);
  font-family: var(--title-400-font-family-400, var(--nexo-font-family));
  font-weight: var(--font-weight-normal, 400);
  --min: 24;
  --max: 32;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.html-text-block h4 {
  color: var(--color-primary, #001339);
  font-family: var(--title-300-font-family-300, var(--nexo-font-family));
  font-weight: var(--font-weight-normal, 400);
  --min: 20;
  --max: 26;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.html-text-block h5 {
  color: var(--txt-primary, #001339);
  font-family: var(--body-500-font-family-500, var(--nexo-font-family));
  font-weight: var(--font-weight-normal, 400);
  --min: 18;
  --max: 22;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.html-text-block h6 {
  color: var(--txt-primary, #001339);
  font-family: var(--body-400-font-family-400, var(--nexo-font-family));
  font-weight: var(--font-weight-normal, 400);
  --min: 16;
  --max: 20;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

/* ==========================================================================
   PÁRRAFOS
   ========================================================================== */

.html-text-block p {
  color: #3f3f3f;
  font-family: var(--body-400-font-family-400, var(--nexo-font-family));
  font-weight: 400;
  font-style: normal;
  font-size: var(--body-400-font-size-400, 28px);
  line-height: var(--body-400-line-height-400, 30px);
  letter-spacing: 0;
  margin-top: 0;
  margin-bottom: 18px;
  text-wrap: initial;
}

.html-text-block p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   ENLACES
   ========================================================================== */

.html-text-block a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.html-text-block a:hover {
  color: var(--color-primary, #001339);
}

.html-text-block a:visited {
  color: inherit;
}

/* ==========================================================================
   LISTAS
   ========================================================================== */

.html-text-block ul,
.html-text-block ol {
  margin-top: 0;
  margin-bottom: 1em;
  padding-left: 1.5em;
  color: #3f3f3f;
  font-family: var(--body-400-font-family-400, var(--nexo-font-family));
  font-weight: 400;
  font-size: var(--body-400-font-size-400, 18px);
  line-height: var(--body-400-line-height-400, 22px);
}

.html-text-block ul {
  list-style: disc;
}

.html-text-block ol {
  list-style: decimal;
}

.html-text-block li {
  margin-bottom: 0.4em;
  color: inherit;
  line-height: inherit;
}

.html-text-block li::marker {
  color: var(--txt-primary, #001339);
}

/* ==========================================================================
   TEXTO ENFATIZADO
   ========================================================================== */

.html-text-block strong,
.html-text-block b {
  font-weight: 700;
  color: inherit;
}

.html-text-block em,
.html-text-block i {
  font-style: italic;
  color: inherit;
}

/* ==========================================================================
   CITAS
   ========================================================================== */

.html-text-block blockquote {
  max-width: var(--html-text-max-width);
  position: relative;

  /* Más separación respecto al elemento superior */
  margin: 72px 0 48px;

  /* Menos separación lateral para que el texto monte algo más sobre la quote */
  padding-left: 64px;

  border: 0 !important;
  background: transparent !important;
}

.html-text-block blockquote :is(p) {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 1040px;

  color: #258747 !important;
  font-style: italic !important;
  font-weight: 400 !important;

  font-size: clamp(20px, 1.35vw, 24px) !important;
  line-height: 1.22 !important;
  letter-spacing: 0 !important;

  position: relative;
  z-index: 1;
}

/* Evita que el editor meta negritas o spans heredados */
.html-text-block blockquote :is(p) *,
.html-text-block blockquote :is(strong, b, span) {
  color: inherit !important;
  font-style: italic !important;
  font-weight: 400 !important;
  line-height: inherit !important;
}

.html-text-block blockquote::before {
  content: "";
  position: absolute;

  /* Quote algo más arriba, como en la referencia */
  top: -30px;
  left: -4px;

  width: 86px;
  height: 82px;

  background-color: #c7f6d8;
  mask-image: url("quotemark.svg");
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("quotemark.svg");
  -webkit-mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;

  opacity: 0.75;
  z-index: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .html-text-block blockquote {
    margin: 52px 0 36px;
    padding-left: 46px;
  }

  .html-text-block blockquote::before {
    top: -20px;
    left: -2px;
    width: 58px;
    height: 54px;
    opacity: 0.75;
  }

  .html-text-block blockquote :is(p) {
    font-size: clamp(18px, 5vw, 21px) !important;
    line-height: 1.28 !important;
  }
}
/* ==========================================================================
   CÓDIGO
   ========================================================================== */

.html-text-block code {
  background-color: var(--color-background-secondary, #f5f5f5);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: var(--font-family-mono, "Courier New", monospace);
  --min: 14;
  --max: 18;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
  color: var(--color-text-code, #d63384);
}

.html-text-block pre {
  background-color: var(--color-background-code, #f8f9fa);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1em 0;
  border: 1px solid var(--color-border-light, #e9ecef);
}

.html-text-block pre code {
  background: none;
  padding: 0;
  color: var(--color-text-default, #001339);
  --min: 14;
  --max: 16;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
}

/* ==========================================================================
   IMÁGENES
   ========================================================================== */

.html-text-block img {
  display: block;
  max-width: 100%;
  max-height: 460px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  height: auto;
  border-top-right-radius: 120px;
  border-bottom-left-radius: 120px;
  margin-block: 20px;
}

/* ==========================================================================
   TABLAS
   ========================================================================== */

.html-text-block table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  border: 1px solid var(--color-border-light, #e9ecef);
  border-radius: 0.5rem;
  overflow: hidden;
}

.html-text-block table tr:nth-child(even) {
  background-color: var(--color-background-secondary, #f8f9fa);
}

.html-text-block th,
.html-text-block td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light, #e9ecef);
  --min: 14;
  --max: 18;
  --mintrans: 1000;
  --maxtrans: 1920;
  font-size: clamp(
    calc(var(--min) * 1px),
    calc((var(--max) - var(--min)) * ((100vw - calc(var(--mintrans) * 1px)) / (var(--maxtrans) - var(--mintrans))) + calc(var(--min) * 1px)),
    calc(var(--max) * 1px)
  ) !important;
}

.html-text-block th {
  background-color: var(--color-background-secondary, #f8f9fa);
  font-weight: var(--font-weight-bold, 600);
  color: var(--color-text-default, #001339);
}

.html-text-block td {
  color: var(--txt-primary, #001339);
}

/* ==========================================================================
   LÍNEAS HORIZONTALES
   ========================================================================== */

.html-text-block hr {
  border: none;
  height: 1px;
  background-color: var(--color-border-light, #e9ecef);
  margin: 2em 0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
  :root {
    --html-text-offset-left: 80px;
    --html-text-content-width: calc(100% - 160px);
  }
}

@media (max-width: 992px) {
  :root {
    --html-text-offset-left: 48px;
    --html-text-content-width: calc(100% - 96px);
  }

  .html-text-block {
    margin-top: 56px;
    margin-bottom: 72px;
  }
}

@media (max-width: 768px) {
  :root {
    --html-text-offset-left: 0px;
    --html-text-content-width: 100%;
  }

  .html-text-block,
  .html-text-block.html-text-block--left,
  .html-text-block.html-text-block--center,
  .html-text-block.html-text-block--right {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 42px;
    margin-bottom: 56px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .html-text-block p {
    font-size: var(--body-400-font-size-400, 17px);
    line-height: var(--body-400-line-height-400, 22px);
    margin-bottom: 16px;
  }

  .html-text-block ul,
  .html-text-block ol {
    font-size: var(--body-400-font-size-400, 17px);
    line-height: var(--body-400-line-height-400, 22px);
  }

  .html-text-block img {
    border-radius: 0;
    border-top-right-radius: 70px;
    border-bottom-left-radius: 70px;
  }

  .html-text-block table {
    display: block;
    width: 100%;
    overflow-x: auto;
    font-size: 0.875rem;
  }

  .html-text-block th,
  .html-text-block td {
    padding: 0.5rem;
  }

  .html-text-block blockquote {
    padding-left: 40px;
  }

  .html-text-block blockquote::before {
    left: 0;
    width: 22px;
    height: 25px;
  }
}

@media (max-width: 480px) {
  .html-text-block,
  .html-text-block.html-text-block--left,
  .html-text-block.html-text-block--center,
  .html-text-block.html-text-block--right {
    margin-top: 36px;
    margin-bottom: 48px;
    padding-left: 20px;
    padding-right: 20px;
  }
}