/*
Theme Name: Edmundo — Astra Child
Theme URI: https://edmundo.pro/
Description: Child theme editorial para edmundo.pro. Requiere Astra.
Author: Edmundo Pérez
Template: astra
Version: 1.4.0
Text Domain: edmundo-astra-child
Requires at least: 6.5
Requires PHP: 7.4
*/

@font-face {
  font-family: "Gonzaga";
  src: url("assets/fonts/GonzagaVariable-Roman.ttf") format("truetype-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Gonzaga";
  src: url("assets/fonts/GonzagaVariable-Italic.ttf") format("truetype-variations");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Gonzaga Medium";
  src: url("assets/fonts/Gonzaga-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Commit Mono";
  src: url("assets/fonts/CommitMono-VF.ttf") format("truetype-variations");
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --ed-bg: oklch(1 0 0);
  --ed-surface: oklch(0.967 0.011 308.3);
  --ed-ink: oklch(0.16 0.018 295);
  --ed-muted: oklch(0.43 0.03 295);
  --ed-primary: oklch(0.395 0.154 288.4);
  --ed-accent: oklch(0.791 0.162 90.6);
  --ed-rule: color-mix(in oklch, var(--ed-ink) 25%, transparent);
  --ed-display: "Gonzaga Medium", "Gonzaga", Georgia, serif;
  --ed-body: "Commit Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ed-max: 94rem;
  --ed-reading: 70rem;
  --ed-ease: cubic-bezier(.16, 1, .3, 1);
  --ast-global-color-0: var(--ed-primary);
  --ast-global-color-1: oklch(0.32 0.13 288.4);
  --ast-global-color-2: var(--ed-ink);
  --ast-global-color-3: var(--ed-muted);
  --ast-global-color-4: var(--ed-bg);
  --ast-global-color-5: var(--ed-surface);
  --wp--preset--color--ast-global-color-0: var(--ed-primary);
  --wp--preset--color--ast-global-color-1: oklch(0.32 0.13 288.4);
}

html { scroll-behavior: smooth; }

body,
.ast-separate-container,
.ast-separate-container .ast-article-post,
.ast-separate-container .ast-article-single {
  background: var(--ed-bg);
  color: var(--ed-ink);
}

body {
  font-family: var(--ed-body);
  font-size: clamp(1rem, .96rem + .18vw, 1.125rem);
  line-height: 1.72;
  transition: background-color .75s var(--ed-ease), color .35s ease;
}

.site-content > .ast-container,
.ast-container {
  width: min(calc(100% - 2rem), var(--ed-max));
  max-width: var(--ed-max);
  padding-inline: 0;
}

.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post {
  padding-inline: clamp(1rem, 4vw, 4rem);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle at 78% 8%, color-mix(in oklch, var(--ed-primary) 10%, transparent), transparent 32rem);
}

::selection { background: color-mix(in oklch, var(--ed-primary) 28%, white); color: var(--ed-ink); }

h1, h2, h3, h4, h5, h6,
.entry-title,
.site-title {
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-style: normal;
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: .98;
  text-wrap: balance;
}

h1, .entry-title { font-size: clamp(3.2rem, 8vw, 6rem); }
h2 { font-size: clamp(2.25rem, 5vw, 4.6rem); }
h3 { font-size: clamp(1.65rem, 3vw, 2.8rem); line-height: 1.05; }
h4 { font-size: clamp(1.3rem, 2vw, 1.85rem); line-height: 1.1; }

p, li { text-wrap: pretty; }

a { color: var(--ed-primary); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--ed-primary);
  outline-offset: 4px;
}

.site-header,
.ast-primary-header-bar {
  background: color-mix(in oklch, var(--ed-bg) 92%, transparent);
  border-bottom: 1px solid var(--ed-rule);
  backdrop-filter: blur(10px);
}

