/* ==========================================================================
   Temasblog — tema leve de revista/blog com documentação embutida
   As variáveis abaixo são sobrescritas em tempo real pelo painel
   (Temasblog > Configurações > Aparência); estes são só os valores padrão.
   ========================================================================== */

:root {
	--tb-accent: #0e7490;
	--tb-ink: #1f2933;
	--tb-bg: #ffffff;

	--tb-header-bg: #106dbe;
	--tb-header-border: #0b5aa0;
	--tb-header-border-width: 3px;
	--tb-header-text: #ffffff;
	--tb-header-pad-v: 16px;
	--tb-header-pad-h: 20px;

	--tb-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--tb-font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--tb-font-menu: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--tb-font-sidebar: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--tb-color-menu: #ffffff;
	--tb-color-sidebar: #1f2933;

	--tb-fs-base: 16px;
	--tb-fs-h1: 34px;
	--tb-fs-h2: 24px;
	--tb-fs-h3: 19px;
	--tb-fs-menu: 15px;
	--tb-fs-sidebar: 14px;

	--tb-max: 1200px;
	--tb-max-shell: 1600px;
	--tb-content-max: 780px;
	--tb-side-w-left: 260px;
	--tb-side-w-right: 260px;
	--tb-line: #e3e7eb;
	--tb-muted: #5f6b76;
	--tb-tint: #f2f7f8;
	--tb-radius: 10px;
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; overflow-y: scroll; }
body {
	margin: 0;
	color: var(--tb-ink);
	background: var(--tb-bg);
	font-family: var(--tb-font-body);
	font-size: var(--tb-fs-base);
	line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--tb-accent); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 { font-family: var(--tb-font-heading); }

.tb-wrap { width: 100%; max-width: var(--tb-max); margin: 0 auto; }
.tb-wide-wrap { width: 100%; max-width: var(--tb-max-shell); margin: 0 auto; padding: 0 var(--tb-header-pad-h); }
.tb-body { padding: 0 var(--tb-header-pad-h) 56px; }
.tb-narrow { max-width: var(--tb-content-max); width: 100%; margin: 0 auto; }

/* ---------- Cabeçalho (sempre 100% da largura da tela, em qualquer monitor) ---------- */

.tb-header { border-bottom: var(--tb-header-border-width) solid var(--tb-header-border); background: var(--tb-header-bg); color: var(--tb-header-text); }
.tb-topbar { display: flex; align-items: center; gap: 20px; padding: var(--tb-header-pad-v) var(--tb-header-pad-h); }
.tb-logo { font-family: var(--tb-font-heading); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; flex: none; color: inherit; }
.tb-logo img { max-height: 42px; width: auto; }
.tb-menu { margin-left: 8px; flex: 1; min-width: 0; }
.tb-menu-list { display: flex; flex-wrap: wrap; gap: 4px 22px; font-family: var(--tb-font-menu); color: var(--tb-color-menu); font-size: var(--tb-fs-menu); }
.tb-menu-list li { position: relative; }
.tb-menu-list > li > a { display: block; padding: 10px 3px; font-weight: 600; color: inherit; }
.tb-menu-list > li > a:hover { opacity: .8; }
.tb-menu-list li.menu-item-has-children > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }

.tb-menu-list .sub-menu {
	display: none;
	position: absolute; top: 100%; left: 0; z-index: 200;
	min-width: 220px; padding: 6px;
	background: var(--tb-bg); color: var(--tb-ink); border: 1px solid var(--tb-line); border-radius: 3px;
	box-shadow: 0 2px 0px 8px #929bffab;
	font-family: var(--tb-font-body); font-size: 1rem;
}
.tb-menu-list .sub-menu .sub-menu { top: -7px; left: 100%; margin-top: 0; margin-left: 6px; }
.tb-menu-list li:hover > .sub-menu,
.tb-menu-list li:focus-within > .sub-menu { display: block; }
.tb-menu-list .sub-menu > li > a { display: block; padding: 8px 10px; border-radius: 6px; font-weight: 500; white-space: nowrap; color: var(--tb-ink); }
.tb-menu-list .sub-menu > li > a:hover { background: var(--tb-tint); opacity: 1; }

