/*
Theme Name: AsapTheme-Child
Theme URI: https://asaptheme.com
Version: 1.0.5
Description: TuxAI child theme
Author: Asap Theme
Author URI: https://asaptheme.com
Template: asap
*/

/* ===== HOMEPAGE: hide duplicate page title and breadcrumbs ===== */
body.home.page article h1:not(.tuxai-hero-title),
body.home.page .breadcrumb-trail,
body.home.page .footer-breadcrumb { display: none !important; }

/* ===== Ocultar fechas de publicación (contenido evergreen) ===== */
.entry-meta .posted-on,
.entry-meta .entry-date,
.post-date,
.entry-footer .posted-on,
time.entry-date,
.meta-date,
.article-date,
span.date,
.post-meta .date,
.wp-block-latest-posts__post-date { display: none !important; }

/* ===================================================================
   HEADER — color base (todas las pantallas)
   =================================================================== */

.site-header {
  background: #0d1117 !important;
  border-bottom: 2px solid #3fb950 !important;
  box-shadow: 0 2px 20px rgba(0,0,0,.5) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
}

/* Forzar ancho 100% — ASAP limita a 980px con inline CSS */
.site-header-content {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Logo: tamaño móvil */
.custom-logo {
  height: 54px !important;
  width: auto !important;
  display: block !important;
}

/* Logo más grande en escritorio */
@media (min-width: 1051px) {
  .custom-logo { height: 90px !important; }
}

/* Logo link */
.custom-logo-link { display: flex !important; align-items: center !important; }

/* Hamburger: color */
#nav-icon .line { background: #8b949e !important; }
#nav-icon:hover .line { background: #e6edf3 !important; }

/* ===================================================================
   HEADER — una sola banda: logo izquierda, nav a continuación (≥ 1051px)
   =================================================================== */
@media (min-width: 1051px) {
  /* Fila única: logo + nav juntos desde la izquierda */
  .site-header-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 24px !important;
    gap: 0 !important;
  }

  /* Div del logo */
  .site-logo {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    padding: 12px 20px 12px 0 !important;
    border-right: 1px solid #21262d !important;
    margin-right: 4px !important;
  }

  /* Div del nav (hijo anónimo de site-header-content) */
  .site-header-content > div:not(.site-logo) {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    min-width: 0 !important;
    background: transparent !important;
    padding: 0 !important;
  }

  /* Nav */
  #menu {
    flex: 1 !important;
    min-width: 0 !important;
  }

  #menu .header-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  #menu .header-menu::-webkit-scrollbar { display: none; }

  #menu .header-menu > li {
    flex-shrink: 0 !important;
  }

  #menu .header-menu > li > a {
    color: #8b949e !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    padding: 0 14px !important;
    line-height: 70px !important;
    white-space: nowrap !important;
    display: block !important;
    border-bottom: 3px solid transparent !important;
    transition: color 0.15s, border-color 0.15s, background 0.15s !important;
  }

  #menu .header-menu > li > a:hover {
    color: #e6edf3 !important;
    background: rgba(255,255,255,.04) !important;
    border-bottom-color: #3fb950 !important;
  }

  #menu .header-menu .current-menu-item > a,
  #menu .header-menu .current-menu-ancestor > a {
    color: #3fb950 !important;
    border-bottom-color: #3fb950 !important;
    background: rgba(63,185,80,.06) !important;
  }
}

/* ================================================================
   TIPOGRAFÍA — Atkinson Hyperlegible
   ================================================================ */
body,
.site-content,
.entry-content,
p, li, td, th, input, textarea, select, button,
h1, h2, h3, h4, h5, h6 {
  font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif !important;
}

/* Mantener monospace donde toca */
code, pre, kbd, samp,
.tuxai-hero-code {
  font-family: 'Courier New', 'DejaVu Sans Mono', monospace !important;
}

/* ================================================================
   TUXAI HERO
   ================================================================ */
