/**
 * Diario Noticias — estilos principais.
 * Variáveis padrão abaixo; a paleta ativa sobrescreve via assets/css/variations.css
 * e o Customizer injeta ajustes finais com wp_add_inline_style().
 */

:root,
body {
	--th-base: #ffffff;
	--th-surface: #f5f5f5;
	--th-contrast: #0d0d0d;
	--th-muted: #6d6d6d;
	--th-border: #e6e6e6;
	--th-primary: #1ea3bf;
	--th-primary-contrast: #ffffff;
	--th-secondary: #0d0d0d;
	--th-accent: #af0a23;
	--th-content: 720px;
	--th-wide: 1240px;
	--th-radius: 14px;
	--th-gap: clamp(1.25rem, 3vw, 2.5rem);
	--th-font-heading: 'DM Serif Display', 'Lora', Georgia, 'Times New Roman', serif;
	--th-font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background-color: var(--th-base);
	color: var(--th-contrast);
	font-family: var(--th-font-body);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--th-font-heading);
	line-height: 1.18;
	margin: 0 0 0.6em;
	font-weight: 700;
	letter-spacing: -0.015em;
}

h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }

p, ul, ol, pre, table, figure, blockquote { margin: 0 0 1.5rem; }

a {
	color: var(--th-primary);
	text-underline-offset: 3px;
}

a:hover,
a:focus { color: var(--th-secondary); }

img, video, iframe, embed, object { max-width: 100%; height: auto; }

:focus-visible {
	outline: 3px solid var(--th-accent);
	outline-offset: 2px;
}

/* ---------- Layout ---------- */

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1 0 auto; padding: clamp(2rem, 5vw, 3.75rem) 0; }

.th-container {
	width: min(100% - 2.5rem, var(--th-wide));
	margin-inline: auto;
}

.th-layout {
	display: grid;
	gap: var(--th-gap);
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
}

@media (min-width: 61.25em) {
	.has-sidebar .th-layout { grid-template-columns: minmax(0, 1fr) 20rem; }
	.has-sidebar.sidebar-left .th-layout { grid-template-columns: 20rem minmax(0, 1fr); }
	.has-sidebar.sidebar-left .content-area { order: 2; }
	.has-sidebar.sidebar-left .widget-area { order: 1; }
}

.no-sidebar .content-area { width: min(100%, var(--th-content)); margin-inline: auto; }
.entry-content > * { max-width: var(--th-content); margin-inline: auto; }
.entry-content > .alignwide { max-width: var(--th-wide); }
.entry-content > .alignfull { max-width: none; width: 100%; }

/* ---------- Header ---------- */

.site-header {
	background-color: var(--th-base);
	border-bottom: 1px solid var(--th-border);
	padding-block: 0.9rem;
	z-index: 50;
}

.site-header.is-sticky { position: sticky; top: 0; }
.site-header.is-scrolled { box-shadow: 0 10px 30px rgba(10, 15, 30, 0.08); }

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	justify-content: space-between;
}

