/* =========================================================================
   CLT FINANÇAS — design system
   Conceito: a carteira de trabalho e os documentos oficiais brasileiros.
   O elemento-assinatura é o "carimbo" (stamp) — usado em categorias, badges
   de status e no próprio logo — em vez de tags genéricas de blog.
   ========================================================================= */

:root {
	--ink:      #16233A; /* texto principal, quase-preto azulado */
	--navy:     #1B2A4A; /* cor de marca — capa da carteira de trabalho */
	--navy-2:   #223757;
	--paper:    #F5F6F2; /* fundo — papel de formulário, não creme genérico */
	--surface:  #FFFFFF;
	--line:     #DCD9CC; /* linha de pauta/ficha */
	--muted:    #5B6472;
	--gold:     #B8863B; /* carimbo/selo dourado — usar com moderação */
	--green:    #2F6B4F; /* "direito garantido", confirmações */
	--radius:   10px;

	--font-display: 'Roboto Slab', Georgia, serif;
	--font-body: 'Public Sans', -apple-system, Segoe UI, sans-serif;
	--font-mono: 'IBM Plex Mono', ui-monospace, monospace;

	--max-w: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	background-image:
		linear-gradient(var(--line) 1px, transparent 1px);
	background-size: 100% 2.1rem;
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
a:focus-visible, button:focus-visible, input:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 2px;
}

.cltf-skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 999;
	background: var(--navy); color: #fff; padding: .75rem 1.25rem;
}
.cltf-skip-link:focus { left: 1rem; top: 1rem; }

.cltf-container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Cabeçalho ---------- */
.cltf-header {
	background: var(--navy);
	color: #fff;
	border-bottom: 4px solid var(--gold);
}
.cltf-header__row { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; gap: 1.5rem; }
.cltf-logo { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; }
.cltf-logo__stamp {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 50%;
	border: 2px dashed rgba(255,255,255,.55);
	font-family: var(--font-mono); font-weight: 600; font-size: .8rem;
	letter-spacing: .03em;
	flex-shrink: 0;
}
.cltf-logo__text { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.15; }
.cltf-logo__text small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .68rem; color: rgba(255,255,255,.65); letter-spacing: .02em; }

.cltf-nav__list { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.cltf-nav__list a {
	color: #fff; text-decoration: none; font-size: .92rem; font-weight: 600;
	letter-spacing: .01em; padding-bottom: 4px; border-bottom: 2px solid transparent;
}
.cltf-nav__list a:hover { border-bottom-color: var(--gold); }

.cltf-nav-toggle { display: none; }

@media (max-width: 780px) {
	.cltf-nav { display: none; }
	.cltf-nav-toggle {
		display: flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer;
	}
	.cltf-nav-toggle span { width: 22px; height: 2px; background: #fff; display: block; }
}

/* ---------- Selo / Carimbo (elemento-assinatura) ---------- */
.cltf-stamp {
	display: inline-block;
	font-family: var(--font-mono);
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--navy);
	border: 1.5px dashed var(--navy);
	border-radius: 999px;
	padding: .3rem .85rem;
	transform: rotate(-2deg);
	text-decoration: none;
	background: rgba(27,42,74,.03);
}
a.cltf-stamp:hover { background: rgba(27,42,74,.08); }
.cltf-stamp--void { color: var(--muted); border-color: var(--muted); }

/* ---------- Breadcrumb ---------- */
.cltf-breadcrumb { margin: 1.5rem 0 .5rem; }
.cltf-breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.cltf-breadcrumb li:not(:last-child)::after { content: '/'; margin-left: .35rem; color: var(--line); }
.cltf-breadcrumb a { color: var(--muted); text-decoration: none; }
.cltf-breadcrumb a:hover { color: var(--navy); text-decoration: underline; }

/* ---------- Hero (home) ---------- */
.cltf-hero { padding: 3rem 0 2rem; max-width: 780px; }
.cltf-hero__title { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.15; margin: 0 0 .75rem; color: var(--navy); }
.cltf-hero__subtitle { font-size: 1.08rem; color: var(--muted); margin: 0; }

/* ---------- Grid de cards ---------- */
.cltf-main { padding-bottom: 4rem; }
.cltf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; margin-top: 1.5rem; }
@media (max-width: 960px) { .cltf-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cltf-grid { grid-template-columns: 1fr; } }

