/* Blog no estilo do site novo: a lista (/blog, templates/blog.html) e cada artigo
   (/articles/<slug>, templates/article.html). A base comum (paleta, fontes, botões,
   cabeçalho e rodapé) está em css/nh.css. Os seletores dos scripts ficam nos
   atributos: data-blog-search, data-blog-card/data-blog-more (js/pages/blog.js) e
   data-audio-player com .framer-audio-icon/.framer-default-slider
   (js/components/audio-player.js). */

/* o build embrulha as imagens em <picture style="display:contents">: os <source> não podem virar item de flex/grid */
.nh-blog picture > source { display: none; }

/* ── lista: topo ── */
.nh-blog-hero { padding: 80px 0 40px; text-align: center; }
.nh-blog-hero__in { display: grid; justify-items: center; gap: 16px; max-width: 760px; }

/* ── lista: busca e categorias ── */
.nh-blog-list { padding: 0 0 var(--secao); }
.nh-blog-bar { display: grid; gap: 18px; justify-items: center; margin: 0 auto 48px; max-width: 880px; }
.nh-blog-search { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px; height: 56px; padding: 0 22px; border-radius: 999px; background: #fff; border: 1px solid var(--linha); box-shadow: 0 10px 30px -22px rgba(42, 48, 89, .35); color: var(--texto-2); font-size: 16px; cursor: text; transition: border-color .2s ease, box-shadow .2s ease; }
.nh-blog-search svg { flex: 0 0 auto; color: var(--lavanda); }
.nh-blog-search span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine){.nh-blog-search:hover{ border-color: rgba(135, 160, 248, .55); box-shadow: 0 14px 34px -22px rgba(42, 48, 89, .45); }}
.nh-blog-search:focus-visible { outline: 3px solid var(--lavanda); outline-offset: 3px; }
.nh-blog-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.nh-blog-cats a { padding: 8px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--linha); font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--texto-2); text-decoration: none; transition: border-color .2s ease, color .2s ease, background .2s ease; }
@media (hover: hover) and (pointer: fine){.nh-blog-cats a:hover{ border-color: rgba(135, 160, 248, .6); color: var(--naval); }}
.nh-blog-cats a[aria-current="page"] { background: var(--naval); border-color: var(--naval); color: #fff; }
.nh-blog-cats a:focus-visible { outline: 3px solid var(--lavanda); outline-offset: 2px; }

/* ── lista: cards ── */
.nh-blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.nh-post { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--raio); background: #fff; border: 1px solid var(--linha); box-shadow: 0 1px 2px rgba(42, 48, 89, .04); text-decoration: none; color: var(--texto); transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s cubic-bezier(.22, 1, .36, 1), border-color .3s ease; }
@media (hover: hover) and (pointer: fine){.nh-post:hover{ transform: translateY(-4px); border-color: rgba(135, 160, 248, .45); box-shadow: 0 28px 50px -32px rgba(42, 48, 89, .45); }}
.nh-post:focus-visible { outline: 3px solid var(--lavanda); outline-offset: 3px; }
.nh-post__media { margin: 12px 12px 0; border-radius: 14px; overflow: hidden; background: var(--azul-claro); }
.nh-post__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s cubic-bezier(.22, 1, .36, 1); }
@media (hover: hover) and (pointer: fine){.nh-post:hover .nh-post__media img{ transform: scale(1.03); }}
.nh-post__body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 18px 22px 22px; }
.nh-post__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.nh-post__tags:empty { display: none; }
.nh-post__tag { padding: 4px 10px; border-radius: 999px; background: var(--azul-claro); color: #5B72C9; font-size: 12.5px; font-weight: 800; line-height: 1.3; }
.nh-post__title { font: 600 21px/1.28 var(--serif); letter-spacing: -.005em; color: var(--naval); }
.nh-post__excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; font-size: 15px; line-height: 1.55; color: var(--texto-2); }
.nh-post__excerpt:empty { display: none; }
.nh-post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-top: auto !important; padding-top: 14px; border-top: 1px solid var(--linha); font-size: 13px; line-height: 1.4; color: var(--texto-2); }
.nh-post__meta > span:empty { display: none; }
.nh-post__meta > span:not(.nh-post__author):not(:empty) ~ span:not(:empty)::before { content: "·"; margin: 0 8px; color: rgba(42, 48, 89, .35); }
.nh-post__author { flex-basis: 100%; font-weight: 800; color: var(--naval); }
.nh-blog-more { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 20px; }

