/* Piezas de interfaz reutilizadas por varios bloques y plantillas. */

.ff-icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

/* Cabecera de sección: h2 entre filetes marinos + «Ver todos ↗» opcional. */
.ff-section-rule {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 2px;
	border-top: 1px solid var(--c-navy);
	border-bottom: 1px solid var(--c-navy);
}

.ff-section-rule h2 {
	margin: 0;
	font-size: var(--fs-h2);
	font-weight: 600;
}

.ff-section-rule--dark {
	border-color: rgba(255, 255, 255, .5);
}

.ff-section-rule--dark h2,
.ff-section-rule--dark .ff-link-arrow {
	color: var(--c-white);
}

/* Mosaico decorativo de cuadrados (esquina de las fotos). */
.ff-media {
	position: relative;
}

.ff-media__frame {
	overflow: hidden;
	background: var(--c-track);
}

.ff-media__frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ff-mosaic {
	--cell: clamp(36px, 4.5vw, 64px);
	position: absolute;
	display: grid;
	grid-template-columns: repeat(3, var(--cell));
	grid-template-rows: repeat(2, var(--cell));
	pointer-events: none;
}

.ff-mosaic--bl { left: 0; bottom: 0; }
.ff-mosaic--tl { left: 0; top: 0; }

.ff-mosaic span:nth-child(1) { grid-column: 1; grid-row: 1; background: var(--c-blue); }
.ff-mosaic span:nth-child(2) { grid-column: 1; grid-row: 2; background: var(--c-blue-light); }
.ff-mosaic span:nth-child(3) { grid-column: 2; grid-row: 2; background: var(--c-navy); }
.ff-mosaic span:nth-child(4) { grid-column: 3; grid-row: 2; background: var(--c-cream); }

.ff-mosaic--tl span:nth-child(1) { grid-row: 2; }
.ff-mosaic--tl span:nth-child(2) { grid-row: 1; }
.ff-mosaic--tl span:nth-child(3) { grid-row: 1; }
.ff-mosaic--tl span:nth-child(4) { grid-row: 1; }

/* Proporciones de imagen del diseño */
.ff-ratio-5-4 { aspect-ratio: 5 / 4; }
.ff-ratio-16-11 { aspect-ratio: 16 / 11; }
.ff-ratio-16-10 { aspect-ratio: 16 / 10; }
.ff-ratio-16-9 { aspect-ratio: 16 / 9; }
.ff-ratio-3-2 { aspect-ratio: 3 / 2; }
.ff-ratio-4-3 { aspect-ratio: 4 / 3; }

/* Badges */
.ff-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	background: var(--c-cream);
	color: var(--c-navy);
	font-size: var(--fs-eyebrow);
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 1.6;
}

.ff-badge--coral { background: var(--c-coral); color: var(--c-navy); }
.ff-badge--blue { background: var(--c-blue-light); color: var(--c-white); }
.ff-badge--navy { background: var(--c-navy); color: var(--c-white); }

/* Avatar con iniciales */
.ff-avatar {
	display: inline-grid;
	place-items: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--c-coral);
	color: var(--c-navy);
	font-size: .8125rem;
	font-weight: 800;
	line-height: 1;
}

.ff-avatar--xs {
	width: 20px;
	height: 20px;
	font-size: .59375rem;
}

/* Foto de perfil en lugar de las iniciales */
.ff-avatar--photo {
	object-fit: cover;
	padding: 0;
}

/* Barra de progreso */
.ff-progress {
	height: 6px;
	background: var(--c-track);
	overflow: hidden;
}

.ff-progress__bar {
	display: block;
	height: 100%;
	width: var(--pct, 0%);
	background: var(--c-blue);
}

.ff-progress--coral .ff-progress__bar {
	background: var(--c-coral);
}

.ff-section--dark .ff-progress,
.ff-progress--on-dark {
	background: rgba(255, 255, 255, .22);
}

/* Viñetas cuadradas coral */
.ff-square-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ff-square-list li {
	position: relative;
	padding-left: 20px;
}

.ff-square-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .6em;
	width: 8px;
	height: 8px;
	background: var(--c-coral);
}

/* Tiles de color (pilares, accesos, herramientas) */
.ff-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 180px;
	padding: 22px;
	background: var(--tile-bg, var(--c-blue-light));
	color: var(--tile-fg, var(--c-white));
}

