/* =====================================================
   CONTENT — CSS de single.php y page.php
   Archivo: assets/content.css
   Prefijo: ct-
   Se encola en is_single() e is_page() (ver functions.php)
   ===================================================== */

/* ── Design tokens ──────────────────────────────────── */
:root {
  --ct-bg-white:        #FFFFFF;
  --ct-bg-light:        #F5F3EE;
  --ct-bg-dark-card:    #1A1A1A;
  --ct-text-dark:       #1A1A1A;
  --ct-text-body:       #444444;
  --ct-text-dark-muted: #666666;
  --ct-text-muted:      #9A9690;
  --ct-text-dim:        #AAAAAA;
  --ct-orange:          #FF6A00;
  --ct-orange-subtle:   rgba(255, 106, 0, 0.12);
  --ct-orange-border:   rgba(255, 106, 0, 0.30);
  --ct-border-light:    rgba(0, 0, 0, 0.10);
  --ct-content-max:     680px;
  --ct-toc-width:       260px;
  --ct-section-h:       40px;
}

/* =====================================================
   HEADER DEL ARTÍCULO
   ===================================================== */
.ct-header {
  padding: 28px var(--ct-section-h) 0;
  background: var(--ct-bg-white);
}

/* ── Migas de pan ─────────────────────────────────── */
.ct-breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  flex-wrap: wrap;
}

.ct-breadcrumb-item a {
  font-size: 12px;
  color: var(--ct-text-muted);
  text-decoration: none;
  transition: color 150ms;
}

.ct-breadcrumb-item a:hover { color: var(--ct-text-dark); }

.ct-breadcrumb-cat { font-size: 12px; color: var(--ct-text-muted); }

.ct-breadcrumb-item--current {
  font-size: 12px;
  font-weight: 500;
  color: var(--ct-text-dark);
}

.ct-breadcrumb-divider { font-size: 12px; color: #ddd; }

/* ── Badge categoría ──────────────────────────────── */
.ct-category { margin-bottom: 14px; }

/* ── H1 ───────────────────────────────────────────── */
.ct-title {
  font-size: 30px;
  font-weight: 500;
  color: var(--ct-text-dark);
  line-height: 1.2;
  max-width: var(--ct-content-max);
  margin-bottom: 16px;
}

/* ── Meta línea ───────────────────────────────────── */
.ct-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 0.5px solid rgba(0,0,0,0.08);
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
  flex-wrap: wrap;
  margin-bottom: 0;
}

.ct-meta__author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-meta__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ct-orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
}

.ct-meta__name,
.ct-meta__date,
.ct-meta__reading-time { font-size: 12px; color: var(--ct-text-dark-muted); }

.ct-meta__updated { font-size: 12px; color: var(--ct-text-dim); }
.ct-meta__sep     { font-size: 12px; color: #ddd; }

/* =====================================================
   IMAGEN DESTACADA
   ===================================================== */
.ct-featured-image {
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: rgba(0,0,0,0.05);
  /* Sin border-radius. Sin marco. */
}

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

/* =====================================================
   LAYOUT 2 COLUMNAS (contenido + TOC)
   ===================================================== */
.ct-layout {
  display: grid;
  grid-template-columns: 1fr var(--ct-toc-width);
  gap: 48px;
  padding: 36px var(--ct-section-h) 0;
  align-items: start;
  background: var(--ct-bg-white);
}

/* Sin TOC en page.php */
.ct-layout--no-toc {
  grid-template-columns: 1fr;
}

.ct-layout--no-toc .ct-main {
  max-width: var(--ct-content-max);
  margin: 0 auto;
}

.ct-main {
  max-width: var(--ct-content-max);
  min-width: 0; /* evita overflow en grid */
}

/* =====================================================
   INTRO / BAJADA
   ===================================================== */
.ct-intro {
  font-size: 15px;
  color: #444;
  line-height: 1.75;
  border-left: 3px solid var(--ct-orange);
  padding-left: 16px;
  margin-bottom: 28px;
  font-weight: 400;
}

/* =====================================================
   TIPOGRAFÍA DEL CONTENIDO (.ct-body)
   ===================================================== */

.ct-body h2 {
  font-size: 20px;
  font-weight: 500;
  color: var(--ct-text-dark);
  line-height: 1.3;
  margin-top: 36px;
  margin-bottom: 12px;
  scroll-margin-top: 90px; /* compensa el header fijo */
}

.ct-body h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--ct-text-dark);
  line-height: 1.35;
  margin-top: 26px;
  margin-bottom: 8px;
  scroll-margin-top: 90px;
}

