/*
Theme Name: Agencia Advest
Theme URI: https://agenciaadvest.com
Author: Javier
Description: Tema de noticias de marketing con estilo neobrutalista: bordes gruesos, sombras duras y bloques de color. Pensado para jóvenes creadores y freelancers.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: advest
*/

:root {
  --bg: #FFF4E0;
  --ink: #111111;
  --white: #FFFFFF;
  --orange: #FF7A59;
  --lilac: #C9B6FF;
  --mint: #B8F2E6;
  --yellow: #FFD93D;
  --muted: #4a4a4a;
  --bw: 3px;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --font-display: "Archivo Black", "Arial Black", Arial, sans-serif;
  --font-body: "Space Grotesk", Arial, Helvetica, sans-serif;
  --wrap: 1180px;
  --read: 700px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 3px;
}
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; left: 12px; top: 12px; z-index: 999;
  background: var(--yellow); border: var(--bw) solid var(--ink); padding: 10px 16px; font-weight: 700;
}
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

/* ---------- Ticker ---------- */
.ticker {
  background: var(--ink); color: var(--yellow); overflow: hidden;
  border-bottom: var(--bw) solid var(--ink); font-size: 13px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.ticker__track {
  display: flex; width: max-content; gap: 0;
  animation: ticker 48s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { padding: 8px 28px; white-space: nowrap; text-decoration: none; }
.ticker__item::before { content: "★"; color: var(--orange); margin-right: 12px; }
.ticker__item:hover { color: var(--white); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Header ---------- */
.site-header { background: var(--bg); border-bottom: var(--bw) solid var(--ink); position: sticky; top: 0; z-index: 50; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; }
.logo { display: inline-flex; align-items: stretch; box-shadow: var(--shadow-sm); text-decoration: none; line-height: 1; }
.logo__main {
  background: var(--ink); color: var(--bg); font-family: var(--font-display);
  font-size: 26px; padding: 6px 14px; border: var(--bw) solid var(--ink); letter-spacing: .01em;
}
.logo__tag {
  background: var(--orange); border: var(--bw) solid var(--ink); border-left: 0;
  font-family: var(--font-display); font-size: 11px; padding: 0 10px; display: flex; align-items: center; color: var(--ink);
}
.custom-logo-link img { max-height: 54px; width: auto; }

.nav { display: flex; align-items: center; gap: 10px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 6px 12px; border: 2px solid var(--ink); background: var(--white);
  transition: transform .15s ease-out;
}
.nav li:nth-child(4n+1) a { background: var(--white); }
.nav li:nth-child(4n+2) a { background: var(--mint); }
.nav li:nth-child(4n+3) a { background: var(--yellow); }
.nav li:nth-child(4n+4) a { background: var(--lilac); }
.nav a:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.nav a:active { transform: translate(1px, 1px); box-shadow: none; }
.nav__cta { background: var(--orange) !important; }
.menu-toggle {
  display: none; font: inherit; font-weight: 700; background: var(--yellow);
  border: var(--bw) solid var(--ink); padding: 6px 14px; cursor: pointer; box-shadow: var(--shadow-sm);
}

/* ---------- Botones y chips ---------- */
.btn {
  display: inline-block; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--white); border: var(--bw) solid var(--ink); padding: 10px 18px;
  transition: transform .15s ease-out;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn--light { background: var(--white); color: var(--ink); }
.btn--orange { background: var(--orange); color: var(--ink); }
.chip {
  display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  border: 2px solid var(--ink); padding: 2px 10px; text-decoration: none; color: var(--ink); background: var(--white);
}
.c1 { background: var(--lilac); } .c2 { background: var(--mint); } .c3 { background: var(--yellow); } .c4 { background: var(--orange); }

/* ---------- Portada ---------- */
.home-hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; padding: 32px 0 12px; }
.hero-main {
  display: block; text-decoration: none; border: var(--bw) solid var(--ink); box-shadow: var(--shadow);
  padding: 28px; background: var(--lilac); transition: transform .15s ease-out;
}
.hero-main:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.hero-main__badge { display: inline-block; background: var(--yellow); border: 2px solid var(--ink); font-size: 12px; font-weight: 700; padding: 3px 10px; letter-spacing: .05em; }
.hero-main__title { font-family: var(--font-display); font-size: clamp(28px, 4.2vw, 46px); line-height: 1.05; margin: 16px 0 12px; }
.hero-main__excerpt { margin: 0 0 18px; max-width: 52ch; }
.hero-main__img { border: var(--bw) solid var(--ink); margin-bottom: 18px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.hero-side { display: flex; flex-direction: column; gap: 24px; }
.hero-side .card { flex: 1; }

.card {
  display: flex; flex-direction: column; text-decoration: none; background: var(--white);
  border: var(--bw) solid var(--ink); box-shadow: var(--shadow); transition: transform .15s ease-out;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.card__media { border-bottom: var(--bw) solid var(--ink); aspect-ratio: 16 / 10; overflow: hidden; background: var(--orange); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 64px; }
.card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__title { font-family: var(--font-display); font-size: 21px; line-height: 1.12; margin: 0; }
.card__meta { font-size: 13px; color: var(--muted); margin-top: auto; }
.card--flat .card__media { display: block; }
.card--flat { justify-content: center; }
.card--flat .card__title { font-size: 19px; }

.cat-strip { display: flex; flex-wrap: wrap; gap: 10px; padding: 26px 0 8px; align-items: center; }
.cat-strip__label { font-family: var(--font-display); font-size: 15px; margin-right: 6px; }
.cat-strip .chip { font-size: 13px; padding: 5px 14px; transition: transform .15s ease-out; }
.cat-strip .chip:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }

.section-title {
  font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); margin: 36px 0 20px;
  display: inline-block; background: var(--yellow); border: var(--bw) solid var(--ink); padding: 2px 12px; box-shadow: var(--shadow-sm);
}
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding-bottom: 24px; }

.newsletter {
  margin: 40px 0; background: var(--orange); border: var(--bw) solid var(--ink); box-shadow: var(--shadow);
  padding: 26px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center;
}
.newsletter h2 { font-family: var(--font-display); font-size: clamp(22px, 3vw, 30px); line-height: 1.1; margin: 0 0 6px; }
.newsletter p { margin: 0; }
.newsletter__form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter__form input[type="email"] {
  flex: 1 1 200px; font: inherit; padding: 10px 12px; border: var(--bw) solid var(--ink); background: var(--white);
}

/* ---------- Paginación ---------- */
.pagination { margin: 20px 0 40px; }
.pagination .nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-block; text-decoration: none; font-weight: 700; padding: 6px 14px;
  border: var(--bw) solid var(--ink); background: var(--white);
}
.pagination .page-numbers.current { background: var(--yellow); }
.pagination a.page-numbers:hover { background: var(--mint); }

