/* Instalio · blog. Va después de /overview/assets/main.css y usa sus tokens. */
.blog-page { background: var(--bg); }
html:has(.blog-page) { scroll-padding-top: 96px; }
.blog-page main { min-height: 50vh; }

/* ── Cabecera: la de /overview (main.css), con lo que es Instalio bajo el nombre ── */
.brand__text { display: flex; flex-direction: column; gap: .25rem; }
.brand__tagline { color: var(--muted); font-size: .6875rem; font-weight: 500; letter-spacing: .005em; line-height: 1; white-space: nowrap; }
.blog-header .site-nav__list a { white-space: nowrap; }
.blog-header .site-nav__list a[aria-current] { background: var(--pill-bg); color: var(--text); }
/* Seis enlaces y el nombre con su línea: entre 1000 y 1199 px, más juntos (y sin la línea hasta 1099). */
@media (min-width: 1000px) and (max-width: 1199px) { .blog-header .site-nav__list a { padding-inline: .55rem; font-size: .875rem; } }
@media (min-width: 1000px) and (max-width: 1099px) { .blog-header .brand__tagline { display: none; } }
/* Al bajar, la barra se recoge en la cápsula de /overview (1060 px como mucho): con la línea no caben
   los enlaces, el botón y el del tema, así que queda solo el nombre, como en /overview. */
@media (min-width: 1000px) { .blog-header.is-scrolled .brand__tagline { display: none; } }
/* Móvil: la línea entera bajo el nombre, «Probar gratis» (o «Probar») sin flecha, y los botones de
   tema y menú algo más pequeños para que quepan junto a ella. */
@media (max-width: 559px) {
  .blog-header.site-header { padding-inline: 10px; }
  .blog-header .site-header__bar { gap: .375rem; padding: 0 6px 0 12px; }
  .blog-header .brand { gap: .5rem; }
  .blog-header .brand__tagline { font-size: .65625rem; }
  .blog-header .site-header__cta { margin-right: 0; padding: 0 .75rem; font-size: .8125rem; }
  .blog-header .site-header__cta .btn__arrow { display: none; }
  .blog-header .theme-toggle, .blog-header .menu-toggle { width: 36px; height: 36px; }
}
@media (max-width: 459px) { .blog-header .site-header__cta-rest { display: none; } }
/* Por debajo de 390 px (iPhone SE, Android pequeños) no cabe la línea: solo el nombre. */
@media (max-width: 389px) { .blog-header .brand__tagline { display: none; } }

/* Pie: tres columnas de enlaces (la landing tiene dos). */
@media (min-width: 720px) { .blog-page .site-footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; } }

