/*
Theme Name: Clio Historiador
Theme URI: https://example.com/clio-historiador
Author: Seu Nome
Author URI: https://example.com
Description: Tema editorial para historiadores e blogs de divulgação histórica. Totalmente responsivo, compatível com Elementor, com modo claro/escuro, grade de artigos, barra lateral e áreas de widgets no rodapé. Fácil de editar direto pelo WordPress.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: clio-historiador
Tags: blog, news, editorial, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   0. RESET & VARIÁVEIS
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--clio-text);
	background: var(--clio-bg);
	line-height: 1.65;
	transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5 {
	font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
	line-height: 1.2;
	margin: 0 0 .5em;
	color: var(--clio-heading);
	font-weight: 700;
}
p { margin: 0 0 1.2em; }
button { font-family: inherit; cursor: pointer; }

:root {
	--clio-accent: #8a1f1f;
	--clio-accent-soft: #f3e4d7;
	--clio-bg: #fbf8f3;
	--clio-surface: #ffffff;
	--clio-text: #2b2622;
	--clio-heading: #1c1815;
	--clio-muted: #6c6259;
	--clio-border: #e6dccd;
	--clio-max: 1200px;
	--clio-radius: 10px;
	--clio-shadow: 0 4px 18px rgba(30, 20, 10, .06);
}
[data-theme="dark"] {
	--clio-bg: #16130f;
	--clio-surface: #1f1a15;
	--clio-text: #e9e2d6;
	--clio-heading: #f6efe3;
	--clio-muted: #b3a793;
	--clio-border: #332b22;
	--clio-accent-soft: #2c2119;
	--clio-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}

.container {
	max-width: var(--clio-max);
	margin: 0 auto;
	padding: 0 24px;
}
.screen-reader-text {
	position: absolute !important;
	clip: rect(1px,1px,1px,1px);
	width: 1px; height: 1px; overflow: hidden;
}

/* =========================================================
   1. TOPO / HEADER
   ========================================================= */
.site-topbar {
	background: var(--clio-heading);
	color: #efe6d8;
	font-size: .82rem;
	padding: 6px 0;
}
.site-topbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.site-topbar a { opacity: .85; }
.site-topbar a:hover { opacity: 1; }
.topbar-socials { display: flex; gap: 14px; }
.topbar-socials svg { width: 15px; height: 15px; fill: currentColor; }

.site-header {
	background: var(--clio-surface);
	border-bottom: 1px solid var(--clio-border);
	position: sticky;
	top: 0;
	z-index: 500;
	box-shadow: var(--clio-shadow);
}
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	gap: 24px;
}
.site-branding { display: flex; align-items: center; gap: 12px; }
.site-branding img.custom-logo { max-height: 56px; width: auto; }
.site-title {
	font-family: 'Playfair Display', serif;
	font-size: 1.6rem;
	font-weight: 800;
	margin: 0;
	letter-spacing: .3px;
}
.site-title a { color: var(--clio-heading); }
.site-description {
	font-size: .78rem;
	color: var(--clio-muted);
	margin: 0;
	letter-spacing: .5px;
	text-transform: uppercase;
}

.main-navigation { display: flex; align-items: center; gap: 8px; }
.clio-menu { display: flex; gap: 4px; flex-wrap: wrap; }
.clio-menu li a {
	display: block;
	padding: 10px 14px;
	font-weight: 600;
	font-size: .95rem;
	color: var(--clio-text);
	border-radius: 6px;
	transition: background .2s, color .2s;
}
.clio-menu li a:hover,
.clio-menu li.current-menu-item > a {
	background: var(--clio-accent-soft);
	color: var(--clio-accent);
}
.clio-menu li.menu-item-has-children { position: relative; }
.clio-menu .sub-menu {
	display: none;
	position: absolute;
	top: 100%; left: 0;
	background: var(--clio-surface);
	border: 1px solid var(--clio-border);
	border-radius: 8px;
	min-width: 220px;
	box-shadow: var(--clio-shadow);
	padding: 8px;
	z-index: 10;
}
.clio-menu li.menu-item-has-children:hover .sub-menu { display: block; }
.clio-menu .sub-menu li a { padding: 8px 10px; font-size: .9rem; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
	background: none;
	border: 1px solid var(--clio-border);
	width: 40px; height: 40px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	color: var(--clio-text);
	transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--clio-accent); color: #fff; border-color: var(--clio-accent); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.menu-toggle { display: none; }

