/**
 * Estilos para página de detalle de fundación
 *
 * @package Fundaciones_AEF
 */

/* Desactivar header sticky en página de fundación */
body.foundation-detail-page-body .site-header {
	position: static !important;
}

/* Eliminar padding-top del #page en página de fundación */
body.foundation-detail-page-body #page {
	padding-top: 0 !important;
}

.foundation-detail-page {
	padding: 2rem 0;
}

.foundation-header {
	display: flex;
	align-items: flex-start;
	gap: 2rem;
	margin-bottom: 3rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid #e5e7eb;
}

/*
 * Estructura del header segun Figma:
 * - Barra azul decorativa a la izquierda
 * - Logo de la fundacion en contenedor blanco, superpuesto parcialmente sobre el azul
 * - Informacion a la derecha
 */
.foundation-logo-wrapper {
	flex-shrink: 0;
	display: flex;
	align-items: stretch;
	height: 180px;
}

.foundation-logo-blue-bar {
	width: 100px;
	height: 100%;
	background: #0070C1;
	flex-shrink: 0;
}

.foundation-logo {
	width: 150px;
	height: 150px;
	margin-left: -50px;
	margin-top: auto;
	margin-bottom: auto;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: none;
	flex-shrink: 0;
}

.foundation-logo--placeholder {
	width: 0;
	margin-left: 0;
	box-shadow: none;
	background: transparent;
}

.foundation-logo--placeholder + .foundation-logo-blue-bar,
.foundation-logo-wrapper:has(.foundation-logo--placeholder) .foundation-logo-blue-bar {
	/* Cuando no hay logo, solo mostrar barra azul pequena */
}

.foundation-logo img {
	width: 90%;
	height: 90%;
	object-fit: contain;
	background-color: #fff;
}

.foundation-title-section {
	flex: 1;
}

.foundation-title {
	font-size: 2rem;
	font-weight: 700;
	margin: 0 0 1rem 0;
	color: #1f2937;
}

.foundation-siglas {
	font-size: 1.25rem;
	font-weight: 400;
	color: #6b7280;
}

/* Lista de contacto en header */
.foundation-header-contact {
	list-style: none;
	margin: 0 0 1rem 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.header-contact-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9375rem;
	color: #374151;
}

.header-contact-item .contact-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	opacity: 0.7;
}

.header-contact-item a {
	color: #374151;
	text-decoration: none;
}

.header-contact-item a:hover {
	color: #0070C1;
	text-decoration: underline;
}

/* Badge Socia AEF */
.foundation-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0;
	background: transparent;
	font-size: 0.9375rem;
	font-weight: 500;
	color: #0070C1;
}

.foundation-badge .badge-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 21px;
	flex-shrink: 0;
}

.foundation-badge .badge-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.foundation-badge-number {
	font-weight: 700;
	color: #0070C1;
}

.foundation-badge-date {
	font-size: 0.8125rem;
	font-weight: 400;
	color: #6b7280;
}

/* Layout de dos columnas */
.foundation-content-wrapper {
	display: grid;
	grid-template-columns: 250px 1fr;
	gap: 3rem;
	align-items: start;
}

/* Sidebar de navegación */
.foundation-sidebar {
	position: sticky;
	top: 2rem;
}

.foundation-nav {
	position: relative;
}

.foundation-nav-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.foundation-nav-item {
	margin-bottom: 0.5rem;
}

.foundation-nav-link {
	display: block;
	padding: 0.5rem 0;
	color: #6b7280;
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 1.5;
	transition: color 0.2s;
	border-left: 2px solid transparent;
	padding-left: 1rem;
}

.foundation-nav-link:hover {
	color: #0070C1;
}

.foundation-nav-link.active {
	color: #0070C1;
	font-weight: 600;
	border-left-color: #0070C1;
}

/* Contenido principal */
.foundation-content {
	max-width: 100%;
}

.foundation-section {
	margin-bottom: 4rem;
	scroll-margin-top: 2rem;
}

.foundation-section:last-child {
	margin-bottom: 0;
}

.section-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 1.5rem 0;
	color: #1f2937;
}

.section-content {
	font-size: 1rem;
	color: #1f2937;
	line-height: 1.6;
}

/* Items de información con flecha */
.foundation-info-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.foundation-info-item:last-child {
	margin-bottom: 0;
}

.info-arrow {
	width: 15px;
	height: 7px;
	flex-shrink: 0;
	margin-top: 0.5rem;
}