/* ── busca (o diálogo de js/components/blog-search.js; a base está em css/base.css) ── */
dialog.cde-search::backdrop { background: rgba(42, 48, 89, .28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.cde-search .cde-search__box { top: 120px; width: min(620px, calc(100% - 32px)); border-radius: var(--raio); border: 1px solid var(--linha); box-shadow: 0 40px 80px -30px rgba(42, 48, 89, .5); font-family: var(--sans); }
dialog.cde-search .cde-search__field { height: 62px; padding: 0 22px; }
dialog.cde-search .cde-search__field svg circle, dialog.cde-search .cde-search__field svg path { stroke: var(--lavanda); }
dialog.cde-search .cde-search__field input { font: 600 17px/1 var(--sans); color: var(--naval); }
dialog.cde-search .cde-search__field input::placeholder { color: var(--texto-2); font-weight: 400; }
dialog.cde-search .cde-search__results:not(:empty) { border-top: 1px solid var(--linha); padding: 6px; }
dialog.cde-search .cde-search__results a { padding: 12px 16px; border-radius: 12px; color: var(--naval); }
dialog.cde-search .cde-search__results a.is-active{ background: var(--azul-claro); }@media (hover: hover) and (pointer: fine){dialog.cde-search .cde-search__results a:hover{ background: var(--azul-claro); }}
dialog.cde-search .cde-search__results strong { font: 600 16px/1.35 var(--serif); }
dialog.cde-search .cde-search__results span { font: 400 12.5px/1.4 var(--sans); color: var(--texto-2); }
dialog.cde-search .cde-search__empty { padding: 16px; font: 400 15px var(--sans); color: var(--texto-2); }

/* ── artigo: cabeçalho ── */
.nh-article { padding: 56px 0 0; }
.nh-article__col { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
.nh-article__head .nh-article__col { display: grid; gap: 22px; }
.nh-article__back { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 7px 14px 7px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--linha); font-size: 14px; font-weight: 800; text-decoration: none; color: var(--texto-2) !important; transition: color .2s ease, border-color .2s ease; }
@media (hover: hover) and (pointer: fine){.nh-article__back:hover{ color: var(--naval) !important; border-color: rgba(135, 160, 248, .55); }}
.nh-article__title { font: 600 clamp(34px, 4.4vw, 50px)/1.1 var(--serif); letter-spacing: -.02em; color: var(--naval); text-wrap: balance; }
.nh-article__byline { display: flex; align-items: center; gap: 14px; }
.nh-article__avatar { flex: 0 0 auto; width: 48px; height: 48px !important; border-radius: 50%; object-fit: cover; object-position: center top; background: var(--azul-claro); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--linha); }
.nh-article__who { display: grid; gap: 2px; }
.nh-article__who strong { font-size: 16px; color: var(--naval); }
.nh-article__who span { font-size: 14px; color: var(--texto-2); }
.nh-article__who :empty { display: none; }
.nh-article__meta { display: flex; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--texto-2); }
.nh-article__reading:empty { display: none; }
.nh-article__reading::before { content: "·"; margin: 0 8px; color: rgba(42, 48, 89, .35); }

