/**
 * Sistema visual global de Adelaida Montenegro.
 * Cargado después de Astra y compartido por frontend + editor.
 */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-var.woff2") format("woff2");
}

:root {
  --am-terracotta: #c85223;
  --am-action: #b9471d;
  --am-action-hover: #963715;
  --am-neutral: #f2f1ef;
  --am-charcoal: #1a1a1a;
  --am-muted: #666666;
  --am-white: #ffffff;
  --am-border: #dedbd7;
  --am-shadow: 0 16px 40px rgb(26 26 26 / 10%);
  --am-radius: 16px;
  --am-content: 760px;
  --am-wide: 1200px;
  --am-gutter: clamp(1rem, 4vw, 2rem);

  /* Sincroniza los componentes heredados de Astra con la marca. */
  --ast-global-color-0: var(--am-terracotta);
  --ast-global-color-1: var(--am-action);
  --ast-global-color-2: var(--am-charcoal);
  --ast-global-color-3: var(--am-muted);
  --ast-global-color-4: var(--am-neutral);
  --ast-global-color-5: var(--am-white);
  --ast-border-color: var(--am-border);
}

html {
  scroll-padding-top: 2rem;
}

body,
button,
input,
select,
textarea {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:is(body.adelaida-theme, .editor-styles-wrapper) {
  background: var(--am-neutral);
  color: var(--am-charcoal);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

:is(body.adelaida-theme, .editor-styles-wrapper) *,
:is(body.adelaida-theme, .editor-styles-wrapper) *::before,
:is(body.adelaida-theme, .editor-styles-wrapper) *::after {
  box-sizing: border-box;
}

:is(.adelaida-theme, .editor-styles-wrapper) :where(h1, h2, h3, h4, h5, h6) {
  color: var(--am-charcoal);
  font-family: inherit;
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

:is(.adelaida-theme, .editor-styles-wrapper) :where(p, li) {
  text-wrap: pretty;
}

:is(.adelaida-theme, .editor-styles-wrapper) img {
  height: auto;
  max-width: 100%;
}

:is(.adelaida-theme, .editor-styles-wrapper) a {
  color: var(--am-action);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

:is(.adelaida-theme, .editor-styles-wrapper) :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--am-charcoal);
  outline-offset: 3px;
}

:is(.adelaida-theme, .editor-styles-wrapper) :where(
  .wp-block-button__link,
  .wp-element-button,
  .ast-button,
  .button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"]
) {
  align-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.07em;
  line-height: 1.25;
  min-height: 48px;
  padding: 0.9rem 1.5rem;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 160ms ease, transform 160ms ease;
}

/* Los colores corporativos son el valor inicial, pero Gutenberg puede sustituirlos. */
:is(.adelaida-theme, .editor-styles-wrapper) :where(
  .wp-block-button__link:not(.has-background),
  .wp-element-button:not(.has-background),
  .ast-button,
  .button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"]
) {
  background: var(--am-action);
}

:is(.adelaida-theme, .editor-styles-wrapper) :where(
  .wp-block-button__link:not(.has-text-color),
  .wp-element-button:not(.has-text-color),
  .ast-button,
  .button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"]
) {
  color: var(--am-white);
}

:is(.adelaida-theme, .editor-styles-wrapper) :where(
  .wp-block-button__link,
  .wp-element-button,
  .ast-button,
  .button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"]
):hover {
  transform: translateY(-1px);
}

:is(.adelaida-theme, .editor-styles-wrapper) :where(
  .wp-block-button__link:not(.has-background),
  .wp-element-button:not(.has-background),
  .ast-button,
  .button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"]
):hover {
  background: var(--am-action-hover);
  color: var(--am-white);
}

/* Los botones de contenido heredan la marca sin alterar controles de navegación de Astra. */
.adelaida-theme .site-content button {
  align-items: center;
  background: var(--am-action);
  border: 0;
  border-radius: 999px;
  color: var(--am-white);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.07em;
  line-height: 1.25;
  min-height: 48px;
  padding: 0.9rem 1.5rem;
  text-align: center;
  text-transform: uppercase;
  transition: background-color 160ms ease, transform 160ms ease;
}

.adelaida-theme .site-content button:hover {
  background: var(--am-action-hover);
  color: var(--am-white);
  transform: translateY(-1px);
}

:is(.adelaida-theme, .editor-styles-wrapper) :where(
  input:not([type]),
  input[type="date"],
  input[type="datetime-local"],
  input[type="email"],
  input[type="month"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="text"],
  input[type="time"],
  input[type="url"],
  input[type="week"],
  select,
  textarea
) {
  background: var(--am-white);
  border: 1px solid var(--am-border);
  border-radius: 8px;
  color: var(--am-charcoal);
  min-height: 48px;
  padding: 0.75rem 0.9rem;
}

:is(.adelaida-theme, .editor-styles-wrapper) ::selection {
  background: var(--am-action);
  color: var(--am-white);
}

:is(.adelaida-theme, .editor-styles-wrapper) .site-header {
  background: var(--am-white);
  border-bottom: 1px solid var(--am-border);
}

:is(.adelaida-theme, .editor-styles-wrapper) .main-header-menu > .menu-item > .menu-link,
:is(.adelaida-theme, .editor-styles-wrapper) .site-title a {
  color: var(--am-charcoal);
  font-weight: 650;
  text-decoration: none;
}

:is(.adelaida-theme, .editor-styles-wrapper) .main-header-menu > .menu-item > .menu-link:hover,
:is(.adelaida-theme, .editor-styles-wrapper) .main-header-menu > .current-menu-item > .menu-link {
  color: var(--am-action);
}

:is(.adelaida-theme, .editor-styles-wrapper) .site-footer {
  background: var(--am-charcoal);
  color: var(--am-white);
}

:is(.adelaida-theme, .editor-styles-wrapper) .site-footer :where(p, a, .widget-title) {
  color: var(--am-white);
}

:is(.adelaida-theme, .editor-styles-wrapper) .site-footer a:focus-visible {
  outline-color: var(--am-white);
}

:is(.adelaida-theme, .editor-styles-wrapper) .is-style-adelaida-card {
  background: var(--am-white);
  border: 1px solid rgb(26 26 26 / 6%);
  border-radius: var(--am-radius);
  box-shadow: var(--am-shadow);
  overflow: hidden;
}

:is(.adelaida-theme, .editor-styles-wrapper) .is-style-adelaida-rounded img {
  border-radius: var(--am-radius);
}

:is(.adelaida-theme, .editor-styles-wrapper) .wp-block-separator {
  border-color: var(--am-border);
}

:is(.adelaida-theme, .editor-styles-wrapper) .am-kicker {
  color: var(--am-action);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

/* La portada necesita llegar de borde a borde dentro del contenedor de Astra. */
.adelaida-front-page .site-content > .ast-container,
.adelaida-front-page #primary,
.adelaida-front-page .site-main,
.adelaida-front-page article.ast-article-single,
.adelaida-front-page .entry-content {
  margin: 0;
  max-width: none;
  padding: 0;
  width: 100%;
}

.adelaida-front-page article.ast-article-single {
  background: transparent;
}

.adelaida-front-page .site-content > .ast-container {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  :is(.adelaida-theme, .editor-styles-wrapper) *,
  :is(.adelaida-theme, .editor-styles-wrapper) *::before,
  :is(.adelaida-theme, .editor-styles-wrapper) *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
