/* ─── Article Header ─── */
.template-article .article-header {
  width: 100%;
  position: relative;
  min-height: max(30vh, 400px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color5);
}

@media (max-width: 1100px) {
  .template-article .article-header {
    min-height: 380px;
  }
}

@media (max-width: 767px) {
  .template-article .article-header {
    min-height: 280px;
  }
}

/* Imagen de fondo */
.template-article .article-header-img {
  position: absolute;
  inset: 0;
}

.template-article .article-header-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

.template-article .article-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color5);
}

.template-article .article-img-placeholder span {
  font-family: var(--font2);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

/* Overlay glass para legibilidad del texto */
.template-article .article-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.2) 80%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* Texto encima de la imagen */
.template-article .article-header-text {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width-desktop);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 1rem;
  padding-top: 3rem;
  padding-bottom: 2.5rem;
}

@media (max-width: 1280px) {
  .template-article .article-header-text {
    max-width: var(--max-width-small-desktop);
  }
}

@media (max-width: 1100px) {
  .template-article .article-header-text {
    max-width: 100%;
    padding-left: 30px;
    padding-right: 30px;
  }
}

@media (max-width: 767px) {
  .template-article .article-header-text {
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 2rem;
  }
}

.template-article .article-category {
  display: inline-block;
  font-family: var(--font2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--colo4);
  background-color: var(--color4);
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
  align-self: flex-start;
}

.template-article .article-header-text h1 {
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

.template-article .article-subtitle {
  font-size: clamp(1.15rem, 2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  margin-top: 0.5rem;
}

.template-article .article-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font2);
  font-size: clamp(0.78rem, 1vw, 0.88rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.75);
}

.template-article .article-meta strong {
  font-weight: 500;
  color: #fff;
}

.article-author {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.article-author-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.article-author-titulo {
  opacity: 0.75;
}

.article-author-titulo::before {
  content: "· ";
}

.template-article .article-meta-sep {
  color: rgba(255, 255, 255, 0.3);
}

/* ─── Article Layout (2 cols, sin índice lateral) ─── */
.template-article .article-layout {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 2.5rem;
  width: 100%;
  align-items: start;
}

/* ─── Share ─── */
.template-article .article-share {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 126px;
}

@media (max-width: 767px) {
  .template-article .article-layout {
    grid-template-columns: 1fr;
  }
  .template-article .article-share {
    position: static;
    order: 1;
    flex-direction: row;
    gap: 0.5rem;
  }
}

.template-article .article-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(140, 128, 113, 0.25);
  background: none;
  color: var(--color1);
  cursor: pointer;
  font-size: 0.85rem;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.template-article .article-share-btn:is(:hover, :focus-visible, :active) {
  background-color: var(--color4);
  border-color: var(--color4);
  color: #fff;
}

/* ─── Content ─── */
.template-article .article-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.template-article .article-lead {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 400;
  color: var(--color1);
  line-height: 1.7;
}

.template-article .article-content h2 {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 600;
  color: var(--color1);
  padding-top: 0.5rem;
  scroll-margin-top: 140px;
}

.template-article .article-content p {
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  line-height: 1.8;
  color: var(--color1);
}

.template-article blockquote {
  border-left: 3px solid var(--color4);
  background-color: var(--color2);
  padding: 1.25rem 1.5rem;
  border-radius: 0 2px 2px 0;
}

.template-article blockquote p {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-style: italic;
  color: var(--color1);
  line-height: 1.65;
}

.template-article blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font2);
  font-size: 0.75rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color4);
}

.template-article .article-figure {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.template-article .article-img-placeholder--inline {
  position: relative;
  height: 320px;
  border-radius: 4px;
  overflow: hidden;
}

.template-article figcaption {
  font-family: var(--font2);
  font-size: 0.75rem;
  color: var(--color1);
  font-style: italic;
}

/* ─── Otras notas ─── */
.template-article .article-related-title {
  font-family: var(--font1);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 600;
  color: var(--color1);
  width: 100%;
  margin-bottom: 1.5rem;
}

.template-article .article-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  width: 100%;
  align-items: start;
}

@media (max-width: 1100px) {
  .template-article .article-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .template-article .article-related-grid {
    grid-template-columns: 1fr;
  }
}

.template-article .article-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;

  p {
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    line-height: 1.55;
    color: var(--color1);
  }

  .article-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background-color: var(--color5);

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  h4 {
    font-family: var(--font1);
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color1);
    transition: color 0.2s;
  }

  &:is(:hover, :focus-visible, :active) h4 {
    color: var(--color3);
  }
}

/* ─── Tipografía del contenido ─── */
.template-article .article-content h3 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 600;
  color: var(--color1);
  padding-top: 0.25rem;
  scroll-margin-top: 140px;
}

.template-article .article-content h4 {
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  font-weight: 600;
  color: var(--color1);
}

.template-article .article-content h5,
.template-article .article-content h6 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Listas ─── */
.template-article .article-content ul,
.template-article .article-content ol {
  padding-left: 1.5rem;
}

.template-article .article-content ul {
  list-style: disc;
}

.template-article .article-content ol {
  list-style: decimal;
}

.template-article .article-content li {
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  line-height: 1.8;
  color: var(--color1);
  margin-bottom: 0.3rem;
}

.template-article .article-content ul ul,
.template-article .article-content ol ol,
.template-article .article-content ul ol,
.template-article .article-content ol ul {
  margin-top: 0.3rem;
  list-style: circle;
}

/* ─── Links ─── */
.template-article .article-content a {
  color: var(--color1);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.template-article .article-content a:is(:hover, :focus-visible, :active) {
  color: var(--color4);
}

/* ─── Inline ─── */
.template-article .article-content strong,
.template-article .article-content b {
  font-weight: 700;
}

.template-article .article-content em,
.template-article .article-content i {
  font-style: italic;
}

.template-article .article-content mark {
  background-color: rgba(184, 154, 106, 0.25);
  color: var(--color1);
  padding: 0.05em 0.2em;
  border-radius: 2px;
}

.template-article .article-content del,
.template-article .article-content s {
  color: var(--color3);
  text-decoration: line-through;
}

.template-article .article-content sup,
.template-article .article-content sub {
  font-size: 0.7em;
}

/* ─── Código ─── */
.template-article .article-content code {
  font-family: monospace;
  font-size: 0.88em;
  background-color: var(--color2);
  color: var(--color1);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  border: 1px solid rgba(140, 128, 113, 0.2);
}

.template-article .article-content pre {
  background-color: var(--color1);
  color: var(--color2);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
}

.template-article .article-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ─── HR ─── */
.template-article .article-content hr {
  border: none;
  border-top: 1px solid rgba(140, 128, 113, 0.2);
  margin: 0.5rem 0;
}

/* ─── Imágenes dentro del contenido ─── */
.template-article .article-content img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.template-article .article-content figure {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-article .article-content figcaption {
  font-family: var(--font2);
  font-size: 0.75rem;
  color: var(--color3);
  font-style: italic;
  text-align: center;
}

/* ─── Tablas ─── */
.template-article .article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
}

.template-article .article-content th,
.template-article .article-content td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  border-bottom: 1px solid rgba(140, 128, 113, 0.2);
  color: var(--color1);
  line-height: 1.5;
}

.template-article .article-content th {
  font-family: var(--font2);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color3);
  border-bottom: 2px solid rgba(140, 128, 113, 0.3);
}

.template-article .article-content tr:last-child td {
  border-bottom: none;
}
