/* article.css — PHP Article & Page Renderer — magdala.xyz */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #111011;
  --surface:   #1a181a;
  --surface-2: #221f22;
  --border:    #2a262a;
  --text:      #fcf7fa;
  --muted:     rgba(252, 247, 250, 0.5);
  --pink:      #ff2eb4;
  --yellow:    #ffbe2c;
  --teal:      #11f2b7;
  --accent:    #fcf7fa;

  --font-black: 'Archivo Black', 'Inter', system-ui, sans-serif;
  --font-body:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'Space Mono', 'Courier New', monospace;

  --max: 1400px;
  --content-width: min(90%, var(--max));
  --gap: 1.75rem;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-underline-offset: 3px; text-decoration: none; }
a:hover { color: var(--pink); }

/* ── Header ──────────────────────────────────────────────────── */
.art-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.art-header::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--pink);
  width: 100%;
}

.art-nav {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
}

.art-nav__logo {
  display: inline-flex;
  align-items: center;
  min-width: 220px;
  height: 32px;
  background: url('/brand-logo-dark.png') left center / contain no-repeat;
  line-height: 1;
  text-indent: -9999px;
  overflow: hidden;
  text-decoration: none;
}

.art-nav__logo-img {
  display: block;
  height: 32px;
  width: auto;
  max-width: 260px;
  text-indent: 0;
}

.art-nav__logo:hover .art-nav__logo-img { opacity: 0.9; }

.art-nav__sep   { color: var(--border); }

.art-nav__section {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
}

.art-nav__section:hover { color: var(--pink); }

/* ── Main ─────────────────────────────────────────────────────── */
.art-main {
  width: var(--content-width);
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 0 6rem;
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.art-breadcrumb {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
  margin-bottom: 2.25rem;
}

.art-breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.art-breadcrumb li + li::before {
  content: '/';
  margin-right: 0.35rem;
  color: var(--border);
}

.art-breadcrumb a { color: var(--muted); }
.art-breadcrumb a:hover { color: var(--pink); }

/* ── H1 ───────────────────────────────────────────────────────── */
.art-h1 {
  font-family: var(--font-black);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 400; /* Archivo Black is inherently heavy */
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.75rem;
}

/* ── Definición formal ────────────────────────────────────────── */
.art-definition {
  position: relative;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--surface);
  border-left: 3px solid var(--pink);
  padding: 1.25rem 1.5rem 1.25rem 1.5rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 2.75rem;
}

.art-definition::before {
  content: 'DEFINICIÓN';
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--pink);
  margin-bottom: 0.625rem;
}

/* ── Body ─────────────────────────────────────────────────────── */
.art-body { margin-bottom: 3rem; }

.art-body h2 {
  font-family: var(--font-black);
  font-size: 1.1875rem;
  font-weight: 400;
  color: var(--text);
  margin-top: 2.75rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
}

.art-body h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.art-body p { margin-bottom: 1rem; color: var(--text); }

.art-body ul,
.art-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.art-body li { margin-bottom: 0.4rem; }

.art-body strong { color: var(--yellow); font-weight: 600; }

.art-body a { color: var(--pink); text-decoration: underline; text-underline-offset: 3px; }
.art-body a:hover { opacity: 0.8; }

/* Tabla comparativa */
.art-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.art-body th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-bottom: 2px solid var(--border);
}

.art-body td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
}

.art-body tr:last-child td { border-bottom: none; }

.art-body td:first-child {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── FAQs ─────────────────────────────────────────────────────── */
.art-faqs {
  margin-bottom: 3rem;
}

.art-faqs > h2 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.art-faq {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
  transition: border-color 0.2s;
}

.art-faq:hover {
  border-color: var(--pink);
}

.art-faq h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.625rem;
  font-family: var(--font-body);
  line-height: 1.4;
}

.art-faq p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Links relacionados ───────────────────────────────────────── */
.art-links {
  margin-bottom: 3rem;
}

.art-links > h2 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.art-links ul { list-style: none; padding: 0; }

.art-links li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.art-links li::before {
  content: '→';
  color: var(--pink);
  font-family: var(--font-mono);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.art-links li:hover::before {
  transform: translateX(3px);
}

.art-links li:last-child { border-bottom: none; }

.art-links a { color: var(--text); }
.art-links a:hover { color: var(--pink); }

/* ── Cards de artículos ───────────────────────────────────────── */
.art-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.art-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.art-card:hover {
  border-color: var(--pink);
  transform: translateY(-2px);
}

/* Media / imagen */
.art-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
  text-decoration: none;
}

.art-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.art-card:hover .art-card__media img {
  transform: scale(1.03);
}

/* Placeholder cuando no hay imagen */
.art-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--border);
  position: relative;
  overflow: hidden;
}

.art-card__placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 12px,
    var(--border) 12px,
    var(--border) 13px
  );
  opacity: 0.4;
}

.art-card__placeholder span {
  font-family: var(--font-black);
  font-size: 2rem;
  color: var(--pink);
  position: relative;
  z-index: 1;
  opacity: 0.8;
}

.art-card__placeholder--fallback {
  display: none;
}

.art-card__media--missing .art-card__placeholder--fallback {
  display: flex;
}

/* Cuerpo de la card */
.art-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex: 1;
}

.art-card__title {
  font-family: var(--font-black);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.25;
}

.art-card__title a {
  color: var(--text);
  text-decoration: none;
}

.art-card__title a:hover { color: var(--pink); }

.art-card__excerpt {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.art-card__cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--pink);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: opacity 0.15s;
  margin-top: auto;
}

.art-card__cta:hover { opacity: 0.7; }

/* ── Glosario: términos definidos ────────────────────────────── */
.art-body dl {}

.art-body dt {
  font-family: var(--font-black);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.25rem;
}

.art-body dd {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

/* ── Footer ───────────────────────────────────────────────────── */
.art-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.art-footer__inner {
  width: var(--content-width);
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.art-footer a { color: var(--muted); }
.art-footer a:hover { color: var(--pink); }

.art-footer__links {
  line-height: 2;
  opacity: 0.7;
}

/* ── Responsive ───────────────────────────────────────────────── */

/* Tablet: 2 columnas */
@media (max-width: 1023px) {
  .art-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 640px) {
  :root { --content-width: 92%; }
  .art-main { padding: 2rem 0 4rem; }
  .art-h1 { font-size: 1.625rem; }
  .art-footer__links { display: none; }
  .art-body table { font-size: 0.8125rem; }
  .art-body td:first-child { white-space: normal; }
  .art-cards { grid-template-columns: 1fr; }
  .art-nav { padding: 0.75rem 1rem; }
  .art-nav__logo { min-width: 190px; height: 28px; }
  .art-nav__logo-img { height: 28px; max-width: 220px; }
}
