/*
 * .dots — estilos propios que complementan main.css (Tailwind precompilado de la web original).
 * main.css no se recompila: lo que el diseño original no traía (fuente self-hosted, blog,
 * buscador, paginación) vive aquí, usando las variables --color-* de main.css.
 */

/* Inter Tight self-hosted (antes Google Fonts). Subconjunto latin, variable 100–900. */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterTight-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterTight-Italic-latin.woff2") format("woff2");
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10000;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--color-secondary);
  color: #fff;
}
.skip-link:focus { top: 1rem; }

/* Logo de escritorio del header (antes con estilos inline) */
.site-logo { width: 60%; padding-left: 10%; }

.ai-voice-header nav a[aria-current="page"] { color: #fff; }
.sidebar a[aria-current="page"] { font-weight: 500; }

/* ---------- Blog: cabeceras ---------- */
.blog-title { font-size: var(--text-heading-4, 2rem); line-height: 1.2; }
@media (min-width: 768px) { .blog-title { font-size: 2.5rem; } }
@media (min-width: 1280px) { .blog-title { font-size: 3.25rem; } }

/* ---------- Blog: tarjeta ---------- */
.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--color-background-2);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgb(18 18 82 / 0.35); }
.post-card-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--color-background-4); }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.post-card:hover .post-card-cover img { transform: scale(1.04); }
.post-card-placeholder { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.post-card-placeholder img { width: 44px; height: 44px; object-fit: contain; opacity: 0.5; }
.post-card:hover .post-card-placeholder img { transform: none; }
.post-card-body { display: flex; flex: 1; flex-direction: column; gap: 0.75rem; padding: 1.5rem; }
@media (min-width: 768px) { .post-card-body { padding: 2rem; } }
.post-card-title { font-size: 1.25rem; line-height: 1.4; font-weight: 500; color: var(--color-secondary); }
@media (min-width: 768px) { .post-card-title { font-size: 1.5rem; } }
.post-card-title a { transition: color 0.3s ease; }
.post-card-title a:hover { color: var(--color-primary-500); }
.post-card-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ---------- Blog: artículo ---------- */
.post-header { max-width: 950px; margin-inline: auto; text-align: center; }
.post-header .post-meta { justify-content: center; margin-bottom: 1.25rem; }
.post-header .post-meta a { text-decoration: underline; text-underline-offset: 3px; }
.post-header .post-meta a:hover { color: var(--color-primary-500); }
.post-title { font-size: 2rem; line-height: 1.2; font-weight: 500; text-wrap: balance; }
@media (min-width: 768px) { .post-title { font-size: 2.5rem; } }
@media (min-width: 1280px) { .post-title { font-size: 3.25rem; } }
.post-byline { margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.post-card-author { display: flex; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; font-size: 0.875rem; line-height: 1.5; color: color-mix(in oklab, var(--color-secondary) 70%, transparent); }
.post-card-author .post-avatar { width: 32px; height: 32px; margin-right: 0; }
.post-avatar { width: 44px; height: 44px; border-radius: 9999px; object-fit: cover; background: var(--color-ns-linen, #e8e4dc); margin-right: 0.25rem; }
.post-cover { max-width: 1100px; margin: 2.5rem auto 0; overflow: hidden; border-radius: 20px; }
@media (min-width: 768px) { .post-cover { margin-top: 3.5rem; border-radius: 2rem; } }
.post-cover img { display: block; width: 100%; height: auto; }

/* Cuerpo: parte de .details-body (NextSaaS) y completa lo que no estilaba */
.post-body { max-width: 760px; margin-top: 2.5rem; }
@media (min-width: 768px) { .post-body { margin-top: 3.5rem; } }
.post-body p { font-size: 1.0625rem; line-height: 1.7; color: color-mix(in oklab, var(--color-secondary) 80%, transparent); }
.post-body h2 { margin: 2.5rem 0 1rem; font-size: 1.75rem; line-height: 1.3; font-weight: 500; }
.post-body h3 { margin: 2rem 0 0.75rem; font-size: 1.375rem; line-height: 1.4; font-weight: 500; }
@media (min-width: 1024px) {
  .post-body h2 { font-size: 2rem; }
  .post-body h3 { margin-top: 2rem; font-size: 1.5rem; }
}
.post-body > :first-child { margin-top: 0; }
.post-body a { color: var(--color-primary-500); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { color: var(--color-primary-600); }
.post-body strong { font-weight: 600; color: var(--color-secondary); }
.post-body ul, .post-body ol { margin: 0 0 1.5rem; padding-left: 1.5rem; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body ul li, .post-body ol li,
.post-body ol li:first-child, .post-body ol li:nth-child(2), .post-body ol li:last-child {
  display: list-item;
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: color-mix(in oklab, var(--color-secondary) 80%, transparent);
}
.post-body ul li::before, .post-body ol li::before { content: none; }
.post-body li::marker { color: var(--color-primary-500); }
.post-body blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--color-ns-linen);
  border-radius: 0 20px 20px 0;
  background: var(--color-background-2);
}
.post-body blockquote p { padding-bottom: 0; font-size: 1.25rem; line-height: 1.5; color: var(--color-secondary); }
.post-body img { display: block; max-width: 100%; height: auto; margin: 2rem auto; border-radius: 20px; }
.post-body figure { margin: 2rem 0; }
.post-body figure img { margin: 0 auto; }
.post-body figcaption { margin-top: 0.75rem; text-align: center; font-size: 0.875rem; color: color-mix(in oklab, var(--color-secondary) 60%, transparent); }

.post-nav {
  display: grid;
  gap: 1rem;
  max-width: 760px;
  margin: 3.5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--color-stroke-2);
}
@media (min-width: 768px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav a { display: block; font-weight: 500; line-height: 1.4; color: var(--color-secondary); transition: color 0.3s ease; }
.post-nav a:hover { color: var(--color-primary-500); }
.post-nav a span { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; font-weight: 400; color: color-mix(in oklab, var(--color-secondary) 60%, transparent); }
@media (min-width: 768px) { .post-nav-next { text-align: right; } }

/* ---------- Paginación ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
}
.pagination a {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--color-stroke-3);
  border-radius: 999px;
  font-weight: 500;
  color: var(--color-secondary);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.pagination a:hover { border-color: var(--color-secondary); background: var(--color-secondary); color: #fff; }
.pagination-status { font-size: 0.875rem; color: color-mix(in oklab, var(--color-secondary) 60%, transparent); }

/* ---------- Buscador estático (search_box de WebBase) ---------- */
.wb-search { position: relative; max-width: 28rem; margin: 2rem auto 0; text-align: left; }
.wb-search-input {
  display: block;
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 3rem;
  border: 1px solid var(--color-stroke-3);
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23121252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m16.5 16.5-4.2-4.2'/%3E%3C/svg%3E") no-repeat 1.25rem center / 18px 18px;
  font-size: 1rem;
  color: var(--color-secondary);
}
.wb-search-input::placeholder { color: color-mix(in oklab, var(--color-secondary) 50%, transparent); }
.wb-search-input:focus { outline: 2px solid var(--color-primary-300); outline-offset: 1px; border-color: var(--color-primary-500); }
.wb-search-results {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 24rem;
  margin: 0.375rem 0 0;
  padding: 0.375rem;
  overflow: auto;
  border: 1px solid var(--color-stroke-2);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 40px -24px rgb(18 18 82 / 0.35);
}
.wb-search-results[hidden] { display: none; }
.wb-search-results a { display: block; padding: 0.625rem 0.875rem; border-radius: 14px; color: var(--color-secondary); }
.wb-search-results a:hover, .wb-search-results li[aria-selected="true"] a { background: var(--color-background-3); }
.wb-search-title { display: block; font-weight: 500; }
.wb-search-meta { display: block; font-size: 0.875rem; color: color-mix(in oklab, var(--color-secondary) 60%, transparent); }
.wb-search-empty { padding: 0.625rem 0.875rem; font-size: 0.875rem; color: color-mix(in oklab, var(--color-secondary) 60%, transparent); }

/* Las categorías se muestran tal cual se escriben (el .badge base las pasa a minúsculas: «LATAM» → «Latam») */
.post-meta .badge { text-transform: none; }
.post-meta .badge::first-letter { text-transform: none; }

/* H1 de páginas internas con el tamaño que tenía como H2 en el diseño original */
h1.h1-as-h2 { font-size: var(--text-heading-5); line-height: var(--text-heading-5--line-height); }
h1.h1-as-h2:not(.font-medium) { font-weight: var(--font-weight-normal); }
@media (width >= 40rem) { h1.h1-as-h2 { font-size: var(--text-heading-4); line-height: var(--text-heading-4--line-height); } }
@media (width >= 48rem) { h1.h1-as-h2 { font-size: var(--text-heading-3); line-height: var(--text-heading-3--line-height); } }
@media (width >= 80rem) { h1.h1-as-h2 { font-size: var(--text-heading-2); line-height: var(--text-heading-2--line-height); } }

/* Footer */
.site-footer { display: grid; gap: 2.5rem; padding: 3.5rem 0 2.5rem; }
@media (min-width: 768px) { .site-footer { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding-top: 4.5rem; } }
.site-footer-logo { display: inline-block; margin-bottom: 1rem; }
.site-footer-logo img { display: block; height: 40px; width: auto; }
.site-footer-brand p { max-width: 340px; font-size: 0.9375rem; line-height: 1.6; }
.site-footer-title { margin-bottom: 0.75rem; font-size: 0.875rem; font-weight: 500; color: var(--color-secondary); }
.site-footer-col ul { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.site-footer-col a { font-size: 0.9375rem; color: color-mix(in oklab, var(--color-secondary) 70%, transparent); transition: color 0.3s ease; }
.site-footer-col a:hover { color: var(--color-primary-500); }
.site-footer-legal { margin-top: 0.5rem; font-size: 0.8125rem; color: color-mix(in oklab, var(--color-secondary) 60%, transparent); }
.site-footer-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; transition: color 0.3s ease; }
.site-footer-legal a:hover { color: var(--color-primary-500); }
