/* Nanoparuro STEAM — blog. Se carga después de styles.css. Mobile first. */

.preview-bar { margin: 0; padding: 8px 20px; background: #FFF4D6; color: #6B4E00; font-size: .875rem; font-weight: 600; text-align: center; }

/* Cabecera del artículo */
.post-head { padding: 24px 0 28px; background: var(--grid), linear-gradient(180deg, #fff 0%, var(--tint) 100%); }
.post-head h1 { font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.75rem); letter-spacing: -.025em; max-width: 900px; margin: 6px 0 14px; }
.post-lead { font-size: 1.0625rem; color: var(--muted); max-width: 760px; }
.post-meta { margin: 0; font-size: .875rem; color: var(--muted); }
.post-author { font-weight: 600; color: var(--heading); }
.blog-head { padding-bottom: 36px; }
.notfound { padding: 56px 0 72px; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; font-size: .8125rem; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--blue); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-weight: 500; }
.crumbs li[aria-current] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; flex: 1 1 0; min-height: 44px; line-height: 44px; }
.crumbs li[aria-current]::before { display: inline; }

/* Imagen principal y layout */
.post-wrap { padding-top: 0; }
.post-hero { margin: 20px 0 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--blue-light); aspect-ratio: 3 / 2; }
.post-hero img { width: 100%; height: 100%; object-fit: cover; }
.post-layout { display: grid; gap: 24px; padding: 28px 0 56px; }
.post-main { min-width: 0; }

