/**
 * Tema: WordPress Site Factory - Starter Theme
 * Arquivo: assets/css/base.css
 * 
 * Desenvolvido por: Roger Alves
 * Data da Modificacao: 2026-05-28
 * Hora da Modificacao: 17:59
 *
 * Todos os direitos reservados.
 */

/* 1. Reset Basico de Estilos */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--font-body);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.6;
	color: var(--color-text-primary);
	background-color: var(--color-bg-light);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* 2. Tipografia Fluida e Semantica */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-headings);
	font-weight: 700;
	line-height: 1.2;
	color: var(--color-primary);
	letter-spacing: 0;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
	margin-bottom: 1rem;
	color: var(--color-text-secondary);
}

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

a:hover {
	color: var(--color-secondary-dark);
	text-decoration: none;
}

/* 3. Componentes Estruturais de Layout */
.container {
	width: 100%;
	max-width: var(--container-width);
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

.section {
	padding-top: var(--space-section);
	padding-bottom: var(--space-section);
	position: relative;
}

.theme-primary {
	background-color: var(--color-primary);
	color: var(--color-text-on-dark);
}

.theme-primary h1, .theme-primary h2, .theme-primary h3, .theme-primary h4, .theme-primary p {
	color: var(--color-text-on-dark);
}

.theme-surface {
	background-color: var(--color-bg-surface);
}

html[data-gpm-theme="dark"] body {
	background:
		linear-gradient(180deg, #071422 0%, #030f1d 100%);
}

html[data-gpm-theme="dark"] .theme-primary {
	background-color: #030f1d;
}

html[data-gpm-theme="dark"] .theme-surface {
	background-color: #14202f;
}

html[data-gpm-theme="dark"] h1,
html[data-gpm-theme="dark"] h2,
html[data-gpm-theme="dark"] h3,
html[data-gpm-theme="dark"] h4,
html[data-gpm-theme="dark"] h5,
html[data-gpm-theme="dark"] h6,
html[data-gpm-theme="dark"] p,
html[data-gpm-theme="dark"] li,
html[data-gpm-theme="dark"] label,
html[data-gpm-theme="dark"] cite,
html[data-gpm-theme="dark"] small,
html[data-gpm-theme="dark"] a,
html[data-gpm-theme="dark"] span,
html[data-gpm-theme="dark"] strong,
html[data-gpm-theme="dark"] .section-kicker,
html[data-gpm-theme="dark"] .landing-kicker,
html[data-gpm-theme="dark"] .library-author-filter-kicker,
html[data-gpm-theme="dark"] .library-author-filter-toggle,
html[data-gpm-theme="dark"] .single-tags-label,
html[data-gpm-theme="dark"] .single-post-nav-label,
html[data-gpm-theme="dark"] .see-also-title,
html[data-gpm-theme="dark"] .toc-list a,
html[data-gpm-theme="dark"] .library-title-search label,
html[data-gpm-theme="dark"] .library-title-suggestion,
html[data-gpm-theme="dark"] .library-title-suggestion:hover,
html[data-gpm-theme="dark"] .library-title-suggestion:focus-visible,
html[data-gpm-theme="dark"] .testimonial-card cite,
html[data-gpm-theme="dark"] .menu-item a,
html[data-gpm-theme="dark"] .menu-item a:hover,
html[data-gpm-theme="dark"] .site-theme-option,
html[data-gpm-theme="dark"] .site-account-link,
html[data-gpm-theme="dark"] .site-theme-option:hover,
html[data-gpm-theme="dark"] .site-theme-option:focus-visible,
html[data-gpm-theme="dark"] .site-account-link:hover,
html[data-gpm-theme="dark"] .site-account-link:focus-visible {
	color: var(--color-text-on-dark);
}

/* 4. Botoes e Elementos de Interacao Globais */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.75rem;
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 0.95rem;
	border-radius: var(--radius-md);
	border: 2px solid transparent;
	cursor: pointer;
	transition: var(--transition-smooth);
}

.btn-primary {
	background-color: var(--color-accent);
	color: var(--color-text-on-dark);
}

.btn-primary:hover {
	background-color: var(--color-accent-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	color: var(--color-text-on-dark);
}

.btn-secondary {
	background-color: var(--color-primary);
	color: var(--color-text-on-dark);
}

.btn-secondary:hover {
	background-color: var(--color-primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	color: var(--color-text-on-dark);
}

html[data-gpm-theme="dark"] .btn-secondary {
	background-color: #1f2b3a;
	border-color: rgba(253, 186, 73, 0.24);
	color: #ffffff;
}

html[data-gpm-theme="dark"] .btn-secondary:hover {
	background-color: #2a3645;
	color: #ffffff;
}

html[data-gpm-theme="dark"] input,
html[data-gpm-theme="dark"] select,
html[data-gpm-theme="dark"] textarea {
	background-color: #030f1d;
	border-color: rgba(6, 37, 71, 0.42);
	color: #dce7f2;
}

html[data-gpm-theme="dark"] input::placeholder,
html[data-gpm-theme="dark"] textarea::placeholder {
	color: #8e99aa;
}

/* Acessibilidade (Focus Ring) */
.btn:focus-visible, a:focus-visible {
	outline: 3px solid var(--color-secondary);
	outline-offset: 2px;
}

/* Imagens responsivas */
img {
	max-width: 100%;
	height: auto;
	display: block;
	object-position: top center;
}

.inserted-post-card {
	margin: 2rem 0;
}

.inserted-post-card__link {
	display: grid;
	grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr);
	gap: 1rem;
	align-items: stretch;
	padding: 1rem;
	background: var(--color-bg-light);
	border: 1px solid rgba(6, 37, 71, 0.14);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	color: var(--color-text-primary);
	overflow: hidden;
	transition: var(--transition-smooth);
}

.inserted-post-card__link:hover,
.inserted-post-card__link:focus-visible {
	color: var(--color-primary);
	box-shadow: var(--shadow-md);
	transform: translateY(-2px);
}

.inserted-post-card__thumb {
	display: block;
	min-height: 8rem;
	background: var(--color-bg-surface);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.inserted-post-card__thumb img {
	width: 100%;
	height: 100%;
	min-height: 8rem;
	object-fit: cover;
	transition: var(--transition-smooth);
}

.inserted-post-card__link:hover .inserted-post-card__thumb img,
.inserted-post-card__link:focus-visible .inserted-post-card__thumb img {
	transform: scale(1.04);
}

.inserted-post-card__placeholder {
	display: grid;
	min-height: 8rem;
	place-items: center;
	color: var(--color-text-muted);
	font-size: 0.8rem;
	font-weight: 600;
}

.inserted-post-card__content {
	display: flex;
	min-width: 0;
	flex-direction: column;
	justify-content: center;
	gap: 0.35rem;
}

.inserted-post-card__label {
	color: var(--color-accent);
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
}

.inserted-post-card__title {
	color: var(--color-primary);
	font-size: clamp(1.05rem, 2vw, 1.3rem);
	font-weight: 700;
	line-height: 1.25;
}

html[data-gpm-theme="dark"] .inserted-post-card__link {
	background: #14202f;
	border-color: rgba(253, 186, 73, 0.2);
}

html[data-gpm-theme="dark"] .inserted-post-card__thumb {
	background: #030f1d;
}

@media (max-width: 640px) {
	.inserted-post-card__link {
		grid-template-columns: 1fr;
	}
}

/* Efeito padrao para sections com imagem de fundo estrutural */
.parallax-bg {
	will-change: transform;
	transform: translate3d(0, var(--parallax-offset, 0px), 0);
}

@media (prefers-reduced-motion: reduce) {
	.parallax-bg {
		transform: none;
	}
}

/* =========================================================
   Galeria de imagens — thumbnails em grid + lightbox
   Suporta: [gallery] shortcode e bloco Gutenberg wp-block-gallery
   ========================================================= */

/* --- Grid de thumbnails --- */
.gallery,
.wp-block-gallery {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 0.5rem;
	margin: 1.5rem 0 !important;
}

/* Colunas explícitas do shortcode [gallery columns=N] */
.gallery-columns-1 { grid-template-columns: 1fr; }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.gallery-columns-7 { grid-template-columns: repeat(7, 1fr); }
.gallery-columns-8 { grid-template-columns: repeat(8, 1fr); }
.gallery-columns-9 { grid-template-columns: repeat(9, 1fr); }

/* Item do shortcode clássico */
.gallery-item {
	display: block;
	margin: 0 !important;
	overflow: hidden;
	border-radius: var(--radius-sm);
	aspect-ratio: 1 / 1;
}

.gallery-item a,
.gallery-item .gallery-icon {
	display: block;
	width: 100%;
	height: 100%;
}

/* Item do bloco Gutenberg */
.wp-block-gallery figure.wp-block-image {
	margin: 0 !important;
	overflow: hidden;
	border-radius: var(--radius-sm);
	aspect-ratio: 1 / 1;
}

/* Thumbnail comum — preenche o container e faz crop centralizado */
.gallery-item img,
.wp-block-gallery img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
	display: block;
	cursor: zoom-in;
	transition: transform 280ms ease, filter 280ms ease;
	border-radius: var(--radius-sm);
}

.gallery-item:hover img,
.wp-block-gallery figure.wp-block-image:hover img {
	transform: scale(1.06);
	filter: brightness(1.08);
}

/* Oculta legenda da galeria shortcode (visível no lightbox) */
.gallery-caption { display: none; }

/* Responsivo mobile */
@media (max-width: 600px) {
	.gallery-columns-4,
	.gallery-columns-5,
	.gallery-columns-6,
	.gallery-columns-7,
	.gallery-columns-8,
	.gallery-columns-9 {
		grid-template-columns: repeat(3, 1fr);
	}
	.gallery-columns-3 {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* --- Lightbox overlay --- */
.gnosis-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(3, 10, 20, 0.93);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 220ms ease;
}

.gnosis-lightbox.is-open {
	opacity: 1;
	pointer-events: all;
}

/* Imagem principal */
.gnosis-lightbox__img {
	max-width: 94vw;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: var(--radius-md);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
	transform: scale(0.94);
	transition: transform 220ms ease;
	display: block;
}

.gnosis-lightbox.is-open .gnosis-lightbox__img {
	transform: scale(1);
}

/* Legenda */
.gnosis-lightbox__caption {
	position: absolute;
	bottom: 1.25rem;
	left: 50%;
	transform: translateX(-50%);
	max-width: 80vw;
	padding: 0.4rem 1rem;
	background: rgba(3, 10, 20, 0.7);
	color: #e8edf3;
	font-size: 0.85rem;
	text-align: center;
	border-radius: var(--radius-full);
	pointer-events: none;
}

/* Botão fechar */
.gnosis-lightbox__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.12);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: background 180ms ease, transform 180ms ease;
}

.gnosis-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.24);
	transform: rotate(90deg);
}

