/**
 * Section: Latest Posts Style
 * Arquivo: sections/latest-posts/style.css
 *
 * Desenvolvido por: Roger Alves
 * Data da Modificacao: 2026-05-28
 * Hora da Modificacao: 18:46
 *
 * Todos os direitos reservados.
 */

/* ── Heading row: título + botões lado a lado ── */
.section-heading-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 1rem 2rem;
	margin-bottom: 2.5rem;
}

.section-heading {
	flex: 1 1 320px;
	min-width: 0;
}

.section-heading-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	align-items: center;
	flex-shrink: 0;
	padding-bottom: 0.25rem; /* alinha visualmente com a base do h2 */
}

/* Variante compacta para os botões do heading */
.btn--sm {
	padding: 0.5rem 1.125rem;
	font-size: 0.875rem;
}

.section-heading {
	max-width: 720px;
}

.section-kicker {
	margin-bottom: 0.5rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--color-accent);
}

.latest-posts-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: stretch;
}

.featured-post-card,
.latest-post-item {
	display: block;
	background: var(--color-bg-light);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.featured-post-card {
	min-height: 100%;
}

.featured-post-card img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.featured-post-content {
	padding: clamp(1.25rem, 3vw, 2rem);
}

.featured-post-content span {
	display: inline-block;
	margin-bottom: 0.75rem;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--color-secondary-dark);
}

.featured-post-content h3 {
	margin-bottom: 0.75rem;
	font-size: clamp(1.35rem, 3vw, 2rem);
}

.latest-posts-list {
	display: grid;
	gap: 1rem;
}

.latest-post-item {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 1rem;
	align-items: center;
	padding: 0.75rem;
}

.latest-post-item img {
	width: 112px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: var(--radius-sm);
}

.latest-post-item h3 {
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.35;
	color: var(--color-primary);
}

html[data-gpm-theme="dark"] .section-heading h2,
html[data-gpm-theme="dark"] .featured-post-content h3,
html[data-gpm-theme="dark"] .latest-post-item h3 {
	color: var(--color-text-on-dark);
}

.featured-post-card:hover,
.latest-post-item:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

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

@media (max-width: 520px) {
	.latest-post-item {
		grid-template-columns: 88px minmax(0, 1fr);
	}

	.latest-post-item img {
		width: 88px;
	}
}

@media (max-width: 640px) {
	.section-heading-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.section-heading-actions {
		width: 100%;
	}

	.section-heading-actions .btn--sm {
		flex: 1 1 0;
		justify-content: center;
	}
}

/* ── Modal de Búsqueda Global ── */
.lp-search-modal {
	position: fixed;
	inset: 0;
	z-index: 9900;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.lp-search-modal[hidden] {
	display: none;
}

.lp-search-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 37, 71, 0.72);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	cursor: pointer;
}

.lp-search-dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 600px;
	background: var(--color-bg-light);
	border-radius: var(--radius-lg, 1rem);
	padding: clamp(1.75rem, 5vw, 2.75rem);
	box-shadow: 0 24px 64px rgba(6, 37, 71, 0.28);
}

.lp-search-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	border: none;
	background: var(--color-bg-surface);
	color: var(--color-text-secondary);
	cursor: pointer;
	transition: var(--transition-smooth);
}

.lp-search-close:hover {
	background: var(--color-primary);
	color: #ffffff;
}

.lp-search-kicker {
	margin: 0 0 0.375rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-accent);
}

.lp-search-title {
	margin: 0 0 1.5rem;
	font-size: clamp(1.25rem, 3vw, 1.75rem);
	color: var(--color-primary);
	line-height: 1.2;
}

.lp-search-field {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.lp-search-input {
	flex: 1;
	height: 3rem;
	padding: 0 1rem;
	font-size: 1rem;
	font-family: var(--font-body);
	border: 2px solid rgba(6, 37, 71, 0.2);
	border-radius: var(--radius-md);
	background: var(--color-bg-surface);
	color: var(--color-text-primary);
	outline: none;
	transition: border-color 0.18s;
}

.lp-search-input:focus {
	border-color: var(--color-primary);
}

.lp-search-submit {
	height: 3rem;
	gap: 0.4rem;
	white-space: nowrap;
	flex-shrink: 0;
}

.lp-search-hint {
	margin: 0.875rem 0 0;
	font-size: 0.825rem;
	color: var(--color-text-muted);
}

/* Dark mode do modal */
html[data-gpm-theme="dark"] .lp-search-dialog {
	background: var(--color-bg-surface);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

html[data-gpm-theme="dark"] .lp-search-title {
	color: var(--color-text-on-dark);
}

html[data-gpm-theme="dark"] .lp-search-close {
	background: var(--color-primary-light);
	color: #ffffff;
}

html[data-gpm-theme="dark"] .lp-search-close:hover {
	background: var(--color-primary-dark);
}

html[data-gpm-theme="dark"] .lp-search-input {
	background: var(--color-bg-dark);
	border-color: rgba(255, 255, 255, 0.12);
	color: #dce7f2;
}
