/*
Theme Name:        Vue Blocks
Theme URI:         https://example.com/vue-blocks
Description:       Tema WordPress clássico construído em PHP seguindo a hierarquia de templates oficial, com Vue.js 3 cuidando de toda a interação de frontend (busca ao vivo, carregamento de posts, menu mobile e modo escuro) através da REST API do WordPress.
Version:           1.0.0
Author:            Seu Nome
Author URI:        https://example.com
Tags:              blog, custom-menu, featured-images, threaded-comments, translation-ready
Text Domain:       vue-blocks
Domain Path:       /languages
Tested up to:      6.7
Requires at least: 6.0
Requires PHP:      7.4
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
*/

/* =========================================================
   1. RESET & VARIÁVEIS
   ========================================================= */
:root {
	--vb-bg: #ffffff;
	--vb-bg-alt: #f5f6f8;
	--vb-text: #1c1d21;
	--vb-text-muted: #6b7280;
	--vb-primary: #4f46e5;
	--vb-primary-hover: #4338ca;
	--vb-border: #e5e7eb;
	--vb-radius: 10px;
	--vb-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
	--vb-max-width: 1180px;
	--vb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--vb-transition: 0.2s ease;
}

[data-theme="dark"] {
	--vb-bg: #14151a;
	--vb-bg-alt: #1d1f26;
	--vb-text: #e9eaee;
	--vb-text-muted: #9aa0ab;
	--vb-primary: #818cf8;
	--vb-primary-hover: #a5b4fc;
	--vb-border: #2b2d36;
	--vb-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--vb-font);
	background: var(--vb-bg);
	color: var(--vb-text);
	line-height: 1.65;
	transition: background var(--vb-transition), color var(--vb-transition);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: var(--vb-radius);
}

a {
	color: var(--vb-primary);
	text-decoration: none;
}

a:hover {
	color: var(--vb-primary-hover);
}

/* Esconde o markup com sintaxe {{ }} até o Vue terminar de compilar/montar */
[v-cloak] {
	visibility: hidden;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* =========================================================
   2. LAYOUT
   ========================================================= */
.vb-container {
	max-width: var(--vb-max-width);
	margin: 0 auto;
	padding: 0 20px;
}

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1 0 auto;
	padding: 40px 0 60px;
}

.vb-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 40px;
}

@media (max-width: 860px) {
	.vb-layout {
		grid-template-columns: 1fr;
	}
}

/* =========================================================
   3. HEADER
   ========================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--vb-bg);
	border-bottom: 1px solid var(--vb-border);
	backdrop-filter: saturate(180%) blur(8px);
}

.site-header .vb-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-top: 16px;
	padding-bottom: 16px;
}

.site-branding .site-title {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.site-branding .site-title a {
	color: var(--vb-text);
}

.site-branding .site-description {
	margin: 2px 0 0;
	font-size: 0.85rem;
	color: var(--vb-text-muted);
}

.main-navigation {
	display: flex;
	align-items: center;
	gap: 24px;
}

.main-navigation ul {
	list-style: none;
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 0;
}

.main-navigation a {
	color: var(--vb-text);
	font-weight: 600;
	font-size: 0.95rem;
}

.main-navigation a:hover {
	color: var(--vb-primary);
}

.menu-toggle {
	display: none;
}

.nav-wrapper {
	display: flex;
}

@media (max-width: 780px) {
	.menu-toggle {
		display: inline-flex;
	}

	.nav-wrapper {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--vb-bg);
		border-bottom: 1px solid var(--vb-border);
		max-height: 0;
		overflow: hidden;
		transition: max-height var(--vb-transition);
		display: block;
	}

	.nav-wrapper.is-open {
		max-height: 320px;
	}

	.nav-wrapper #primary-menu {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		padding: 12px 20px 18px;
	}

	.main-navigation {
		position: relative;
		flex: 1;
		justify-content: flex-end;
	}
}

/* =========================================================
   4. VUE APP – utilitários genéricos usados pelos componentes
   ========================================================= */
.vb-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--vb-primary);
	color: #fff;
	border: none;
	padding: 10px 18px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background var(--vb-transition), transform var(--vb-transition);
}

.vb-btn:hover {
	background: var(--vb-primary-hover);
	color: #fff;
}

.vb-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.vb-btn--ghost {
	background: transparent;
	color: var(--vb-text);
	border: 1px solid var(--vb-border);
}

.vb-icon-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--vb-border);
	background: var(--vb-bg-alt);
	color: var(--vb-text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 1.1rem;
	transition: transform var(--vb-transition);
}

.vb-icon-btn:hover {
	transform: scale(1.06);
}

.vb-search {
	position: relative;
	max-width: 420px;
	margin: 0 auto 32px;
}