.ff-tile--azul { --tile-bg: var(--c-blue); --tile-fg: var(--c-white); }
.ff-tile--azul-claro { --tile-bg: var(--c-blue-light); --tile-fg: var(--c-white); }
.ff-tile--crema { --tile-bg: var(--c-cream); --tile-fg: var(--c-navy); }
.ff-tile--marino { --tile-bg: var(--c-navy); --tile-fg: var(--c-white); }

.ff-tile h3,
.ff-tile strong {
	color: inherit;
}

/* Tarjeta de contenido (noticia, curso, vídeo) */
.ff-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: var(--c-text);
}

.ff-card__media {
	overflow: hidden;
	background: var(--c-track);
}

.ff-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}

.ff-card:hover .ff-card__media img {
	transform: scale(1.03);
}

.ff-card__title {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--c-navy);
}

.ff-card__excerpt {
	font-size: var(--fs-small);
	line-height: 1.6;
	color: var(--c-text);
}

/* Icono en círculo con borde (redes) */
.ff-round-icon {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	color: inherit;
}

.ff-round-icon .ff-icon {
	width: 16px;
	height: 16px;
}

/* Panel blanco del área privada */
.ff-panel {
	padding: clamp(18px, 2.5vw, 26px);
	background: var(--c-white);
	border: 1px solid var(--c-line);
}

/* Aviso */
.ff-notice {
	display: flex;
	gap: 12px;
	padding: 14px 18px;
	background: var(--c-cream);
	color: var(--c-navy);
}

.ff-notice--info { background: var(--c-bg-alt); border-left: 3px solid var(--c-blue); }
.ff-notice--error { background: color-mix(in srgb, var(--c-coral) 14%, var(--c-white)); border-left: 3px solid var(--c-coral); }

/* Estado vacío */
.ff-empty {
	padding: 26px;
	border: 1px dashed var(--c-line);
	color: var(--c-muted);
	text-align: center;
	font-weight: 600;
}

/* Pastillas de filtro (noticias, Vademécum, Campus, Videoteca). Activa = aria-current o aria-pressed. */
.ff-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ff-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 20px;
	border: 1.5px solid var(--c-navy);
	border-radius: var(--pill);
	background: var(--c-white);
	color: var(--c-navy);
	font: inherit;
	font-size: .84375rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background var(--t-fast), color var(--t-fast);
}

.ff-pill span {
	font-weight: 600;
	opacity: .7;
}

.ff-pill:hover,
.ff-pill[aria-current],
.ff-pill[aria-pressed="true"] {
	background: var(--c-navy);
	color: var(--c-white);
}

/* Miga de pan */
.ff-crumbs {
	font-size: var(--fs-meta);
	font-weight: 600;
	color: var(--c-muted);
}

.ff-crumbs a {
	color: var(--c-muted);
}

.ff-crumbs a:hover {
	color: var(--c-blue);
}

/* Paginación numerada (cuadrados de 44px) */
.ff-pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.ff-pager > * {
	display: grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding-inline: 6px;
	border: 1px solid var(--c-line);
	color: var(--c-navy);
	font-weight: 700;
	text-decoration: none;
}

.ff-pager a:hover {
	border-color: var(--c-navy);
}

.ff-pager [aria-current] {
	border-color: var(--c-navy);
	background: var(--c-navy);
	color: var(--c-white);
}

.ff-pager .is-disabled {
	color: var(--c-line);
}

.ff-pager .ff-pager__gap {
	border: 0;
	color: var(--c-muted);
}

.ff-pager .ff-icon {
	width: 16px;
	height: 16px;
}

/* Aviso legal discreto entre filetes, desplegable */
.ff-disclaimer {
	border-block: 1px solid var(--c-line);
	font-size: var(--fs-meta);
	color: var(--c-muted);
}

.ff-disclaimer summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 9px;
	padding-block: 9px;
	list-style: none;
	cursor: pointer;
}

.ff-disclaimer summary::-webkit-details-marker {
	display: none;
}

.ff-disclaimer summary .ff-icon {
	flex: none;
	width: 16px;
	height: 16px;
}

.ff-disclaimer b {
	color: var(--c-blue);
}

.ff-disclaimer p {
	margin: 0 0 10px;
	max-width: 90ch;
}