.site-header { position: relative; z-index: 50; }
.ast-desktop .ast-primary-header-bar {
  min-height: 5.5rem;
  border-bottom: 2px solid var(--ed-ink);
}
.site-primary-header-wrap.ast-container { max-width: var(--ed-max); }
.ast-builder-grid-row-has-sides { grid-template-columns: minmax(12rem, .7fr) minmax(0, 1.3fr); }
.site-header-primary-section-right { gap: clamp(1rem, 3vw, 3rem); }
.site-title a {
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: clamp(1.8rem, 2.5vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -.025em;
  text-decoration: none;
}
.main-header-menu > .menu-item > .menu-link,
.ast-header-break-point .main-header-menu .menu-link {
  color: var(--ed-ink);
  font-family: var(--ed-body);
  font-size: .94rem;
  font-weight: 520;
}

.main-header-menu { gap: clamp(.2rem, 1.5vw, 1rem); }
.main-header-menu > .menu-item:last-child > .menu-link {
  min-height: 2.65rem;
  margin-left: clamp(.5rem, 2vw, 1.5rem);
  padding: .5rem .9rem;
  border: 2px solid var(--ed-ink);
  background: var(--ed-primary);
  color: white;
  box-shadow: 3px 3px 0 var(--ed-ink);
  font-family: var(--ed-display);
  font-size: 1rem;
  transition: transform .22s var(--ed-ease), box-shadow .22s var(--ed-ease), background-color .22s ease;
}
.main-header-menu > .menu-item:last-child > .menu-link::after { content: "↗"; position: static; width: auto; height: auto; margin-left: .65rem; background: none; transform: none; font-family: var(--ed-body); }
.main-header-menu > .menu-item:last-child > .menu-link:hover,
.main-header-menu > .current-menu-item:last-child > .menu-link {
  background: var(--ed-primary);
  color: white;
  box-shadow: 1px 1px 0 var(--ed-ink);
  transform: translate(3px, 3px);
}

.main-header-menu > .menu-item > .menu-link::after {
  content: "";
  position: absolute;
  left: 1em;
  right: 1em;
  top: .7em;
  height: .18em;
  background: var(--ed-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ed-ease);
}

.main-header-menu > .menu-item:hover > .menu-link::after,
.main-header-menu > .current-menu-item > .menu-link::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Botón con borde negro, sombra dura y desplazamiento, inspirado en salonsoweb.es. */
body .ed-button,
body .wp-block-button .wp-block-button__link,
body .ast-button,
body .button,
body button:not(.menu-toggle):not([class*="cookie"]),
body input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8em;
  min-height: 3.25rem;
  padding: .8rem 1.25rem;
  border: 2px solid var(--ed-ink) !important;
  border-radius: 0 !important;
  background: var(--ed-primary) !important;
  color: white !important;
  box-shadow: 4px 4px 0 var(--ed-ink) !important;
  font-family: var(--ed-display);
  font-size: clamp(1.15rem, 1rem + .4vw, 1.45rem);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: transform .22s var(--ed-ease), box-shadow .22s var(--ed-ease), background-color .22s ease;
}

body .ed-button::after,
body .wp-block-button .wp-block-button__link::after { content: "→"; font-family: var(--ed-body); }
body .ed-button:hover,
body .wp-block-button .wp-block-button__link:hover,
body .ast-button:hover,
body .button:hover,
body button:not(.menu-toggle):not([class*="cookie"]):hover,
body input[type="submit"]:hover {
  background: oklch(0.32 0.13 288.4) !important;
  color: white !important;
  box-shadow: 1px 1px 0 var(--ed-ink) !important;
  transform: translate(3px, 3px);
}

@keyframes ed-link-wiggle {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-2px) rotate(-.7deg); }
  50% { transform: translateX(2px) rotate(.7deg); }
  75% { transform: translateX(-1px) rotate(-.35deg); }
}

.entry-content a:not(.wp-block-button__link),
.ed-single__content a:not(.wp-block-button__link),
.comment-content a {
  color: var(--ed-primary);
  font-weight: 600;
  text-decoration-thickness: .1em;
  text-decoration-color: color-mix(in oklch, var(--ed-primary) 55%, transparent);
  transition: text-decoration-color .2s ease;
}

.entry-content a:not(.wp-block-button__link):hover,
.entry-content a:not(.wp-block-button__link):focus-visible,
.ed-single__content a:not(.wp-block-button__link):hover,
.ed-single__content a:not(.wp-block-button__link):focus-visible,
.comment-content a:hover,
.comment-content a:focus-visible {
  display: inline-block;
  text-decoration-color: currentColor;
  animation: ed-link-wiggle .38s var(--ed-ease) 1;
}

