/* ============================================================
   VendeAutos.pe — Blog CSS
   Paleta: Rojo #FF0033 · Naranja #FF9900
   Font: Inter (Google Fonts)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --rojo:       #FF0033;
  --naranja:    #FF9900;
  --oscuro:     #1a1a1a;
  --texto:      #333333;
  --gris-claro: #f5f5f5;
  --gris-borde: #e0e0e0;
  --blanco:     #ffffff;
  --font:       'Inter', 'Segoe UI', Arial, sans-serif;
  --radius:     8px;
  --sombra:     0 2px 12px rgba(0,0,0,.08);
  --navbar-h:   68px;
  --max-w:      1200px;
  --art-w:      760px;
}

/* ── Reset base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--texto);
  background: var(--blanco);
  line-height: 1.7;
  padding-top: var(--navbar-h);
}

a { color: var(--rojo); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── Barra de progreso de lectura ────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--rojo), var(--naranja));
  z-index: 9999;
  transition: width .1s linear;
}

/* ── NAVBAR ──────────────────────────────────────────────────── */
.va-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--blanco);
  border-bottom: 3px solid var(--rojo);
  z-index: 1000;
  box-shadow: var(--sombra);
}

.va-navbar__container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.va-navbar__logo {
  display: inline-flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
}
.va-navbar__logo img {
  display: block;
  height: 36px;
  width: auto;
}

.va-navbar__menu {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0;
  gap: .25rem;
  list-style: none;
}

.va-navbar__menu > li {
  display: flex;
  align-items: center;
  height: 100%;
}

.va-navbar__link {
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  line-height: 1;
  padding: .65rem .85rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--oscuro);
  border-radius: var(--radius);
  transition: color .2s, background .2s;
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.va-navbar__link:hover { color: var(--rojo); background: #fff0f0; text-decoration: none; }

.va-navbar__cta {
  background: var(--rojo);
  color: var(--blanco) !important;
  font-weight: 600;
  padding: .65rem 1.1rem;
}
.va-navbar__cta:hover { background: #cc0028; color: var(--blanco) !important; }

/* Dropdown Ciudades */
.va-navbar__dropdown-wrap { position: relative; }

.va-navbar__dropdown-toggle {
  gap: .35rem;
}
.va-navbar__dropdown-toggle .va-navbar__arrow {
  font-size: .55rem;
  line-height: 1;
  transition: transform .2s;
  display: inline-block;
}
.va-navbar__dropdown-wrap.is-open .va-navbar__arrow { transform: rotate(180deg); }

.va-navbar__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  list-style: none;
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 100;
  padding: .5rem 0;
}
.va-navbar__dropdown-wrap.is-open .va-navbar__dropdown { display: block; }

.va-navbar__dropdown li a {
  display: block;
  padding: .45rem 1.25rem;
  font-size: .85rem;
  color: var(--texto);
  transition: background .15s, color .15s;
}
.va-navbar__dropdown li a:hover { background: #fff0f0; color: var(--rojo); text-decoration: none; }

/* Hamburguesa (mobile) */
.va-navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.va-navbar__toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--oscuro);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ── CONTENEDOR PRINCIPAL ─────────────────────────────────────── */
.va-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── BREADCRUMB ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: #888;
  padding: 1.25rem 0 .5rem;
  list-style: none;
  background: none;
}
.breadcrumb a { color: #888; }
.breadcrumb a:hover { color: var(--rojo); }
.breadcrumb span { color: var(--texto); font-weight: 500; }

/* ── BADGE CATEGORÍA ─────────────────────────────────────────── */
.tag-category {
  display: inline-block;
  background: var(--naranja);
  color: var(--blanco);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .25rem .75rem;
  border-radius: 20px;
  margin-bottom: .75rem;
}

/* ── CABECERA DEL ARTÍCULO ───────────────────────────────────── */
.article-header { margin-bottom: 1.5rem; }

.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--oscuro);
  line-height: 1.25;
  margin-bottom: .75rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  font-size: .82rem;
  color: #777;
}
.article-meta strong { color: var(--texto); }
.meta-reading { color: var(--rojo); font-weight: 500; }

