/**
 * Theme Name: Blocksy Child
 * Description: Devil Fruit TCG — One Piece TCG niche site
 * Author: Hache
 * Template: blocksy
 * Text Domain: blocksy-child
 */

/* ==========================================================================
   1. VARIABLES GLOBALES
   ========================================================================== */

:root {
  /* Project variables (Blocksy palette overrides are in functions.php wp_head) */
  --df-bg: #F8F8F8;
  --df-surface: #FFFFFF;
  --df-dark: #0F1117;
  --df-dark-alt: #1A1A2E;
  --df-accent: #C0392B;
  --df-accent-hover: #A93226;
  --df-orange: #E8572A;
  --df-gold: #F4C430;
  --df-text: #1A1A1A;
  --df-text-muted: #6B7280;
  --df-text-light: #9CA3AF;
  --df-border: #E5E7EB;
  --df-radius: 8px;
  --df-radius-lg: 12px;
  --df-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --df-shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --df-shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --df-transition: 0.2s ease;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */

body {
  background-color: var(--df-bg);
  color: var(--df-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a {
  color: var(--df-accent);
  transition: color var(--df-transition);
}

a:hover {
  color: var(--df-accent-hover);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--df-dark);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); margin-top: 2.5rem; }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); margin-top: 2rem; }

p {
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   3. BLOQUE RESPUESTA DIRECTA (AEO)
   ========================================================================== */

.respuesta-directa {
  background: linear-gradient(135deg, #fef3f2 0%, #fff7ed 100%);
  border-left: 4px solid var(--df-accent);
  border-radius: 0 var(--df-radius) var(--df-radius) 0;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  margin: 0 0 2rem 0;
  position: relative;
  font-size: 1.05rem;
  line-height: 1.7;
}

.respuesta-directa::before {
  content: "\1F4A1";
  position: absolute;
  top: 1.25rem;
  left: -0.85rem;
  background: var(--df-surface);
  border: 2px solid var(--df-accent);
  border-radius: 50%;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
}

.respuesta-directa p:last-child {
  margin-bottom: 0;
}

.respuesta-directa strong {
  color: var(--df-dark);
}

/* ==========================================================================
   4. TARJETAS DE ARTICULO
   ========================================================================== */

.entries {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

article.post {
  background: var(--df-surface);
  border-radius: var(--df-radius-lg);
  overflow: hidden;
  box-shadow: var(--df-shadow);
  transition: transform var(--df-transition), box-shadow var(--df-transition);
}

article.post:hover {
  transform: translateY(-3px);
  box-shadow: var(--df-shadow-lg);
}

article.post .ct-image-container {
  aspect-ratio: 16/9;
  overflow: hidden;
}

article.post .ct-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

article.post:hover .ct-image-container img {
  transform: scale(1.03);
}

article.post .entry-card-content {
  padding: 1.25rem;
}

article.post .entry-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

article.post .entry-title a {
  color: var(--df-dark);
  text-decoration: none;
}

article.post .entry-title a:hover {
  color: var(--df-accent);
}

article.post .entry-excerpt {
  color: var(--df-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-card-category {
  display: inline-block;
  background: var(--df-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   5. TABLAS COMPARATIVAS
   ========================================================================== */

.tabla-comparativa {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--df-radius);
  overflow: hidden;
  box-shadow: var(--df-shadow);
  margin: 2rem 0;
  font-size: 0.95rem;
}

.tabla-comparativa thead th {
  background: var(--df-dark);
  color: #fff;
  font-weight: 600;
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tabla-comparativa tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--df-border);
}

.tabla-comparativa tbody tr:nth-child(even) {
  background: #F9FAFB;
}

.tabla-comparativa tbody tr:hover {
  background: #f0f4ff;
}

.tabla-comparativa tbody tr:last-child td {
  border-bottom: none;
}

.tabla-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border-radius: var(--df-radius);
}

/* ==========================================================================
   6. BLOQUE PRODUCTO / AFILIACION
   ========================================================================== */

.producto-afiliado {
  display: flex;
  gap: 1.5rem;
  background: var(--df-surface);
  border: 1px solid var(--df-border);
  border-radius: var(--df-radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
  align-items: center;
  box-shadow: var(--df-shadow);
  transition: box-shadow var(--df-transition);
}

.producto-afiliado:hover {
  box-shadow: var(--df-shadow-md);
}

.producto-afiliado .producto-imagen {
  flex: 0 0 140px;
  aspect-ratio: 1;
  border-radius: var(--df-radius);
  overflow: hidden;
}

.producto-afiliado .producto-imagen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.producto-afiliado .producto-info {
  flex: 1;
}

.producto-afiliado .producto-nombre {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--df-dark);
  margin: 0 0 0.25rem 0;
}

.producto-afiliado .producto-precio {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--df-accent);
  margin: 0.5rem 0;
}

.producto-afiliado .producto-desc {
  color: var(--df-text-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.producto-afiliado .btn-afiliado {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--df-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--df-radius);
  text-decoration: none;
  transition: background var(--df-transition), transform var(--df-transition);
}

.producto-afiliado .btn-afiliado:hover {
  background: var(--df-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .producto-afiliado {
    flex-direction: column;
    text-align: center;
  }
  .producto-afiliado .producto-imagen {
    flex: 0 0 auto;
    width: 140px;
    margin: 0 auto;
  }
}

/* ==========================================================================
   7. FAQ ACORDEON
   ========================================================================== */

.faq-section {
  margin: 2.5rem 0;
}

.faq-section details {
  background: var(--df-surface);
  border: 1px solid var(--df-border);
  border-radius: var(--df-radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: box-shadow var(--df-transition);
}

.faq-section details:hover {
  box-shadow: var(--df-shadow);
}

.faq-section details[open] {
  box-shadow: var(--df-shadow);
}

.faq-section summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--df-dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  user-select: none;
}

.faq-section summary::-webkit-details-marker {
  display: none;
}

.faq-section summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--df-text-muted);
  flex-shrink: 0;
  transition: transform var(--df-transition);
}

.faq-section details[open] summary::after {
  content: "\2212";
  color: var(--df-accent);
}

.faq-section .faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--df-text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.faq-section .faq-answer p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   8. AUTHOR BOX
   ========================================================================== */

.author-box {
  display: flex;
  gap: 1.25rem;
  background: var(--df-surface);
  border: 1px solid var(--df-border);
  border-radius: var(--df-radius-lg);
  padding: 1.5rem;
  margin: 3rem 0 2rem;
  align-items: flex-start;
}

.author-box .author-avatar {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--df-accent);
}

.author-box .author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-box .author-info {
  flex: 1;
}

.author-box .author-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--df-text-muted);
  margin: 0 0 0.15rem 0;
}

