/* ============================================
   Toca y Opina · Blog shared stylesheet
   ============================================ */

:root{
  --brand:#105BF5;
  --brand-2:#3D7DFF;
  --brand-dark:#0B47C4;
  --brand-soft:#EAF1FE;
  --ink:#0A0A0A;
  --ink-2:#1D1D1F;
  --ink-3:#3A3A3D;
  --muted:#6E6E73;
  --muted-2:#86868B;
  --line:#E5E5E7;
  --line-2:#F1F1F3;
  --gold:#F5B941;
  --gold-2:#FFD27A;
  --gold-soft:#FFF6E0;
  --green:#22C55E;
  --paper:#FAFAFB;
  --paper-2:#F5F5F7;
}

*{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}
html{scroll-behavior:smooth;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Inter",system-ui,sans-serif;
  color:var(--ink);
  background:#fff;
  letter-spacing:-0.011em;
}

/* Headings */
.display{font-weight:800;letter-spacing:-0.045em;line-height:1.02;}
.display-xl{font-size:clamp(2.25rem,5.4vw,4.5rem);}
.display-lg{font-size:clamp(1.875rem,4.2vw,3.25rem);}
.display-md{font-size:clamp(1.5rem,2.8vw,2.25rem);}

.eyebrow{
  text-transform:uppercase;
  letter-spacing:0.18em;
  font-size:0.72rem;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  gap:0.5em;
}
.eyebrow::before{
  content:'';
  width:5px;height:5px;border-radius:9999px;background:currentColor;
}