.tuxai-hero {
  background: #0d1117;
  padding: 48px 24px 40px;
  border-radius: 8px;
  margin-bottom: 32px;
}
.tuxai-hero-title {
  color: #e6edf3 !important;
  font-size: 2.1rem !important;
  line-height: 1.2 !important;
  margin-bottom: 16px !important;
}
.tuxai-hero-sub {
  color: #8b949e !important;
  font-size: 1.05rem !important;
  margin-bottom: 20px !important;
}
.tuxai-hero-sub strong { color: #e6edf3 !important; }
.tuxai-hero-sub code {
  background: #161b22;
  color: #58a6d6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.tuxai-hero-code {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  color: #3fb950 !important;
  font-size: 0.82rem !important;
  padding: 14px 18px !important;
  border-radius: 6px !important;
  max-width: 600px;
  margin: 0 auto !important;
  display: block;
}

/* ================================================================
   LINUX FAMILY CARDS
   ================================================================ */
.tuxai-families .wp-block-column {
  border-radius: 8px;
  padding: 20px 20px 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.tuxai-families .wp-block-column h3 {
  font-size: 1.1rem !important;
  margin-bottom: 10px !important;
}
.tuxai-families .wp-block-column ul {
  font-size: 0.9rem;
  margin: 0 0 12px 0;
  padding-left: 18px;
}
.tuxai-families .wp-block-column ul li { margin-bottom: 3px; }
.tuxai-family--debian { border-top: 4px solid #E95420 !important; }
.tuxai-family--fedora { border-top: 4px solid #3c6eb4 !important; }
.tuxai-family--arch   { border-top: 4px solid #1793d1 !important; }
.tuxai-pkg {
  background: #0d1117 !important;
  color: #3fb950 !important;
  font-size: 0.78rem !important;
  padding: 8px 12px !important;
  border-radius: 4px !important;
  margin: 0 !important;
}

/* ================================================================
   CATEGORY CARDS
   ================================================================ */
.tuxai-cats { margin-top: 8px !important; }
.tuxai-cat-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 18px 14px;
  background: #fff;
  transition: box-shadow .15s ease;
}
.tuxai-cat-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.tuxai-cat-card h4 {
  font-size: 0.95rem !important;
  margin-bottom: 8px !important;
}
.tuxai-cat-card p { font-size: 0.88rem !important; margin-bottom: 8px !important; }
.tuxai-cat-card p:last-child { margin-bottom: 0 !important; }
.tuxai-cat-card a { font-weight: 600; font-size: 0.85rem; }

/* ================================================================
   AFFILIATE BOX
   ================================================================ */
.tuxai-affiliate-box {
  border: 1px solid #3fb950;
  border-radius: 8px;
  background: #0d1117;
  margin: 28px 0;
  overflow: hidden;
}
.tuxai-affiliate-badge {
  background: #3fb950;
  color: #0d1117;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 16px;
}
.tuxai-affiliate-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px;
}
.tuxai-affiliate-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e6edf3;
  white-space: nowrap;
  padding-top: 2px;
}
.tuxai-affiliate-details p {
  color: #e6edf3;
  font-size: 0.9rem;
  margin-bottom: 8px !important;
}
.tuxai-affiliate-details ul {
  margin: 0;
  padding-left: 18px;
}
.tuxai-affiliate-details ul li {
  color: #8b949e;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.tuxai-affiliate-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}
.tuxai-btn-affiliate {
  display: inline-block;
  background: #3fb950;
  color: #0d1117 !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s;
}
.tuxai-btn-affiliate:hover { background: #56d364 !important; color: #0d1117 !important; }
.tuxai-affiliate-note {
  font-size: 0.7rem !important;
  color: #484f58 !important;
  text-align: center;
  margin: 0 !important;
}
@media (max-width: 680px) {
  .tuxai-affiliate-inner { grid-template-columns: 1fr; }
  .tuxai-affiliate-cta { align-items: flex-start; }
}

/* ================================================================
   RESPONSIVE — tablas y bloques de código en móvil
   ================================================================ */

/* Tablas: scroll horizontal en vez de desbordarse */
.entry-content figure.wp-block-table,
.entry-content .wp-block-table {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  display: block !important;
}
.entry-content .wp-block-table table {
  min-width: 480px; /* fuerza scroll en móvil cuando la tabla es ancha */
}

/* Bloques de código: scroll horizontal, sin romper el layout */
.entry-content pre,
.entry-content .wp-block-code,
.entry-content pre.wp-block-code {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  white-space: pre !important;
  word-wrap: normal !important;
}

/* Evitar que cualquier elemento hijo desborde el contenedor */
.entry-content {
  overflow-x: hidden !important;
}
.entry-content > * {
  max-width: 100% !important;
}