.site-branding { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.site-branding img { max-height: 56px; width: auto; }
.site-title { font-family: var(--th-font-heading); font-size: 1.35rem; margin: 0; font-weight: 800; }
.site-title a { color: inherit; text-decoration: none; }
.site-description { margin: 0; font-size: 0.85rem; color: var(--th-muted); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.th-icon-button {
	appearance: none;
	background: var(--th-surface);
	border: 1px solid var(--th-border);
	border-radius: 999px;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 2.5rem;
	min-width: 2.5rem;
	padding: 0 0.75rem;
	font: inherit;
	font-size: 0.95rem;
	line-height: 1;
}

.th-icon-button:hover { border-color: var(--th-primary); color: var(--th-primary); }

/* ---------- Navegação ---------- */

.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation .menu { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.main-navigation li { position: relative; }

.main-navigation a {
	display: block;
	padding: 0.55rem 0.8rem;
	border-radius: calc(var(--th-radius) / 1.6);
	color: inherit;
	text-decoration: none;
	font-weight: 500;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
	background: var(--th-surface);
	color: var(--th-primary);
}

.main-navigation .sub-menu {
	background: var(--th-base);
	border: 1px solid var(--th-border);
	border-radius: var(--th-radius);
	box-shadow: 0 18px 40px rgba(10, 15, 30, 0.12);
	display: none;
	left: 0;
	min-width: 13rem;
	padding: 0.4rem;
	position: absolute;
	top: 100%;
	z-index: 60;
}

.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu,
.main-navigation .sub-menu.is-open { display: block; }

.menu-toggle { display: none; }

@media (max-width: 61.24em) {
	.menu-toggle { display: inline-flex; }
	.main-navigation {
		display: none;
		order: 3;
		width: 100%;
	}
	.main-navigation.is-open { display: block; }
	.main-navigation .menu { flex-direction: column; align-items: stretch; }
	.main-navigation .sub-menu {
		border: 0;
		box-shadow: none;
		display: block;
		padding-left: 1rem;
		position: static;
	}
}

/* ---------- Hero / Seções ---------- */

.th-hero {
	background: linear-gradient(135deg, var(--th-primary), var(--th-secondary));
	border-radius: var(--th-radius);
	color: var(--th-primary-contrast);
	margin-block-end: var(--th-gap);
	overflow: hidden;
	padding: clamp(2.5rem, 7vw, 5rem);
}

.th-hero h1, .th-hero h2 { color: inherit; margin-top: 0; }
.th-hero p { font-size: 1.1rem; max-width: 46ch; opacity: 0.92; }
.th-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.th-button,
.wp-block-button__link,
button, input[type="submit"] {
	background: var(--th-primary);
	border: 1px solid transparent;
	border-radius: 999px;
	color: var(--th-primary-contrast);
	cursor: pointer;
	display: inline-block;
	font: inherit;
	font-weight: 600;
	padding: 0.7rem 1.4rem;
	text-decoration: none;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.th-button:hover, button:hover, input[type="submit"]:hover { transform: translateY(-1px); opacity: 0.92; color: var(--th-primary-contrast); }
.th-button--ghost { background: transparent; border-color: currentColor; color: inherit; }

.th-section { margin-block: clamp(2.5rem, 6vw, 4rem); }
.th-section__title { text-align: center; margin-bottom: 0.5rem; }
.th-section__lead { color: var(--th-muted); text-align: center; margin-bottom: 2rem; }

.th-features { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

.th-feature {
	background: var(--th-surface);
	border: 1px solid var(--th-border);
	border-radius: var(--th-radius);
	padding: 1.5rem;
}

.th-feature__icon {
	align-items: center;
	background: var(--th-primary);
	border-radius: 50%;
	color: var(--th-primary-contrast);
	display: inline-flex;
	font-weight: 700;
	height: 2.5rem;
	justify-content: center;
	margin-bottom: 0.9rem;
	width: 2.5rem;
}

.th-cta {
	align-items: center;
	background: var(--th-surface);
	border: 1px solid var(--th-border);
	border-radius: var(--th-radius);
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	justify-content: space-between;
	padding: clamp(1.75rem, 4vw, 2.75rem);
}

/* ---------- Posts ---------- */

.posts-list { display: grid; gap: var(--th-gap); }
.posts-list.layout-grid { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.posts-list.layout-masonry { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); grid-auto-rows: 8px; }
.posts-list.layout-masonry .entry-thumbnail img { width: 100%; }

.entry-card {
	background: var(--th-surface);
	border: 1px solid var(--th-border);
	border-radius: var(--th-radius);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.layout-list .entry-card { background: transparent; border: 0; border-bottom: 1px solid var(--th-border); border-radius: 0; padding-bottom: var(--th-gap); }
.layout-list .entry-card:last-child { border-bottom: 0; }

.entry-thumbnail img { display: block; width: 100%; object-fit: cover; }
.layout-grid .entry-thumbnail img { aspect-ratio: 16 / 10; }

.entry-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.layout-list .entry-card__body { padding: 1.25rem 0 0; }

.entry-title { margin: 0; font-size: 1.35rem; }
.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { color: var(--th-primary); }

.entry-meta { color: var(--th-muted); display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem; }
.entry-meta a { color: inherit; }

.th-badge {
	background: color-mix(in srgb, var(--th-primary) 14%, transparent);
	border-radius: 999px;
	color: var(--th-primary);
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	padding: 0.2rem 0.7rem;
	text-transform: uppercase;
}

.page-header { margin-bottom: var(--th-gap); }
.page-title { margin-bottom: 0.25rem; }
.archive-description { color: var(--th-muted); }

.th-breadcrumbs { color: var(--th-muted); font-size: 0.85rem; margin-bottom: 1.25rem; }
.th-breadcrumbs a { color: inherit; }
.th-breadcrumbs span + span::before { content: "/"; margin: 0 0.5rem; opacity: 0.5; }

.entry-footer { border-top: 1px solid var(--th-border); margin-top: 2rem; padding-top: 1rem; color: var(--th-muted); font-size: 0.9rem; }

.post-navigation { display: flex; gap: 1rem; justify-content: space-between; margin-top: 2rem; }
.post-navigation a { text-decoration: none; font-weight: 600; }

.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pagination .page-numbers {
	border: 1px solid var(--th-border);
	border-radius: calc(var(--th-radius) / 2);
	color: inherit;
	display: inline-block;
	min-width: 2.4rem;
	padding: 0.45rem 0.7rem;
	text-align: center;
	text-decoration: none;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--th-primary); border-color: var(--th-primary); color: var(--th-primary-contrast); }

/* ---------- Widgets / rodapé ---------- */

.widget-area { display: grid; gap: 1.25rem; }
.widget {
	background: var(--th-surface);
	border: 1px solid var(--th-border);
	border-radius: var(--th-radius);
	padding: 1.25rem;
}
.widget-title { font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; }
.widget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.widget a { color: inherit; text-decoration: none; }
.widget a:hover { color: var(--th-primary); }

.site-footer { background: var(--th-surface); border-top: 1px solid var(--th-border); margin-top: auto; padding-block: clamp(2rem, 5vw, 3.5rem) 1.5rem; }
.footer-widgets { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: 2rem; }
.footer-widgets .widget { background: transparent; border: 0; padding: 0; }
.site-info { border-top: 1px solid var(--th-border); color: var(--th-muted); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; padding-top: 1.25rem; font-size: 0.9rem; }
.footer-menu ul { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.footer-menu a { color: inherit; text-decoration: none; }

/* ---------- Formulários / comentários ---------- */

input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], input[type="number"], textarea, select {
	background: var(--th-base);
	border: 1px solid var(--th-border);
	border-radius: calc(var(--th-radius) / 1.6);
	color: inherit;
	font: inherit;
	padding: 0.65rem 0.85rem;
	width: 100%;
	max-width: 100%;
}

.search-form { display: flex; gap: 0.5rem; }
.search-form .search-submit { flex: 0 0 auto; }

.comments-area { margin-top: 3rem; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.comment-list .children { list-style: none; margin: 1.25rem 0 0 1.5rem; padding: 0; display: grid; gap: 1.25rem; }
.comment-body { background: var(--th-surface); border: 1px solid var(--th-border); border-radius: var(--th-radius); padding: 1.25rem; }
.comment-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; font-size: 0.85rem; color: var(--th-muted); }
.comment-meta img { border-radius: 50%; }

/* ---------- Blocos do WordPress ---------- */

.alignleft { float: left; margin: 0.4rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.4rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.sticky .entry-title::after { content: " ★"; color: var(--th-accent); }
.wp-caption-text, .wp-element-caption { color: var(--th-muted); font-size: 0.85rem; text-align: center; }
.wp-block-quote, blockquote { border-left: 4px solid var(--th-primary); margin-inline: 0; padding-left: 1.25rem; font-style: italic; }
.wp-block-table table, table { border-collapse: collapse; width: 100%; }
.wp-block-table td, .wp-block-table th, td, th { border: 1px solid var(--th-border); padding: 0.6rem 0.8rem; }
pre, code { background: var(--th-surface); border-radius: calc(var(--th-radius) / 2); }
pre { overflow-x: auto; padding: 1rem; }
code { padding: 0.1rem 0.35rem; }

/* ---------- Utilidades ---------- */

.th-skip-link:focus { left: 1rem; top: 1rem; }
.th-back-to-top {
	border-radius: 999px;
	bottom: 1.5rem;
	display: none;
	height: 2.75rem;
	position: fixed;
	right: 1.5rem;
	width: 2.75rem;
	padding: 0;
	z-index: 80;
}
.th-back-to-top.is-visible { display: inline-flex; align-items: center; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
