/* ============================================================
   ARTÍCULOS — listado y página de artículo
   Usa los tokens de styles.css (navy, naranja, Poppins, Inter)
   ============================================================ */

/* ---------- Listado ---------- */
.art-head {
  background: var(--navy);
  padding: 9rem 0 3.5rem;
}
.art-head h1 {
  color: var(--white);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  max-width: 16ch;
}
.art-head p {
  color: rgba(255,255,255,.72);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  max-width: 56ch;
  margin-top: 1rem;
}

.art-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2.25rem;
}
.art-filter button {
  font: 500 .95rem 'Inter', sans-serif;
  color: rgba(255,255,255,.8);
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: .45rem 1.1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.art-filter button:hover { border-color: rgba(255,255,255,.6); color: var(--white); }
.art-filter button[aria-pressed="true"] {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.art-list {
  padding: 3.5rem 0 6rem;
  background: var(--gray-50);
}
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.art-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
}
.art-card:hover .art-card__title { color: var(--orange); }
.art-card:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.art-card__img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: var(--gray-100);
}
.art-card__body {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.4rem 1.5rem 1.6rem;
  flex: 1;
}
.art-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  transition: color var(--transition);
}
.art-card__dek {
  color: var(--gray-500);
  font-size: .98rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.art-card__meta {
  margin-top: auto;
  padding-top: .5rem;
  font-size: .85rem;
  color: var(--gray-500);
}

/* El artículo más reciente ocupa todo el ancho */
@media (min-width: 900px) {
  .art-card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
  }
  .art-card--featured .art-card__img {
    width: 58%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
  }
  .art-card--featured .art-card__body {
    padding: 2.5rem;
    justify-content: center;
  }
  .art-card--featured .art-card__title { font-size: clamp(1.5rem, 2.4vw, 2rem); }
  .art-card--featured .art-card__dek { font-size: 1.05rem; -webkit-line-clamp: 4; }
}

.art-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--gray-500);
  padding: 3rem 1rem;
}

/* Etiqueta de tipo: Artículo / Caso */
.art-tag {
  align-self: flex-start;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1;
  color: var(--orange);
  background: rgba(230,87,43,.1);
  border-radius: 999px;
  padding: .4rem .75rem;
}

/* ---------- Página de artículo ---------- */
.article {
  padding: 7.5rem 0 4rem;
  background: var(--white);
}
.article__cover {
  max-width: 960px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 5vw, 2.5rem);
}
.article__cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--gray-100);
}
.article__col {
  max-width: 720px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 5vw, 2.5rem);
}
.article__header { padding-top: 2.5rem; }
.article__header .art-tag { display: inline-block; }
.article__title {
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
  margin-top: 1rem;
  letter-spacing: -.01em;
}
.article__dek {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.5;
  color: var(--gray-700);
  margin-top: 1rem;
}

.article__byline {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}
.article__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
}
.article__author { line-height: 1.45; flex: 1; min-width: 0; }
.article__author strong { display: block; color: var(--text-dark); font-weight: 600; }
.article__author span { font-size: .9rem; color: var(--gray-500); }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: 500 .9rem 'Inter', sans-serif;
  color: var(--navy);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  padding: .45rem .95rem;
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition);
}
.share-btn:hover { border-color: var(--orange); color: var(--orange); }
.share-btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
@media (max-width: 520px) {
  .share-btn__label { display: none; }
}

/* Cuerpo del artículo */
.article__body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-body);
  padding-top: 2.25rem;
}
.article__body > * + * { margin-top: 1.4rem; }
.article__body h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.7rem);
  font-weight: 700;
  margin-top: 2.75rem;
}
.article__body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.25rem;
}
.article__body h2 + *, .article__body h3 + * { margin-top: .9rem; }
.article__body a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article__body strong { color: var(--text-dark); font-weight: 600; }
.article__body ul, .article__body ol { padding-left: 1.4rem; }
.article__body ul { list-style: disc; }
.article__body ol { list-style: decimal; }
.article__body li + li { margin-top: .5rem; }
.article__body li::marker { color: var(--orange); }
.article__body blockquote {
  border-left: 4px solid var(--orange);
  padding: .25rem 0 .25rem 1.4rem;
  font-size: 1.3rem;
  line-height: 1.55;
  color: var(--text-dark);
  font-weight: 500;
}
.article__body figure img { border-radius: var(--radius); width: 100%; }
.article__body figcaption {
  font-size: .9rem;
  color: var(--gray-500);
  margin-top: .6rem;
  text-align: center;
}
.article__body hr {
  border: 0;
  border-top: 1px solid var(--gray-100);
  margin: 2.5rem 0;
}

/* Ficha del autor + contacto al final */
.article__end {
  margin-top: 3.5rem;
  padding: 2rem;
  background: var(--navy);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem 1.5rem;
  align-items: center;
}
.article__end .article__avatar { width: 72px; height: 72px; }
.article__end h2 { color: var(--white); font-size: 1.2rem; font-weight: 600; }
.article__end p { color: rgba(255,255,255,.72); font-size: 1rem; line-height: 1.6; margin-top: .35rem; }
.article__end .btn { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 520px) {
  .article__end { grid-template-columns: 1fr; }
}

/* Más artículos */
.article-more {
  background: var(--gray-50);
  padding: 4rem 0 5rem;
}
.article-more__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.article-more__head h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
.article-more__head a { color: var(--orange); font-weight: 600; }
.article-more__head a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .art-card__title, .share-btn, .art-filter button { transition: none; }
}