.preview-banner { position: sticky; top: 0; z-index: 70; padding: .65rem var(--gutter); background: var(--warning); color: #1a1204; font-size: .9375rem; font-weight: 600; text-align: center; }

/* ── Migas de pan ────────────────────────────────────────────────── */
.crumbs { padding-top: clamp(1rem, 3vw, 1.5rem); font-size: .875rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .2rem .5rem; list-style: none; }
.crumbs li { display: inline-flex; gap: .5rem; min-width: 0; }
.crumbs li + li::before { content: "›"; color: var(--border-strong); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs [aria-current] { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; max-width: min(42ch, 70vw); }

/* ── Portada, categoría y búsqueda ───────────────────────────────── */
.blog-hero { padding-block: clamp(1.25rem, 4vw, 2.75rem) clamp(1.5rem, 3vw, 2.25rem); }
.blog-hero h1 { max-width: 22ch; margin-bottom: .4em; font-size: clamp(2.125rem, 1.5rem + 2.8vw, 3.25rem); line-height: 1.05; letter-spacing: -.035em; }
.blog-hero .lead { max-width: 62ch; margin-bottom: 0; }
.blog-search { display: flex; gap: .5rem; max-width: 38rem; margin-top: 1.5rem; }
.blog-search input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 1.1rem; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;
}
.blog-search input::placeholder { color: var(--muted); }
.blog-search input:focus-visible { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.blog-search .btn { min-height: 48px; }
.cat-nav { margin: 1.25rem calc(-1 * var(--gutter)) 0; padding-inline: var(--gutter); overflow-x: auto; scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav ul { display: flex; gap: .375rem; width: max-content; list-style: none; }
.cat-nav a {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 .95rem; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-2); font-size: .9375rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: border-color var(--t-base) var(--ease-out), color var(--t-base), background-color var(--t-base);
}
.cat-nav a:hover { border-color: var(--border-strong); color: var(--text); }
.cat-nav a[aria-current="page"] { border-color: var(--text); background: var(--text); color: var(--bg); }
.cat-nav small { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.cat-nav a[aria-current="page"] small { color: inherit; }

.posts { padding-bottom: clamp(3rem, 6vw, 5rem); }
.posts__title { margin: 0 0 1rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .09em; line-height: 1.4; text-transform: uppercase; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; list-style: none; }
.post-card {
  position: relative; display: flex; flex-direction: column; gap: .55rem; height: 100%; padding: 1.25rem 1.3rem 1.2rem;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color var(--t-base) var(--ease-out), transform var(--t-slow) var(--ease-quint), box-shadow var(--t-slow) var(--ease-quint);
}
.post-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card:focus-within { box-shadow: var(--focus); }
@media (prefers-reduced-motion: reduce) { .post-card, .post-card:hover { transform: none; transition: none; } }
.post-card__media { margin: -1.25rem -1.3rem .35rem; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--sunken); aspect-ratio: 16 / 9; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__cat { margin: 0; color: var(--accent); font-size: .75rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.post-card__title { margin: 0; font-size: 1.1875rem; line-height: 1.3; letter-spacing: -.015em; }
.post-card__title a { color: var(--text); text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card__title a:focus-visible { box-shadow: none; }
.post-card__summary { flex: 1; margin: 0; color: var(--text-2); font-size: .96875rem; line-height: 1.55; }
.post-card__meta { margin: .2rem 0 0; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .375rem; margin-top: 2.25rem; }
.pager ol { display: contents; list-style: none; }
.pager a, .pager span {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .9rem; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; text-decoration: none;
}
.pager a:hover { border-color: var(--border-strong); color: var(--text); }
.pager [aria-current="page"] { border-color: var(--text); background: var(--text); color: var(--bg); }

.empty { max-width: 42rem; padding: clamp(1.5rem, 5vw, 2.5rem); border: 1px dashed var(--border-strong); border-radius: var(--r-xl); color: var(--text-2); }
.empty h2 { margin: 0 0 .5rem; color: var(--text); font-size: 1.375rem; line-height: 1.25; letter-spacing: -.02em; }
.empty p:last-child { margin-bottom: 0; }
.empty ul { display: grid; gap: .4rem; margin: .5rem 0 0; padding-left: 1.2rem; }
.empty a { color: var(--accent); }

/* ── Artículo ────────────────────────────────────────────────────── */
.post__head { max-width: 50rem; padding-block: clamp(1rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem); }
.post__head .overline a { color: inherit; text-decoration: none; }
.post__head .overline a:hover { text-decoration: underline; }
.post__head h1 { margin-bottom: .45em; font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); line-height: 1.08; letter-spacing: -.032em; }
.post__head .lead { margin-bottom: 1.1rem; }
.post__meta { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: 0; color: var(--muted); font-size: .875rem; list-style: none; }
.post__meta strong { color: var(--text-2); font-weight: 600; }
.post__review { margin: .6rem 0 0; color: var(--text-2); font-size: .875rem; }
.post-cover { max-width: 48rem; margin: 0 0 clamp(1.5rem, 3vw, 2rem); }
.post-cover img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); border-radius: var(--r-xl); }
.post-cover figcaption { margin-top: .6rem; color: var(--muted); font-size: .8125rem; }

.post__layout { display: grid; gap: 1.5rem; padding-block: clamp(1.25rem, 3vw, 2rem) clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--border); }
@media (min-width: 1000px) {
  .post__layout { grid-template-columns: 15rem minmax(0, 46rem); gap: 4rem; align-items: start; }
  .post__layout--single { grid-template-columns: minmax(0, 46rem); }
  .toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; padding-right: .5rem; }
}
.toc { font-size: .9375rem; }
.toc summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 1rem;
  border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); font-weight: 600; cursor: pointer; list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; color: var(--muted); font-size: 1.25rem; font-weight: 400; }