/* Clase utilitaria para el efecto solicitado. Añadir “ed-overline” en Avanzado > Clase CSS. */
.ed-overline {
  position: relative;
  display: inline;
  z-index: 0;
}

.ed-overline::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: .08em;
  left: -.04em;
  width: calc(100% + .08em);
  height: .17em;
  background: var(--ed-primary);
  transform: scaleX(.22);
  transform-origin: left;
  transition: transform .5s var(--ed-ease);
}

.ed-overline:hover::before,
a:hover .ed-overline::before { transform: scaleX(1); }

.ed-highlight {
  padding: 0 .08em;
  background: linear-gradient(transparent 52%, color-mix(in oklch, var(--ed-primary) 55%, white) 52%, color-mix(in oklch, var(--ed-primary) 55%, white) 88%, transparent 88%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.ed-shell { width: min(calc(100% - 2rem), var(--ed-max)); margin-inline: auto; }
.ed-archive { padding-block: clamp(3.5rem, 8vw, 8rem); }
.ed-archive__header { margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.ed-archive__title { margin: 0; }
.ed-archive__description { max-width: 62ch; margin-top: 1.4rem; color: var(--ed-muted); }

.ed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.ed-filter {
  display: inline-flex;
  padding: .48rem .85rem;
  border: 1px solid var(--ed-rule);
  border-radius: 999px;
  background: color-mix(in oklch, var(--ed-bg) 78%, white);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.ed-filter:hover, .ed-filter[aria-current="page"] { background: var(--ed-ink); color: var(--ed-bg); transform: translateY(-2px); }

.ed-posts { border-top: 1px solid var(--ed-rule); }
.ed-post {
  position: relative;
  display: grid;
  grid-template-columns: minmax(16rem, 38%) 1fr;
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(1.5rem, 4vw, 3.25rem);
  border-bottom: 1px solid var(--ed-rule);
}

.ed-post::before, .ed-post::after {
  content: "+";
  position: absolute;
  left: -.18em;
  font: 600 1.7rem/1 var(--ed-body);
}
.ed-post::before { top: -.55em; }
.ed-post::after { bottom: -.55em; }
.ed-post__media { overflow: hidden; aspect-ratio: 16 / 10; background: var(--ed-surface); }
.ed-post__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ed-ease); }
.ed-post:hover .ed-post__media img { transform: scale(1.035); }
.ed-post__title { margin: 0 0 1.2rem; font-size: clamp(2rem, 4.5vw, 4.4rem); }
.ed-post__title a { text-decoration: none; }
.ed-post__title a,
.ed-single__title a { color: var(--ed-ink); }
.ed-post__meta a,
.ed-single__meta a,
.entry-meta a,
.posted-on a,
.cat-links a,
.tags-links a,
.comments-link a,
.ast-breadcrumbs a {
  color: var(--ed-primary) !important;
  text-decoration-color: color-mix(in oklch, var(--ed-primary) 55%, transparent);
}
.ed-post__meta { display: flex; flex-wrap: wrap; gap: .55rem 1.2rem; color: var(--ed-muted); font-size: .8rem; font-weight: 600; }
.ed-post__excerpt { max-width: 58ch; margin-top: 1rem; }

.ed-single { padding-block: clamp(3rem, 8vw, 8rem); }
.ed-single__header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 38%); gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.ed-single__header--text { display: block; max-width: 90rem; }
.ed-single__title { margin: 0; }
.ed-single__meta { margin-top: 1.25rem; color: var(--ed-muted); font-size: .82rem; }
.ed-single__image { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.ed-single__body {
  display: grid;
  grid-template-columns: minmax(14rem, 17rem) minmax(0, var(--ed-reading));
  gap: clamp(2rem, 4vw, 4.5rem);
  align-items: start;
  justify-content: center;
  width: 100%;
  margin: clamp(3rem, 8vw, 7rem) auto 0;
}
.ed-single__content { width: 100%; margin: 0; }
.ed-single__content > p,
.ed-single__content > ul,
.ed-single__content > ol,
.ed-single__content > blockquote { max-width: none; }
.ed-single__content > * + * { margin-block-start: 1.45em; }
.ed-single__content > h2, .ed-single__content > h3 { margin-block-start: 1.4em; }
.ed-single__content > h2[id], .ed-single__content > h3[id] { scroll-margin-top: 7rem; }
.ed-single__content blockquote { margin-inline: 0; padding: 1.2rem 0; border-block: 1px solid var(--ed-rule); font-family: var(--ed-display); font-size: 1.45em; line-height: 1.25; }
.ed-single__content img { margin-inline: max(-8vw, -7rem); width: calc(100% + min(16vw, 14rem)); max-width: none; }

.ed-toc {
  position: sticky;
  top: 2rem;
  border: 2px solid var(--ed-ink);
  background: var(--ed-primary);
  color: white;
  box-shadow: 4px 4px 0 var(--ed-ink);
}
.ed-toc[hidden] { display: none; }
.ed-toc__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid color-mix(in oklch, white 32%, transparent);
}
.ed-toc__title { font-size: .76rem; font-weight: 700; }
body .ed-toc__toggle {
  min-height: 0;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: white !important;
  box-shadow: none !important;
  font: 700 1rem/1 var(--ed-body);
  transform: none !important;
}
.ed-toc__toggle::after { content: "−"; }
.ed-toc.is-collapsed .ed-toc__toggle::after { content: "+"; }
.ed-toc__nav { padding: .75rem 1rem 1rem; }
.ed-toc.is-collapsed .ed-toc__nav { display: none; }
.ed-toc__list { counter-reset: toc; display: grid; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.ed-toc__item { counter-increment: toc; }
.ed-toc__item a {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: .35rem;
  padding: .45rem 0;
  color: color-mix(in oklch, white 78%, transparent);
  font-size: .76rem;
  font-weight: 540;
  line-height: 1.35;
  text-decoration: none;
}
.ed-toc__item a::before { content: counter(toc, decimal-leading-zero) "."; color: var(--ed-accent); }
.ed-toc__item--h3 a { padding-left: .8rem; font-size: .7rem; }
.ed-toc__item a:hover, .ed-toc__item a.is-active { color: white; }
.ed-toc__item a.is-active { text-decoration: underline; text-decoration-color: var(--ed-accent); text-decoration-thickness: .15em; text-underline-offset: .28em; }
.ed-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: min(100%, var(--ed-reading)); margin: 5rem auto 0; padding-top: 2rem; border-top: 1px solid var(--ed-rule); }
.ed-post-nav a { font-family: var(--ed-display); font-size: 1.4rem; text-decoration: none; }
.ed-post-nav .nav-next { text-align: right; }

.ed-comments {
  width: min(100%, var(--ed-reading));
  margin: clamp(4rem, 9vw, 8rem) auto 0;
  padding-top: clamp(2rem, 5vw, 4rem);
  border-top: 2px solid var(--ed-ink);
}

.ed-comments .comments-title,
.ed-comments .comment-reply-title {
  margin-bottom: 1.5rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.ed-comments .comment-list { margin: 0; padding: 0; list-style: none; }
.ed-comments .comment { padding-block: 1.5rem; border-bottom: 1px solid var(--ed-rule); }
.ed-comments .children { margin-left: clamp(1rem, 4vw, 3rem); list-style: none; }
.ed-comments .comment-meta { margin-bottom: .8rem; font-size: .78rem; color: var(--ed-muted); }
.ed-comments .avatar { width: 2.5rem; height: 2.5rem; margin-right: .75rem; border-radius: 50%; vertical-align: middle; }
.ed-comments .comment-form { display: grid; gap: 1rem; }
.ed-comments .comment-form > p { margin: 0; }
.ed-comments label { display: block; margin-bottom: .35rem; font-size: .82rem; font-weight: 650; }
.ed-comments input:not([type="submit"]),
.ed-comments textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--ed-ink);
  border-radius: 0;
  background: color-mix(in oklch, var(--ed-bg) 92%, white);
  color: var(--ed-ink);
  font: inherit;
}
.ed-comments textarea { min-height: 10rem; resize: vertical; }
.ed-comments .comment-notes, .ed-comments .logged-in-as { color: var(--ed-muted); font-size: .84rem; }