/* ── artigo: player de áudio ── */
.nh-audio { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--linha); box-shadow: 0 10px 30px -24px rgba(42, 48, 89, .4); }
.nh-audio audio { display: none; }
.nh-audio__btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--naval); color: #fff; cursor: pointer; transition: transform .15s ease, background .2s ease; }
@media (hover: hover) and (pointer: fine){.nh-audio__btn:hover{ background: #3a4170; }}
.nh-audio__btn:active { transform: scale(.94); }
.nh-audio__btn:focus-visible { outline: 3px solid var(--lavanda); outline-offset: 3px; }
.nh-audio__time { flex: 0 0 auto; font-size: 14px; font-weight: 700; color: var(--naval); font-variant-numeric: tabular-nums; }
.nh-audio__time span { padding: 0 3px; color: var(--texto-2); font-weight: 400; }
.nh-audio__bar { position: relative; flex: 1 1 auto; display: flex; align-items: center; min-width: 60px; height: 24px; }
.nh-audio__bar input { position: relative; z-index: 1; width: 100%; height: 24px; margin: 0; opacity: 0; cursor: pointer; }
.nh-audio__track { position: absolute; left: 0; right: 0; top: calc(50% - 3px); height: 6px; border-radius: 6px; overflow: hidden; background: var(--azul-claro); pointer-events: none; }
.nh-audio__fill { width: 100%; height: 100%; background: var(--lavanda); transform: scaleX(0); transform-origin: left center; }
.nh-audio__knob { position: absolute; left: 0; top: calc(50% - 7px); width: 100%; height: 14px; pointer-events: none; transform: translateX(0); }
.nh-audio__knob span { position: absolute; left: -7px; top: 0; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--lavanda); box-shadow: 0 2px 6px rgba(42, 48, 89, .2); }
.nh-audio__bar:has(input:focus-visible) .nh-audio__knob span { box-shadow: 0 0 0 4px rgba(135, 160, 248, .35); }
.nh-audio__speed { flex: 0 0 auto; height: 36px; padding: 0 30px 0 14px; border-radius: 999px; border: 1px solid var(--linha); background: var(--azul-claro) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%232A3059' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 11px center / 12px no-repeat; color: var(--naval); font: 800 14px/1 var(--sans); -webkit-appearance: none; appearance: none; cursor: pointer; }
.nh-audio__speed:focus-visible { outline: 3px solid var(--lavanda); outline-offset: 2px; }

/* ── artigo: capa ── */
.nh .nh-article__cover { margin: 44px auto 0; max-width: 1000px; }
.nh-article__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 22px; border: 1px solid var(--linha); background: var(--azul-claro); box-shadow: 0 40px 80px -48px rgba(42, 48, 89, .5); }

/* ── artigo: texto (rich text do CMS; as classes framer-text ficam sem efeito aqui) ── */
.nh .nh-prose { padding-top: 48px; font-size: 18px; line-height: 1.75; color: #3B4168; overflow-wrap: break-word; }
.nh .nh-prose > * + * { margin-top: 1.1em; }
.nh .nh-prose p, .nh .nh-prose li { font-size: 18px; line-height: 1.75; }
.nh .nh-prose strong { font-weight: 800; color: var(--naval); }
.nh .nh-prose em { font-style: italic; }
.nh .nh-prose h1, .nh .nh-prose h2, .nh .nh-prose h3, .nh .nh-prose h4, .nh .nh-prose h5, .nh .nh-prose h6 { font-family: var(--serif); font-weight: 600; color: var(--naval); letter-spacing: -.01em; text-wrap: balance; }
.nh .nh-prose h1, .nh .nh-prose h2 { margin-top: 1.9em; font-size: clamp(26px, 2.6vw, 31px); line-height: 1.22; }
.nh .nh-prose h3 { margin-top: 1.7em; font-size: clamp(22px, 2.1vw, 25px); line-height: 1.28; }
.nh .nh-prose h4, .nh .nh-prose h5, .nh .nh-prose h6 { margin-top: 1.5em; font-size: 20px; line-height: 1.35; }
.nh .nh-prose > :first-child { margin-top: 0; }
.nh .nh-prose h1 strong, .nh .nh-prose h2 strong, .nh .nh-prose h3 strong, .nh .nh-prose h4 strong, .nh .nh-prose h5 strong, .nh .nh-prose h6 strong { font-weight: inherit; }
.nh .nh-prose :is(h1, h2, h3, h4, h5, h6) + * { margin-top: .6em; }
.nh .nh-prose a { color: var(--naval); font-weight: 700; text-decoration: underline; text-decoration-color: var(--lavanda); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: background .2s ease; }
@media (hover: hover) and (pointer: fine){.nh .nh-prose a:hover{ background: var(--azul-claro); }}
.nh .nh-prose ul, .nh .nh-prose ol { display: grid; gap: .5em; padding-left: 1.4em; }
.nh .nh-prose ul { list-style: disc; }
.nh .nh-prose ol { list-style: decimal; }
.nh .nh-prose li::marker { color: var(--lavanda); font-weight: 800; }
.nh .nh-prose li > p { margin: 0; }
.nh .nh-prose blockquote { margin-left: 0; margin-right: 0; padding: 18px 22px; border-left: 3px solid var(--lavanda); border-radius: 0 14px 14px 0; background: var(--azul-claro); font: 500 20px/1.55 var(--serif); color: var(--naval); }
.nh .nh-prose blockquote p { font: inherit; }
.nh .nh-prose img { max-width: 100%; height: auto; margin-left: auto; margin-right: auto; border-radius: 16px; border: 1px solid var(--linha); }
.nh .nh-prose figure { margin-left: 0; margin-right: 0; }
/* <code> no CMS é usado como destaque (não é código): fundo suave, mesma fonte; num título vira um quadro */
.nh .nh-prose code { padding: .1em .3em; border-radius: 6px; background: var(--azul-claro); font: inherit; color: var(--naval); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.nh .nh-prose :is(h4, h5, h6):has(> code) { padding: 18px 20px; border-left: 3px solid var(--lavanda); border-radius: 0 14px 14px 0; background: var(--azul-claro); font: 400 17px/1.65 var(--sans); letter-spacing: 0; color: #3B4168; }
.nh .nh-prose :is(h4, h5, h6) > code { padding: 0; background: none; color: inherit; }
.nh .nh-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 16px; }
.nh .nh-prose td, .nh .nh-prose th { padding: 10px 14px; border: 1px solid var(--linha); vertical-align: top; }
.nh .nh-prose br.trailing-break { display: none; }

/* ── artigo: anterior / próximo ── */
.nh-article__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px !important; padding-top: 32px; border-top: 1px solid var(--linha); }
.nh-article__pager-link { display: grid; align-content: start; gap: 6px; padding: 18px 20px; border-radius: 16px; background: #fff; border: 1px solid var(--linha); text-decoration: none; transition: border-color .2s ease, transform .25s ease; }
@media (hover: hover) and (pointer: fine){.nh-article__pager-link:hover{ border-color: rgba(135, 160, 248, .55); transform: translateY(-2px); }}
.nh-article__pager-link:focus-visible { outline: 3px solid var(--lavanda); outline-offset: 3px; }
.nh-article__pager-link small { font-size: 13px; font-weight: 800; color: var(--lavanda); }
.nh-article__pager-link small::before { content: "← "; }
.nh-article__pager-link--next { text-align: right; }
.nh-article__pager-link--next small::before { content: none; }
.nh-article__pager-link--next small::after { content: " →"; }
.nh-article__pager-link span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font: 600 17px/1.35 var(--serif); color: var(--naval); }

/* ── artigo: convite final ── */
.nh-article-cta { padding: 80px 0 var(--secao); }
.nh-article-cta__card { display: grid; justify-items: center; gap: 16px; max-width: 880px; margin: 0 auto; padding: 56px 40px; border-radius: 28px; background: var(--azul-claro); border: 1px solid rgba(135, 160, 248, .25); text-align: center; }
.nh-article-cta__card .nh-lead { max-width: 600px; }
.nh-article-cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.nh-article-cta .nh-btn--ghost { background: #fff; }

/* ── tablet ── */
@media (max-width: 1023.98px) {
	.nh-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nh-blog-hero { padding-top: 64px; }
}

/* ── celular ── */
@media (max-width: 639.98px) {
	.nh-blog-hero { padding: 48px 0 28px; }
	.nh-blog-bar { margin-bottom: 32px; }
	.nh-blog-search { height: 52px; padding: 0 18px; font-size: 15px; }
	.nh-blog-bar { justify-items: stretch; gap: 14px; }
	.nh-blog-search { max-width: none; }
	/* categorias numa linha que rola de lado dentro dela (a página não rola) */
	.nh-blog-cats { flex-wrap: nowrap; justify-content: flex-start; margin: 0 -18px; padding: 2px 18px 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.nh-blog-cats::-webkit-scrollbar { display: none; }
	.nh-blog-cats a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; font-size: 14px; white-space: nowrap; }
	.nh-blog-grid { grid-template-columns: 1fr; gap: 20px; }
	.nh-post__body { padding: 16px 18px 20px; }
	.nh-post__title { font-size: 20px; }
	.nh-blog-more .nh-btn { width: 100%; }
	dialog.cde-search .cde-search__box { top: 16px; }

	.nh-article { padding-top: 32px; }
	.nh-article__head .nh-article__col { gap: 18px; }
	.nh-audio { flex-wrap: wrap; gap: 10px 12px; padding: 10px 14px 12px 10px; border-radius: 22px; }
	.nh-audio__bar { order: 4; flex-basis: 100%; }
	.nh-audio__speed { margin-left: auto; }
	.nh .nh-article__cover { margin-top: 32px; }
	.nh-article__cover img { border-radius: 16px; }
	.nh .nh-prose { padding-top: 36px; font-size: 17px; }
	.nh .nh-prose p, .nh .nh-prose li { font-size: 17px; }
	.nh .nh-prose blockquote { padding: 16px 18px; font-size: 18px; }
	.nh-article__pager { grid-template-columns: 1fr; margin-top: 48px !important; }
	.nh-article__pager-link--next { text-align: left; }
	.nh-article-cta { padding-top: 56px; }
	.nh-article-cta__card { padding: 40px 22px; border-radius: 22px; }
	.nh-article-cta__actions { width: 100%; }
	.nh-article-cta__actions .nh-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.nh-post, .nh-post__media img, .nh-blog-search, .nh-blog-cats a, .nh-article__back, .nh-audio__btn, .nh-article__pager-link, .nh .nh-prose a { transition: none; }
	@media (hover: hover) and (pointer: fine){.nh-post:hover,.nh-article__pager-link:hover{ transform: none; }}
	@media (hover: hover) and (pointer: fine){.nh-post:hover .nh-post__media img{ transform: none; }}
}