/* ── IMAGEN DESTACADA ────────────────────────────────────────── */
.article-featured-img {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.article-featured-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.article-featured-img figcaption {
  font-size: .75rem;
  color: #999;
  text-align: center;
  padding: .4rem 0 0;
}

/* ── INTRO DEL ARTÍCULO ──────────────────────────────────────── */
.article-intro p {
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 1rem;
}

/* ── CUADROS ESPECIALES ──────────────────────────────────────── */
.highlight-box {
  background: #fff8e1;
  border-left: 4px solid var(--naranja);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.highlight-box strong { color: var(--oscuro); }

.warning-box {
  background: #fff0f0;
  border-left: 4px solid var(--rojo);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.warning-box strong { color: var(--rojo); }

/* ── TABLA DE CONTENIDOS (TOC) ───────────────────────────────── */
.toc {
  background: var(--gris-claro);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.toc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--oscuro);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.toc-title::before { content: '📋'; font-size: 1rem; }

.toc ul { list-style: none; counter-reset: toc; }
.toc ul li {
  counter-increment: toc;
  padding: .3rem 0;
  border-bottom: 1px solid var(--gris-borde);
  font-size: .88rem;
}
.toc ul li:last-child { border-bottom: none; }
.toc ul li::before {
  content: counter(toc) '. ';
  color: var(--rojo);
  font-weight: 600;
}
.toc ul li a { color: var(--texto); font-weight: 500; }
.toc ul li a:hover { color: var(--rojo); }

/* ── CUERPO DEL ARTÍCULO ─────────────────────────────────────── */
.blog-article {
  max-width: var(--art-w);
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.blog-article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--oscuro);
  margin: 2.25rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gris-borde);
}
.blog-article h2::before { content: ''; display: block; height: calc(var(--navbar-h) + 16px); margin-top: calc(-1 * (var(--navbar-h) + 16px)); }

.blog-article h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--oscuro);
  margin: 1.75rem 0 .6rem;
}

.blog-article p { margin-bottom: 1.1rem; line-height: 1.8; }

.blog-article ul,
.blog-article ol {
  margin: .75rem 0 1.25rem 1.5rem;
}
.blog-article li { margin-bottom: .4rem; line-height: 1.7; }

.blog-article strong { color: var(--oscuro); }

.blog-article a { color: var(--rojo); font-weight: 500; }
.blog-article a:hover { text-decoration: underline; }

/* ── TABLAS ──────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--sombra);
}
.data-table thead tr { background: var(--rojo); color: var(--blanco); }
.data-table th, .data-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gris-borde);
}
.data-table tbody tr:nth-child(even) { background: var(--gris-claro); }
.data-table tbody tr:hover { background: #fff0f0; }

/* ── CAJA DE AUTOR ───────────────────────────────────────────── */
.author-box {
  display: flex;
  gap: 1.25rem;
  background: var(--gris-claro);
  border-left: 4px solid var(--naranja);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem;
  margin: 2.5rem 0;
  align-items: flex-start;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--naranja);
}

.author-info { flex: 1; }

.author-label {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #999;
  margin-bottom: .15rem;
}

.author-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--oscuro);
  margin-bottom: .15rem;
}

.author-title {
  display: block;
  font-size: .8rem;
  color: var(--rojo);
  font-weight: 500;
  margin-bottom: .6rem;
}

.author-bio {
  font-size: .88rem;
  color: #555;
  line-height: 1.65;
  margin: 0;
}
.author-bio a { color: var(--rojo); }

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq-section {
  margin: 2.5rem 0;
  border-top: 2px solid var(--gris-borde);
  padding-top: 1.5rem;
}

.faq-section > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--oscuro);
  margin-bottom: 1.25rem;
  border-bottom: none !important;
}

.faq-section details {
  border: 1px solid var(--gris-borde);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}

.faq-section details[open] { border-color: var(--rojo); }

.faq-section summary {
  font-size: .95rem;
  font-weight: 600;
  color: var(--oscuro);
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gris-claro);
  user-select: none;
  transition: background .15s;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--rojo);
  font-weight: 300;
  flex-shrink: 0;
}
.faq-section details[open] summary { background: #fff0f0; }
.faq-section details[open] summary::after { content: '−'; }
.faq-section summary:hover { background: #fff0f0; }

.faq-section details p {
  padding: 1rem 1.25rem;
  font-size: .92rem;
  line-height: 1.75;
  margin: 0;
  background: var(--blanco);
}

/* ── ARTÍCULOS RELACIONADOS ──────────────────────────────────── */
.related-posts {
  margin: 2.5rem 0 1rem;
  border-top: 2px solid var(--gris-borde);
  padding-top: 1.5rem;
}

.related-posts > h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--oscuro);
  margin-bottom: 1.25rem;
}

