/* ═══════════════════════════════════════════════════════════════════
   Matmap Blog Builder — public/css/post.css
   Scoped with .mbb-* prefix. No global selectors.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────────── */
:root {
  --mbb-primary:       #2d3748;
  --mbb-accent:        #e69130;
  --mbb-accent-hover:  #c05621;
  --mbb-head:          #1a202c;
  --mbb-body:          #4a5568;
  --mbb-bg:            #fdfdfd;
  --mbb-bg-alt:        #f7fafc;
  --mbb-border:        #e2e8f0;
  --mbb-success-bg:    #c6f6d5;
  --mbb-success-fg:    #22543d;
  --mbb-warn-bg:       #fefcbf;
  --mbb-warn-fg:       #744210;
  --mbb-danger-bg:     #fed7d7;
  --mbb-danger-fg:     #742a2a;
  --mbb-cta:           #3a3972;
  --mbb-font:          'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mbb-shadow-md:     0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -1px rgba(0,0,0,.06);
  --mbb-shadow-lg:     0 12px 24px -8px rgba(0,0,0,.15);
  --mbb-radius:        12px;
  --mbb-wrap:          1100px;
  --mbb-wrap-mid:      980px;
  --mbb-wrap-narrow:   820px;
}

/* ── Reset (scoped) ──────────────────────────────────────────────── */
.mbb-hero *,
.mbb-hero *::before,
.mbb-hero *::after,
#mbb-main *,
#mbb-main *::before,
#mbb-main *::after,
.mbb-sticky-cta *,
.mbb-sticky-cta *::before,
.mbb-sticky-cta *::after {
  box-sizing: border-box;
}

.mbb-hero,
#mbb-main,
.mbb-sticky-cta {
  font-family: var(--mbb-font);
  color: var(--mbb-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

#mbb-main img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Utility ─────────────────────────────────────────────────────── */
.mbb-wrap       { max-width: var(--mbb-wrap);        margin: 0 auto; padding: 0 1.5rem; }
.mbb-wrap--mid  { max-width: var(--mbb-wrap-mid);    margin: 0 auto; padding: 0 1.5rem; }
.mbb-wrap--narrow { max-width: var(--mbb-wrap-narrow); margin: 0 auto; padding: 0 1.5rem; }

.mbb-vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Hero ────────────────────────────────────────────────────────── */
.mbb-hero {
  position: relative;
  min-height: 64vh;
  display: grid;
  place-items: center;
  isolation: isolate;
  background: #0f0f14;
}

.mbb-hero__images {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 1fr;
  z-index: -2; overflow: hidden;
}

.mbb-hero__img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.65);
}

.mbb-hero__img--2 { display: none; }

.mbb-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.58), rgba(0,0,0,.68));
  pointer-events: none;
  z-index: 0;
}

.mbb-hero__content {
  position: relative; z-index: 1;
  color: #fff; text-align: center;
  padding: 2rem;
}

.mbb-hero__kicker {
  margin: 0 0 .25rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .9rem;
}

.mbb-hero__title {
  margin: .25rem 0 .6rem;
  line-height: 1.06; color: #fff;
  font-weight: 800;
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
}

.mbb-hero__sub {
  max-width: 66ch; margin: 0 auto 1.1rem;
  font-size: clamp(1.05rem, 2.3vw, 1.22rem);
  color: #fff;
}

.mbb-hero__ctas {
  display: flex; gap: .8rem;
  justify-content: center; flex-wrap: wrap;
}

@media (min-width: 980px) {
  .mbb-hero              { min-height: 70vh; }
  .mbb-hero__images      { grid-template-columns: 1fr 1fr; }
  .mbb-hero__img--2      { display: block; }
  .mbb-hero__content     {
    text-align: left;
    max-width: 52%;
    justify-self: start;
    margin-left: 2rem;
  }
  .mbb-hero__ctas        { justify-content: flex-start; }
  .mbb-hero__sub         { margin-left: 0; }
}

/* ── Sections ────────────────────────────────────────────────────── */
.mbb-section      { padding: 3rem 0; }
.mbb-section--alt { background: var(--mbb-bg-alt); }

.mbb-section h2,
.mbb-section h3 { color: var(--mbb-head); line-height: 1.3; }

.mbb-section__title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 1rem; font-weight: 800;
  text-align: center;
}

.mbb-section__intro {
  max-width: 70ch; margin: 0 auto 1.6rem;
  text-align: center;
}

