/* ═══════════════════════════════════════════════════════
   HIDROLIT — blog.css  v3.0
   Single posts, archive, categorías
═══════════════════════════════════════════════════════ */

/* ── Variables locales ──────────────────────────────── */
:root {
  --blog-max: 760px;
  --blog-body-size: 1.08rem;
  --blog-lh: 1.82;
  --blog-h-dark: var(--hlp-blue-dark);
  --blog-h-blue: var(--hlp-blue);
  --blog-accent: rgba(68,159,220,.12);
}

/* ── Breadcrumbs ─────────────────────────────────────── */
.hlp-breadcrumbs {
  margin-bottom: 1.8rem;
  font-size: .82rem;
  color: var(--hlp-text-mut);
}
.hlp-breadcrumbs__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .5rem;
}
.hlp-breadcrumbs__item:not(:last-child)::after {
  content: '›';
  margin-left: .4rem;
  opacity: .4;
}
.hlp-breadcrumbs__item a { color: var(--hlp-blue-dark); }
.hlp-breadcrumbs__item--current span {
  color: var(--hlp-blue-dark);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   ARTICLE HEADER
═══════════════════════════════════════════════════════ */
.hlp-article { padding: 2.5rem 0 4rem; }

.hlp-article__header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--hlp-border);
}

/* Categoría badge */
.hlp-article__cat {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(2,60,127,.08);
  color: var(--hlp-blue-dark);
  padding: .38rem 1.1rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 1.2rem;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.hlp-article__cat:hover {
  background: var(--hlp-blue-dark);
  color: #fff;
}
.hlp-article__cat::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--hlp-blue);
}

/* H1 — TÍTULO PRINCIPAL DEL ARTÍCULO */
.hlp-article__title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--hlp-blue-dark);
  line-height: 1.1;
  letter-spacing: -.04em;
  max-width: 900px;
  margin: 0 auto 1.4rem;
  text-wrap: balance;
  /* Gradiente de texto en el título */
  background: linear-gradient(135deg, #011d3f 0%, var(--hlp-blue-dark) 50%, #0a5aaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Avatar circular */
.hlp-avatar {
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  border: 2px solid rgba(2,60,127,.12);
}

/* Meta: fecha, tiempo de lectura */
.hlp-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem 1.5rem;
  font-size: .82rem;
  color: var(--hlp-text-mut);
  margin-bottom: .5rem;
}
.hlp-post-meta__sep { opacity: .3; }

/* Imagen hero */
.hlp-article__hero {
  margin: 0 -1.25rem 2.5rem;
  border-radius: var(--hlp-radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #f0f6ff;
  box-shadow: 0 12px 48px rgba(2,60,127,.14);
}
.hlp-article__hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s ease;
}
.hlp-article__hero:hover .hlp-article__hero-img { transform: scale(1.03); }

/* ═══════════════════════════════════════════════════════
   BODY DEL ARTÍCULO — TIPOGRAFÍA
═══════════════════════════════════════════════════════ */
.hlp-article__body { padding: .5rem 0 2rem; }

.hlp-article__content {
  font-size: var(--blog-body-size);
  line-height: var(--blog-lh);
  color: #1a202c;
  max-width: var(--blog-max);
  margin: 0 auto;
}

/* ── H2 ─── */
.hlp-article__content h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--blog-h-dark);
  margin: 3rem 0 1.1rem;
  line-height: 1.25;
  letter-spacing: -.025em;
  padding: .9rem 1.3rem .9rem 1.4rem;
  background: linear-gradient(135deg, rgba(2,60,127,.05) 0%, rgba(68,159,220,.04) 100%);
  border-left: 5px solid var(--blog-h-blue);
  border-radius: 0 10px 10px 0;
  position: relative;
}
.hlp-article__content h2::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--hlp-blue-dark), var(--hlp-blue));
  border-radius: 0 0 0 0;
}

/* ── H3 ─── */
.hlp-article__content h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.38rem);
  font-weight: 700;
  color: var(--blog-h-dark);
  margin: 2.2rem 0 .7rem;
  letter-spacing: -.015em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.hlp-article__content h3::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--blog-h-blue);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── H4 ─── */
.hlp-article__content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blog-h-dark);
  margin: 1.8rem 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .88rem;
}

/* ── Párrafos ─── */
.hlp-article__content p { margin-bottom: 1.5em; }
.hlp-article__content > p:first-of-type {
  font-size: 1.15rem;
  color: #2d3748;
  line-height: 1.75;
}