.vb-search input {
	width: 100%;
	padding: 12px 16px 12px 42px;
	border-radius: 999px;
	border: 1px solid var(--vb-border);
	background: var(--vb-bg-alt);
	color: var(--vb-text);
	font-size: 0.95rem;
}

.vb-search input:focus {
	outline: 2px solid var(--vb-primary);
	outline-offset: 1px;
}

.vb-search .vb-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--vb-text-muted);
}

.vb-search-results {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 8px);
	background: var(--vb-bg);
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
	box-shadow: var(--vb-shadow);
	max-height: 320px;
	overflow-y: auto;
	z-index: 40;
	text-align: left;
}

.vb-search-results a {
	display: block;
	padding: 10px 14px;
	color: var(--vb-text);
	font-size: 0.9rem;
	border-bottom: 1px solid var(--vb-border);
}

.vb-search-results a:last-child {
	border-bottom: none;
}

.vb-search-results a:hover {
	background: var(--vb-bg-alt);
}

.vb-search-empty,
.vb-search-loading {
	padding: 12px 14px;
	font-size: 0.85rem;
	color: var(--vb-text-muted);
}

/* Grid de posts renderizado pelo Vue */
.vb-posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
}

.vb-post-card {
	background: var(--vb-bg-alt);
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform var(--vb-transition), box-shadow var(--vb-transition);
}

.vb-post-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--vb-shadow);
}

.vb-post-card__thumb {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
	border-radius: 0;
	background: var(--vb-border);
}

.vb-post-card__body {
	padding: 16px 18px 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.vb-post-card__meta {
	font-size: 0.75rem;
	color: var(--vb-text-muted);
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.vb-post-card__title {
	font-size: 1.05rem;
	margin: 0 0 8px;
	line-height: 1.35;
}

.vb-post-card__title a {
	color: var(--vb-text);
}

.vb-post-card__excerpt {
	font-size: 0.88rem;
	color: var(--vb-text-muted);
	margin: 0 0 14px;
	flex: 1;
}

.vb-load-more {
	display: flex;
	justify-content: center;
	margin-top: 36px;
}

.vb-skeleton {
	background: linear-gradient(90deg, var(--vb-border) 25%, var(--vb-bg-alt) 37%, var(--vb-border) 63%);
	background-size: 400% 100%;
	animation: vb-shimmer 1.4s ease infinite;
	border-radius: var(--vb-radius);
	height: 220px;
}

@keyframes vb-shimmer {
	0% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0 50%;
	}
}

/* =========================================================
   5. CONTEÚDO / ARTIGO
   ========================================================= */
.entry-header {
	margin-bottom: 24px;
}

.entry-title {
	font-size: 2rem;
	line-height: 1.2;
	margin: 0 0 10px;
}

.entry-meta {
	color: var(--vb-text-muted);
	font-size: 0.85rem;
}

.entry-content h2 {
	margin-top: 2em;
}

.entry-content blockquote {
	margin: 0;
	padding: 12px 20px;
	border-left: 4px solid var(--vb-primary);
	background: var(--vb-bg-alt);
	border-radius: 0 var(--vb-radius) var(--vb-radius) 0;
}

.entry-content pre {
	background: var(--vb-bg-alt);
	padding: 16px;
	border-radius: var(--vb-radius);
	overflow-x: auto;
}

.entry-footer {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--vb-border);
	font-size: 0.85rem;
	color: var(--vb-text-muted);
}

/* =========================================================
   6. SIDEBAR / WIDGETS
   ========================================================= */
.widget {
	background: var(--vb-bg-alt);
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
	padding: 20px;
	margin-bottom: 24px;
}

.widget-title {
	margin: 0 0 14px;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.widget li {
	padding: 6px 0;
	border-bottom: 1px solid var(--vb-border);
}

.widget li:last-child {
	border-bottom: none;
}

/* =========================================================
   7. FOOTER
   ========================================================= */
.site-footer {
	border-top: 1px solid var(--vb-border);
	background: var(--vb-bg-alt);
	padding: 30px 0;
	font-size: 0.85rem;
	color: var(--vb-text-muted);
}

.site-footer .vb-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

/* =========================================================
   8. HERO (front-page)
   ========================================================= */
.vb-hero {
	text-align: center;
	padding: 60px 0 40px;
}

.vb-hero h1 {
	font-size: 2.4rem;
	margin: 0 0 12px;
	letter-spacing: -0.02em;
}

.vb-hero p {
	color: var(--vb-text-muted);
	max-width: 560px;
	margin: 0 auto 28px;
}

/* Comments */
.comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .comment-body {
	background: var(--vb-bg-alt);
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
	padding: 16px 18px;
	margin-bottom: 16px;
}

.comment-list .children {
	list-style: none;
	margin-left: 24px;
	padding: 0;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1px solid var(--vb-border);
	background: var(--vb-bg);
	color: var(--vb-text);
	margin-bottom: 14px;
	font-family: inherit;
}