/* ---------- Archivo / búsqueda ---------- */
.page-head { padding: 36px 0 8px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 52px); line-height: 1.05; margin: 8px 0; }
.page-head p { max-width: 60ch; margin: 0; }
.search-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.search-form input[type="search"] { flex: 1 1 220px; font: inherit; padding: 10px 12px; border: var(--bw) solid var(--ink); background: var(--white); }

/* ---------- Artículo ---------- */
.article { padding: 36px 0 20px; }
.article__head, .article__body, .article__foot { width: min(100% - 32px, var(--read)); margin-inline: auto; }
.article__title { font-family: var(--font-display); font-size: clamp(30px, 5.2vw, 50px); line-height: 1.06; margin: 14px 0; }
.article__lead { font-size: 20px; line-height: 1.5; color: var(--muted); margin: 0 0 16px; }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; font-weight: 700; margin-bottom: 20px; }
.article__meta .avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); }
.article__cover {
  width: min(100% - 32px, 980px); margin: 0 auto 32px; border: var(--bw) solid var(--ink); box-shadow: var(--shadow); background: var(--white);
}
.article__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article__cover figcaption { padding: 8px 12px; font-size: 13px; border-top: var(--bw) solid var(--ink); background: var(--white); }

.entry { font-size: 19px; line-height: 1.75; }
.entry > * { margin-top: 0; margin-bottom: 1.2em; }
.entry h2 {
  font-family: var(--font-display); font-size: 27px; line-height: 1.15; margin-top: 1.8em;
  display: inline; background: var(--yellow); padding: 2px 8px; border: 2px solid var(--ink);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.entry h2 + * { margin-top: 1em; }
.entry h3 { font-family: var(--font-display); font-size: 22px; line-height: 1.2; margin-top: 1.6em; }
.entry a { font-weight: 700; text-decoration-thickness: 3px; text-decoration-color: var(--orange); text-underline-offset: 3px; }
.entry a:hover { background: var(--orange); }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry li { margin-bottom: .4em; }
.entry blockquote {
  margin: 1.6em 6px 1.6em 0; padding: 18px 22px; background: var(--mint); border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow); font-weight: 700; font-size: 21px; line-height: 1.4;
}
.entry blockquote p { margin: 0; }
.entry img, .entry .wp-block-image img { border: var(--bw) solid var(--ink); }
.entry figure { margin-inline: 0; }
.entry figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.entry pre { background: var(--ink); color: var(--yellow); padding: 16px; overflow-x: auto; border: var(--bw) solid var(--ink); font-size: 15px; }
.entry code { background: var(--white); border: 1.5px solid var(--ink); padding: 0 5px; font-size: .9em; }
.entry pre code { background: none; border: 0; padding: 0; }
.entry table { width: 100%; border-collapse: collapse; font-size: 16px; }
.entry th, .entry td { border: 2px solid var(--ink); padding: 8px 10px; text-align: left; }
.entry th { background: var(--lilac); }
.entry .wp-block-table { overflow-x: auto; }
.entry hr { border: 0; border-top: var(--bw) solid var(--ink); }