.ed-pagination { margin-top: 3rem; font-size: .9rem; }
.ed-pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.ed-pagination .page-numbers { padding: .55rem .8rem; border: 1px solid var(--ed-rule); text-decoration: none; }
.ed-pagination .current { background: var(--ed-ink); color: var(--ed-bg); }

.ed-footer-lead {
  background: var(--ed-ink);
  color: var(--ed-bg);
  border-top: 2px solid var(--ed-ink);
}
.ed-footer-lead__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 25%) minmax(13rem, 22%);
  gap: 2rem;
  align-items: end;
  padding-block: clamp(3rem, 6vw, 5rem);
}
.ed-footer-lead__brand {
  margin: 0;
  color: inherit;
  font-family: var(--ed-display);
  font-size: clamp(3.8rem, 8vw, 6.5rem);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: .84;
}
.ed-footer-lead__aside { display: grid; gap: 1.4rem; justify-items: start; }
.ed-footer-lead__aside p { max-width: 34ch; margin: 0; color: color-mix(in oklch, var(--ed-bg) 78%, transparent); }
.ed-footer-lead__top {
  color: inherit;
  font-size: .84rem;
  font-weight: 650;
  text-decoration: none;
}
.ed-footer-lead__top::after { content: " ↑"; color: var(--ed-accent); }
.ed-footer-legal { align-self: end; }
.ed-footer-legal__label { display: block; margin-bottom: .85rem; color: color-mix(in oklch, var(--ed-bg) 58%, transparent); font-size: .72rem; font-weight: 650; }
.ed-footer-legal .menu { display: flex; flex-wrap: wrap; gap: .55rem 1.1rem; margin: 0; padding: 0; list-style: none; }
.ed-footer-legal a { color: var(--ed-bg); font-size: .78rem; text-underline-offset: .28em; }
.ed-footer-legal:empty { min-height: 3rem; }
.site-footer, .site-primary-footer-wrap, .site-below-footer-wrap {
  background: var(--ed-ink) !important;
  color: var(--ed-bg);
}
.site-below-footer-wrap { border-top: 1px solid color-mix(in oklch, var(--ed-bg) 25%, transparent) !important; }
.site-below-footer-inner-wrap { min-height: 5rem; }
.ast-footer-copyright { width: 100%; }
.ast-footer-copyright p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; width: 100%; margin: 0; color: color-mix(in oklch, var(--ed-bg) 74%, transparent); font-size: .78rem; }
.site-footer a, .site-footer h2, .site-footer h3 { color: inherit; }
.site-footer a { text-decoration-color: var(--ed-accent); text-underline-offset: .3em; }

