/*
Theme Name: Pablo Espinosa
Theme URI: https://pabloespinosa.es
Author: Pablo Espinosa
Description: Theme personal editorial para SEO técnico, IA y automatizaciones.
Version: 1.1.3
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: pabloespinosa
*/

@font-face {
  font-display: swap;
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg-soft: #0c1016;
  --card: #10151c;
  --card-hover: #141b24;
  --text: #f7f7f5;
  --muted: #a7afb9;
  --faint: #68717d;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --accent: #6dd5ff;
  --accent2: #b268ff;
  --success: #92e6bd;
  --radius: 16px;
  --max: 1180px;
  --rail: 264px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4f7;
  --bg-soft: #e9edf2;
  --card: #fff;
  --card-hover: #f7f9fb;
  --text: #111720;
  --muted: #596572;
  --faint: #7b8792;
  --line: rgba(17, 23, 32, .11);
  --line-strong: rgba(17, 23, 32, .18);
  --accent: #008ecb;
  --accent2: #7d42d8;
  --success: #187653;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  margin: 0;
  text-rendering: optimizeLegibility;
}
body, button, input, textarea, select { font-family: var(--font); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; height: auto; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px;
}
.skip-link:focus {
  background: var(--card); clip: auto; clip-path: none; height: auto;
  left: 1rem; padding: .5rem 1rem; top: 1rem; width: auto; z-index: 100;
}
.container { margin-inline: auto; max-width: var(--max); width: min(calc(100% - 48px), var(--max)); }
.reading { margin-inline: auto; max-width: 760px; }
.eyebrow {
  color: var(--accent); font-size: 10px; font-weight: 700;
  letter-spacing: .16em; margin: 0 0 14px; text-transform: uppercase;
}
h1, h2, h3, h4 { letter-spacing: -.045em; line-height: 1.05; margin: 0 0 12px; }
h1 { font-size: clamp(64px, 7vw, 96px); font-weight: 800; letter-spacing: -.055em; line-height: .94; }
h2 { font-size: clamp(36px, 4vw, 48px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
h3 { font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.gradient-text {
  background: linear-gradient(100deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}

/* Header */
.site-header {
  background: rgba(7, 9, 13, .78); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px);
}
[data-theme="light"] .site-header { background: rgba(242, 244, 247, .86); }
.header-inner { align-items: center; display: flex; gap: 30px; min-height: 58px; }
.brand { font-size: 13px; font-weight: 750; letter-spacing: -.045em; white-space: nowrap; }
.brand span { color: var(--accent); }
.main-nav { margin-left: auto; }
.menu-list { align-items: center; display: flex; gap: 27px; list-style: none; margin: 0; padding: 0; }
.menu-list a { color: var(--muted); font-size: 11px; font-weight: 500; }
.menu-list a:hover, .menu-list .current-menu-item a { color: var(--text); }
.header-tools { align-items: center; display: flex; gap: 12px; }
.header-tool {
  align-items: center; background: transparent; border: 0; color: var(--muted);
  cursor: pointer; display: inline-flex; font-size: 11px; gap: 6px; padding: 4px;
}
.header-tool:hover { color: var(--text); }
.theme-toggle {
  background: #f4f6f8; border: 1px solid rgba(255,255,255,.35); border-radius: 99px;
  height: 17px; padding: 2px; position: relative; width: 34px;
}
.theme-toggle::after {
  background: #10151c; border-radius: 50%; content: ""; display: block;
  height: 11px; transform: translateX(0); transition: transform .2s; width: 11px;
}
.theme-toggle[aria-pressed="true"]::after { transform: translateX(17px); }
.nav-toggle { display: none; }

/* Controls */
.button {
  align-items: center; border: 1px solid var(--line-strong); border-radius: 7px;
  display: inline-flex; font-size: 11px; font-weight: 650; gap: 7px;
  justify-content: center; min-height: 34px; padding: 0 13px; transition: border-color .2s, background .2s, transform .2s;
}
.button:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.button--solid { background: var(--text); border-color: var(--text); color: var(--bg); }
.button--solid:hover { background: var(--accent); border-color: var(--accent); color: #061018; }
.button--outline { background: transparent; color: var(--text); }
.button--arrow::after { content: "→"; font-size: 14px; }

/* Homepage shell */
.home-shell { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) var(--rail); padding-bottom: 18px; padding-top: 18px; }
.home-main, .home-sidebar { min-width: 0; }
.home-main { display: grid; gap: 18px; }
.panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }

/* Hero */
.hero-panel {
  min-height: 452px; overflow: hidden; padding: 49px 34px 25px; position: relative;
}
.hero-panel::before {
  background: linear-gradient(90deg, rgba(7,9,13,.97) 0%, rgba(7,9,13,.84) 36%, rgba(7,9,13,.18) 82%),
    linear-gradient(0deg, rgba(7,9,13,.72), transparent 45%);
  content: ""; inset: 0; position: absolute; z-index: 1;
}
.hero-panel picture, .hero-panel picture img { inset: 0; height: 100%; position: absolute; width: 100%; }
.hero-panel picture img { object-fit: cover; object-position: center; }
.hero-content { max-width: 590px; position: relative; z-index: 2; }
.hero-content h1 { max-width: 650px; }
.hero-lead { color: var(--muted); font-size: 17px; line-height: 1.65; max-width: 545px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 21px 0 25px; }
.hero-side-note {
  color: var(--muted); font-size: 10px; line-height: 1.4; position: absolute;
  right: 30px; top: 90px; width: 75px; z-index: 2;
}
.hero-side-note::after { color: var(--accent); content: "→"; display: block; font-size: 20px; margin-top: 10px; }
.tech-strip { align-items: center; bottom: 22px; display: flex; flex-wrap: wrap; gap: 15px; position: absolute; z-index: 2; }
.tech-label { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; width: 100%; }
.tech-list { display: flex; flex-wrap: wrap; gap: 14px; }
.tech-list span { color: var(--muted); font-size: 10px; font-weight: 550; }
.tech-list span::before { color: var(--accent); content: "◈"; font-size: 9px; margin-right: 5px; }

/* Services */
.section-panel { padding: 27px 24px 25px; }
.section-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 19px; }
.section-heading h2 { font-size: clamp(28px, 3.2vw, 39px); }
.section-description { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0; max-width: 320px; }
.section-link { color: var(--text); font-size: 10px; white-space: nowrap; }
.section-link::after { content: " →"; color: var(--accent); font-size: 14px; }
.service-grid { display: grid; gap: 9px; grid-template-columns: repeat(4, 1fr); }
.service-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  min-height: 135px; padding: 15px 13px 12px; transition: background .2s, border-color .2s;
}
.service-card:hover { background: var(--card-hover); border-color: var(--line-strong); }
.service-icon { color: var(--accent); display: block; height: 25px; margin-bottom: 13px; width: 25px; }
.service-card h3 { font-size: 12px; margin-bottom: 7px; }
.service-card p { color: var(--muted); font-size: 10px; line-height: 1.45; margin-bottom: 10px; }
.mini-link { color: var(--text); font-size: 9px; font-weight: 600; }
.mini-link::after { color: var(--accent); content: " →"; font-size: 13px; }

