/*
Theme Name: HubSincro Blog
Theme URI: https://hubsincro.com
Author: HubSincro
Author URI: https://hubsincro.com
Description: Tema custom para el blog de HubSincro. Branding navy + blue, Plus Jakarta Sans, navbar con vínculos al sitio principal, footer con CTA, tracking GTM-NBJK877Q integrado. Listo para que un AI plugin o CMS publique entradas automáticamente.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hubsincro-blog
Tags: blog, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  /* Brand colors — match main site */
  --c-navy:       #0B1F3A;
  --c-navy-800:   #0f2847;
  --c-navy-700:   #153258;
  --c-blue:       #2F80ED;
  --c-blue-400:   #5099F0;
  --c-blue-300:   #7BB3F4;
  --c-blue-100:   #DCEBFF;
  --c-blue-50:    #EEF5FF;
  --c-green:      #10B981;
  --c-green-100:  #D1FAE5;

  /* Neutrals */
  --c-white:      #FFFFFF;
  --c-bg:         #F8FAFC;
  --c-surface:    #FFFFFF;
  --c-border:     #E5E7EB;
  --c-border-2:   #F3F4F6;
  --c-text:       #111827;
  --c-text-2:     #374151;
  --c-text-3:     #6B7280;
  --c-text-4:     #9CA3AF;

  /* Spacing scale (8px base) */
  --sp-1:  4px;  --sp-2:  8px;  --sp-3:  12px; --sp-4:  16px;
  --sp-5:  20px; --sp-6:  24px; --sp-8:  32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* Typography scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Radius */
  --r-sm:  6px;  --r-md:  10px; --r-lg:  16px;
  --r-xl:  24px; --r-2xl: 32px; --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-blue: 0 8px 32px rgba(47,128,237,0.25);

  /* Transitions */
  --t-fast:   150ms ease;
  --t-base:   200ms ease;
  --t-slow:   300ms ease;

  /* Layout */
  --max-w: 1160px;
  --max-w-narrow: 720px;
  --nav-h: 68px;
}

/* ═══════════════════════════════════════════
   RESET + BASE
═══════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; scroll-padding-top: var(--nav-h); }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--c-blue); text-decoration: none; transition: color var(--t-base); }
a:hover { color: var(--c-navy); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 3px; border-radius: var(--r-sm); }

/* ═══════════════════════════════════════════
   LAYOUT UTILITIES
═══════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
@media (min-width: 768px) { .container { padding-inline: var(--sp-8); } }
.container--narrow { max-width: var(--max-w-narrow); }
.container--wide { max-width: 1280px; }
.text-center { text-align: center; }

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow var(--t-base);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: var(--sp-6);
}
.header-logo { display: flex; align-items: center; flex-shrink: 0; }
.header-logo img { height: 40px; width: auto; }
@media (max-width: 480px) { .header-logo img { height: 34px; } }

.header-nav { display: none; }
@media (min-width: 900px) {
  .header-nav { display: block; flex: 1; }
  .header-nav ul { display: flex; gap: var(--sp-8); list-style: none; justify-content: center; }
  .header-nav a {
    color: var(--c-text-3);
    font-size: var(--text-sm);
    font-weight: 500;
    position: relative;
  }
  .header-nav a:hover { color: var(--c-navy); }
  .header-nav a::after {
    content: '';
    position: absolute; bottom: -6px; left: 0; right: 0; height: 2px;
    background: var(--c-blue);
    transform: scaleX(0); transform-origin: left;
    transition: transform var(--t-base);
    border-radius: var(--r-full);
  }
  .header-nav a:hover::after { transform: scaleX(1); }
}

.header-cta {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--c-blue);
  color: #fff !important;
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 10px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-blue);
  transition: transform var(--t-base), box-shadow var(--t-base);
  flex-shrink: 0;
  white-space: nowrap;
}
.header-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(47,128,237,0.35); color: #fff !important; }
@media (max-width: 480px) {
  .header-cta { padding: 8px 14px; font-size: var(--text-xs); }
  .header-cta svg { display: none; }
}

/* ═══════════════════════════════════════════
   MAIN
═══════════════════════════════════════════ */
.main {
  padding-block: var(--sp-12) var(--sp-20);
  min-height: 60vh;
}
@media (min-width: 768px) { .main { padding-block: var(--sp-20) var(--sp-24); } }

