/**
 * Resource File block — front + editor shared styles.
 *
 * @package WOREC_WP
 */

.worec-file-download {
	--wfd-primary: #560688;
	--wfd-accent: #d928aa;
	--wfd-text: #333333;
	--wfd-muted: #666666;
	--wfd-lavender: #c98eef;
	--wfd-border: #e8e4ee;
	--wfd-soft: #f6f4f8;
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 1.5rem 0; /* stack-friendly gap between multiple cards */
	padding: 1.25rem 1.35rem;
	background: #ffffff;
	border: 1px solid var(--wfd-border);
	border-radius: 4px;
	box-shadow: 6px 6px 0 var(--wfd-lavender);
}

.worec-file-download *,
.worec-file-download *::before,
.worec-file-download *::after {
	box-sizing: border-box;
}

.worec-file-download__heading {
	margin: 0 0 1rem;
	font-size: clamp(1.15rem, 2vw, 1.35rem);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.015em;
	color: var(--wfd-primary);
}

.worec-file-download__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.worec-file-download__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.85rem 1rem;
	padding: 0.85rem 1rem;
	background: var(--wfd-soft);
	border: 1px solid var(--wfd-border);
	border-radius: 4px;
}

.worec-file-download__meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
	flex: 1 1 12rem;
}

.worec-file-download__icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 4px;
	background: rgba(217, 40, 170, 0.12);
	color: var(--wfd-accent);
}

.worec-file-download__meta-text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.worec-file-download__name {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--wfd-primary);
	word-break: break-word;
}

.worec-file-download__details {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--wfd-muted);
}

.worec-file-download__type {
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wfd-primary);
}

.worec-file-download__sep {
	opacity: 0.55;
}

.worec-file-download__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0.7rem 1.25rem;
	background-color: var(--wfd-accent);
	color: #ffffff !important;
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none !important;
	border-radius: 2px;
	border: 2px solid transparent;
	line-height: 1.35;
	transition: transform 0.2s ease, filter 0.2s ease, background-color 0.2s ease;
}

.worec-file-download__button:hover,
.worec-file-download__button:focus-visible {
	filter: brightness(1.06);
	transform: translateY(-2px);
	color: #ffffff !important;
}

.worec-file-download__button:focus-visible {
	outline: 3px solid var(--wfd-primary);
	outline-offset: 3px;
}

/* Entry-content overrides (links / lists) */
.page-entry-content .worec-file-download__list,
.single-entry-content .worec-file-download__list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.page-entry-content .worec-file-download__item,
.single-entry-content .worec-file-download__item {
	padding-left: 1rem;
}

.page-entry-content .worec-file-download__item::before,
.single-entry-content .worec-file-download__item::before {
	display: none;
}

.page-entry-content .worec-file-download__button,
.single-entry-content .worec-file-download__button {
	color: #ffffff !important;
	text-decoration: none !important;
}

.page-entry-content .worec-file-download__heading,
.single-entry-content .worec-file-download__heading {
	color: var(--wfd-primary);
	margin-top: 0;
}

@media (max-width: 480px) {
	.worec-file-download {
		margin: 1.15rem 0;
		padding: 1rem;
		box-shadow: 4px 4px 0 var(--wfd-lavender);
	}

	.worec-file-download__item {
		flex-direction: column;
		align-items: stretch;
	}

	.worec-file-download__button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.worec-file-download__button {
		transition: none;
	}

	.worec-file-download__button:hover,
	.worec-file-download__button:focus-visible {
		transform: none;
	}
}