@media (max-width: 760px) {
  .ed-post, .ed-single__header { grid-template-columns: 1fr; }
  .ed-post__media { aspect-ratio: 3 / 2; }
  .ed-single__image { aspect-ratio: 16 / 10; }
  .ed-single__content img { width: 100%; max-width: 100%; margin-inline: 0; }
  .ed-post-nav { grid-template-columns: 1fr; }
  .ed-post-nav .nav-next { text-align: left; }
  .ed-footer-lead__inner { grid-template-columns: 1fr; }
  .ed-footer-lead__brand { line-height: .82; }
  .ast-header-break-point .ast-primary-header-bar { min-height: 4.6rem; border-bottom: 2px solid var(--ed-ink); }
  .ast-header-break-point .main-header-menu { gap: 0; padding: 1rem; background: var(--ed-primary); }
  .ast-header-break-point .main-header-menu .menu-link { padding: 1rem; color: white; border-bottom: 1px solid color-mix(in oklch, white 30%, transparent); font-family: var(--ed-display); font-size: 1.8rem; line-height: 1; }
  .ast-header-break-point .main-header-menu > .menu-item:last-child > .menu-link { margin: 1rem 0 0; background: white; color: var(--ed-ink); box-shadow: 4px 4px 0 var(--ed-ink); }
}

@media (max-width: 1180px) {
  .ed-single__body { grid-template-columns: minmax(0, var(--ed-reading)); }
  .ed-toc { position: relative; top: auto; width: min(100%, 42rem); }
  .ed-toc.is-collapsed .ed-toc__nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