.ct-body h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--ct-text-dark);
  line-height: 1.4;
  margin-top: 20px;
  margin-bottom: 6px;
}

.ct-body p {
  font-size: 14px;
  color: var(--ct-text-body);
  line-height: 1.8;
  margin-bottom: 18px;
}

.ct-body strong { font-weight: 500; color: var(--ct-text-dark); }
.ct-body em     { font-style: italic; }

/* Listas */
.ct-body ul,
.ct-body ol {
  margin-bottom: 20px;
  padding-left: 0;
  list-style: none;
}

.ct-body ul li,
.ct-body ol li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--ct-text-body);
  line-height: 1.7;
  margin-bottom: 8px;
  align-items: flex-start;
}

/* Punto naranja para ul */
.ct-body ul li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ct-orange);
  flex-shrink: 0;
  margin-top: 8px;
}

/* Número naranja para ol */
.ct-body ol { counter-reset: ct-counter; }
.ct-body ol li { counter-increment: ct-counter; }
.ct-body ol li::before {
  content: counter(ct-counter) '.';
  font-size: 12px;
  font-weight: 500;
  color: var(--ct-orange);
  flex-shrink: 0;
  min-width: 18px;
  margin-top: 2px;
}

/* Blockquote / Callout */
.ct-body blockquote {
  background: var(--ct-bg-light);
  border-left: 3px solid var(--ct-orange);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
}

.ct-body blockquote p {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  margin-bottom: 0;
  line-height: 1.65;
}

/* Código inline */
.ct-body code {
  background: #F1EFE8;
  color: #D85A30;
  font-size: 13px;
  font-family: var(--font-mono, monospace);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Bloque de código */
.ct-body pre {
  background: #1A1A1A;
  border-radius: 8px;
  padding: 20px 22px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.ct-body pre code {
  background: none;
  color: #F0EDE6;
  font-size: 13px;
  padding: 0;
}

/* Imágenes dentro del contenido */
.ct-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px 0;
}

.ct-body figure { margin: 24px 0; }
.ct-body figcaption {
  font-size: 12px;
  color: var(--ct-text-dim);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* Links dentro del contenido */
.ct-body a {
  color: var(--ct-orange);
  text-decoration: underline;
  text-decoration-color: var(--ct-orange-border);
  text-underline-offset: 2px;
  transition: text-decoration-color 150ms;
}

.ct-body a:hover { text-decoration-color: var(--ct-orange); }

/* Separador */
.ct-body hr {
  border: none;
  border-top: 0.5px solid rgba(0,0,0,0.12);
  margin: 32px 0;
}

/* Tabla */
.ct-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 24px;
}

.ct-body th {
  background: var(--ct-bg-light);
  font-weight: 500;
  color: var(--ct-text-dark);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 0.5px solid rgba(0,0,0,0.12);
}

.ct-body td {
  padding: 10px 12px;
  color: var(--ct-text-body);
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
}

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

/* =====================================================
   SIDEBAR: TOC + COMPARTIR
   ===================================================== */
.ct-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 80px;
}

/* TOC widget */
.ct-toc-widget {
  border: 0.5px solid var(--ct-border-light);
  border-radius: 10px;
  padding: 18px 16px;
}

.ct-toc-widget__title {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ct-text-muted);
  margin-bottom: 14px;
}

/* Links TOC — generados por toc.js */
.ct-toc-link {
  display: block;
  font-size: 12px;
  color: var(--ct-text-dark-muted);
  text-decoration: none;
  padding: 4px 0 4px 10px;
  border-left: 2px solid transparent;
  margin-bottom: 4px;
  line-height: 1.4;
  transition: color 150ms, border-color 150ms;
}