.toc details[open] summary::after { content: "−"; }
.toc ol { display: grid; gap: .05rem; padding: .6rem 0 0; list-style: none; }
.toc ol ol { padding: 0 0 0 .8rem; font-size: .875rem; }
.toc a { display: block; padding: .35rem 0 .35rem .75rem; border-left: 2px solid var(--border); color: var(--text-2); line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc a.is-active { border-left-color: var(--accent); color: var(--text); }
@media (min-width: 1000px) {
  .toc summary { min-height: 0; margin-bottom: .25rem; padding: 0; border: 0; color: var(--muted); font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; }
  .toc details[open] summary::after { content: ""; }
}

.post__body { min-width: 0; color: var(--text-2); font-size: 1.0625rem; line-height: 1.7; overflow-wrap: break-word; }
.post__body > :first-child { margin-top: 0; }
.post__body p { margin: 0 0 1.1em; }
.post__body h2 { margin: 2.2em 0 .6em; color: var(--text); font-size: clamp(1.4rem, 1.25rem + .6vw, 1.75rem); line-height: 1.2; letter-spacing: -.02em; }
.post__body h3 { margin: 1.8em 0 .5em; color: var(--text); font-size: 1.1875rem; line-height: 1.3; letter-spacing: -.012em; }
.post__body h4 { margin: 1.5em 0 .4em; color: var(--text); font-size: 1.0625rem; line-height: 1.35; }
.post__body strong { color: var(--text); }
.post__body a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.post__body a:hover { text-decoration-color: currentColor; }
.post__body ul, .post__body ol { display: grid; gap: .45rem; margin: 0 0 1.1em; padding-left: 1.4rem; }
.post__body li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.post__body ol > li::marker { color: var(--accent); font-weight: 600; }
.post__body li > ul, .post__body li > ol { margin: .45rem 0 0; }
.post__body li > p { margin: 0 0 .4em; }
.post__body code { padding: .1em .38em; border-radius: 6px; background: var(--sunken); color: var(--text); font-size: .875em; }
.post__body pre { margin: 0 0 1.25em; padding: 1rem; overflow-x: auto; border-radius: var(--r-md); background: var(--sunken); font-size: .875rem; line-height: 1.5; }
.post__body pre code { padding: 0; background: none; }
.post__body blockquote { margin: 0 0 1.25em; padding: .2rem 0 .2rem 1.1rem; border-left: 3px solid var(--border-strong); color: var(--text); font-style: italic; }
.post__body blockquote p:last-child { margin-bottom: 0; }
.post__body hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--border); }
.post-figure { margin: 1.75em 0; }
.post-figure img { border: 1px solid var(--border); border-radius: var(--r-lg); }
.post-figure figcaption { margin-top: .6rem; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.figure__credit { display: block; font-size: .8125rem; }
.figure__caption + .figure__credit { margin-top: .2rem; }
.post-figure figcaption a, .post-cover figcaption a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.post-figure figcaption a:hover, .post-cover figcaption a:hover { color: var(--text); }

.cite { font-size: .7em; line-height: 0; }
.cite a { margin-left: .12em; padding: .05em .3em; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; }
.cite a:hover { background: color-mix(in srgb, var(--accent) 22%, var(--bg)); }
.cite--missing { color: var(--warning); }
.post__body sup + sup a { margin-left: .15em; }

.answer { margin: 0 0 2rem; padding: 1.15rem 1.35rem 1.2rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: var(--r-lg); background: var(--accent-soft); color: var(--text); }
.post__body .answer__title { margin: 0 0 .45rem; color: var(--accent); font-size: .75rem; letter-spacing: .09em; line-height: 1.4; text-transform: uppercase; }
.answer p:last-child, .callout p:last-child, .instalio-box p:last-child { margin-bottom: 0; }

.callout { margin: 1.6em 0; padding: 1rem 1.15rem; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-md); background: var(--bg-soft); color: var(--text); font-size: 1rem; line-height: 1.6; }
.callout__title { margin: 0 0 .35rem !important; color: var(--text); font-weight: 600; }
.callout--aviso { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 9%, var(--bg)); }
.callout--profesional { border-left-color: var(--g-warm); background: color-mix(in srgb, var(--g-warm) 8%, var(--bg)); }
.callout ul, .callout ol { margin-bottom: .6em; }

