/* =========================================
   BLOCO PERSONALIZADO: ARQUIVO (PHP RENDER)
   ========================================= */

.wp-block-file.is-style-escs-download-card {
	background-color: #fff;
	border: 1px solid var(--ext-border, #e2e8f0);
	border-radius: 12px;
	padding: 1.25rem;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
	margin: 2rem 0;
	display: flex;
	align-items: center;
	gap: 20px;
	transition: all 0.2s ease;
	text-decoration: none; /* Remove sublinhado global */
}

.wp-block-file.is-style-escs-download-card:hover {
	border-color: var(--ext-primary, #0073aa);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* 1. Ícone Grande Esquerda */
.escs-file-icon {
	font-size: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* 2. Informações (Centro) */
.escs-file-info {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0; /* Previne overflow de texto */
}

.escs-file-name {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--ext-text-main, #333);
	text-decoration: none;
	line-height: 1.3;
	display: block;
}

.escs-file-name:hover {
	color: var(--ext-primary, #0073aa);
	text-decoration: underline;
}

.escs-file-meta {
	font-size: 0.85rem;
	color: var(--ext-text-muted, #777);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.escs-file-meta i {
	font-size: 0.8rem;
	margin-right: 2px;
}

.escs-file-meta .sep {
	color: #ddd;
}

.escs-file-meta .ext-badge {
	background: #f0f0f0;
	color: #555;
	font-size: 0.65rem;
	padding: 2px 6px;
	border-radius: 4px;
	font-weight: bold;
}

/* 3. Ações (Botões Direita) */
.escs-file-actions {
	display: flex;
	gap: 10px;
	flex-shrink: 0;
}

.btn-escs-file {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s;
	white-space: nowrap;
}

/* Botão Visualizar (Secundário) */
.btn-view {
	background-color: #f1f5f9;
	color: #475569;
	border: 1px solid #e2e8f0;
}
.btn-view:hover {
	background-color: #e2e8f0;
	color: #333;
}

/* Botão Download (Primário) */
.btn-download {
	background-color: var(--ext-primary, #0073aa);
	color: #fff;
	border: 1px solid var(--ext-primary, #0073aa);
}
.btn-download:hover {
	background-color: var(--ext-primary-hover, #005177);
	color: #fff;
}

/* Ajuste para o Header do Card (para separar do embed) */
.escs-file-header {
	display: flex;
	align-items: center;
	gap: 20px;
	width: 100%;
}

/* O Container do Embed (Accordion) */
.escs-file-embed-container {
	display: none; /* Oculto por padrão */
	width: 100%;
	margin-top: 20px;
	border-top: 1px solid #eee;
	padding-top: 20px;
	animation: fadeIn 0.3s ease;
}

/* Classe que o JS adiciona para mostrar */
.escs-file-embed-container.is-open {
	display: block;
}

/* Estiliza tanto iframe quanto object */
.escs-file-embed-container iframe,
.escs-file-embed-container object {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #f8f9fa;
	width: 100%; /* Garante largura total */
	height: 600px; /* Altura fixa */
	display: block; /* Remove espaços inline */
}

/* Ajuste do Container Principal para aceitar wrap */
.wp-block-file.is-style-escs-download-card {
	flex-wrap: wrap; /* Permite que o iframe caia para a linha de baixo */
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Reset de botão para o visualizador parecer link/botão do tema */
button.btn-escs-file {
	cursor: pointer;
	font-family: inherit;
	border: 1px solid #e2e8f0; /* Igual ao estilo anterior */
}

/* Responsivo Mobile */
@media (max-width: 768px) {
	.wp-block-file.is-style-escs-download-card {
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
	}

	.escs-file-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.escs-file-icon {
		font-size: 2rem;
		margin-bottom: 5px;
	}

	.escs-file-actions {
		width: 100%;
		margin-top: 10px;
		flex-direction: column;
	}

	.btn-escs-file {
		width: 100%;
		justify-content: center;
	}
}