.info-label {
	font-weight: 500;
	color: #1f2937;
}

.info-value {
	color: #1f2937;
}

.info-link {
	color: #0070C1;
	text-decoration: none;
}

.info-link:hover {
	text-decoration: underline;
}

/* Campos de formulario (para sección de contacto) */
.foundation-field {
	margin-bottom: 1.5rem;
}

.field-label {
	font-size: 0.875rem;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0 0 0.5rem 0;
}

.field-value {
	font-size: 1rem;
	color: #1f2937;
	line-height: 1.6;
}

.field-value a {
	color: #0070C1;
	text-decoration: none;
}

.field-value a:hover {
	text-decoration: underline;
}

/* Tags de áreas de actividad */
.foundation-activity-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.activity-tag {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: #e5e7eb;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	color: #374151;
}

/* Indicador de transparencia */
.transparency-indicator {
	display: inline-block;
	margin-left: 0.5rem;
	padding: 0.25rem 0.5rem;
	background: #10b981;
	color: #ffffff;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 600;
	vertical-align: middle;
}

/* Lista de noticias */
.foundation-news-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.foundation-news-item {
	margin-bottom: 1rem;
	border-bottom: 1px solid #e5e7eb;
	padding-bottom: 1rem;
}

.foundation-news-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.news-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	text-decoration: none;
	color: #1f2937;
	transition: color 0.2s;
}

.news-link:hover {
	color: #0070C1;
}

.news-title {
	flex: 1;
	font-size: 1rem;
	font-weight: 500;
}

.news-arrow {
	width: 15px;
	height: 7px;
	flex-shrink: 0;
	transition: transform 0.2s;
}

.news-link:hover .news-arrow {
	transform: translateX(4px);
}

/* Responsive */
@media (max-width: 1024px) {
	.foundation-content-wrapper {
		grid-template-columns: 200px 1fr;
		gap: 2rem;
	}
}

@media (max-width: 768px) {
	.foundation-header {
		flex-direction: column;
		gap: 1.5rem;
	}

	.foundation-logo-wrapper {
		height: 140px;
	}

	.foundation-logo-blue-bar {
		width: 60px;
	}

	.foundation-logo {
		width: 110px;
		height: 110px;
		margin-left: -30px;
	}

	.foundation-logo--placeholder {
		width: 0;
		margin-left: 0;
	}

	.foundation-title {
		font-size: 1.5rem;
	}

	.foundation-content-wrapper {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	.foundation-sidebar {
		position: static;
		order: 1;
	}

	.foundation-sidebar.is-sticky {
		position: sticky;
		top: 0;
		background: #ffffff;
		padding: 1rem 0;
		z-index: 10;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
		margin-bottom: 1rem;
	}

	.foundation-content {
		order: 2;
	}

	.foundation-nav-list {
		display: flex;
		flex-wrap: wrap;
		gap: 1rem;
	}

	.foundation-nav-item {
		margin-bottom: 0;
	}

	.foundation-nav-link {
		border-left: none;
		border-bottom: 2px solid transparent;
		padding-left: 0;
		padding-bottom: 0.5rem;
	}

	.foundation-nav-link.active {
		border-left: none;
		border-bottom-color: #0070C1;
	}

	.section-title {
		font-size: 1.25rem;
	}

	.convocatoria-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.convocatoria-actions {
		width: 100%;
		justify-content: flex-start;
	}
}

/* ===========================================
   Seccion de Convocatorias
   =========================================== */

.foundation-convocatorias-section {
	margin-top: 2rem;
}

.convocatorias-description {
	font-size: 0.9375rem;
	color: #6b7280;
	line-height: 1.6;
	margin-bottom: 1.5rem;
}

.convocatorias-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.convocatoria-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 0;
	border-bottom: 1px solid #e5e7eb;
}

.convocatoria-row:last-child {
	border-bottom: none;
}

.convocatoria-title {
	font-size: 1rem;
	font-weight: 500;
	color: #1f2937;
	margin: 0;
	flex: 1;
	padding-right: 1rem;
}

.convocatoria-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
}

.convocatoria-tag-abierta {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #0070C1;
	background-color: #dbeafe;
	border: 1px solid #0070C1;
	border-radius: 4px;
}

.convocatoria-accede {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.9375rem;
	font-weight: 500;
	color: #1f2937;
	text-decoration: none;
	transition: color 0.2s ease;
}

.convocatoria-accede:hover {
	color: #0070C1;
}

.convocatoria-accede span {
	font-size: 1.25rem;
}