.mbb-lead {
  max-width: 74ch; margin: 1rem auto 0;
  font-size: 1.05rem; opacity: .95;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.mbb-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.mbb-card {
  background: #fff;
  border: 1px solid var(--mbb-border);
  border-radius: var(--mbb-radius);
  padding: 1.2rem;
  box-shadow: var(--mbb-shadow-md);
}

.mbb-card__icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: .25rem;
}

.mbb-card__title {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  margin: 0 0 .5rem; font-weight: 800;
  color: var(--mbb-head);
}

.mbb-card__body { margin: 0; }

@media (min-width: 900px) {
  .mbb-cards { grid-template-columns: 1fr 1fr; }
}

/* ── Decision cards ──────────────────────────────────────────────── */
.mbb-decision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem; text-align: center;
  margin-top: 1.6rem;
}

.mbb-decision-card {
  background: #fff;
  padding: 1.4rem;
  border-radius: var(--mbb-radius);
  border: 1px solid var(--mbb-border);
  box-shadow: var(--mbb-shadow-md);
}

.mbb-decision-card__icon {
  font-size: 2.1rem; margin-bottom: .2rem;
}

.mbb-decision-card__title {
  font-weight: 800; color: var(--mbb-head);
  margin: .2rem 0 .25rem;
  font-size: 1.1rem;
}

.mbb-decision-card__winner {
  display: block; font-weight: 800;
  color: var(--mbb-primary); font-size: 1.05rem;
  margin-bottom: .35rem;
}

.mbb-decision-card__desc { font-size: .97rem; margin: 0; }

@media (min-width: 768px) {
  .mbb-decision-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Table ───────────────────────────────────────────────────────── */
.mbb-table {
  width: 100%; border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--mbb-border);
  border-radius: var(--mbb-radius);
  overflow: hidden;
  box-shadow: var(--mbb-shadow-md);
  margin-top: 1rem;
}

.mbb-table th,
.mbb-table td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--mbb-border);
  text-align: left;
}

.mbb-table thead {
  background: #f4f7fb;
  color: var(--mbb-primary);
  font-weight: 800;
}

.mbb-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
  .mbb-table thead { display: none; }
  .mbb-table,
  .mbb-table tbody,
  .mbb-table tr,
  .mbb-table td     { display: block; width: 100%; }
  .mbb-table tr     { border-bottom: 1px solid var(--mbb-border); padding: 1rem; }
  .mbb-table tr:last-child { border-bottom: none; }
  .mbb-table td     { border: none; padding: .35rem 0; }
  .mbb-table td[data-label] {
    display: flex; justify-content: space-between; gap: 1rem;
  }
  .mbb-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 800; color: var(--mbb-primary);
  }
}

/* ── Badges ──────────────────────────────────────────────────────── */
.mbb-badge {
  display: inline-block; border-radius: 999px;
  padding: .3rem .7rem; font-weight: 800; font-size: .85rem;
}

.mbb-badge--ok     { background: var(--mbb-success-bg); color: var(--mbb-success-fg); }
.mbb-badge--warn   { background: var(--mbb-warn-bg);    color: var(--mbb-warn-fg);    }
.mbb-badge--danger { background: var(--mbb-danger-bg);  color: var(--mbb-danger-fg);  }

/* ── Analysis grid (image + text) ────────────────────────────────── */
.mbb-analysis-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: 1fr;
  margin-top: 2.4rem;
}

.mbb-analysis-item img {
  border-radius: var(--mbb-radius);
  margin-bottom: .9rem;
  box-shadow: var(--mbb-shadow-lg);
  width: 100%; height: 320px;
  object-fit: cover;
}

.mbb-analysis-item h3 {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  margin: 0 0 .6rem; font-weight: 800;
  color: var(--mbb-head);
}

.mbb-analysis-item ul {
  margin: .35rem 0 0; padding-left: 1.1rem;
}

@media (min-width: 980px) {
  .mbb-analysis-grid { grid-template-columns: 1fr 1fr; }
}

/* ── CTA Banner ──────────────────────────────────────────────────── */
.mbb-cta-banner {
  background: var(--mbb-cta); color: #fff;
  text-align: center; padding: 2.6rem 1.2rem;
  border-radius: var(--mbb-radius);
}

.mbb-cta-banner__title {
  color: #fff !important; margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
}