.search-flyout {
	display: none;
	position: absolute;
	top: 100%; left: 0; right: 0;
	background: var(--clio-surface);
	border-bottom: 1px solid var(--clio-border);
	padding: 18px 24px;
	box-shadow: var(--clio-shadow);
}
.search-flyout.is-open { display: block; }
.search-flyout form { display: flex; max-width: var(--clio-max); margin: 0 auto; gap: 8px; }
.search-flyout input[type="search"] {
	flex: 1;
	padding: 12px 16px;
	border: 1px solid var(--clio-border);
	border-radius: 8px;
	background: var(--clio-bg);
	color: var(--clio-text);
	font-size: 1rem;
}
.search-flyout button {
	background: var(--clio-accent);
	color: #fff;
	border: none;
	padding: 0 20px;
	border-radius: 8px;
	font-weight: 600;
}

/* =========================================================
   2. HERO / DESTAQUE
   ========================================================= */
.hero-section { padding: 40px 0; }
.hero-grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr;
	gap: 24px;
}
.hero-main {
	position: relative;
	border-radius: var(--clio-radius);
	overflow: hidden;
	min-height: 420px;
	display: flex;
	align-items: flex-end;
	background: #333;
}
.hero-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.hero-main::after {
	content: '';
	position: absolute; inset: 0;
	background: linear-gradient(to top, rgba(10,8,6,.88) 5%, rgba(10,8,6,.15) 60%, transparent 100%);
}
.hero-main-content { position: relative; z-index: 2; padding: 32px; color: #fff; }
.hero-main-content .clio-badge { background: var(--clio-accent); color: #fff; }
.hero-main-content h1, .hero-main-content h2 { color: #fff; font-size: 2rem; margin: 12px 0 10px; }
.hero-main-content p { color: #eee0cd; max-width: 60ch; }
.hero-meta { color: #d9cbb4; font-size: .85rem; }

.hero-side { display: flex; flex-direction: column; gap: 18px; }
.hero-side-item { display: flex; gap: 14px; align-items: flex-start; }
.hero-side-item .thumb {
	width: 96px; height: 72px; flex-shrink: 0;
	border-radius: 8px; overflow: hidden; background: var(--clio-border);
}
.hero-side-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-side-item h3 { font-size: 1rem; margin: 4px 0; }
.hero-side-item h3 a:hover { color: var(--clio-accent); }
.hero-side-item .clio-meta-small { font-size: .78rem; color: var(--clio-muted); }

/* =========================================================
   3. BADGES / META
   ========================================================= */
.clio-badge {
	display: inline-block;
	background: var(--clio-accent-soft);
	color: var(--clio-accent);
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .6px;
	padding: 4px 10px;
	border-radius: 100px;
}
.clio-meta {
	font-size: .82rem;
	color: var(--clio-muted);
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	margin: 8px 0;
}
.clio-meta a { color: var(--clio-muted); }
.clio-meta a:hover { color: var(--clio-accent); }

/* =========================================================
   4. SEÇÕES / TÍTULOS DE BLOCO
   ========================================================= */
.section-title {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 48px 0 24px;
}
.section-title h2 {
	font-size: 1.5rem;
	white-space: nowrap;
	margin: 0;
}
.section-title .line { flex: 1; height: 1px; background: var(--clio-border); }
.section-title a.see-all { font-size: .85rem; font-weight: 700; color: var(--clio-accent); white-space: nowrap; }

/* =========================================================
   5. GRID DE ARTIGOS / CARDS
   ========================================================= */
.content-layout {
	display: grid;
	grid-template-columns: 2.2fr 1fr;
	gap: 40px;
	align-items: start;
	padding-bottom: 60px;
}
.posts-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 28px;
}
.posts-grid.list-layout { grid-template-columns: 1fr; }

.clio-card {
	background: var(--clio-surface);
	border: 1px solid var(--clio-border);
	border-radius: var(--clio-radius);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease;
	display: flex;
	flex-direction: column;
}
.clio-card:hover { transform: translateY(-4px); box-shadow: var(--clio-shadow); }
.clio-card .card-thumb { aspect-ratio: 3/2; overflow: hidden; background: var(--clio-border); }
.clio-card .card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.clio-card:hover .card-thumb img { transform: scale(1.05); }
.clio-card .card-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.clio-card h3 { font-size: 1.15rem; margin: 10px 0 8px; }
.clio-card h3 a:hover { color: var(--clio-accent); }
.clio-card .excerpt { color: var(--clio-muted); font-size: .93rem; flex: 1; }

.posts-grid.list-layout .clio-card { flex-direction: row; }
.posts-grid.list-layout .card-thumb { width: 260px; flex-shrink: 0; aspect-ratio: auto; }
.posts-grid.list-layout .card-body { padding: 20px 24px; }

/* =========================================================
   6. SIDEBAR
   ========================================================= */
.clio-sidebar { display: flex; flex-direction: column; gap: 28px; }
.clio-widget {
	background: var(--clio-surface);
	border: 1px solid var(--clio-border);
	border-radius: var(--clio-radius);
	padding: 22px;
}
.clio-widget-title {
	font-size: 1.05rem;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--clio-accent);
	display: inline-block;
}
.widget-post-mini { display: flex; gap: 12px; margin-bottom: 14px; }
.widget-post-mini:last-child { margin-bottom: 0; }
.widget-post-mini .thumb { width: 64px; height: 64px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--clio-border); }
.widget-post-mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-post-mini h4 { font-size: .9rem; margin: 0; line-height: 1.35; }
.widget-post-mini h4 a:hover { color: var(--clio-accent); }

.about-widget-avatar { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; margin: 0 auto 14px; }
.about-widget-avatar img { width: 100%; height: 100%; object-fit: cover; }
.about-widget { text-align: center; }
.about-widget p { font-size: .9rem; color: var(--clio-muted); }
.about-widget .socials { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }

.newsletter-widget input[type="email"] {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--clio-border);
	border-radius: 7px;
	margin-bottom: 10px;
	background: var(--clio-bg);
	color: var(--clio-text);
}
.newsletter-widget button {
	width: 100%;
	background: var(--clio-accent);
	color: #fff;
	border: none;
	padding: 11px;
	border-radius: 7px;
	font-weight: 700;
}

.tagcloud a, .cat-list a {
	display: inline-block;
	margin: 0 6px 8px 0;
	padding: 5px 12px;
	font-size: .82rem !important;
	border: 1px solid var(--clio-border);
	border-radius: 100px;
	color: var(--clio-text) !important;
}
.tagcloud a:hover, .cat-list a:hover { background: var(--clio-accent); color: #fff !important; border-color: var(--clio-accent); }
.widget_categories ul li, .widget_archive ul li {
	display: flex; justify-content: space-between;
	padding: 9px 0; border-bottom: 1px solid var(--clio-border); font-size: .92rem;
}
.widget_categories ul li:last-child, .widget_archive ul li:last-child { border-bottom: none; }

/* =========================================================
   7. ARTIGO / SINGLE
   ========================================================= */
.clio-breadcrumb { font-size: .82rem; color: var(--clio-muted); padding: 18px 0; }
.clio-breadcrumb a:hover { color: var(--clio-accent); }
.clio-breadcrumb .sep { margin: 0 6px; }

.single-header { padding: 10px 0 30px; max-width: 820px; }
.single-header h1 { font-size: 2.4rem; margin: 12px 0 16px; }
.single-header .clio-meta { font-size: .9rem; }
.single-header .excerpt-lead { font-size: 1.15rem; color: var(--clio-muted); }

.author-box-inline { display: flex; align-items: center; gap: 10px; }
.author-box-inline img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

.single-featured-image { border-radius: var(--clio-radius); overflow: hidden; margin-bottom: 32px; }
.single-featured-image img { width: 100%; }
.image-caption { font-size: .82rem; color: var(--clio-muted); text-align: center; margin-top: 8px; }

.entry-content { max-width: 780px; font-size: 1.08rem; }
.entry-content h2 { font-size: 1.6rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.4em; }
.entry-content blockquote {
	border-left: 4px solid var(--clio-accent);
	margin: 28px 0;
	padding: 6px 24px;
	font-style: italic;
	font-size: 1.15rem;
	color: var(--clio-muted);
	background: var(--clio-accent-soft);
	border-radius: 0 8px 8px 0;
}
.entry-content figure { margin: 28px 0; }
.entry-content figure img { border-radius: 8px; }
.entry-content a { color: var(--clio-accent); text-decoration: underline; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin-bottom: 1.2em; }
.entry-content ul li, .entry-content ol li { margin-bottom: .4em; }

.tags-share { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin: 40px 0; padding: 24px 0; border-top: 1px solid var(--clio-border); border-bottom: 1px solid var(--clio-border); max-width: 780px; }
.post-tags a { display: inline-block; margin: 0 8px 8px 0; padding: 6px 14px; border: 1px solid var(--clio-border); border-radius: 100px; font-size: .82rem; }
.post-tags a:hover { background: var(--clio-accent); color: #fff; border-color: var(--clio-accent); }
.share-links { display: flex; gap: 8px; }

.author-box {
	display: flex;
	gap: 20px;
	background: var(--clio-surface);
	border: 1px solid var(--clio-border);
	border-radius: var(--clio-radius);
	padding: 24px;
	max-width: 780px;
	margin-bottom: 40px;
}
.author-box img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; }
.author-box h4 { margin: 0 0 6px; }
.author-box p { color: var(--clio-muted); font-size: .92rem; margin: 0; }

.related-posts { max-width: 900px; }

/* =========================================================
   8. PAGINAÇÃO
   ========================================================= */
.clio-pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0; flex-wrap: wrap; }
.clio-pagination a, .clio-pagination span {
	display: flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 10px;
	border: 1px solid var(--clio-border);
	border-radius: 8px;
	font-weight: 600; font-size: .9rem;
}
.clio-pagination .current { background: var(--clio-accent); color: #fff; border-color: var(--clio-accent); }
.clio-pagination a:hover { border-color: var(--clio-accent); color: var(--clio-accent); }

/* =========================================================
   9. COMENTÁRIOS
   ========================================================= */
#comments { max-width: 780px; margin-top: 50px; }
.comment-list { display: flex; flex-direction: column; gap: 20px; }
.comment-body { background: var(--clio-surface); border: 1px solid var(--clio-border); border-radius: 10px; padding: 18px; }
.comment-form input, .comment-form textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--clio-border);
	border-radius: 8px; background: var(--clio-bg); color: var(--clio-text); margin-bottom: 14px;
}
.comment-form textarea { min-height: 130px; }
.comment-form .submit-btn {
	background: var(--clio-accent); color: #fff; border: none; padding: 12px 26px;
	border-radius: 8px; font-weight: 700;
}