.author-box .author-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--df-dark);
  margin: 0 0 0.5rem 0;
}

.author-box .author-bio {
  font-size: 0.9rem;
  color: var(--df-text-muted);
  line-height: 1.6;
  margin: 0 0 0.75rem 0;
}

.author-box .author-social {
  display: flex;
  gap: 0.75rem;
}

.author-box .author-social a {
  color: var(--df-text-muted);
  font-size: 1.1rem;
  transition: color var(--df-transition);
}

.author-box .author-social a:hover {
  color: var(--df-accent);
}

@media (max-width: 480px) {
  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .author-box .author-social {
    justify-content: center;
  }
}

/* ==========================================================================
   9. BREADCRUMBS
   ========================================================================== */

.ct-breadcrumbs {
  font-size: 0.8rem;
  color: var(--df-text-muted);
  padding: 0.75rem 0;
}

.ct-breadcrumbs a {
  color: var(--df-text-muted);
  text-decoration: none;
}

.ct-breadcrumbs a:hover {
  color: var(--df-accent);
}

/* ==========================================================================
   10. HEADER
   ========================================================================== */

[data-header*="type-1"] .ct-header [data-row*="middle"] {
  background-color: var(--df-dark) !important;
}

[data-header*="type-1"] .ct-header [data-id="logo"] .site-title {
  color: #fff;
}

[data-header*="type-1"] .ct-header [data-id="logo"] .site-title a {
  color: #fff;
  text-decoration: none;
}

[data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > a,
[data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > .ct-menu-link {
  color: rgba(255,255,255,0.85);
}

[data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > a:hover,
[data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > .ct-menu-link:hover {
  color: #fff;
}

[data-header*="type-1"] .ct-header [data-id="trigger"] svg,
[data-header*="type-1"] .ct-header [data-id="search"] svg {
  color: rgba(255,255,255,0.85);
}

header[data-id="type-1"] {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header[data-id="type-1"].ct-sticky-active {
  box-shadow: 0 2px 15px rgba(0,0,0,0.25);
}

/* ==========================================================================
   10b. FOOTER
   ========================================================================== */

[data-footer*="type-1"] .ct-footer {
  background-color: var(--df-dark) !important;
  color: rgba(255,255,255,0.7);
}

[data-footer*="type-1"] .ct-footer a {
  color: rgba(255,255,255,0.7);
  transition: color var(--df-transition);
}

[data-footer*="type-1"] .ct-footer a:hover {
  color: #fff;
}

[data-footer*="type-1"] .ct-footer .widget-title {
  color: #fff;
}

[data-footer*="type-1"] [data-id="copyright"] {
  color: rgba(255,255,255,0.5);
}

[data-footer*="type-1"] [data-id="copyright"] a {
  color: rgba(255,255,255,0.5);
}

[data-footer*="type-1"] [data-id="copyright"] a:hover {
  color: var(--df-accent);
}

/* ==========================================================================
   11. SINGLE POST
   ========================================================================== */

.single .entry-header {
  margin-bottom: 2rem;
}

.single .entry-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.single .entry-content {
  font-size: 1.05rem;
}

.single .entry-content img {
  border-radius: var(--df-radius);
}

/* ==========================================================================
   12. UTILIDADES
   ========================================================================== */

.reading-time {
  font-size: 0.8rem;
  color: var(--df-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.reading-time::before {
  content: "\23F1";
  font-size: 0.85rem;
}

.highlight-gold {
  background: linear-gradient(transparent 60%, rgba(244,196,48,0.3) 60%);
}

.text-accent {
  color: var(--df-accent);
}

.text-gold {
  color: var(--df-gold);
}
