/* ==========================================================================
   Resource Hub Filter — Frontend Styles
   ========================================================================== */

/* Wrapper */
.rhf-filter-wrapper {
	width: 100%;
	margin: 0 auto;
	padding: 24px 0;
}

/* ==========================================================================
   Search Row
   ========================================================================== */

.rhf-search-row {
	display: flex;
	justify-content: center;
	margin-bottom: 20px;
}

.rhf-search-input {
	width: 100%;
	max-width: 520px;
	padding: 10px 18px;
	border: 2px solid #092669;
	border-radius: 100px;
	font-size: 15px;
	font-weight: bolder;
	font-family: 'Barlow', sans-serif;
	color: #000000;
	background: #ffffff;
	outline: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	/* Remove the browser-default search cancel button styling inconsistencies */
	-webkit-appearance: none;
	appearance: none;
}

.rhf-search-input:focus {
	border-color: #092669;
	box-shadow: 0 0 0 3px rgba( 9, 38, 105, 0.12 );
}

.rhf-search-input::placeholder {
	color: #aaaaaa;
}

/* ==========================================================================
   Filter Rows
   ========================================================================== */

.rhf-filter-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 12px;
}

.rhf-filter-row--tags {
	gap: 6px;
	margin-bottom: 32px;
}

/* ==========================================================================
   Filter Buttons
   ========================================================================== */

.rhf-btn {
	display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 22px;
    border: 2px solid #09266a;
    border-radius: 100px;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.rhf-btn:hover,
.rhf-btn:focus-visible {
	border-color: #092669;
	background: #092669;
	color: #ffffff;
	outline: none;
}

/* Row 1 — post type buttons active state */
.rhf-btn--type.is-active {
	background: #092669;
	border-color: #092669;
	color: #ffffff;
}

/* Row 2 — tag buttons active state */
.rhf-btn--tag {
	padding: 6px 16px;
	font-size: 13px;
}

.rhf-btn--tag.is-active {
	background: #3E5C76;
	border-color: #3E5C76;
	color: #ffffff;
}

/* Apply Filters */
.rhf-apply-row {
	display: flex;
	justify-content: center;
	margin: 8px 0 32px;
}

.rhf-btn--apply {
	padding: 11px 40px;
	border-radius: 6px;
	font-size: 15px;
	letter-spacing: 0.3px;
}

/* Load More */
.rhf-load-more-wrapper {
	text-align: center;
	margin-top: 40px;
}

.rhf-btn--load-more {
	padding: 12px 40px;
	border-radius: 6px;
	font-size: 15px;
}

.rhf-btn--load-more:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ==========================================================================
   Divider
   ========================================================================== */

.rhf-divider {
	width: 60px;
	border: none;
	border-top: 2px solid #d0d0d0;
	margin: 20px auto 30px !important;
}

/* ==========================================================================
   Posts Grid
   ========================================================================== */

.rhf-posts-grid {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 28px;
}

@media ( max-width: 1200px ) {
	.rhf-posts-grid {
		grid-template-columns: repeat( 3, 1fr );
	}
}

@media ( max-width: 960px ) {
	.rhf-posts-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 600px ) {
	.rhf-posts-grid {
		grid-template-columns: 1fr;
	}

	.rhf-filter-row--tags {
		display: grid;
		grid-auto-flow: column;
		grid-template-rows: repeat( 2, auto );
		justify-content: start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 4px;
		-webkit-mask-image: linear-gradient( to right, black calc( 100% - 56px ), transparent 100% );
		mask-image: linear-gradient( to right, black calc( 100% - 56px ), transparent 100% );
	}

	.rhf-filter-row--tags.is-scroll-start-end {
		-webkit-mask-image: none;
		mask-image: none;
	}

	.rhf-filter-row--tags.is-scroll-middle {
		-webkit-mask-image: linear-gradient( to right, transparent 0%, black 56px, black calc( 100% - 56px ), transparent 100% );
		mask-image: linear-gradient( to right, transparent 0%, black 56px, black calc( 100% - 56px ), transparent 100% );
	}

	.rhf-filter-row--tags.is-scroll-end {
		-webkit-mask-image: linear-gradient( to right, transparent 0%, black 56px );
		mask-image: linear-gradient( to right, transparent 0%, black 56px );
	}

	.rhf-filter-row--tags::-webkit-scrollbar {
		display: none;
	}
}

/* ==========================================================================
   Post Card
   ========================================================================== */

.rhf-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #e6e6e6;
	border-radius: 10px;
	overflow: hidden;
	background: #ffffff;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rhf-card:hover {
	box-shadow: 0 6px 24px rgba( 0, 0, 0, 0.10 );
	transform: translateY( -2px );
}