.instalio-box { margin: 1.8em 0; padding: 1.15rem 1.25rem 1.2rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text-2); font-size: 1rem; line-height: 1.6; }
.instalio-box__title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .5rem !important; color: var(--text); font-weight: 600; }
.instalio-box__title img { flex: none; width: 28px; height: 28px; }
.post__body .instalio-box__action { margin: .9rem 0 0; }
.instalio-box .btn { min-height: 40px; color: var(--text); text-decoration: none; }

.post-cta { margin: 2.75rem 0 0; padding: clamp(1.35rem, 4vw, 2rem); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: var(--r-xl); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--text-2); }
.post__body .post-cta__title { margin: 0 0 .5rem; color: var(--text); font-size: clamp(1.25rem, 1.15rem + .5vw, 1.5rem); font-weight: 600; line-height: 1.25; letter-spacing: -.02em; text-wrap: balance; }
.post__body .post-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 1.25rem 0 0; }
.post-cta .btn { color: var(--on-accent); text-decoration: none; }
.post-cta__note { color: var(--text-2); font-size: .875rem; }

.post__body .post-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.post-tags li { padding: .25rem .7rem; border-radius: 999px; background: var(--pill-bg); color: var(--text-2); font-size: .8125rem; }

.sources { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.post__body .sources h2 { margin-top: 0; }
.sources__note { color: var(--muted); font-size: .9375rem; }
.post__body .sources__list { gap: .7rem; padding: 0; list-style: none; }
.source { padding: .95rem 1.1rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-size: .9375rem; line-height: 1.5; scroll-margin-top: 24px; transition: border-color var(--t-slow), box-shadow var(--t-slow); }
.source:target, .source.is-flash { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.source__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .4rem; color: var(--muted); font-size: .75rem; }
.source__num { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.source__kind { font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.source__domain { margin-left: auto; font-family: var(--font-mono); font-size: .75rem; }
.post__body .source p { margin: 0 0 .25rem; }
.post__body .source p:last-child { margin: 0; }
.post__body .source__title a { color: var(--text); font-weight: 600; }
.source__meta { color: var(--text-2); }
.source__foot { color: var(--muted); font-size: .8125rem; }

.method { margin-top: 2rem; padding: 1rem 1.15rem; border-radius: var(--r-md); background: var(--bg-soft); color: var(--text-2); font-size: .9375rem; line-height: 1.6; }
.post__body .method h2 { margin: 0 0 .35rem; font-size: 1rem; letter-spacing: -.01em; }

.related { padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--border); }
.related h2 { margin-bottom: 1.25rem; font-size: clamp(1.5rem, 1.3rem + .8vw, 2rem); }

.cite-pop {
  position: fixed; inset: auto; z-index: 80; width: min(22rem, calc(100vw - 32px)); margin: 0; padding: .9rem 1rem 1rem;
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-lg);
  color: var(--text-2); font-size: .875rem; line-height: 1.45;
}
.cite-pop p { margin: 0 0 .35rem; }
.cite-pop__title { color: var(--text); font-weight: 600; }
.cite-pop__links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem !important; }
.cite-pop a { color: var(--accent); font-weight: 600; }

.blog-404 { max-width: 46rem; padding-block: clamp(2.5rem, 7vw, 5rem); }
.blog-404 h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); line-height: 1.08; letter-spacing: -.032em; }
.blog-404 .actions { margin-top: 1.5rem; }

.t-center { text-align: center !important; }
.t-right { text-align: right !important; }
.table-wrap { margin: 1.5em 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.table-wrap:focus-visible { box-shadow: var(--focus); }
.table-wrap table { width: 100%; min-width: 32rem; border-collapse: collapse; font-size: .9375rem; line-height: 1.5; }
.table-wrap th, .table-wrap td { padding: .7rem 1rem; text-align: left; vertical-align: top; }
.table-wrap thead th { background: var(--bg-soft); color: var(--muted); font-size: .8125rem; font-weight: 600; }
.table-wrap tbody th { color: var(--text); font-weight: 600; }
.table-wrap tbody tr { border-top: 1px solid var(--border); }
.table-wrap code { white-space: nowrap; }

@media print {
  .site-header, .crumbs, .toc, .post-cta, .instalio-box, .related, .site-footer, .cite-pop, .preview-banner { display: none !important; }
  .post__layout { display: block; border: 0; }
  .post__body, .post__body strong, .post__body h2, .post__body h3 { color: #000; }
  .post__body a { color: #000; }
  .source { break-inside: avoid; }
}
