/*
 * PDF Carousel / Resource Grid (CSS-only)
 * Note: this file is enqueued by functions/blocks.php
 */

 .resource-carousel-section {
	margin-inline: calc(var(--wdg-gap-block) * -1);
	padding-inline: 0;
	max-width: none;
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	row-gap: var(--wdg-gap-xsmall);
}

@media (max-width: 768px) {
	.resource-carousel-section {
		padding-inline: var(--wdg-gap-block);
	}
}

.resource-section-title {
	text-align: left;
	margin-bottom: var(--wdg-gap-xsmall);
	font-weight: 500;
	line-height: 115%;
	letter-spacing: -0.6px;
}

.resource-section-blurb {
	margin-bottom: var(--wdg-gap-xsmall);
}

/* Columns wrapper used by the block template */
.resource-grid__columns {
	margin-top: var(--wdg-gap-xsmall);
	margin-bottom: var(--wdg-gap-xsmall);
	align-items: stretch;
}

.resource-grid__columns > .wp-block-column {
	display: flex;
	flex-direction: column;
	gap: var(--wdg-gap-xsmall);
}

/* Card */
.resource-grid__card {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	height: 100%;
	border: var(--wdg-color-white-gray) 1px  solid;
	border-radius: 6px;
}

/* inner wrapper mimics wp:group padding */
.resource-grid__card-inner {
	padding-top: var(--wp--preset--spacing--xsmall, var(--wdg-gap-xsmall));
	padding-right: var(--wp--preset--spacing--xsmall, var(--wdg-gap-xsmall));
	padding-bottom: var(--wp--preset--spacing--xsmall, var(--wdg-gap-xsmall));
	padding-left: var(--wp--preset--spacing--xsmall, var(--wdg-gap-xsmall));
	display: flex;
	flex-direction: column;
	gap: var(--wdg-gap-xsmall);
	min-height: 100%;
}

.resource-grid__title {
	text-align: center;
	font-size: var(--wdg-font-size-h5);
	font-weight:800;
	letter-spacing: -0.24px;
	font-weight: 500;
	margin: 0;
	color: var(--wdg-color-primary);
}

.resource-grid__desc {
	font-size: var(--wdg-font-size-default);
	color: var(--wdg-color-text);
	margin: 0;
	line-height: 1.4;
}

/* Image preview similar to your WP example: centered, constrained */
.resource-grid__media {
	width: 100%;
	margin: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
}

.resource-grid__image {
	width: 100%;
	max-width: 100%;
	height: auto;
	border-radius: 6px;
	display: inline-blockblock;
	object-fit: cover;
	border: var(--wdg-color-white-gray) 1px  solid;
}

/* Actions pinned to bottom */
.resource-grid__actions-wrap {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

.resource-grid__actions {
	margin-top: 0;
}

.resource-grid__actions.wp-block-buttons {
	display: flex;
	flex-direction: column;
	gap: var(--wdg-gap-xsmall);
	align-items: stretch;
}

.resource-grid__actions .wp-block-button {
	margin: 0;
	width: 100%;
}

.resource-grid__actions .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
}

/* Popup styles (kept from existing behavior) */
.r-iframe-popup {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.6);
	z-index: 1000;
	justify-content: center;
	align-items: center;
}

.r-popup-content {
	background-color: #fff;
	width: 80%;
	max-width: 800px;
	height: 80%;
	border-radius: 8px;
	position: relative;
	overflow: hidden;
}

.r-popup-content iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.r-close-popup {
	position: absolute;
	top: 15px;
	right: 20px;
	font-size: 2em;
	color: #333;
	cursor: pointer;
	z-index: 1002;
	background: none;
	border: none;
	transition: color 0.3s;
}

.r-close-popup:hover {
	color: #007bff;
}

@media (max-width: 768px) {
	.r-close-popup {
		top: 10px;
		right: 10px;
		font-size: 1.5em;
	}
}