.cltf-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex; flex-direction: column;
}
.cltf-card__thumb { position: relative; display: block; aspect-ratio: 16/10; background: var(--navy); overflow: hidden; }
.cltf-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cltf-card__thumb-fallback { color: #fff; font-family: var(--font-display); font-size: 2.5rem; display: flex; align-items: center; justify-content: center; height: 100%; }
.cltf-card__stamp { position: absolute; left: .75rem; bottom: .75rem; background: var(--surface); }
.cltf-card__body { padding: 1.1rem 1.15rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.cltf-card__title { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.3; margin: 0; }
.cltf-card__title a { color: var(--ink); text-decoration: none; }
.cltf-card__title a:hover { color: var(--navy); text-decoration: underline; }
.cltf-card__excerpt { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; }
.cltf-card__meta { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); margin: 0; display: flex; gap: .4rem; }

/* ---------- Artigo ---------- */
.cltf-article { max-width: var(--max-w); margin: 0 auto; }
.cltf-article__header { max-width: 760px; margin: .5rem auto 1.5rem; }
.cltf-article__title { font-family: var(--font-display); font-size: clamp(1.7rem, 3.5vw, 2.4rem); line-height: 1.2; color: var(--navy); margin: .75rem 0 1rem; }
.cltf-article__meta { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 0; }
.cltf-article__meta-item::before { content: '· '; }
.cltf-article__meta-item:first-child::before { content: ''; }
.cltf-meta__item--updated { color: var(--green); }
.cltf-meta__item--updated::before { content: '· '; color: var(--muted); }

.cltf-article__cover { max-width: 900px; margin: 0 auto 2rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.cltf-article__cover img { width: 100%; }

.cltf-article__layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 2.5rem; max-width: 980px; margin: 0 auto; align-items: start; }
.cltf-article__layout:has(.cltf-article__sidebar:empty) { grid-template-columns: 1fr; }
@media (max-width: 860px) { .cltf-article__layout { grid-template-columns: 1fr; } .cltf-article__sidebar { order: -1; } }

/* Índice (TOC) */
.cltf-toc { position: sticky; top: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.cltf-toc__title { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--muted); margin: 0 0 .6rem; }
.cltf-toc ol { margin: 0; padding-left: 1.1rem; font-size: .87rem; }
.cltf-toc li { margin-bottom: .5rem; }
.cltf-toc a { color: var(--ink); text-decoration: none; }
.cltf-toc a:hover { color: var(--navy); text-decoration: underline; }

/* Corpo do artigo */
.cltf-article__body { font-size: 1.08rem; }
.cltf-article__body--full { max-width: 760px; margin: 0 auto; }
.cltf-article__body h2 { font-family: var(--font-display); color: var(--navy); font-size: 1.5rem; margin: 2.2rem 0 1rem; scroll-margin-top: 1.5rem; }
.cltf-article__body h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 1.7rem 0 .75rem; scroll-margin-top: 1.5rem; }
.cltf-article__body p { margin: 0 0 1.1rem; }
.cltf-article__body ul, .cltf-article__body ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.cltf-article__body li { margin-bottom: .4rem; }
.cltf-article__body a.cltf-inline-link { text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.cltf-article__body table {
	width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem;
	font-family: var(--font-mono);
}
.cltf-article__body th, .cltf-article__body td { border: 1px solid var(--line); padding: .6rem .75rem; text-align: left; }
.cltf-article__body th { background: var(--navy); color: #fff; font-weight: 600; }
.cltf-article__body tr:nth-child(even) td { background: rgba(27,42,74,.03); }
.cltf-article__body img { border-radius: var(--radius); margin: 1rem 0; }
.cltf-article__body blockquote { border-left: 3px solid var(--gold); margin: 1.5rem 0; padding: .25rem 1.25rem; color: var(--muted); font-style: italic; }

/* Ver também */
.cltf-related-box { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 4px; padding: 1.1rem 1.3rem; margin: 2.2rem 0; }
.cltf-related-box__title { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--green); margin: 0 0 .6rem; }
.cltf-related-box ul { margin: 0; padding-left: 1.1rem; }
.cltf-related-box li { margin-bottom: .35rem; }

/* Tags */
.cltf-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0 1.5rem; }
.cltf-tag { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; text-decoration: none; }
.cltf-tag:hover { border-color: var(--navy); color: var(--navy); }

/* Autor */
.cltf-author-box { display: flex; gap: 1rem; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin: 1.5rem 0; }
.cltf-author-box img { border-radius: 50%; flex-shrink: 0; }
.cltf-author-box__name { font-weight: 700; margin: 0 0 .25rem; }
.cltf-author-box__bio { margin: 0; color: var(--muted); font-size: .92rem; }

/* Anterior/Próximo */
.cltf-prevnext { max-width: 980px; margin: 2.5rem auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cltf-prevnext__link { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; text-decoration: none; color: var(--ink); }
.cltf-prevnext__link span { display: block; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-bottom: .3rem; }
.cltf-prevnext__link--next { text-align: right; grid-column: 2; }

/* Paginação */
.cltf-pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 2.5rem; font-family: var(--font-mono); }
.cltf-pagination .page-numbers { text-decoration: none; color: var(--ink); padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 6px; }
.cltf-pagination .page-numbers.current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Arquivo de categoria */
.cltf-archive-header { max-width: 760px; margin: 1.5rem 0 .5rem; }
.cltf-archive-header h1 { font-family: var(--font-display); color: var(--navy); margin: .6rem 0; }
.cltf-archive-header__desc { color: var(--muted); }

/* 404 */
.cltf-404 { max-width: 640px; text-align: left; padding: 3rem 0; }
.cltf-btn { display: inline-block; background: var(--navy); color: #fff; text-decoration: none; padding: .7rem 1.4rem; border-radius: 6px; font-weight: 600; margin-top: .5rem; }

/* ---------- Rodapé ---------- */
.cltf-footer { background: var(--navy); color: rgba(255,255,255,.85); margin-top: 4rem; padding-top: 3rem; }
.cltf-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
@media (max-width: 780px) { .cltf-footer__grid { grid-template-columns: 1fr 1fr; } }
.cltf-footer h3 { font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.55); margin: 0 0 .9rem; }
.cltf-footer ul { list-style: none; margin: 0; padding: 0; }
.cltf-footer li { margin-bottom: .5rem; }
.cltf-footer a { color: rgba(255,255,255,.85); text-decoration: none; font-size: .92rem; }
.cltf-footer a:hover { text-decoration: underline; }
.cltf-logo__stamp--footer { border-color: rgba(255,255,255,.4); margin-bottom: .75rem; }
.cltf-footer__bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 1.25rem 0; font-size: .8rem; color: rgba(255,255,255,.55); }

/* ---------- Acessibilidade ---------- */
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}