.mbb-cta-banner__body {
  max-width: 60ch; margin: .8rem auto 1.2rem; opacity: .95;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.mbb-btn {
  display: inline-block;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid transparent;
  line-height: 1.3;
  font-family: var(--mbb-font);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.mbb-btn:focus { outline: 3px solid #a0aec0; outline-offset: 2px; }

.mbb-btn--primary {
  background: var(--mbb-accent); color: #fff;
}
.mbb-btn--primary:hover {
  background: var(--mbb-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--mbb-shadow-md);
  color: #fff;
}

.mbb-btn--ghost {
  background: transparent;
  border-color: #fff; color: #fff;
}
.mbb-btn--ghost:hover {
  background: #fff; color: var(--mbb-primary);
}

/* ── FAQ ─────────────────────────────────────────────────────────── */
.mbb-faq__item {
  border-bottom: 1px solid var(--mbb-border);
  padding: .9rem 0;
}

.mbb-faq__item:first-of-type { border-top: 1px solid var(--mbb-border); }

.mbb-faq__q {
  font-weight: 800; color: var(--mbb-head);
  cursor: pointer; list-style: none;
}

.mbb-faq__q::-webkit-details-marker { display: none; }
.mbb-faq__q::marker { display: none; }

.mbb-faq__q::before {
  content: "+ ";
  font-weight: 900;
  color: var(--mbb-accent);
  margin-right: .15rem;
  transition: content .15s;
}

details[open] > .mbb-faq__q::before { content: "− "; }

.mbb-faq__a { margin: .55rem 0 0; padding-left: 1rem; }

/* ── Author card ─────────────────────────────────────────────────── */
.mbb-author-card {
  background: #fff;
  border: 1px solid var(--mbb-border);
  border-radius: var(--mbb-radius);
  box-shadow: var(--mbb-shadow-md);
  padding: 1.1rem;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  align-items: flex-start;
}

.mbb-author-card__img {
  width: 72px; height: 72px;
  border-radius: 50%; object-fit: cover;
}

.mbb-author-card__name {
  margin: .1rem 0 .2rem;
  font-size: 1.2rem !important;
  color: var(--mbb-head);
  text-align: left !important;
  font-weight: 800;
}

.mbb-author-card__meta {
  margin: 0 0 .5rem; font-weight: 700; color: var(--mbb-head);
}

.mbb-author-card__bullets {
  margin: .2rem 0 .4rem; padding-left: 1.15rem;
}
.mbb-author-card__bullets li { margin: .15rem 0; }

.mbb-author-card__link {
  font-weight: 800; text-decoration: none;
  color: var(--mbb-primary);
  display: inline-block; margin-top: .35rem;
}
.mbb-author-card__link:hover { text-decoration: underline; }

/* ── Sticky mobile CTA ───────────────────────────────────────────── */
.mbb-sticky-cta {
  position: sticky; bottom: 0;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  padding: .8rem;
  border-top: 1px solid var(--mbb-border);
  display: flex; gap: .6rem;
  z-index: 100;
}

.mbb-sticky-cta .mbb-btn { flex: 1; text-align: center; }

@media (min-width: 900px) { .mbb-sticky-cta { display: none; } }

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mbb-hero,
  #mbb-main,
  .mbb-sticky-cta {
    * { transition: none !important; animation: none !important; }
  }
}

/* ── Print ───────────────────────────────────────────────────────── */
@media print {
  .mbb-hero__images,
  .mbb-hero::after,
  .mbb-sticky-cta { display: none; }
  .mbb-hero { min-height: auto; background: none; }
  .mbb-hero__content { color: #000; padding: 0; }
  .mbb-hero__title   { color: #000; text-shadow: none; }
}

/* ── Bloque Texto / Encabezado ─────────────────────────── */
.mbb-section--text .mbb-wrap--narrow { max-width: 780px; }

.mbb-text-heading {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--mbb-brand, #3a3972);
  margin: 0 0 .75em;
  line-height: 1.25;
}

.mbb-text-body {
  font-size: 1rem;
  line-height: 1.75;
  color: #333;
}
.mbb-text-body p  { margin: 0 0 1em; }
.mbb-text-body p:last-child { margin-bottom: 0; }
.mbb-text-body strong { color: inherit; font-weight: 700; }
.mbb-text-body a  { color: var(--mbb-brand, #3a3972); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(58,57,114,.3); }
.mbb-text-body ul, .mbb-text-body ol { padding-left: 1.5em; margin: .75em 0; }
.mbb-text-body li { margin-bottom: .35em; }