.ct-toc-link:hover { color: var(--ct-orange); }

.ct-toc-link--active {
  color: var(--ct-orange);
  border-left-color: var(--ct-orange);
  font-weight: 500;
}

/* H3 en TOC — indentados */
.ct-toc-link--h3 { padding-left: 20px; font-size: 11px; }

/* Compartir widget */
.ct-share-widget {
  border: 0.5px solid var(--ct-border-light);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.ct-share-widget__title {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ct-text-muted);
  margin-bottom: 12px;
}

.ct-share-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.ct-share-btn {
  width: 32px;
  height: 32px;
  border: 0.5px solid var(--ct-border-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
  font-family: inherit;
}

.ct-share-btn:hover {
  border-color: var(--ct-orange);
  color: var(--ct-orange);
}

.ct-share-copied {
  font-size: 11px;
  color: var(--ct-orange);
  margin-top: 8px;
  height: 16px;
  opacity: 0;
  transition: opacity 200ms;
}

.ct-share-copied--visible { opacity: 1; }

/* =====================================================
   ARTÍCULOS RELACIONADOS
   ===================================================== */
.ct-related {
  padding: 40px var(--ct-section-h) 0;
  border-top: 0.5px solid rgba(0,0,0,0.08);
  margin-top: 40px;
  background: var(--ct-bg-white);
}

.ct-related__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ct-text-muted);
  margin-bottom: 20px;
}

.ct-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ct-related-card {
  border: 0.5px solid var(--ct-border-light);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 200ms;
  background: var(--ct-bg-white);
}

.ct-related-card:hover { border-color: var(--ct-orange-border); }

.ct-related-card__image {
  height: 110px;
  overflow: hidden;
  background: rgba(0,0,0,0.04);
}

.ct-related-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms;
}

.ct-related-card:hover .ct-related-card__image img { transform: scale(1.03); }

.ct-related-card__placeholder {
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.04);
}

.ct-related-card__body { padding: 14px 12px; }

.ct-related-card__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ct-text-dark);
  line-height: 1.35;
  margin: 7px 0 8px;
}

.ct-related-card__title a { color: inherit; text-decoration: none; }
.ct-related-card__title a:hover { color: var(--ct-orange); }

.ct-related-card__link {
  font-size: 11px;
  font-weight: 500;
  color: var(--ct-orange);
  text-decoration: none;
}

/* =====================================================
   CTA FINAL
   ===================================================== */
.ct-cta-section {
  background: var(--ct-bg-light);
  padding: 48px var(--ct-section-h);
  margin-top: 36px;
}

.ct-cta-box {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  background: var(--ct-bg-dark-card);
  border-radius: 10px;
  padding: 36px 28px;
  border: 0.5px solid var(--ct-orange-border);
}

.ct-cta-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ct-orange);
  margin-bottom: 12px;
}

.ct-cta-headline {
  font-size: 18px;
  font-weight: 500;
  color: #F0EDE6;
  line-height: 1.35;
  margin-bottom: 10px;
}

.ct-cta-body {
  font-size: 13px;
  color: var(--ct-text-muted);
  line-height: 1.65;
  margin-bottom: 0;
}

.ct-cta-btn {
  display: inline-block;
  background: var(--ct-orange);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: 4px;
  margin-top: 18px;
  text-decoration: none;
  transition: background 200ms;
}

.ct-cta-btn:hover { background: #e55f2e; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Tablet */
@media (max-width: 1023px) {
  :root { --ct-section-h: 24px; }

  /* Layout: 1 columna, TOC oculto */
  .ct-layout              { grid-template-columns: 1fr; }
  .ct-sidebar             { display: none; }
  .ct-related-grid        { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 767px) {
  :root { --ct-section-h: 20px; }

  .ct-title           { font-size: 22px; }
  .ct-meta            { gap: 8px; }
  .ct-featured-image  { height: 200px; }
  .ct-related-grid    { grid-template-columns: 1fr; }
  .ct-cta-section     { padding: 40px var(--ct-section-h); }
  .ct-cta-box         { padding: 28px 20px; }
}