/* ═══════════════════════════════════════════
   ARCHIVE / BLOG INDEX
═══════════════════════════════════════════ */
.archive-header {
  text-align: center;
  margin-bottom: var(--sp-12);
}
.archive-header h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-navy);
  margin-bottom: var(--sp-3);
}
@media (min-width: 768px) { .archive-header h1 { font-size: var(--text-5xl); } }
.archive-header p {
  font-size: var(--text-lg);
  color: var(--c-text-3);
  max-width: 580px;
  margin-inline: auto;
}

/* ═══════════════════════════════════════════
   POST GRID (CARDS)
═══════════════════════════════════════════ */
.post-grid {
  display: grid;
  gap: var(--sp-8);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-blue-100);
}
.post-card__image {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--c-blue-50);
}
.post-card__image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.post-card:hover .post-card__image img { transform: scale(1.04); }
.post-card__body {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex: 1;
}
.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--c-text-3);
  font-weight: 500;
}
.post-card__category {
  color: var(--c-blue);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.post-card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-navy);
  letter-spacing: -0.01em;
}
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--c-blue); }
.post-card__excerpt {
  color: var(--c-text-2);
  font-size: var(--text-sm);
  line-height: 1.6;
  flex: 1;
}
.post-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-2);
  font-size: var(--text-xs);
  color: var(--c-text-3);
}
.post-card__link {
  color: var(--c-blue);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════ */
.pagination {
  margin-top: var(--sp-16);
  display: flex;
  justify-content: center;
}
.pagination .nav-links,
.pagination .page-numbers {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-size: var(--text-sm);
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  transition: all var(--t-base);
}
.pagination a:hover { background: var(--c-blue-50); color: var(--c-blue); border-color: var(--c-blue-100); }
.pagination .current { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }

/* ═══════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  border-radius: var(--r-2xl);
}
.empty-state h2 {
  font-size: var(--text-3xl);
  color: var(--c-navy);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-4);
}
.empty-state p {
  font-size: var(--text-lg);
  color: var(--c-text-3);
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: var(--sp-8);
}
.empty-state__actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  flex-wrap: wrap;
}
.empty-state__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--text-sm);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  transition: all var(--t-base);
}
.empty-state__btn:hover { border-color: var(--c-blue); color: var(--c-blue); }
.empty-state__btn--primary {
  background: var(--c-navy);
  color: #fff;
  border-color: var(--c-navy);
  box-shadow: var(--shadow-md);
}
.empty-state__btn--primary:hover { background: var(--c-navy-800); color: #fff; border-color: var(--c-navy-800); }

/* ═══════════════════════════════════════════
   SINGLE POST
═══════════════════════════════════════════ */
.post-single { color: var(--c-text); }
.post-header {
  padding-block: var(--sp-12) var(--sp-8);
}
.post-header__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--c-text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-4);
}
.post-header__meta a { color: var(--c-blue); }
.post-header__title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-navy);
  line-height: 1.15;
  margin-bottom: var(--sp-5);
}
@media (min-width: 768px) { .post-header__title { font-size: var(--text-5xl); } }
.post-header__byline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--c-text-3);
  font-weight: 500;
}
.post-featured {
  margin-block: var(--sp-8);
}
.post-featured img {
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.post-content {
  padding-block: var(--sp-8);
}
.post-content > .container > p,
.post-content > .container > h2,
.post-content > .container > h3,
.post-content > .container > ul,
.post-content > .container > ol,
.post-content > .container > blockquote,
.post-content > .container > figure,
.post-content > .container > pre {
  margin-bottom: var(--sp-6);
}
.post-content h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--c-navy);
  letter-spacing: -0.01em;
  margin-top: var(--sp-12);
  margin-bottom: var(--sp-4);
}
.post-content h3 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-navy);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}
.post-content p {
  font-size: var(--text-lg);
  line-height: 1.75;
  color: var(--c-text-2);
}
.post-content a {
  color: var(--c-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.post-content a:hover { color: var(--c-navy); }
.post-content ul, .post-content ol {
  padding-left: var(--sp-6);
  font-size: var(--text-lg);
  line-height: 1.75;
  color: var(--c-text-2);
}
.post-content li { margin-bottom: var(--sp-2); }
.post-content blockquote {
  border-left: 4px solid var(--c-blue);
  padding: var(--sp-4) var(--sp-6);
  background: var(--c-blue-50);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--c-text);
}
.post-content code {
  background: var(--c-blue-50);
  color: var(--c-navy);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  font-size: 0.9em;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}
.post-content pre {
  background: var(--c-navy);
  color: var(--c-blue-100);
  padding: var(--sp-5);
  border-radius: var(--r-md);
  overflow-x: auto;
  font-size: var(--text-sm);
}
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-content img,
.post-content figure {
  border-radius: var(--r-lg);
  margin-block: var(--sp-8);
}
.post-content figcaption {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--c-text-3);
  margin-top: var(--sp-2);
}