.article__foot { margin-top: 36px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 24px 0; }
.share__label { font-family: var(--font-display); font-size: 15px; }
.share .btn { padding: 6px 14px; font-size: 14px; }
.author-box {
  display: flex; gap: 16px; align-items: flex-start; background: var(--lilac); border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow); padding: 18px; margin: 28px 6px 28px 0;
}
.author-box img { width: 64px; height: 64px; border: var(--bw) solid var(--ink); border-radius: 50%; flex: none; }
.author-box h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 18px; }
.author-box p { margin: 0; font-size: 15px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.post-nav a { display: block; text-decoration: none; background: var(--white); border: var(--bw) solid var(--ink); padding: 12px 14px; font-weight: 700; transition: transform .15s ease-out; }
.post-nav a:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-sm); }
.post-nav small { display: block; font-weight: 400; color: var(--muted); }
.post-nav .next { text-align: right; }
.related { padding-top: 8px; }

/* ---------- Comentarios ---------- */
.comments { margin-top: 36px; }
.comments h2 { font-family: var(--font-display); font-size: 24px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { background: var(--white); border: var(--bw) solid var(--ink); padding: 14px; margin-bottom: 14px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: var(--bw) solid var(--ink); background: var(--white);
}
.comment-form .submit { font: inherit; font-weight: 700; background: var(--orange); border: var(--bw) solid var(--ink); padding: 10px 20px; cursor: pointer; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 70px 0; }
.notfound__num { font-family: var(--font-display); font-size: clamp(90px, 20vw, 190px); line-height: 1; display: inline-block; background: var(--lilac); border: var(--bw) solid var(--ink); box-shadow: var(--shadow); padding: 0 24px; }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: var(--bg); margin-top: 40px; border-top: var(--bw) solid var(--ink); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding: 32px 0; align-items: flex-start; }
.site-footer .logo { box-shadow: none; }
.site-footer .logo__main { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.site-footer .logo__tag { border-color: var(--bg); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--yellow); font-weight: 700; }
.site-footer__note { font-size: 13px; opacity: .8; padding-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .newsletter { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .menu-toggle { display: inline-block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: var(--bw) solid var(--ink); padding: 14px 16px 18px; flex-direction: column; align-items: stretch; display: none; }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; }
  .nav a { display: block; }
  .hero-side { flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .logo__main { font-size: 22px; }
  .entry { font-size: 18px; }
  .post-nav { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker__track { animation: none; overflow-x: auto; }
  .card, .btn, .hero-main, .nav a, .post-nav a, .cat-strip .chip { transition: none; }
}