.tb-search-trigger {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; margin-left: auto; padding: 0; cursor: pointer;
	color: inherit; background: transparent; border: 1px solid currentColor; opacity: .85; border-radius: 999px;
	flex: none;
}
.tb-search-trigger:hover { opacity: 1; }

/* ---------- Estrutura de 3 colunas (barra esquerda / conteúdo / barra direita) ---------- */

.tb-shell {
	max-width: var(--tb-max-shell);
	margin: 0 auto;
	padding: 28px var(--tb-header-pad-h) 8px;
	display: grid;
	grid-template-columns: minmax(0, var(--tb-side-w-left)) minmax(0, 1fr) minmax(0, var(--tb-side-w-right));
	gap: 28px;
	align-items: start;
}
.tb-shell.tb-shell-no-side { grid-template-columns: minmax(0, 1fr); }
.tb-main-col { min-width: 0; }
.tb-side { position: sticky; top: 20px; padding: 0 16px; font-family: var(--tb-font-sidebar); color: var(--tb-color-sidebar); font-size: var(--tb-fs-sidebar); }
.tb-side-widget { margin-bottom: 20px; }
.tb-side-widget-title { margin: 0 0 10px; font-size: 1.15em; font-weight: 700; }
.tb-side ul { list-style: disc; padding-left: 1.2em; }
.tb-side li { margin: 4px 0; }
.tb-side img { border-radius: 8px; }

/* ---------- Rodapé ---------- */

.tb-footer { margin-top: 20px; padding: 32px 0 24px; border-top: 1px solid var(--tb-line); }
.tb-footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin-bottom: 24px; }
.tb-footer-widget-title { margin: 0 0 10px; font-size: 1rem; font-weight: 700; }
.tb-footer-widgets ul { list-style: disc; padding-left: 1.2em; }
.tb-footer-widgets li { margin: 3px 0; }
.tb-footer-copy { margin: 0; color: var(--tb-muted); font-size: .88rem; }

/* ---------- Breadcrumb ---------- */

.tb-crumbs { margin-bottom: 18px; font-size: .88rem; color: var(--tb-muted); text-align: center; }
.tb-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin: 0; padding: 0; }
.tb-crumbs li { display: inline-flex; align-items: center; }
.tb-crumbs li + li::before { content: "/"; margin: 0 9px; opacity: .5; }
.tb-crumbs a:hover { color: var(--tb-accent); text-decoration: underline; }

/* ---------- Home: cards com imagem em cima (colunas configuráveis) ---------- */

.tb-section { margin-bottom: 36px; }
.tb-home-grid { display: grid; grid-template-columns: repeat(var(--tb-home-cols, 2), minmax(0, 1fr)); gap: 24px; }
.tb-home-card { border: 1px solid var(--tb-line); border-radius: var(--tb-radius); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.tb-home-card:hover { box-shadow: 0 14px 28px -16px rgba(15, 23, 42, .25); transform: translateY(-2px); }
.tb-home-link { display: block; height: 100%; }
.tb-home-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tb-tint); }
.tb-home-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tb-home-body { display: block; padding: 16px 18px; }
.tb-home-cat { display: inline-block; margin-bottom: 6px; font-size: .78rem; font-weight: 700; color: var(--tb-accent); }
.tb-home-title { display: block; font-family: var(--tb-font-heading); font-weight: 700; line-height: 1.35; margin-bottom: 6px; font-size: 1.08rem; }
.tb-home-card:hover .tb-home-title { color: var(--tb-accent); }
.tb-home-meta { display: block; font-size: .82rem; color: var(--tb-muted); margin-bottom: 8px; }
.tb-home-excerpt { display: block; font-size: .9rem; color: var(--tb-muted); }

/* ---------- Widgets de categorias / docs (usados na home, abaixo da lista) ---------- */

.tb-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tb-widget { padding: 18px 20px; border: 1px solid var(--tb-line); border-radius: var(--tb-radius); }
.tb-widget-title { margin: 0 0 12px; font-size: 1.05rem; }
.tb-widget-list li + li { border-top: 1px dashed var(--tb-line); }
.tb-widget-list a { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.tb-widget-list a:hover { color: var(--tb-accent); }
.tb-widget-count { margin-left: auto; font-size: .82rem; color: var(--tb-muted); }
.tb-widget-more { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--tb-accent); }
.tb-widget-more:hover { text-decoration: underline; }

