/* ═══════════════════════════════════════════════════════
   articulos.css | Public article listing page
   Depends on: ../../css/main.css?v=4
   ═══════════════════════════════════════════════════════ */

/* ─── TYPOGRAPHY OVERRIDE ────────────────────────────── */
.t-hero {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(32px, 4.2vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
}

/* ─── SUBPAGE HERO OVERRIDE ──────────────────────────── */
.subpage-hero {
  min-height: unset;
  padding: 40px 0 40px;
}

/* ─── PAGE WRAPPER ───────────────────────────────────── */
.art-page {
  width: 100%;
  max-width: var(--max-w);
  padding: clamp(32px, 4vw, 60px) 0 clamp(80px, 10vw, 140px);
}

/* ─── FILTER BAR ─────────────────────────────────────── */
.art-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: clamp(32px, 4vw, 52px);
  padding-bottom: clamp(20px, 2.5vw, 32px);
  border-bottom: 1px solid var(--divider);
}

.art-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 1000px;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--dark-grey);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  background: transparent;
}

.art-filter-tab:hover {
  background: #f4f5f7;
  color: var(--black);
}

.art-filter-tab.active {
  background: var(--accent-1);
  color: #fff;
  font-weight: 700;
  border-color: var(--accent-1);
}

.art-filter-tab.active .art-filter-count {
  color: rgba(255,255,255,0.75);
}

.art-filter-count {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  color: var(--grey-mid);
  letter-spacing: 0;
}

/* ─── ARTICLE GRID ───────────────────────────────────── */
.art-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: clamp(40px, 5vw, 72px);
}

/* ─── ARTICLE CARD ───────────────────────────────────── */
.art-card {
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.art-card:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: rgba(60, 114, 161, 0.2);
}

.art-card-link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(20px, 2.5vw, 28px);
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* ── Meta row: category tag + reading time ── */
.art-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Category color tags */
.art-cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 1000px;
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cat-noticias       { background: #dbeafe; color: #1d4ed8; }
.cat-guias          { background: #fef9c3; color: #a16207; }
.cat-vehiculos      { background: #dcfce7; color: #15803d; }
.cat-datos          { background: #f3e8ff; color: #7e22ce; }
.cat-casos          { background: #ffedd5; color: #c2410c; }
.cat-default        { background: #f3f4f6; color: var(--grey-mid); }

.art-reading-time {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  color: var(--grey-mid);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Title ── */
.art-card-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--black);
  transition: color 0.2s;
}

.art-card:hover .art-card-title {
  color: var(--accent-1);
}

/* ── Excerpt ── */
.art-card-excerpt {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--dark-grey);
  flex: 1;
}

/* ── Footer: date + read link ── */
.art-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  margin-top: auto;
}

.art-card-date {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  color: var(--grey-mid);
  letter-spacing: 0.02em;
}

.art-card-read {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--accent-1);
  white-space: nowrap;
  transition: opacity 0.2s;
}

.art-card:hover .art-card-read {
  opacity: 0.7;
}

/* ─── EMPTY STATE ────────────────────────────────────── */
.art-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: clamp(60px, 8vw, 120px) 0;
  text-align: center;
  border: 1px dashed var(--divider);
  border-radius: 20px;
  background: #fafafa;
}

.art-empty-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--black);
}

.art-empty-body {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1vw, 15px);
  color: var(--dark-grey);
  line-height: 1.6;
  max-width: 440px;
}

/* ─── PAGINATION ─────────────────────────────────────── */
.art-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: clamp(32px, 4vw, 52px);
  border-top: 1px solid var(--divider);
  flex-wrap: wrap;
}

.art-page-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-1);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 1000px;
  border: 1px solid var(--divider);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  background: #fff;
}

.art-page-btn:hover {
  background: var(--accent-2);
  border-color: var(--accent-1);
}

.art-page-btn.is-disabled {
  color: var(--grey-mid);
  pointer-events: none;
  opacity: 0.5;
}

.art-page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.art-page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark-grey);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.art-page-num:hover {
  background: #f4f5f7;
  color: var(--black);
}

.art-page-num.active {
  background: var(--accent-1);
  color: #fff;
  font-weight: 700;
}

.art-page-ellipsis {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--grey-mid);
  padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════
   ARTICLE READER STYLES
   Used by articulo.php only
   ═══════════════════════════════════════════════════════ */

/* ─── READER LAYOUT ─────────────────────────────────── */
.art-reader {
  width: 100%;
  max-width: var(--max-w);
  padding: clamp(32px, 4vw, 60px) 0 clamp(80px, 10vw, 140px);
}

/* ─── BREADCRUMB ─────────────────────────────────────── */
.art-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(24px, 3vw, 40px);
  flex-wrap: wrap;
}