/* ── CARD GRID ───────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card-articulo {
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: transform .2s, box-shadow .2s;
}
.card-articulo:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.card-articulo__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.card-articulo__body { padding: 1rem; }

.card-articulo__cat {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--rojo);
  margin-bottom: .4rem;
}

.card-articulo__title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--oscuro);
  line-height: 1.35;
  margin-bottom: .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-articulo__excerpt {
  font-size: .82rem;
  color: #666;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .6rem;
}

.card-articulo__meta {
  font-size: .75rem;
  color: #999;
  display: flex;
  justify-content: space-between;
}

.card-articulo a {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* ── INDEX — HERO BANNER ─────────────────────────────────────── */
.blog-hero {
  background: linear-gradient(135deg, var(--rojo) 0%, #cc0028 50%, #8b0000 100%);
  color: var(--blanco);
  padding: 4rem 1.25rem 3rem;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  margin-bottom: .75rem;
  line-height: 1.2;
}

.blog-hero p {
  font-size: 1.05rem;
  opacity: .9;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.blog-hero__cta {
  display: inline-block;
  background: var(--naranja);
  color: var(--blanco);
  font-weight: 700;
  padding: .85rem 2rem;
  border-radius: 30px;
  font-size: 1rem;
  transition: transform .2s, background .2s;
}
.blog-hero__cta:hover { background: #e68800; transform: scale(1.04); text-decoration: none; }

/* ── INDEX — FILTROS ─────────────────────────────────────────── */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1.5rem 1.25rem 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.filter-btn {
  background: var(--gris-claro);
  border: 1px solid var(--gris-borde);
  color: var(--texto);
  font-size: .82rem;
  font-weight: 500;
  padding: .4rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all .15s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--rojo);
  border-color: var(--rojo);
  color: var(--blanco);
}

/* ── INDEX — GRID PRINCIPAL ──────────────────────────────────── */
.blog-index-grid {
  max-width: var(--max-w);
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.va-footer {
  background: var(--oscuro);
  color: #ccc;
  margin-top: 3rem;
}

.va-footer .footer-top-area {
  padding: 3rem 0 2rem;
}

.va-footer .widgettitle {
  color: var(--blanco);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--rojo);
  display: inline-block;
}

.va-footer .footer-menu {
  list-style: none;
  padding: 0;
}

.va-footer .footer-menu li { margin-bottom: .5rem; }

.va-footer .footer-menu a {
  color: #aaa;
  font-size: .88rem;
  transition: color .15s;
}
.va-footer .footer-menu a:hover { color: var(--naranja); text-decoration: none; }

.va-footer .rtin-des {
  font-size: .88rem;
  color: #999;
  margin-top: .75rem;
  line-height: 1.65;
}
.va-footer .rtin-img { margin-bottom: .75rem; }
.va-footer .rtin-img img {
  filter: brightness(0) invert(1);
  opacity: .85;
}

.va-footer .footer-bottom-area {
  border-top: 1px solid #333;
  padding: 1.25rem 0;
  font-size: .8rem;
  color: #666;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-index-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid       { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Navbar mobile */
  .va-navbar__toggle { display: flex; }
  .va-navbar__menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-h);
    left: 0; right: 0;
    background: var(--blanco);
    border-top: 1px solid var(--gris-borde);
    padding: 1rem;
    gap: .25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    align-items: flex-start;
  }
  .va-navbar__menu.is-open { display: flex; }
  .va-navbar__menu > li { width: 100%; }
  .va-navbar__link { width: 100%; text-align: left; padding: .65rem 1rem; }

  .va-navbar__dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--gris-claro);
    border-radius: var(--radius);
    margin-top: .25rem;
  }

  /* Artículo */
  .blog-article { padding: 1rem .75rem 2.5rem; }
  .blog-article h2 { font-size: 1.3rem; }

  /* Author box */
  .author-box { flex-direction: column; align-items: center; text-align: center; }
  .author-label { text-align: center; }

  /* Cards */
  .blog-index-grid { grid-template-columns: 1fr; padding: 0 .75rem; }
  .card-grid       { grid-template-columns: 1fr; }

  /* Tablas scroll horizontal */
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .blog-hero { padding: 2.5rem .75rem 2rem; }
  .toc { padding: 1rem; }
  .article-meta { flex-direction: column; gap: .3rem; }
}