/* ═══════════════════════════════════════════
   POST FOOTER
═══════════════════════════════════════════ */
.post-footer {
  padding-block: var(--sp-8) var(--sp-12);
  border-top: 1px solid var(--c-border);
  margin-top: var(--sp-12);
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-8);
}
.post-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 6px 12px;
  background: var(--c-blue-50);
  color: var(--c-blue);
  border-radius: var(--r-full);
  transition: all var(--t-base);
}
.post-tag:hover { background: var(--c-blue); color: #fff; }

/* CTA box at end of post */
.post-cta-box {
  background: linear-gradient(135deg, var(--c-navy) 0%, var(--c-navy-700) 100%);
  color: #fff;
  padding: var(--sp-10);
  border-radius: var(--r-2xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.post-cta-box h3 {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-2);
  color: #fff;
}
.post-cta-box p {
  color: rgba(255,255,255,0.7);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-6);
}
.post-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--c-blue);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: var(--text-base);
  box-shadow: var(--shadow-blue);
  transition: transform var(--t-base);
}
.post-cta-btn:hover { transform: translateY(-2px); color: #fff; }

/* ═══════════════════════════════════════════
   RELATED POSTS
═══════════════════════════════════════════ */
.related-posts {
  padding-block: var(--sp-16);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.related-posts h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--c-navy);
  margin-bottom: var(--sp-8);
}

/* ═══════════════════════════════════════════
   STATIC PAGE
═══════════════════════════════════════════ */
.page-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-navy);
  margin-bottom: var(--sp-8);
}
.page-body {
  font-size: var(--text-lg);
  color: var(--c-text-2);
  line-height: 1.75;
}
.page-body h2, .page-body h3 {
  color: var(--c-navy);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  font-weight: 700;
}
.page-body p { margin-bottom: var(--sp-5); }
.page-body a { color: var(--c-blue); text-decoration: underline; text-underline-offset: 3px; }

/* ═══════════════════════════════════════════
   404
═══════════════════════════════════════════ */
.main--404 { min-height: 70vh; display: grid; place-items: center; }
.main--404 h1 {
  font-size: var(--text-5xl);
  color: var(--c-navy);
  font-weight: 800;
  margin-bottom: var(--sp-4);
}
.main--404 p {
  font-size: var(--text-lg);
  color: var(--c-text-3);
  margin-bottom: var(--sp-8);
}
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--text-sm);
  margin-inline: var(--sp-2);
  transition: all var(--t-base);
}
.btn-primary {
  background: var(--c-navy);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--c-navy-800); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
}
.btn-ghost:hover { border-color: var(--c-blue); color: var(--c-blue); }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer {
  background: var(--c-navy);
  color: rgba(255,255,255,0.7);
  padding-block: var(--sp-16) var(--sp-8);
}
.footer-grid {
  display: grid;
  gap: var(--sp-10);
  grid-template-columns: 1fr;
  margin-bottom: var(--sp-12);
}
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.5fr; } }

.footer-col h4 {
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-4);
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: var(--text-sm);
  transition: color var(--t-base);
}
.footer-col a:hover { color: var(--c-blue-300); }

.footer-col--brand img {
  filter: brightness(0) invert(1);
  margin-bottom: var(--sp-4);
}
.footer-col--brand p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  max-width: 280px;
}

.footer-col--cta p {
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
}
.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--c-blue);
  color: #fff !important;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-blue);
  transition: transform var(--t-base);
}
.footer-cta-btn:hover { transform: translateY(-1px); color: #fff !important; }

.footer-bottom {
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
}
.footer-bottom a { color: rgba(255,255,255,0.7); }
.footer-bottom a:hover { color: var(--c-blue-300); }

/* ═══════════════════════════════════════════
   COMMENTS (basic — usually disabled for blog)
═══════════════════════════════════════════ */
.comments-area {
  padding-block: var(--sp-12);
  border-top: 1px solid var(--c-border);
}
.comment-list { list-style: none; }
.comment-list .comment {
  padding: var(--sp-5);
  background: var(--c-surface);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
}

/* ═══════════════════════════════════════════
   ALIGNMENT (Gutenberg)
═══════════════════════════════════════════ */
.alignwide { margin-inline: calc((100% - var(--max-w)) / 2); max-width: var(--max-w); }
.alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; }
@media (max-width: 1199px) { .alignwide { margin-inline: 0; max-width: 100%; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