/* Posts and tools */
.post-grid, .tool-grid { display: grid; gap: 9px; grid-template-columns: repeat(3, 1fr); }
.content-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  transition: background .2s, border-color .2s, transform .2s;
}
.content-card:hover { background: var(--card-hover); border-color: var(--line-strong); transform: translateY(-2px); }
.content-card-image { aspect-ratio: 1.66; object-fit: cover; width: 100%; }
.content-card-body { padding: 13px 13px 14px; }
.content-card-meta { color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.content-card h3 { font-size: 13px; line-height: 1.2; margin: 6px 0; }
.content-card p { color: var(--muted); font-size: 10px; line-height: 1.45; margin-bottom: 11px; }
.card-footer { align-items: center; color: var(--muted); display: flex; font-size: 9px; justify-content: space-between; }
.card-footer a { color: var(--text); font-size: 15px; line-height: 1; }
.tool-card { align-items: center; display: flex; gap: 12px; min-height: 82px; padding: 13px; }
.tool-icon { align-items: center; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--accent); display: flex; flex: 0 0 35px; font-size: 18px; height: 35px; justify-content: center; }
.tool-card h3 { font-size: 11px; margin: 0 0 4px; }
.tool-card p { font-size: 9px; margin: 0; }
.tool-actions { align-items: center; display: flex; gap: 7px; margin-left: auto; }
.tool-actions .button { font-size: 8px; min-height: 24px; padding: 0 8px; }
.tool-actions small { color: var(--muted); font-size: 8px; white-space: nowrap; }