/* ---------- Grade de categorias de docs (/docs/) ---------- */

.tb-doc-grid { display: grid; grid-template-columns: repeat(var(--tb-doc-cols, 3), minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.tb-doc-card { padding: 20px; border: 1px solid var(--tb-line); border-top: 3px solid var(--tb-accent); border-radius: 4px 4px var(--tb-radius) var(--tb-radius); }
.tb-doc-card-title { margin: 0 0 12px; font-size: 1.1rem; }
.tb-doc-card-title a:hover { color: var(--tb-accent); }

/* ---------- Artigo (post / doc) ---------- */

.tb-article-head { margin-bottom: 22px; }
.tb-article-cat { display: inline-block; margin-bottom: 8px; font-size: .82rem; font-weight: 700; color: var(--tb-accent); }
.tb-article-title { margin: 0 0 8px; font-size: var(--tb-fs-h1); line-height: 1.2; letter-spacing: -0.015em; }
.tb-meta { margin: 0; color: var(--tb-muted); font-size: .9rem; }
.tb-article-thumb { margin-bottom: 22px; border-radius: var(--tb-radius); overflow: hidden; }
.tb-content > :first-child { margin-top: 0; }
.tb-content h2 { font-size: var(--tb-fs-h2); }
.tb-content h3 { font-size: var(--tb-fs-h3); }
.tb-content a { color: var(--tb-accent); text-decoration: underline; text-underline-offset: 3px; }
.tb-content img { border-radius: 6px; }
.tb-comments { margin-top: 36px; }

/* Botão base (reutilizado no feedback dos docs e no 404) */
.tb-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; margin-top: 10px; cursor: pointer; color: #fff; background: var(--tb-accent); border: none; border-radius: 8px; font-weight: 600; }
.tb-btn:hover { opacity: .9; }

/* Feedback "foi útil?" */
.tb-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 40px 0 0; padding: 18px 20px; border: 1px solid var(--tb-line); border-radius: var(--tb-radius); }
.tb-feedback-q { margin: 0; font-weight: 600; }
.tb-feedback-btns { display: flex; gap: 8px; }
.tb-btn-outline { color: inherit; background: transparent; border: 1px solid var(--tb-line); }
.tb-btn-outline:hover:not(:disabled) { border-color: var(--tb-accent); color: var(--tb-accent); opacity: 1; }
.tb-btn-outline.is-chosen { background: var(--tb-accent); border-color: var(--tb-accent); color: #fff; }
.tb-btn:disabled { cursor: default; opacity: .7; }
.tb-feedback-msg { margin: 0; width: 100%; font-size: .9rem; color: var(--tb-muted); }
.tb-feedback-msg:empty { display: none; }

/* Relacionados */
.tb-related { margin-top: 32px; }
.tb-related h2 { margin: 0 0 12px; font-size: var(--tb-fs-h3); }
.tb-related .tb-widget-list { columns: 2 240px; column-gap: 24px; }
.tb-related .tb-widget-list li { break-inside: avoid; }

/* ---------- Listagens (categoria / busca / blog) ---------- */

.tb-archive-title { margin: 0 0 8px; font-size: var(--tb-fs-h1); }
.tb-archive-desc { max-width: 70ch; color: var(--tb-muted); margin-bottom: 20px; }
.tb-list { border-top: 1px solid var(--tb-line); margin-top: 18px; }
.tb-list-item { border-bottom: 1px solid var(--tb-line); }
.tb-list-item a { display: flex; gap: 14px; align-items: flex-start; padding: 16px 4px; }
.tb-list-thumb { flex: none; width: 100px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--tb-tint); }
.tb-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tb-list-body { min-width: 0; }
.tb-list-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; line-height: 1.4; font-family: var(--tb-font-heading); }
.tb-list-item a:hover .tb-list-title { color: var(--tb-accent); }
.tb-list-excerpt { display: block; margin-top: 4px; font-size: .92rem; color: var(--tb-muted); }
.tb-list-meta { display: block; margin-top: 4px; font-size: .82rem; color: var(--tb-muted); }
.tb-empty { color: var(--tb-muted); }