/* Índice */
.toc details { border: 1px solid var(--blue-light); border-radius: var(--radius-sm); background: #FBFDFF; }
.toc summary { display: flex; align-items: center; min-height: 48px; padding: 10px 44px 10px 16px; position: relative; font-weight: 600; color: var(--heading); cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; position: absolute; right: 18px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-right: 2.5px solid var(--blue-ink); border-bottom: 2.5px solid var(--blue-ink); transform: rotate(45deg); transition: transform .2s; }
.toc details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.toc ol { counter-reset: toc; padding: 0 12px 12px; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 10px 6px; min-height: 44px; align-items: baseline; font-size: .9375rem; line-height: 1.4; color: var(--text); text-decoration: none; border-radius: 6px; }
.toc a::before { content: counter(toc); flex: none; min-width: 1.4em; font-weight: 700; color: var(--blue-ink); }
.toc a:hover { background: var(--tint); color: var(--blue-ink-dark); }

/* Contenido */
.prose { font-size: 1.0625rem; line-height: 1.75; max-width: 720px; overflow-wrap: break-word; }
.prose > * + * { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: clamp(1.4375rem, 1.1rem + 1.4vw, 1.875rem); margin: 1.9em 0 .6em; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.1875rem; margin: 1.5em 0 .5em; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .45em; padding-left: .2em; }
.prose li::marker { color: var(--blue-ink); font-weight: 700; }
.prose strong { color: var(--heading); font-weight: 600; }
.prose a { font-weight: 500; }
.prose blockquote { margin: 0 0 1.2em; padding: 14px 18px; border-left: 4px solid var(--blue); background: var(--tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p:last-child { margin: 0; }
.prose code { font-size: .9em; padding: 1px 5px; border-radius: 4px; background: var(--tint); }
.prose pre { margin: 0 0 1.4em; padding: 14px 16px; max-width: 100%; overflow-x: auto; border-radius: var(--radius-sm); background: #0F2A3D; color: #E6F1F8; font-size: .875rem; line-height: 1.6; -webkit-overflow-scrolling: touch; }
.prose pre code { padding: 0; background: none; color: inherit; font-size: inherit; white-space: pre; }
.prose hr { border: 0; border-top: 1px solid var(--blue-light); margin: 2em 0; }

.table-wrap-post { margin: 0 0 1.4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.5; }
.prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prose tbody { display: grid; gap: 10px; }
.prose tr { display: block; padding: 12px 14px; border: 1px solid var(--blue-light); border-radius: var(--radius-sm); background: #fff; }
.prose td { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid var(--tint); text-align: left; }
.prose td:first-child { display: block; padding-top: 0; border-top: 0; font-weight: 700; color: var(--heading); font-size: 1rem; }
.prose td:first-child::before { content: none; }
.prose td::before { content: attr(data-label); font-size: .8125rem; font-weight: 600; color: var(--muted); }
.prose .price-last td:last-child { font-weight: 600; color: var(--heading); }

@media (min-width: 760px) {
  .table-wrap-post { overflow-x: auto; border: 1px solid var(--blue-light); border-radius: var(--radius-sm); }
  .prose thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .prose tbody { display: table-row-group; }
  .prose tr { display: table-row; padding: 0; border: 0; border-radius: 0; }
  .prose th, .prose td, .prose td:first-child { display: table-cell; padding: 10px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--tint); font-size: .9375rem; }
  .prose td::before { content: none; }
  .prose thead th { border-top: 0; background: var(--tint); color: var(--heading); font-weight: 600; font-size: .875rem; }
  .prose td:last-child { white-space: nowrap; }
  .prose .wrap-last td:last-child { white-space: normal; }
}

/* Tablas de conexiones (pines): tabla real también en mobile */
.prose .table-pins { overflow-x: auto; border: 1px solid var(--blue-light); border-radius: var(--radius-sm); }
.prose .table-pins table { font-size: .875rem; }
.prose .table-pins thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
.prose .table-pins tbody { display: table-row-group; }
.prose .table-pins tr { display: table-row; padding: 0; border: 0; border-radius: 0; }
.prose .table-pins th, .prose .table-pins td, .prose .table-pins td:first-child { display: table-cell; padding: 8px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--tint); font-size: .875rem; }
.prose .table-pins td::before { content: none; }
.prose .table-pins thead th { border-top: 0; background: var(--tint); color: var(--heading); font-weight: 600; font-size: .8125rem; }
.prose .table-pins td:first-child { font-weight: 600; }
.prose .table-pins td:last-child { white-space: nowrap; }
.prose .table-pins.wrap-last td:last-child { white-space: normal; }

.post-fig { margin: 8px 0 1.6em; }
.post-fig img { width: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.post-fig figcaption { margin-top: 8px; font-size: .875rem; line-height: 1.5; color: var(--muted); }

/* Caja de materiales */
.materiales { margin: 6px 0 1.6em; padding: 18px 18px 14px; border: 1px solid var(--blue-light); border-left: 5px solid var(--blue); border-radius: var(--radius-sm); background: #FBFDFF; font-size: 1rem; line-height: 1.5; }
.materiales-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px !important; font-weight: 700; color: var(--heading); }
.materiales-title .ico { color: var(--blue-ink); }
.prose .materiales ul { list-style: none; margin: 0; padding: 0; }
.prose .materiales li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding: 9px 0; border-top: 1px solid var(--tint); }
.mat-name { min-width: 0; }
.mat-note { display: block; font-size: .8125rem; color: var(--muted); }
.mat-price { flex: none; font-weight: 700; color: var(--heading); white-space: nowrap; }
.mat-foot { margin: 8px 0 0 !important; font-size: .8125rem; color: var(--muted); }

/* CTA intermedio */
.cta-box { margin: 8px 0 1.8em; padding: 22px 20px; border-radius: var(--radius); color: #fff; background: linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(135deg, #0070B5 0%, #005A93 100%); box-shadow: var(--shadow); }
.cta-box p { margin: 0 0 14px !important; line-height: 1.55; opacity: .96; }
.cta-box .cta-box-title { font-size: 1.1875rem; font-weight: 700; opacity: 1; }
.prose .cta-box a.btn { width: 100%; color: var(--blue-ink-dark); text-decoration: none; }
.btn-ghost-white { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.btn-ghost-white:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }

/* FAQ del artículo */
.post-faq { max-width: 720px; margin-top: 40px; }
.post-faq h2 { font-size: clamp(1.4375rem, 1.1rem + 1.4vw, 1.875rem); }
.post-faq .faq details { border: 1px solid var(--blue-light); }

.related h2 { margin-bottom: 24px; }
.blog-list { padding-top: 40px; }

@media (min-width: 480px) {
  .prose .cta-box a.btn { width: auto; }
}

@media (min-width: 600px) {
  .post-head { padding: 32px 0 40px; }
  .post-hero { aspect-ratio: 16 / 8; }
  .materiales, .cta-box { padding: 22px 24px 18px; }
}

@media (min-width: 1024px) {
  .post-layout { grid-template-columns: minmax(0, 720px) 280px; justify-content: space-between; gap: 56px; padding: 44px 0 80px; }
  .post-aside { grid-column: 2; grid-row: 1; }
  .post-main { grid-column: 1; grid-row: 1; }
  .toc { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; }
  .post-hero { aspect-ratio: 21 / 9; margin-top: 28px; }
}

@media (max-width: 374px) {
  .prose { font-size: 1rem; }
  .materiales, .cta-box { padding-left: 14px; padding-right: 14px; }
  .prose .materiales li { flex-wrap: wrap; gap: 2px 12px; }
  .prose td { grid-template-columns: 1fr; gap: 0; }
}