/* =========================================================
   10. FOOTER
   ========================================================= */
.site-footer { background: var(--clio-heading); color: #d9cfbe; margin-top: 60px; }
.footer-top { padding: 56px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
.footer-col h4 { color: #f6efe3; font-size: 1rem; margin-bottom: 16px; }
.footer-col p, .footer-col a { color: #b7ac97; font-size: .92rem; }
.footer-col a:hover { color: #fff; }
.footer-col ul li { margin-bottom: 10px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand .site-title { color: #fff; font-size: 1.3rem; }
.footer-socials { display: flex; gap: 10px; margin-top: 16px; }
.footer-socials a {
	width: 36px; height: 36px; border-radius: 50%;
	border: 1px solid #453b2e;
	display: flex; align-items: center; justify-content: center;
}
.footer-socials svg { width: 15px; height: 15px; fill: #d9cfbe; }
.footer-socials a:hover { background: var(--clio-accent); border-color: var(--clio-accent); }
.footer-socials a:hover svg { fill: #fff; }

.footer-bottom { border-top: 1px solid #3a3225; padding: 20px 0; font-size: .82rem; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-bottom a:hover { color: #fff; }

.back-to-top {
	position: fixed; right: 24px; bottom: 24px;
	width: 46px; height: 46px; border-radius: 50%;
	background: var(--clio-accent); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: var(--clio-shadow); z-index: 400;
	opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: opacity .25s, transform .25s, visibility .25s;
	border: none;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top svg { width: 18px; height: 18px; fill: currentColor; }

/* =========================================================
   11. ELEMENTOS GERAIS (404, formulários, etc.)
   ========================================================= */
.error-404 { text-align: center; padding: 80px 0; }
.error-404 h1 { font-size: 5rem; color: var(--clio-accent); margin-bottom: 0; }
.clio-search-form { display: flex; max-width: 480px; margin: 24px auto; gap: 8px; }
.clio-search-form input { flex: 1; padding: 12px 16px; border: 1px solid var(--clio-border); border-radius: 8px; background: var(--clio-surface); color: var(--clio-text); }
.clio-search-form button { background: var(--clio-accent); color: #fff; border: none; padding: 0 20px; border-radius: 8px; font-weight: 700; }
.btn-primary {
	display: inline-block; background: var(--clio-accent); color: #fff !important;
	padding: 12px 26px; border-radius: 8px; font-weight: 700; border: none;
}
.btn-primary:hover { opacity: .9; }

/* =========================================================
   12. RESPONSIVIDADE
   ========================================================= */
@media (max-width: 1024px) {
	.content-layout { grid-template-columns: 1fr; }
	.hero-grid { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 782px) {
	.site-topbar { display: none; }
	.main-navigation {
		position: fixed; top: 0; right: -100%;
		width: 82%; max-width: 340px; height: 100vh;
		background: var(--clio-surface);
		flex-direction: column; align-items: flex-start;
		padding: 90px 24px 24px;
		transition: right .3s ease;
		z-index: 600;
		overflow-y: auto;
		box-shadow: -8px 0 24px rgba(0,0,0,.15);
	}
	.main-navigation.is-open { right: 0; }
	.clio-menu { flex-direction: column; width: 100%; gap: 0; }
	.clio-menu li { width: 100%; border-bottom: 1px solid var(--clio-border); }
	.clio-menu .sub-menu { display: block; position: static; border: none; box-shadow: none; padding-left: 12px; }
	.clio-menu li.menu-item-has-children:hover .sub-menu { display: block; }
	.menu-toggle {
		display: flex; align-items: center; justify-content: center;
		width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--clio-border);
		background: none; color: var(--clio-text);
	}
	.menu-toggle svg { width: 22px; height: 22px; fill: currentColor; }
	.nav-overlay {
		display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 550;
	}
	.nav-overlay.is-open { display: block; }
	.nav-close { display: block; position: absolute; top: 24px; right: 24px; background: none; border: none; }
	.nav-close svg { width: 24px; height: 24px; }

	.posts-grid { grid-template-columns: 1fr; }
	.posts-grid.list-layout .clio-card { flex-direction: column; }
	.posts-grid.list-layout .card-thumb { width: 100%; aspect-ratio: 3/2; }
	.footer-grid { grid-template-columns: 1fr; gap: 28px; }
	.single-header h1 { font-size: 1.7rem; }
	.tags-share { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
	.header-inner { padding: 12px 16px; }
	.site-title { font-size: 1.25rem; }
	.hero-main { min-height: 320px; }
	.hero-main-content h1, .hero-main-content h2 { font-size: 1.4rem; }
	.container { padding: 0 16px; }
}