/* Sidebar */
.home-sidebar { display: grid; gap: 18px; align-content: start; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding: 20px; }
.side-hero { min-height: 256px; overflow: hidden; padding: 23px 18px; position: relative; }
.side-hero::before { background: linear-gradient(0deg, rgba(7,9,13,.97), rgba(7,9,13,.18)); content: ""; inset: 0; position: absolute; }
.side-hero img { height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; }
.side-hero-content { position: relative; z-index: 1; }
.side-hero h2 { font-size: 26px; line-height: 1.02; }
.side-hero p { color: var(--muted); font-size: 10px; line-height: 1.45; }
.code-card { background: #0b0e13; }
.code-card h3 { font-size: 18px; max-width: 180px; }
.code-card p { color: var(--muted); font-size: 11px; }
.code-window { background: #07090d; border: 1px solid var(--line); border-radius: 8px; margin-top: 14px; overflow: hidden; }
.window-bar { background: var(--card); display: flex; gap: 4px; padding: 7px 9px; }
.window-bar i { background: #ff6259; border-radius: 50%; height: 5px; width: 5px; }
.window-bar i:nth-child(2) { background: #ffbd44; }
.window-bar i:nth-child(3) { background: #27c840; }
.code-window pre { color: #c7d3df; font: 9px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; overflow: auto; padding: 12px; }
.code-window .kw { color: #ff7ab2; }
.code-window .fn { color: #6dd5ff; }
.stats-card { padding: 19px; }
.stats-grid { border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 17px; padding-bottom: 16px; }
.stat strong { display: block; font-size: 22px; letter-spacing: -.06em; }
.stat span { color: var(--muted); display: block; font-size: 8px; line-height: 1.2; }
.quote { color: var(--muted); font-size: 11px; font-style: italic; line-height: 1.5; }
.quote-author { color: var(--text); font-size: 9px; font-style: normal; }
.side-image { aspect-ratio: 1.7; border-radius: 9px; margin-top: 14px; object-fit: cover; width: 100%; }
.newsletter h3 { font-size: 17px; }
.newsletter p { color: var(--muted); font-size: 10px; }
.newsletter-form { display: flex; gap: 5px; margin-top: 15px; }
.newsletter-form input { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; color: var(--text); min-width: 0; padding: 8px; width: 100%; }
.newsletter-form button { border: 0; border-radius: 5px; cursor: pointer; font-size: 9px; font-weight: 700; padding: 0 9px; }

/* CTA/footer */
.cta-panel {
  background: #090e15 url("assets/images/cta-tierra.jpg") center right / auto 100% no-repeat;
  border-block: 1px solid var(--line); min-height: 185px; overflow: hidden; padding: 39px 24px; position: relative;
}
.cta-panel::before { background: linear-gradient(90deg, #090e15 0%, rgba(9,14,21,.94) 37%, rgba(9,14,21,.08) 100%); content: ""; inset: 0; position: absolute; }
.cta-content { max-width: 560px; position: relative; z-index: 1; }
.cta-content h2 { font-size: clamp(26px, 3.5vw, 40px); }
.cta-content p { color: var(--muted); font-size: 11px; max-width: 440px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding: 25px 0; }
.footer-grid { align-items: center; display: flex; justify-content: space-between; }
.footer-copy { font-size: 9px; }
.footer-nav { display: flex; gap: 17px; }
.footer-nav a { font-size: 9px; }

/* Internal templates */
.archive-header, .single-header { padding: 65px 0 24px; }
.single-header h1 { font-size: clamp(42px, 6vw, 76px); }
.post-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 10px; gap: 12px; margin: 13px 0; }
.featured-image { border: 1px solid var(--line); border-radius: var(--radius); margin: 20px auto 38px; width: 100%; }
.entry-content { font-size: 17px; }
.entry-content h2, .entry-content h3 { margin-top: 38px; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content pre { background: #020509; border: 1px solid var(--line); border-radius: 9px; color: #cbeaff; overflow: auto; padding: 18px; }
.entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.entry-content blockquote { border-left: 2px solid var(--accent); color: var(--muted); margin: 30px 0; padding: 8px 20px; }
.entry-content table { border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 9px; text-align: left; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: 9px; margin: 25px 0; padding: 14px 18px; }
.toc summary { cursor: pointer; font-weight: 650; }
.toc ol { margin: 10px 0 0; padding-left: 22px; }
.author-box { border-top: 1px solid var(--line); margin-top: 50px; padding-top: 25px; }
.pagination { display: flex; font-size: 11px; justify-content: space-between; padding: 28px 0; }
.no-results { padding: 100px 0; }

@media (max-width: 960px) {
  .home-shell { grid-template-columns: 1fr; }
  .home-sidebar { grid-template-columns: repeat(2, 1fr); }
  .side-hero { grid-column: span 2; }
  .newsletter { grid-column: span 2; }
  .hero-side-note { display: none; }
}
@media (max-width: 720px) {
  .container { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 52px; }
  .main-nav { background: var(--card); border: 1px solid var(--line); border-radius: 9px; display: none; left: 14px; padding: 14px; position: absolute; right: 14px; top: 57px; }
  .main-nav.is-open { display: block; }
  .menu-list { align-items: stretch; flex-direction: column; gap: 0; }
  .menu-list a { display: block; padding: 9px; }
  .nav-toggle { display: inline-flex; }
  .header-tool span { display: none; }
  .header-tools > .button { display: none; }
  .home-shell { gap: 14px; padding-top: 14px; }
  .home-main, .home-sidebar { display: contents; }
  .hero-panel { order: 1; }
  .home-sidebar .side-hero { order: 2; }
  .home-sidebar .code-card { order: 3; }
  .home-sidebar .stats-card { order: 4; }
  .home-sidebar .newsletter { order: 5; }
  .home-main #que-hago { order: 6; }
  .home-main #publicaciones { order: 7; }
  .home-main #herramientas { order: 8; }
  .hero-panel { min-height: 485px; padding: 37px 20px 20px; }
  .hero-panel::before { background: linear-gradient(0deg, rgba(7,9,13,.96) 5%, rgba(7,9,13,.52) 65%, rgba(7,9,13,.15)); }
  .hero-panel picture img { object-position: 60% center; }
  .gradient-text { white-space: normal; }
  h1 { font-size: clamp(40px, 11vw, 52px); }
  .hero-lead { font-size: 15px; }
  .tech-strip { bottom: 17px; left: 20px; }
  .tech-list { gap: 8px; }
  .tech-list span { font-size: 8px; }
  .section-panel { padding: 23px 15px 18px; }
  .section-heading { align-items: start; flex-direction: column; gap: 5px; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid, .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 72px; }
  .side-hero, .newsletter { grid-column: auto; }
  .footer-grid { align-items: start; flex-direction: column; gap: 16px; }
  .footer-nav { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