/* Pill */
.rhf-card__pill {
	display: inline-block;
	align-self: flex-start;
	margin: 16px 16px 0;
	padding: 4px 14px;
	border-radius: 100px;
	background: #eef5fb;
	color: #0073aa;
	font-size: 24px;
	font-family: 'Barlow', sans-serif;
	font-weight: 700;
	letter-spacing: 0.6px;
	text-transform: uppercase;
}

/* Thumbnail */
.rhf-card__thumbnail {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	margin-top: 12px;
	background: #f0f2f4;
}

.rhf-card__thumbnail--empty {
	/* placeholder visible when there's no featured image */
	background: linear-gradient( 135deg, #f0f2f4 25%, #e4e7ea 100% );
}

.rhf-card__thumbnail a {
	display: block;
	position: absolute;
	inset: 0;
}

.rhf-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.3s ease;
}

.rhf-card:hover .rhf-card__image {
	transform: scale( 1.03 );
}

/* Body */
.rhf-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 18px 20px 20px;
}

.rhf-card__title {
	font-size: 30px;
	font-family: 'Barlow', sans-serif;
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 10px;
}

.rhf-card__title a {
	color: #1a1a1a;
	text-decoration: none;
	font-weight: bold;
    text-shadow: 0px 0px 2px #00000021;
	letter-spacing: -1px;
}

.rhf-card__title a:hover {
	color: #CC0F05;
    text-shadow: 0px 0px 0px rgba(96, 100, 105, 1);
}

.rhf-card__excerpt {
	flex: 1;
	font-size: 24px;
	font-family: 'Barlow', sans-serif;
	color: #000000;
	line-height: 1.65;
	margin: 0 0 18px;
	font-weight: normal;

	/* Clamp excerpt to 3 lines */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rhf-card__button {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	padding: 10px 22px;
	border-radius: 6px;
	background: #092669;
	color: #ffffff;
	font-size: 20px;
	font-family: 'Barlow', sans-serif;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.18s ease;
	border: 2px solid #0942c5;
	box-shadow: 0px 0px 15px #0926696b !important;
}

.rhf-card__button:hover,
.rhf-card__button:focus-visible {
	background: #072059;
    border: 2px solid #0566ff;
	color: #ffffff;
	outline: none;
}

/* ==========================================================================
   States
   ========================================================================== */

.rhf-loading {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 60px 20px;
	color: #888888;
	font-size: 15px;
}

.rhf-loading__spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid #d0d0d0;
	border-top-color: #092669;
	border-radius: 50%;
	animation: rhf-spin 0.7s linear infinite;
}

@keyframes rhf-spin {
	to { transform: rotate( 360deg ); }
}

.rhf-no-results {
	grid-column: 1 / -1;
	padding: 60px 20px;
	text-align: center;
	color: #888888;
	font-size: 15px;
}

.rhf-error {
	grid-column: 1 / -1;
	padding: 40px 20px;
	text-align: center;
	color: #cc0000;
	font-size: 15px;
}

.rhf-no-results p {
	margin: 0 0 16px;
}

.rhf-btn--reset {
	cursor: pointer;
}