.art-breadcrumb a {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-1);
  text-decoration: none;
  transition: opacity 0.2s;
}
.art-breadcrumb a:hover { opacity: 0.7; }

.art-breadcrumb span[aria-hidden] {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--divider);
}

/* ─── ARTICLE HEADER ────────────────────────────────── */
.art-reader-header {
  width: 100%;
  max-width: clamp(600px, 72vw, 880px);
  margin-bottom: clamp(32px, 4vw, 52px);
}

.art-reader-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--black);
  margin-bottom: clamp(16px, 2vw, 28px);
}

.art-reader-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.art-reader-date,
.art-reader-time,
.art-reader-author {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10px, 0.85vw, 12px);
  color: var(--grey-mid);
  letter-spacing: 0.03em;
}

.art-reader-sep {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: var(--divider);
}

.art-reader-divider {
  width: 100%;
  height: 1px;
  background: var(--divider);
}

/* ─── FEATURED IMAGE ─────────────────────────────────── */
.art-reader-featured-img {
  width: 100%;
  height: clamp(220px, 40vw, 580px);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: clamp(32px, 4vw, 60px);
}

.art-reader-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── ARTICLE BODY ───────────────────────────────────── */
/* Styles the rich text HTML output from TinyMCE */
.art-reader-body {
  width: 100%;
  max-width: clamp(600px, 72vw, 880px);
  margin-bottom: clamp(48px, 6vw, 80px);

  font-family: 'DM Sans', sans-serif;
  font-size: clamp(15px, 1.2vw, 17px);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: -0.005em;
  color: var(--dark-grey);
}

.art-reader-body p {
  margin-bottom: 1.4em;
}

.art-reader-body h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--black);
  margin-top: 2em;
  margin-bottom: 0.6em;
}

.art-reader-body h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--black);
  margin-top: 1.6em;
  margin-bottom: 0.5em;
}

.art-reader-body h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-top: 1.4em;
  margin-bottom: 0.4em;
}

.art-reader-body a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s;
}
.art-reader-body a:hover { opacity: 0.7; }

.art-reader-body strong, .art-reader-body b {
  font-weight: 700;
  color: var(--black);
}

.art-reader-body em, .art-reader-body i {
  font-style: italic;
}

.art-reader-body ul, .art-reader-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.4em;
}

.art-reader-body li {
  margin-bottom: 0.5em;
  line-height: 1.65;
}

.art-reader-body blockquote {
  border-left: 3px solid var(--accent-1);
  margin: 1.6em 0;
  padding: 0.8em 0 0.8em 1.4em;
  background: var(--accent-2);
  border-radius: 0 8px 8px 0;
}

.art-reader-body blockquote p {
  margin: 0;
  font-style: italic;
  color: var(--black);
}

.art-reader-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1.2em 0;
  display: block;
}

.art-reader-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: clamp(13px, 1vw, 15px);
}

.art-reader-body th {
  background: #f4f5f7;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  color: var(--black);
}

.art-reader-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}

.art-reader-body pre,
.art-reader-body code {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  background: #f4f5f7;
  border-radius: 6px;
}

.art-reader-body pre {
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.4em 0;
}

.art-reader-body code {
  padding: 2px 6px;
}

.art-reader-body hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 2em 0;
}

/* ─── ARTICLE FOOTER ─────────────────────────────────── */
.art-reader-footer {
  width: 100%;
  max-width: clamp(600px, 72vw, 880px);
  padding-top: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--divider);
}

.art-reader-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.art-back-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-1);
  text-decoration: none;
  transition: opacity 0.2s;
}
.art-back-btn:hover { opacity: 0.7; }

/* ─── RELATED ARTICLES ───────────────────────────────── */
.art-related {
  width: 100%;
  max-width: var(--max-w);
  padding: clamp(48px, 6vw, 80px) 0 clamp(80px, 10vw, 120px);
  border-top: 1px solid var(--divider);
}

.art-related-header {
  margin-bottom: clamp(24px, 3vw, 40px);
}

.art-related-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--black);
  margin-top: 8px;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .art-reader-header,
  .art-reader-body,
  .art-reader-footer {
    max-width: 100%;
  }

  .art-reader-featured-img {
    border-radius: 16px;
  }
}

/* ═══════════════════════════════════════════════════════
   ORIGINAL LISTING RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .art-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .art-filter-bar {
    gap: 4px;
  }
}

@media (max-width: 600px) {
  .art-grid {
    grid-template-columns: 1fr;
  }

  .art-filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 16px;
    scrollbar-width: none;
  }
  .art-filter-bar::-webkit-scrollbar { display: none; }

  .art-filter-tab {
    flex-shrink: 0;
  }

  .art-pagination {
    gap: 6px;
  }
}