/* ── Listas ─── */
.hlp-article__content ul,
.hlp-article__content ol {
  margin: 1.4em 0;
  padding-left: 0;
  list-style: none;
}
.hlp-article__content ul li,
.hlp-article__content ol li {
  margin-bottom: .8em;
  line-height: 1.7;
  padding-left: 1.6rem;
  position: relative;
}
.hlp-article__content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .65em;
  width: 7px; height: 7px;
  background: var(--hlp-blue);
  border-radius: 50%;
}
.hlp-article__content ol {
  counter-reset: hlp-ol;
}
.hlp-article__content ol li::before {
  counter-increment: hlp-ol;
  content: counter(hlp-ol);
  position: absolute;
  left: 0;
  top: .1em;
  font-size: .78rem;
  font-weight: 800;
  color: #fff;
  background: var(--hlp-blue-dark);
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.hlp-article__content li strong { color: var(--hlp-blue-dark); }

/* ── Links ─── */
.hlp-article__content a {
  color: var(--hlp-blue-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(68,159,220,.4);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color .2s, text-decoration-color .2s;
}
.hlp-article__content a:hover {
  color: var(--hlp-blue);
  text-decoration-color: var(--hlp-blue);
}

/* ── Blockquote ─── */
.hlp-article__content blockquote {
  margin: 2.5rem 0;
  padding: 1.5rem 1.8rem 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(2,60,127,.04), rgba(68,159,220,.04));
  border-left: 5px solid var(--hlp-blue);
  border-radius: 0 14px 14px 0;
  font-size: 1.1em;
  font-style: italic;
  color: #2d3748;
  line-height: 1.7;
  position: relative;
}
.hlp-article__content blockquote::before {
  content: '\201C';
  position: absolute;
  top: -.4rem; left: 1rem;
  font-size: 4rem;
  color: rgba(68,159,220,.25);
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  font-family: Georgia, serif;
}
.hlp-article__content blockquote p { margin: 0; }
.hlp-article__content blockquote cite {
  display: block;
  margin-top: .8rem;
  font-size: .85rem;
  font-style: normal;
  color: var(--hlp-blue-dark);
  font-weight: 600;
}

/* ── Imágenes ─── */
.hlp-article__content img {
  border-radius: 12px;
  margin: 1.8rem auto;
  display: block;
  max-width: 100%;
  box-shadow: 0 4px 24px rgba(2,60,127,.1);
}
.hlp-article__content figure {
  margin: 2rem 0;
}
.hlp-article__content figcaption {
  text-align: center;
  font-size: .82rem;
  color: var(--hlp-text-mut);
  margin-top: .6rem;
  font-style: italic;
}

/* ── Code ─── */
.hlp-article__content code {
  background: #f0f6ff;
  color: #023c7f;
  padding: .15rem .45rem;
  border-radius: 5px;
  font-size: .88em;
  font-family: 'Courier New', monospace;
  border: 1px solid rgba(2,60,127,.1);
}
.hlp-article__content pre {
  background: #011d40;
  color: #7ec8f0;
  padding: 1.4rem 1.6rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: .9rem;
  line-height: 1.6;
}
.hlp-article__content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

/* ═══════════════════════════════════════════════════════
   TABLAS — SCROLLEABLES (CSS puro, funciona en Safari)
═══════════════════════════════════════════════════════ */

/* Wrapper necesario para el scroll — lo pone el JS de blog.js */
.hlp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(2,60,127,.1);
  scrollbar-width: thin;
  scrollbar-color: rgba(2,60,127,.3) transparent;
}
.hlp-table-wrap::-webkit-scrollbar { height: 6px; }
.hlp-table-wrap::-webkit-scrollbar-track { background: #f0f6ff; border-radius: 10px; }
.hlp-table-wrap::-webkit-scrollbar-thumb { background: rgba(2,60,127,.3); border-radius: 10px; }

/* Hint de "deslizá la tabla" en mobile */
.hlp-table-hint {
  display: none;
  font-size: .75rem;
  color: var(--hlp-blue);
  text-align: center;
  margin: -.8rem 0 .5rem;
  letter-spacing: .3px;
}
@media (max-width: 680px) { .hlp-table-hint { display: block; } }

/* La tabla en sí: sin width:100% para que pueda desbordar */
.hlp-article__content table {
  border-collapse: collapse;
  width: max-content;   /* ← clave: ocupa lo que necesita, no más */
  min-width: 100%;      /* pero al menos ocupa el ancho del contenedor */
  background: #fff;
  font-size: .9rem;
}

/* Encabezado */
.hlp-article__content thead {
  background: linear-gradient(90deg, var(--hlp-blue-dark), #0a5aaa);
  color: #fff;
}
.hlp-article__content th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;     /* encabezados nunca se parten */
  vertical-align: middle;
}

/* Celdas con padding cómodo */
.hlp-article__content td {
  padding: 1rem 1.5rem;   /* padding generoso — sin colapso */
  border-bottom: 1px solid var(--hlp-border);
  color: #1a202c;
  line-height: 1.6;
  vertical-align: top;
  min-width: 130px;        /* columna mínima antes de scroll */
  max-width: 280px;        /* columna máxima — evita celdas enormes */
}
.hlp-article__content tbody tr:nth-child(even) { background: rgba(68,159,220,.04); }
.hlp-article__content tbody tr:hover { background: rgba(2,60,127,.07); transition: background .2s; }
.hlp-article__content tbody td:first-child {
  font-weight: 700;
  color: var(--hlp-blue-dark);
  white-space: nowrap; /* primera columna no se parte */
}

/* ═══════════════════════════════════════════════════════
   POST META · TAGS · SHARE
═══════════════════════════════════════════════════════ */
.hlp-post-meta { margin-bottom: 1rem; }

.hlp-article__tags {
  margin: 3.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 2px solid var(--hlp-border);
}
.hlp-tags-label {
  font-weight: 700;
  color: var(--hlp-blue-dark);
  margin-right: .5rem;
  font-size: .85rem;
}
.hlp-article__tags a {
  display: inline-block;
  padding: .3rem .9rem;
  margin: .25rem;
  background: rgba(2,60,127,.07);
  border: 1px solid rgba(2,60,127,.1);
  border-radius: 100px;
  color: var(--hlp-blue-dark);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.hlp-article__tags a:hover {
  background: var(--hlp-blue-dark);
  color: #fff;
}

/* Share */
.hlp-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
  margin: 2rem 0;
  padding: 1.4rem 1.8rem;
  background: linear-gradient(135deg, rgba(2,60,127,.04), rgba(68,159,220,.04));
  border-radius: 16px;
  border: 1px solid rgba(2,60,127,.08);
}
.hlp-share__label {
  font-weight: 700;
  color: var(--hlp-blue-dark);
  font-size: .9rem;
  margin-right: .3rem;
}
.hlp-share__btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .48rem 1.1rem;
  border-radius: 100px;
  background: #fff;
  border: 1px solid var(--hlp-border);
  color: var(--hlp-text);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s, background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.hlp-share__btn:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.hlp-share__btn--wa:hover { background: #25D366; }
.hlp-share__btn--fb:hover { background: #1877F2; }
.hlp-share__btn--tw:hover { background: #111; }
.hlp-share__btn--in:hover { background: #0A66C2; }

/* Post nav */
.hlp-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 3rem;
}
.hlp-post-nav__item {
  display: block;
  padding: 1.4rem 1.6rem;
  background: #fff;
  border: 1px solid var(--hlp-border);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.hlp-post-nav__item:hover {
  border-color: var(--hlp-blue);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(2,60,127,.1);
}
.hlp-post-nav__item--next { text-align: right; }
.hlp-post-nav__label {
  display: block;
  font-size: .72rem;
  color: var(--hlp-blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: .4rem;
}
.hlp-post-nav__title {
  font-weight: 700;
  color: var(--hlp-blue-dark);
  line-height: 1.3;
  font-size: .95rem;
}

/* Related */
.hlp-related {
  background: #f7faff;
  padding: 4rem 0;
  margin-top: 4rem;
  border-top: 1px solid var(--hlp-border);
}
.hlp-related__title {
  text-align: center;
  color: var(--hlp-blue-dark);
  margin-bottom: 2.5rem;
  font-size: 1.6rem;
  font-weight: 800;
}
.hlp-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Comments */
.hlp-comments { padding: 3rem 0; }

/* ── Barra de progreso de lectura ──────────────────── */
.hlp-read-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--hlp-blue-dark), var(--hlp-blue), #7ec8f0);
  z-index: 9999;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
}

/* ═══════════════════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════════════════ */
@media (max-width: 680px) {
  .hlp-article { padding: 1.5rem 0 2.5rem; }
  .hlp-article__title { letter-spacing: -.03em; }
  .hlp-article__hero { margin: 0 -.75rem 1.8rem; border-radius: 8px; }
  .hlp-article__content { font-size: 1rem; }
  .hlp-article__content > p:first-of-type { font-size: 1.06rem; }

  .hlp-article__content h2 {
    font-size: 1.25rem;
    padding: .75rem 1rem .75rem 1.1rem;
    margin: 2.2rem 0 .9rem;
  }
  .hlp-article__content h3 { font-size: 1.08rem; }

  .hlp-article__content th,
  .hlp-article__content td { padding: .75rem 1rem; min-width: 100px; }

  .hlp-share { padding: 1rem 1.2rem; }
  .hlp-post-nav { grid-template-columns: 1fr; }
  .hlp-post-nav__item--next { text-align: left; }
}
