/* =========================================================================
   AA Posts Widget Frontend Styles
   ========================================================================= */

.aa-posts-grid {
	display: grid;
	gap: 24px;
	/* Default 3-col; Elementor's responsive control overrides via inline selector */
	grid-template-columns: repeat(3, 1fr);
}

.aa-post-item {
	border-radius: 8px;
	overflow: hidden;
	position: relative;
	display: flex;
	flex-direction: column;
}

.aa-latest-posts .aa-post-item {
	box-shadow: rgba(0, 44, 85, 0.08) 0px 6px 16px;
	transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.aa-latest-posts .aa-post-item:hover {
    transform: translateY(-4px);
}

.aa-latest-posts .aa-post-title {
	font-size: 18px !important;
}

.aa-most-viewed .elementor-element-populated {
    box-shadow: rgba(0, 44, 85, 0.08) 0px 6px 16px;
}

.aa-most-viewed .aa-post-item {
	padding: 18px 0;
}

.aa-post-badge {
	display: inline-block;
	padding: 7px 16px 5px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: #fff;
	line-height: 1.6;
	white-space: nowrap;
	flex-shrink: 0;
	margin-bottom: 5px;
}

.aa-post-badge--text {
	background: transparent;
	padding: 0;
}

.aa-post-item--numbered {
	flex-direction: row;
	align-items: flex-start;
	gap: 16px;
}

.aa-post-item--numbered .aa-post-link,
.aa-post-item--numbered .aa-post-body {
	flex: 1;
	min-width: 0;
}

.aa-post-number {
    font-family: "Helvetica 83 Heavy Extended" !important;
	flex-shrink: 0;
	font-size: 26px;
	line-height: 1;
	color: #C5A9CF;
	min-width: 1.2em;
}

.aa-post-number--overlay {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .35);
	color: #fff;
	border-radius: 50%;
	font-size: 14px;
	font-weight: 800;
}

.aa-post-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 5px;
	font-size: 13px;
	margin-top: auto;
}

.aa-post-author {
	font-weight: 800;
	color: #36597f;
}

.aa-post-sep {
	color: #8196ac;
	user-select: none;
	font-size: 8px;
	padding: 0 4px;
}

.aa-post-date {
	color: #8196ac;
	font-size: 13px;
}

.aa-post-link {
	display: flex;
	flex-direction: inherit;
	flex: 1;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.aa-posts-style-card .aa-post-image-wrap {
	display: block;
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	text-decoration: none;
	flex-shrink: 0;
}

.aa-posts-style-card .aa-post-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Badge sits in the top-left corner of the image */
.aa-posts-style-card .aa-post-image-wrap .aa-post-badge {
	position: absolute;
	top: 14px;
	left: 14px;
}

/* Badge when there is no image */

.aa-posts-style-card .aa-post-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 15px;
	padding: 22px 22px 24px;
}

.aa-most-viewed .aa-posts-style-card .aa-post-body {
	gap: 0;
	padding: 0;
}

.aa-posts-style-card .aa-post-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
	color: #002C55;
}

.aa-post-link:hover .aa-post-title {
	color: #9F6EAF;
}

.aa-posts-style-card .aa-post-excerpt {
	font-size: 14px;
	line-height: 1.65;
	color: #36597f;
	margin: 0;
	flex: 1;
}

/* =========================================================================
   OVERLAY CARD   (.aa-posts-style-overlay)
   ========================================================================= */

.aa-posts-style-overlay .aa-post-item {
	aspect-ratio: 4 / 3;
	background-color: #1a2e44;
	background-size: cover;
	background-position: center center;
	display: flex;
	flex-direction: row;
	align-items: flex-end;
}

.aa-posts-style-overlay .aa-post-item::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 44, 85, 1) 0%,
		rgba(0, 44, 85, 0.5) 75%,
		rgba(0, 44, 85, 0.25) 100%,
		transparent 100%
	);
	z-index: 1;
	transition: opacity .25s;
}

/* Full-card clickable link layer */
.aa-post-overlay-link {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: block;
}

/* Content rests above the gradient */
.aa-post-overlay-body {
	position: relative;
	z-index: 2;
	padding: 40px;
	width: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

/* Prevent badge from stretching to full card width inside flex column */
.aa-post-overlay-body .aa-post-badge {
	align-self: flex-start;
}

.aa-post-overlay-title {
	font-size: 36px;
	font-weight: 700;
	line-height: 1.1;
	color: #fff;
	margin: 0;
}

.aa-posts-style-overlay .aa-post-excerpt {
	font-size: 16px;
	line-height: 1.3;
	color: rgba(255, 255, 255, .82);
	margin: 5px 0;
	/* Clamp to 2 lines */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Meta colours inverted for dark background */
.aa-posts-style-overlay .aa-post-meta {
	color: rgba(255, 255, 255, .8);
	font-size: 13px;
}

.aa-posts-style-overlay .aa-post-author { 
	color: #fff; 
}
.aa-posts-style-overlay .aa-post-sep    { 
	color: #28a8c9; 
}
.aa-posts-style-overlay .aa-post-date   { 
	font-size: 13px;
}

.aa-posts-empty {
	text-align: center;
	padding: 48px 20px;
	color: #94a3b8;
	font-style: italic;
}

/* =========================================================================
   LOAD MORE
   ========================================================================= */

.aa-posts-load-more-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin-top: 32px;
	text-align: center;
}

.aa-posts-load-more-btn {
	display: inline-block;
	cursor: pointer;
	border: 1px solid transparent;
	background-color: #1a2e44;
	color: #fff;
	padding: 12px 28px;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.aa-posts-load-more-btn:hover {
	background-color: #28a8c9;
}

.aa-posts-load-more-btn:disabled {
	opacity: .6;
	cursor: default;
}

.aa-posts-no-more {
	margin: 12px 0 0;
	color: #767676;
	font-size: 14px;
	font-style: italic;
}

.aa-featured-post .aa-post-item {
	box-shadow: rgba(0, 44, 85, 0.14) 0px 18px 40px;
	    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 300ms cubic-bezier(0.22, 1, 0.36, 1)
}

.aa-featured-post .aa-post-item:hover {
	transform: translateY(-4px);
    box-shadow: rgba(0, 44, 85, 0.2) 0px 28px 60px;
}

@media (max-width: 1024px) {
	.aa-posts-grid:not([style*='grid-template-columns']) {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.aa-posts-grid:not([style*='grid-template-columns']) {
		grid-template-columns: 1fr;
	}

	.aa-posts-style-overlay .aa-post-item {
		aspect-ratio: 3 / 2;
	}

	.aa-post-overlay-title {
		font-size: 18px;
	}
}