.tb-ad-slot { list-style: none; padding: 8px 0; border-bottom: none !important; }

.tb-pagination { margin-top: 26px; }
.tb-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--tb-line); border-radius: 7px; }
.tb-pagination .page-numbers.current { background: var(--tb-accent); border-color: var(--tb-accent); color: #fff; }
.tb-pagination a.page-numbers:hover { border-color: var(--tb-accent); color: var(--tb-accent); }

/* ---------- Anúncios ---------- */

.tb-ad { display: block; margin: 0 0 20px; text-align: center; overflow: hidden; }
.tb-ad-featured { border-radius: var(--tb-radius); background: var(--tb-tint); }
.tb-ad-below-content { margin: 32px 0 0; }
.tb-ad-category { margin: 4px 0 16px; }

/* ---------- Popup de busca ---------- */

.tb-search-overlay { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 20px 20px; background: rgba(15, 23, 42, .55); }
.tb-search-overlay[hidden] { display: none; }
.tb-search-modal { position: relative; width: 100%; max-width: 640px; max-height: 78vh; display: flex; flex-direction: column; background: #fff; color: var(--tb-ink); border-radius: 14px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45); overflow: hidden; }
.tb-search-close { position: absolute; top: 12px; right: 12px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; cursor: pointer; color: inherit; background: transparent; border: none; }
.tb-search-close:hover { color: var(--tb-accent); }
.tb-search-form { position: relative; padding: 18px 56px 18px 18px; border-bottom: 1px solid var(--tb-line); }
.tb-search-icon { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); color: #7b8792; }
.tb-search-input { width: 100%; height: 46px; margin: 0; padding: 0 12px 0 40px; font: inherit; font-size: 1.05rem; color: var(--tb-ink); background: #fff; border: 1.5px solid var(--tb-line); border-radius: 10px; }
.tb-search-input:focus { outline: none; border-color: var(--tb-accent); }
.tb-search-results { overflow-y: auto; padding: 8px; }
.tb-sr-group { padding: 10px 10px 2px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tb-accent); }
.tb-sr-item { display: block; padding: 10px 12px; border-radius: 8px; }
.tb-sr-item:hover, .tb-sr-item.is-active { background: var(--tb-tint); }
.tb-sr-title { display: block; font-weight: 600; line-height: 1.35; }
.tb-sr-ex { display: block; font-size: .87rem; color: var(--tb-muted); margin-top: 2px; }
.tb-sr-empty { padding: 20px 14px; color: var(--tb-muted); }

/* ---------- 404 ---------- */

/* ---------- Responsivo ----------
   Tela cheia (FullHD e maiores): as duas barras + o conteúdo do meio.
   Fica apertado: some a barra ESQUERDA primeiro, fica só a direita.
   Aperta mais ainda: somem as duas, só o conteúdo do meio (celular/tablet). */

@media (max-width: 1280px) {
	.tb-shell { grid-template-columns: minmax(0, 1fr) minmax(0, var(--tb-side-w-right)); }
	.tb-side-left { display: none; }
}
@media (max-width: 899px) {
	.tb-shell { grid-template-columns: minmax(0, 1fr); }
	.tb-side-right { display: none; }
}
@media (max-width: 900px) {
	.tb-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tb-doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tb-columns { grid-template-columns: minmax(0, 1fr); }
	.tb-article-title, .tb-archive-title { font-size: calc(var(--tb-fs-h1) * 0.82); }
}
@media (max-width: 640px) {
	.tb-topbar { flex-wrap: wrap; }
	.tb-menu { order: 3; width: 100%; }
	.tb-home-grid { grid-template-columns: minmax(0, 1fr); }
	.tb-doc-grid { grid-template-columns: minmax(0, 1fr); }
	.tb-list-item a { gap: 10px; }
	.tb-list-thumb { width: 76px; }
	.tb-article-title, .tb-archive-title { font-size: calc(var(--tb-fs-h1) * 0.65); }
}