/* Botões de navegação anterior / próximo */
.gnosis-lightbox__prev,
.gnosis-lightbox__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.12);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 1.5rem;
	cursor: pointer;
	transition: background 180ms ease;
	user-select: none;
}

.gnosis-lightbox__prev { left: 1rem; }
.gnosis-lightbox__next { right: 1rem; }

.gnosis-lightbox__prev:hover,
.gnosis-lightbox__next:hover {
	background: rgba(255, 255, 255, 0.26);
}

.gnosis-lightbox__prev[hidden],
.gnosis-lightbox__next[hidden] {
	display: none;
}

/* Contador (ex: 2 / 5) */
.gnosis-lightbox__counter {
	position: absolute;
	top: 1rem;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	pointer-events: none;
}

/* Modo escuro — sem ajuste necessário, já é escuro por natureza */

/* Menu lateral retratil para templates com sidebar em dispositivos moveis */
.mobile-sidebar-toggle {
	display: none;
}

@media (max-width: 920px) {
	.mobile-sidebar-toggle {
		position: fixed;
		top: 112px;
		right: 0.75rem;
		z-index: 1002;
		display: inline-flex;
		align-items: center;
		gap: 0.45rem;
		min-height: 42px;
		padding: 0.55rem 0.75rem;
		border: 1px solid rgba(244, 185, 66, 0.42);
		border-radius: var(--radius-full);
		background: var(--color-primary);
		color: var(--color-text-on-dark);
		box-shadow: var(--shadow-md);
		cursor: pointer;
		transition: transform 220ms ease, background-color 220ms ease, right 220ms ease;
	}

	.mobile-sidebar-toggle span,
	.mobile-sidebar-toggle span::before,
	.mobile-sidebar-toggle span::after {
		display: block;
		width: 16px;
		height: 2px;
		border-radius: var(--radius-full);
		background: currentColor;
		transition: transform 220ms ease, opacity 220ms ease;
	}

	.mobile-sidebar-toggle span {
		position: relative;
	}

	.mobile-sidebar-toggle span::before,
	.mobile-sidebar-toggle span::after {
		content: "";
		position: absolute;
		left: 0;
	}

	.mobile-sidebar-toggle span::before {
		top: -5px;
	}

	.mobile-sidebar-toggle span::after {
		top: 5px;
	}

	.mobile-sidebar-toggle strong {
		font-size: 0.75rem;
		font-weight: 800;
		letter-spacing: 0.04em;
		text-transform: uppercase;
	}

	.mobile-sidebar-toggle.is-open {
		right: min(320px, 76vw);
		background: var(--color-accent);
	}

	.mobile-sidebar-toggle.is-open span {
		background: transparent;
	}

	.mobile-sidebar-toggle.is-open span::before {
		top: 0;
		transform: rotate(45deg);
	}

	.mobile-sidebar-toggle.is-open span::after {
		top: 0;
		transform: rotate(-45deg);
	}

	.mobile-sidebar-panel {
		position: fixed !important;
		top: 88px !important;
		right: 0 !important;
		bottom: 1rem !important;
		z-index: 1001 !important;
		width: min(320px, 76vw) !important;
		max-height: none !important;
		padding: 0.75rem !important;
		overflow-y: auto !important;
		border-left: 1px solid rgba(13, 35, 58, 0.12);
		border-radius: var(--radius-md) 0 0 var(--radius-md);
		background: var(--color-bg-light);
		box-shadow: -18px 0 48px rgba(7, 21, 36, 0.18);
		transform: translateX(calc(100% + 1.25rem));
		transition: transform 260ms ease;
		order: initial !important;
	}

	html[data-gpm-theme="dark"] .mobile-sidebar-panel {
		border-left-color: rgba(253, 186, 73, 0.18);
		background: #101c2b;
		box-shadow: -18px 0 48px rgba(0, 0, 0, 0.34);
	}

	.mobile-sidebar-panel.is-open {
		transform: translateX(0);
	}
}
