/*
 * Article Cards - styled with Kadence global variables so it follows your
 * theme palette, fonts and dark mode. Fallbacks apply on non-Kadence themes.
 *
 * Card layout (no outer padding, the image is flush with the card edge):
 *   [ title ............................ 100% ]
 *   [ image 25% ][ date + excerpt ....... 75% ]
 *   [ ............................ read more ]   right aligned
 *
 * Everything is in normal document flow: text can never be covered or hidden by the image.
 */
.artc {
	display: flex;
	flex-direction: column;
	gap: var(--global-md-spacing, 2rem);
	width: 100%;
}

/* Card: border, radius and shadow come from the block's "Card style" settings */
.artc .artc-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 0;
	overflow: hidden;                 /* clips the image to the rounded corners */
	container-type: inline-size;      /* lets the image box size itself from the card width (cqw) */
	background: var(--global-palette9, #fff);
	border: var(--artc-border-width, 1px) solid var(--artc-border-color, var(--global-gray-400, #cbd5e0));
	border-radius: var(--artc-radius, 4px);
	box-shadow: var(--artc-shadow, 0 15px 15px -10px rgba(0, 0, 0, .05));
}

/* Row 1: title, full width. Wraps, breaks long words, cut with "..." after N lines */
.artc .artc-title {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: var(--artc-pad, 16px) var(--artc-pad, 16px) calc(var(--artc-pad, 16px) * .75);
	font-size: 1.4rem;
	line-height: 1.3;
}
.artc-title a {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--artc-title-lines, 2);
	line-clamp: var(--artc-title-lines, 2);
	overflow: hidden;
	overflow-wrap: anywhere;
	color: var(--global-palette3, #1a202c);
	text-decoration: none;
}
.artc-title a:hover { color: var(--global-palette-highlight, var(--global-palette1, #2b6cb0)); }
.artc-full-title .artc-title a { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }

/* Row 2: image 25% | text 75%. Row height = tallest of (text, image min-height). */
.artc-row {
	display: grid;
	grid-template-columns: 25% minmax(0, 1fr);
	gap: 0;
	align-items: stretch;
}
.artc-row--text-only { grid-template-columns: minmax(0, 1fr); }   /* no image: text uses full width */

/* Image: flush, no margin/padding, cropped to fill a square-ish box (grows if the text is taller) */
.artc .artc-media {
	position: relative;
	display: block;
	margin: 0;
	padding: 0;
	overflow: hidden;
	min-height: 8rem;                 /* fallback for browsers without container units */
}
@supports (width: 1cqw) {
	.artc .artc-media { min-height: var(--artc-media-min, 25cqw); }
}
.artc .artc-media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0;
	border-radius: 0;
	object-fit: cover;                /* crop to fit */
	object-position: center;
}

/* Text: normal flow, always visible */
.artc-text {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	min-width: 0;
	padding: var(--artc-pad, 16px);
}
.artc-date { font-size: 80%; color: var(--global-palette6, #718096); }
.artc-excerpt {
	margin: 0;
	line-height: 1.6;
	color: var(--global-palette4, #2d3748);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--artc-excerpt-lines, 6);
	line-clamp: var(--artc-excerpt-lines, 6);
	overflow: hidden;
}

/* Small phones: image on top (16:9), text below */
@media (max-width: 480px) {
	.artc-row { grid-template-columns: minmax(0, 1fr); }
	.artc .artc-media { min-height: 0; aspect-ratio: 16 / 9; align-self: start; }
}

/* Row 3: read more, full width, aligned right */
.artc-foot {
	box-sizing: border-box;
	display: flex;
	justify-content: flex-end;
	width: 100%;
	padding: 0 var(--artc-pad, 16px) var(--artc-pad, 16px);
}

.artc .artc-btn { display: inline-flex; align-items: center; gap: .4em; text-decoration: none; cursor: pointer; }
.artc .artc-btn--button {
	padding: .4em 1em;
	border-radius: 3px;
	background: var(--global-palette-btn-bg, var(--global-palette1, #2b6cb0));
	color: var(--global-palette-btn, #fff);
	transition: background .2s, color .2s;
}
.artc .artc-btn--button:hover, .artc .artc-btn--button:focus {
	background: var(--global-palette-btn-bg-hover, var(--global-palette2, #215387));
	color: var(--global-palette-btn-hover, #fff);
}
.artc .artc-btn--link { padding: 0; font-weight: 600; color: var(--global-palette-highlight, var(--global-palette1, #2b6cb0)); }
.artc .artc-btn--link:hover, .artc .artc-btn--link:focus { color: var(--global-palette-highlight-alt, var(--global-palette2, #215387)); }
.artc-arrow { display: inline-flex; transition: transform .2s; }
.artc-btn--link:hover .artc-arrow { transform: translateX(3px); }

.artc-empty { text-align: center; color: var(--global-palette6, #718096); }
