/**
 * Drive de Fotos – Estilos Públicos (Frontend)
 * Fiel ao modelo CEA: #008CD2 / #006BA6 / #8CD4F5
 * Escopo: .rf-section → evita conflito com tema do cliente
 */

/* ─── Variáveis ─────────────────────────────────────────────────────────────── */
.rf-section {
	--rf-primary:    #008CD2;
	--rf-primary-dk: #006BA6;
	--rf-primary-lt: #8CD4F5;
	--rf-text:       #333333;
	--rf-text-muted: #666666;
	--rf-bg:         #F5F7FA;
	--rf-white:      #FFFFFF;
	--rf-radius:     8px;
	--rf-radius-pill:50px;
	--rf-shadow-sm:  0 4px 6px rgba(0,0,0,0.05);
	--rf-shadow-md:  0 10px 20px rgba(0,0,0,0.10);
	--rf-transition: all 0.3s ease;
}

/* Reset de links do tema */
.rf-section a {
	text-decoration: none !important;
	box-shadow: none !important;
}

.rf-section a:hover {
	text-decoration: none !important;
	box-shadow: none !important;
	color: inherit;
}

/* Esconde tags <p> e <br> fantasmas injetadas pelo WordPress/Elementor/Plugins */
.rf-section p:empty,
.rf-section > p:empty {
	display: none !important;
}

.rf-card p:not([class^="rf-"]),
.rf-card br {
	display: none !important;
}

/* ─── Seção Wrapper ──────────────────────────────────────────────────────────── */
.rf-section {
	background-color: var(--rf-bg);
	padding: 50px 0;
	width: 100%;
}

.rf-container {
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

/* ─── Cabeçalho ──────────────────────────────────────────────────────────────── */
.rf-header {
	text-align: center;
	margin-bottom: 40px;
}

.rf-header__title {
	color: var(--rf-primary);
	font-size: 2.2rem;
	font-weight: 700;
	margin: 0 0 10px 0;
	line-height: 1.2;
}

.rf-header__subtitle {
	color: var(--rf-text-muted);
	font-size: 1.05rem;
	margin: 0;
	line-height: 1.5;
}

/* ─── Barra de Filtros ───────────────────────────────────────────────────────── */
.rf-filter-bar {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 40px;
}

.rf-filter-btn {
	background-color: var(--rf-white);
	color: var(--rf-primary);
	border: 2px solid var(--rf-primary);
	padding: 8px 22px;
	border-radius: var(--rf-radius-pill);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--rf-transition);
	font-family: inherit;
	line-height: 1.4;
}

.rf-section .rf-filter-btn:hover,
.rf-section .rf-filter-btn--active {
	background-color: var(--rf-primary) !important;
	color: var(--rf-white) !important;
	border-color: var(--rf-primary) !important;
}

.rf-filter-btn:focus-visible {
	outline: 3px solid var(--rf-primary-lt);
	outline-offset: 2px;
}

/* ─── Grid de Cards ──────────────────────────────────────────────────────────── */
.rf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 28px;
}

/* ─── Card ───────────────────────────────────────────────────────────────────── */
.rf-card {
	background-color: var(--rf-white);
	border-radius: var(--rf-radius);
	overflow: hidden;
	box-shadow: var(--rf-shadow-sm);
	transition: var(--rf-transition);
	display: flex;
	flex-direction: column;
}

.rf-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--rf-shadow-md);
}

/* Card oculto pelo filtro JS */
.rf-card--hidden {
	display: none;
}

/* ─── Link da Imagem de Capa ─────────────────────────────────────────────────── */
.rf-card__image-link {
	display: block;
	text-decoration: none;
	overflow: hidden;
	flex-shrink: 0;
}
.rf-card__image-link:hover .rf-card__image {
	filter: brightness(1.08);
}

/* ─── Imagem de Capa ─────────────────────────────────────────────────────────── */
.rf-card__image {
	width: 100%;
	height: 185px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
	flex-shrink: 0;
}

/* Overlay sutil sobre imagens reais para garantir legibilidade do badge */
.rf-card__image[style*="background-image"]::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, transparent 50%);
}

.rf-card__image svg {
	flex-shrink: 0;
}

/* ─── Badge de Categoria ─────────────────────────────────────────────────────── */
.rf-card__badge {
	position: absolute;
	top: 14px;
	right: 14px;
	background-color: var(--rf-primary);
	color: var(--rf-white);
	font-size: 0.72rem;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: var(--rf-radius-pill);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	z-index: 1;
	line-height: 1.4;
}

/* ─── Conteúdo do Card ───────────────────────────────────────────────────────── */
.rf-card__content {
	padding: 22px 24px 24px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.rf-card__date {
	display: flex;
	align-items: center;
	gap: 5px;
	color: var(--rf-text-muted);
	font-size: 0.82rem;
	margin-bottom: 8px;
}

.rf-card__date svg {
	flex-shrink: 0;
	color: var(--rf-text-muted);
}

.rf-card__title {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--rf-text);
	line-height: 1.35;
	margin: 0 0 18px 0;
	flex-grow: 1;
}

.rf-card__title a {
	color: var(--rf-text) !important;
	transition: var(--rf-transition);
}

.rf-card__title a:hover {
	color: var(--rf-primary) !important;
}

/* ─── CTA Button ─────────────────────────────────────────────────────────────── */
.rf-card__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	background-color: var(--rf-primary);
	color: var(--rf-white) !important;
	text-decoration: none !important;
	padding: 12px 20px;
	border-radius: var(--rf-radius);
	font-weight: 700;
	font-size: 0.92rem;
	transition: var(--rf-transition);
	margin-top: auto;
	line-height: 1.3;
	border: none;
}

.rf-card__cta:hover {
	background-color: var(--rf-primary-dk);
	color: var(--rf-white) !important;
	text-decoration: none !important;
}

.rf-card__cta:focus-visible {
	outline: 3px solid var(--rf-primary-lt);
	outline-offset: 2px;
}

.rf-card__cta svg {
	flex-shrink: 0;
}

/* ─── Empty State ────────────────────────────────────────────────────────────── */
.rf-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--rf-text-muted);
}

.rf-empty svg {
	opacity: 0.25;
	margin-bottom: 16px;
}

.rf-empty p {
	font-size: 1.05rem;
	margin: 0;
}

/* ─── Animação de entrada dos cards ─────────────────────────────────────────── */
@keyframes rfFadeIn {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

.rf-card {
	animation: rfFadeIn 0.35s ease both;
}

/* Delay escalonado para efeito cascata (máx. 6 cards) */
.rf-grid .rf-card:nth-child(1) { animation-delay: 0.00s; }
.rf-grid .rf-card:nth-child(2) { animation-delay: 0.05s; }
.rf-grid .rf-card:nth-child(3) { animation-delay: 0.10s; }
.rf-grid .rf-card:nth-child(4) { animation-delay: 0.15s; }
.rf-grid .rf-card:nth-child(5) { animation-delay: 0.20s; }
.rf-grid .rf-card:nth-child(6) { animation-delay: 0.25s; }

/* Respeita preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
	.rf-card {
		animation: none;
	}
	.rf-card:hover {
		transform: none;
	}
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
	.rf-section {
		padding: 36px 0;
	}

	.rf-header__title {
		font-size: 1.75rem;
	}

	.rf-header__subtitle {
		font-size: 0.95rem;
	}

	.rf-filter-bar {
		gap: 8px;
	}

	.rf-filter-btn {
		padding: 7px 16px;
		font-size: 0.875rem;
	}

	.rf-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

@media (min-width: 769px) and (max-width: 1023px) {
	.rf-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