.text-gradient-brand{
  background:linear-gradient(135deg,#105BF5 0%,#3D7DFF 50%,#6BA4FF 100%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
}
.text-gradient-gold{
  background:linear-gradient(135deg,#F5B941 0%,#FFD27A 100%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
}

/* Glass header */
.glass{
  background:rgba(255,255,255,0.85);
  backdrop-filter:saturate(180%) blur(22px);
  -webkit-backdrop-filter:saturate(180%) blur(22px);
  border-bottom:1px solid rgba(0,0,0,0.06);
}

/* Article prose */
.prose-blog{
  color:var(--ink-2);
  font-size:1.0625rem;
  line-height:1.75;
}
.prose-blog p{margin:0 0 1.25em;}
.prose-blog h2{
  font-size:clamp(1.5rem,2.6vw,2rem);
  font-weight:800;
  letter-spacing:-0.025em;
  line-height:1.2;
  color:var(--ink);
  margin:2.6em 0 0.8em;
  scroll-margin-top:6rem;
}
.prose-blog h3{
  font-size:clamp(1.2rem,1.8vw,1.4rem);
  font-weight:700;
  letter-spacing:-0.02em;
  line-height:1.3;
  color:var(--ink);
  margin:2em 0 0.6em;
  scroll-margin-top:6rem;
}
.prose-blog h2 + p,
.prose-blog h3 + p{margin-top:0;}
.prose-blog a{
  color:var(--brand);
  text-decoration:underline;
  text-decoration-color:rgba(16,91,245,0.35);
  text-underline-offset:3px;
  font-weight:500;
  transition:all 0.2s;
}
.prose-blog a:hover{
  text-decoration-color:var(--brand);
  color:var(--brand-dark);
}
.prose-blog strong{color:var(--ink);font-weight:700;}
.prose-blog ul,.prose-blog ol{
  margin:0 0 1.5em;
  padding-left:1.5em;
}
.prose-blog ul li,.prose-blog ol li{
  margin:0.5em 0;
  padding-left:0.3em;
}
.prose-blog ul li::marker{color:var(--brand);}
.prose-blog ol li::marker{color:var(--brand);font-weight:700;}
.prose-blog blockquote{
  margin:2em 0;
  padding:1.25em 1.5em;
  border-left:4px solid var(--brand);
  background:var(--brand-soft);
  border-radius:0 12px 12px 0;
  font-style:italic;
  color:var(--ink-2);
}
.prose-blog blockquote p:last-child{margin-bottom:0;}
.prose-blog hr{
  border:0;
  border-top:1px solid var(--line);
  margin:3em 0;
}
.prose-blog code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:0.9em;
  background:var(--paper-2);
  padding:0.15em 0.4em;
  border-radius:4px;
  color:var(--ink);
}
.prose-blog table{
  width:100%;
  border-collapse:collapse;
  margin:2em 0;
  font-size:0.95em;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
}
.prose-blog th{
  background:var(--paper-2);
  font-weight:700;
  text-align:left;
  padding:0.75em 1em;
  color:var(--ink);
  border-bottom:1px solid var(--line);
}
.prose-blog td{
  padding:0.75em 1em;
  border-bottom:1px solid var(--line-2);
  vertical-align:top;
}
.prose-blog tr:last-child td{border-bottom:0;}

/* Callout boxes */
.callout{
  margin:2em 0;
  padding:1.5em;
  border-radius:16px;
  border:1px solid var(--line);
  background:var(--paper);
}
.callout-brand{
  background:linear-gradient(135deg,rgba(16,91,245,0.04),rgba(16,91,245,0.08));
  border-color:rgba(16,91,245,0.15);
}
.callout-gold{
  background:linear-gradient(135deg,rgba(245,185,65,0.06),rgba(245,185,65,0.12));
  border-color:rgba(245,185,65,0.25);
}
.callout-green{
  background:linear-gradient(135deg,rgba(34,197,94,0.04),rgba(34,197,94,0.08));
  border-color:rgba(34,197,94,0.18);
}
.callout p:last-child{margin-bottom:0;}
.callout-title{
  font-weight:700;
  color:var(--ink);
  display:flex;
  align-items:center;
  gap:0.5em;
  margin-bottom:0.5em;
  font-size:1.05em;
}

/* CTA card */
.cta-card{
  background:linear-gradient(135deg,#0A0A0A 0%,#1D1D1F 100%);
  color:#fff;
  border-radius:24px;
  padding:2em;
  margin:3em 0;
  position:relative;
  overflow:hidden;
}
.cta-card::before{
  content:'';
  position:absolute;
  top:-50%;left:-10%;
  width:60%;height:200%;
  background:radial-gradient(ellipse,rgba(16,91,245,0.25),transparent 70%);
  pointer-events:none;
}
.cta-card > *{position:relative;}

/* TOC */
.toc{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:16px;
  padding:1.5em;
  margin:2em 0;
}
.toc-title{
  font-size:0.85em;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.1em;
  color:var(--muted);
  margin-bottom:0.75em;
}
.toc ol{
  margin:0;padding-left:1.25em;font-size:0.95em;
}
.toc ol li{margin:0.4em 0;}
.toc a{
  color:var(--ink-2);
  text-decoration:none;
  transition:color 0.2s;
}
.toc a:hover{color:var(--brand);text-decoration:underline;}

/* Pillar hero gradient */
.hero-bg{
  background:
    radial-gradient(60% 50% at 80% 0%,rgba(16,91,245,0.15) 0%,rgba(16,91,245,0) 60%),
    radial-gradient(50% 60% at 5% 25%,rgba(245,185,65,0.12) 0%,rgba(245,185,65,0) 60%),
    linear-gradient(180deg,#FAFBFE 0%,#FFFFFF 60%);
}

/* Cards (related posts, hub grid) */
.card-post{
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  overflow:hidden;
  transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
  display:flex;
  flex-direction:column;
  height:100%;
}
.card-post:hover{
  transform:translateY(-4px);
  border-color:rgba(16,91,245,0.25);
  box-shadow:0 20px 40px -20px rgba(16,91,245,0.15);
}
.card-post .card-img{
  aspect-ratio:16/10;
  background:linear-gradient(135deg,var(--brand-soft),#fff);
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.card-post .card-img-pillar{
  background:linear-gradient(135deg,#0A0A0A,#1D1D1F);
  color:#fff;
}
.card-post .card-body{
  padding:1.5em;
  display:flex;
  flex-direction:column;
  flex:1;
}
.card-post h3{
  font-size:1.15em;
  font-weight:700;
  letter-spacing:-0.02em;
  line-height:1.3;
  margin:0 0 0.5em;
  color:var(--ink);
}
.card-post .card-excerpt{
  color:var(--muted);
  font-size:0.95em;
  line-height:1.55;
  flex:1;
  margin-bottom:1em;
}
.card-post .card-meta{
  display:flex;
  align-items:center;
  gap:0.75em;
  font-size:0.8em;
  color:var(--muted-2);
  padding-top:1em;
  border-top:1px solid var(--line-2);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  gap:0.5em;
  padding:0.875em 1.5em;
  border-radius:9999px;
  font-weight:600;
  font-size:0.95em;
  text-decoration:none;
  transition:all 0.2s;
  white-space:nowrap;
}
.btn-primary{
  background:var(--ink);
  color:#fff;
}
.btn-primary:hover{background:var(--ink-2);transform:translateY(-1px);}
.btn-brand{
  background:linear-gradient(135deg,var(--brand),var(--brand-dark));
  color:#fff;
  box-shadow:0 8px 24px -8px rgba(16,91,245,0.5);
}
.btn-brand:hover{transform:translateY(-1px);box-shadow:0 12px 28px -8px rgba(16,91,245,0.6);}
.btn-ghost{
  background:#fff;
  color:var(--ink);
  border:1px solid var(--line);
}
.btn-ghost:hover{border-color:var(--ink);}

/* Tag */
.tag{
  display:inline-flex;
  align-items:center;
  font-size:0.7em;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  padding:0.3em 0.7em;
  border-radius:9999px;
}
.tag-pillar{background:var(--ink);color:#fff;}
.tag-howto{background:var(--brand-soft);color:var(--brand);}
.tag-strategy{background:var(--gold-soft);color:#92400E;}
.tag-template{background:#DCFCE7;color:#166534;}

/* Breadcrumb */
.breadcrumb{
  display:flex;
  align-items:center;
  gap:0.5em;
  font-size:0.85em;
  color:var(--muted);
  flex-wrap:wrap;
}
.breadcrumb a{
  color:var(--muted);
  text-decoration:none;
  transition:color 0.2s;
}
.breadcrumb a:hover{color:var(--brand);}
.breadcrumb .sep{opacity:0.4;}

/* Article meta strip */
.meta-strip{
  display:flex;
  align-items:center;
  gap:1em;
  flex-wrap:wrap;
  font-size:0.85em;
  color:var(--muted);
  padding:1em 0;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  margin:2em 0;
}
.meta-strip .author{
  display:flex;
  align-items:center;
  gap:0.5em;
  font-weight:600;
  color:var(--ink-2);
}
.meta-strip .author-avatar{
  width:36px;height:36px;
  border-radius:9999px;
  background:linear-gradient(135deg,var(--brand),var(--brand-dark));
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:0.85em;
}

/* Highlight wrapper */
.lead{
  font-size:1.2em;
  line-height:1.55;
  color:var(--ink-2);
  font-weight:400;
  margin-bottom:1.5em;
}

/* Stat block */
.stat-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:1em;
  margin:2em 0;
}
.stat-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:16px;
  padding:1.25em;
}
.stat-num{
  font-size:1.85em;
  font-weight:800;
  letter-spacing:-0.03em;
  line-height:1;
  color:var(--brand);
  margin-bottom:0.25em;
}
.stat-label{
  font-size:0.85em;
  color:var(--muted);
  line-height:1.4;
}

/* Footer */
.site-footer{
  background:#0A0A0A;
  color:#fff;
  padding:3em 0 2em;
  margin-top:5em;
}
.site-footer a{color:#A1A1A6;text-decoration:none;transition:color 0.2s;}
.site-footer a:hover{color:#fff;}

/* ============================================
   Mobile responsiveness fixes
   ============================================ */
@media (max-width: 640px){
  .prose-blog{font-size:1rem;}
  .prose-blog h2{font-size:1.5rem;margin-top:2em;}
  .prose-blog h3{font-size:1.15rem;}
  .prose-blog table{font-size:0.85em;}
  .prose-blog table th,
  .prose-blog table td{padding:0.5em 0.7em;}
  .prose-blog code{font-size:0.85em;word-break:break-all;}
  .prose-blog blockquote{padding:1em 1.2em;font-size:0.95em;}
  .callout{padding:1.2em;margin:1.5em 0;}
  .cta-card{padding:1.5em;border-radius:18px;margin:2em 0;}
  .cta-card h3{font-size:1.25em !important;line-height:1.25 !important;}
  .cta-card p{font-size:0.92em;}
  .toc{padding:1.2em;}
  .meta-strip{font-size:0.78em;gap:0.6em;}
  .meta-strip .author-avatar{width:28px;height:28px;font-size:0.75em;}
  .stat-row{grid-template-columns:repeat(2,1fr);gap:0.7em;}
  .stat-card{padding:1em;}
  .stat-num{font-size:1.45em;}
  .stat-label{font-size:0.78em;}
  .lead{font-size:1.05em;}
  .breadcrumb{font-size:0.78em;}
  .card-post h3{font-size:1.05em;}
  .card-post .card-body{padding:1.2em;}
  /* avoid horizontal scroll on long URLs in plantillas */
  .prose-blog code{display:inline-block;max-width:100%;overflow-wrap:anywhere;}
}

/* Scrollable tables on small screens */
@media (max-width: 540px){
  .prose-blog table{
    display:block;
    overflow-x:auto;
    white-space:nowrap;
    border-radius:12px;
  }
}

/* ============================================
   Sticky mobile CTA — bottom of screen
   ============================================ */
.sticky-mobile-cta{
  position:fixed;
  left:0;right:0;bottom:0;
  z-index:60;
  background:#0A0A0A;
  padding:0.75em 1em calc(0.75em + env(safe-area-inset-bottom, 0));
  box-shadow:0 -8px 32px -8px rgba(0,0,0,0.4);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0.75em;
  transform:translateY(100%);
  transition:transform 0.3s cubic-bezier(0.4,0,0.2,1);
  border-top:1px solid rgba(255,255,255,0.08);
}
.sticky-mobile-cta.visible{transform:translateY(0);}
.sticky-mobile-cta .label{
  color:#fff;
  font-weight:600;
  font-size:0.92em;
  line-height:1.2;
  display:flex;
  flex-direction:column;
  gap:0.1em;
}
.sticky-mobile-cta .label small{
  color:#A1A1A6;
  font-size:0.72em;
  font-weight:400;
}
.sticky-mobile-cta .price-tag{
  background:#fff;
  color:#0A0A0A;
  font-weight:700;
  border-radius:9999px;
  padding:0.6em 1.1em;
  font-size:0.92em;
  display:inline-flex;
  align-items:center;
  gap:0.4em;
  text-decoration:none;
  transition:transform 0.15s;
}
.sticky-mobile-cta .price-tag:hover{transform:scale(1.04);}
.sticky-mobile-cta .price-tag svg{width:14px;height:14px;}

@media (min-width: 768px){
  .sticky-mobile-cta{display:none;}
  body{padding-bottom:0;}
}
@media (max-width: 767px){
  body{padding-bottom:80px;}
}

/* ============================================
   Mobile nav: show key items in compact form
   ============================================ */
@media (max-width: 767px){
  /* If page has hidden md:flex nav, force show */
  header nav.hidden{display:none !important;}
  /* The btn at the right of the nav should still be visible */
}

/* ============================================
   Reading progress bar (top of viewport)
   ============================================ */
.reading-progress{
  position:fixed;
  top:0;left:0;right:0;
  height:3px;
  background:transparent;
  z-index:70;
  pointer-events:none;
}
.reading-progress-bar{
  height:100%;
  width:0%;
  background:linear-gradient(90deg,var(--brand),var(--brand-2),var(--gold));
  transition:width 0.1s linear;
  box-shadow:0 0 8px rgba(16,91,245,0.4);
}

/* ============================================
   Hub search box (filter cards live)
   ============================================ */
.hub-search-wrap{
  position:relative;
  max-width:520px;
  margin:0 0 2em;
}
.hub-search{
  width:100%;
  padding:0.85em 1.1em 0.85em 2.6em;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  font-size:0.95em;
  color:var(--ink);
  font-family:inherit;
  transition:all 0.2s;
  box-shadow:0 1px 3px rgba(0,0,0,0.03);
}
.hub-search:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(16,91,245,0.08);
}
.hub-search::placeholder{color:var(--muted-2);}
.hub-search-icon{
  position:absolute;
  left:0.9em;top:50%;
  transform:translateY(-50%);
  width:18px;height:18px;
  color:var(--muted);
  pointer-events:none;
}
.hub-search-clear{
  position:absolute;
  right:0.7em;top:50%;
  transform:translateY(-50%);
  width:24px;height:24px;
  border-radius:9999px;
  background:var(--paper-2);
  display:none;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:var(--muted);
  border:0;
}
.hub-search-clear:hover{background:var(--line);color:var(--ink);}
.hub-search-wrap.has-value .hub-search-clear{display:inline-flex;}

/* Card filter states (hide when not matching) */
.card-post.filtered-out{
  display:none !important;
}

/* ============================================
   Sticky TOC (fixed on left, wide screens only)
   ============================================ */
.toc-fixed{
  display:none;
}
@media (min-width: 1280px){
  .toc-fixed{
    display:block;
    position:fixed;
    top:7rem;
    left:max(1.5rem, calc(50vw - 480px - 220px));
    width:200px;
    max-height:calc(100vh - 9rem);
    overflow-y:auto;
    font-size:0.85em;
    z-index:30;
    padding-right:0.5rem;
  }
  .toc-fixed::-webkit-scrollbar{width:4px;}
  .toc-fixed::-webkit-scrollbar-thumb{background:var(--line);border-radius:9999px;}
  .toc-fixed-title{
    font-size:0.7em;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:0.16em;
    color:var(--muted);
    margin-bottom:1em;
    padding-bottom:0.6em;
    border-bottom:1px solid var(--line);
  }
  .toc-fixed ul{list-style:none;padding:0;margin:0;}
  .toc-fixed li{margin:0.4em 0;line-height:1.3;}
  .toc-fixed li.toc-h3{margin-left:0.9em;font-size:0.92em;}
  .toc-fixed a{
    color:var(--muted);
    text-decoration:none;
    border-left:2px solid transparent;
    padding-left:0.8em;
    margin-left:-0.8em;
    display:block;
    transition:all 0.2s;
  }
  .toc-fixed a:hover{color:var(--ink);}
  .toc-fixed a.active{
    color:var(--brand);
    border-left-color:var(--brand);
    font-weight:600;
  }
}
.hub-empty-state{
  display:none;
  padding:3em 1em;
  text-align:center;
  color:var(--muted);
  font-size:0.95em;
  border:1px dashed var(--line);
  border-radius:16px;
}
.hub-filtering .hub-empty-state.show{display:block;}

