/**
 * Community Partners – Dynamic Content Shortcodes
 * Archive card grid styles ([cp_archive_grid])
 *
 * Colors/sizing below were matched by eye to the existing Blog Module
 * card screenshot and the "Host Name" card mockup — the gold/green hex
 * values in particular are approximations. If they're off from PTU's
 * actual brand colors, they only need to change in the --cp-accent-*
 * variables below; everything else references them.
 *
 * SPECIFICITY, not just !important: Divi's Theme Builder reset
 * (`#et-boc .et-l a, div, p, img, ...`) carries !important on color,
 * background-color, border-radius, box-shadow, and (on img) height.
 * When both sides have !important, the browser falls back to plain
 * CSS specificity — and `#et-boc .et-l p` (ID + class + tag) beats
 * `.cp-archive-card__description` (one class) even with !important on
 * ours too, `!important` alone can't win that fight.
 *
 * Fix: every rule below that touches a reset property is written as
 * TWO comma-separated selectors — the plain class (so this still works
 * if the markup ever renders outside a Divi Theme Builder template)
 * and the same selector prefixed with `#et-boc .et-l` (which matches
 * the exact wrapper Divi renders Theme Builder content into, and beats
 * the reset's specificity because it adds a class on top of the same
 * ID). Keep both selectors on any rule you add here for the same
 * reason — dropping the `#et-boc .et-l` half will look fine in a
 * plain HTML preview and then silently lose to the reset on the
 * actual site.
 */

:root {
	--cp-card-radius: 12px;
	--cp-card-gap: 30px;
	--cp-card-image-height: 110px;
	--cp-accent-gold: #c9862a;
	--cp-accent-green: #4f7a4f;
	--cp-accent-grey-black: #242124;
}

/* Grid: 3 columns desktop, 2 tablet, 1 phone. Not a reset target
   (grid/display properties aren't touched by Divi's typography reset),
   so no #et-boc prefix needed here. */
.cp-archive-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--cp-card-gap);
	margin: 0 0 30px;
}

@media (max-width: 980px) {
	.cp-archive-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.cp-archive-grid {
		grid-template-columns: 1fr;
	}
}

/* Card — flex column so the CTA button can sit flush at the bottom of
   every card regardless of how long the description/fields run above it */
.cp-archive-card,
#et-boc .et-l .cp-archive-card {
	display: flex;
	flex-direction: column;
	background: #fff !important;
	border-radius: var(--cp-card-radius) !important;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
	text-decoration: none !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cp-archive-card:hover,
.cp-archive-card:focus,
#et-boc .et-l .cp-archive-card:hover,
#et-boc .et-l .cp-archive-card:focus {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14) !important;
}

/* Fixed height + object-fit:cover so every card image crops to the
   same height regardless of the source image's aspect ratio. Adjust
   --cp-card-image-height above to taste. */
.cp-archive-card__image,
#et-boc .et-l .cp-archive-card__image {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	height: var(--cp-card-image-height) !important;
	object-fit: cover !important;
	object-position: center !important;
	margin: 0;
	border-radius: 0 !important;
	flex-shrink: 0;
}

.cp-archive-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	box-sizing: border-box;
	padding: 22px 26px 26px !important;
}

.cp-archive-card__title,
#et-boc .et-l .cp-archive-card__title {
	margin: 0 0 10px;
	font-family: "Barlow Condensed", Helvetica, Arial, Lucida, sans-serif !important;
	font-size: 1.3rem !important;
	font-weight: 600 !important;
	line-height: 1.3;
	color: var(--cp-accent-grey-black) !important;
	overflow-wrap: break-word;
}

.cp-archive-card__description,
#et-boc .et-l .cp-archive-card__description {
	margin: 0 0 1rem !important;
	font-family: "Barlow", Helvetica, Arial, Lucida, sans-serif !important;
	font-size: 0.92rem !important;
	line-height: 1.55;
	color: var(--cp-accent-grey-black) !important;
	overflow-wrap: break-word;
}

/* Custom field rows (e.g. Supporting) */
.cp-archive-card__field,
#et-boc .et-l .cp-archive-card__field {
	margin: 0 0 1rem;
	font-size: 0.92rem !important;
	line-height: 1.4;
	color: #333 !important;
	overflow-wrap: break-word;
}

.cp-archive-card__field-label,
#et-boc .et-l .cp-archive-card__field-label {
	font-weight: 600 !important;
	color: var(--cp-accent-gold) !important;
}

/* Kept for any future post type that still wants a date row — unused
   by Community Media Partner cards currently, but harmless if unused. */
.cp-archive-card__date,
#et-boc .et-l .cp-archive-card__date {
	margin: 0 0 14px;
	font-size: 0.85rem !important;
	font-style: italic !important;
	color: var(--cp-accent-green) !important;
}

/* CTA button — green, centered, pinned to the bottom of the card body */
.cp-archive-card__cta,
#et-boc .et-l .cp-archive-card__cta {
	display: block;
	margin-top: auto;
	padding: 12px 20px;
	background: var(--cp-accent-green) !important;
	color: #fff !important;
	text-align: center;
	border-radius: 8px !important;
	font-size: 0.9rem !important;
	font-weight: 700 !important;
	letter-spacing: normal;
	text-transform: none;
}

.cp-archive-card__cta-arrow {
	margin-left: 4px;
}

/* Empty state */
.cp-archive-empty,
#et-boc .et-l .cp-archive-empty {
	padding: 40px 0;
	text-align: center;
	color: #666 !important;
}

/* Pagination */
.cp-archive-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 10px;
}

.cp-archive-pagination a,
.cp-archive-pagination span,
#et-boc .et-l .cp-archive-pagination a,
#et-boc .et-l .cp-archive-pagination span {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid #ddd;
	border-radius: 6px !important;
	color: #333 !important;
	text-decoration: none !important;
	font-size: 0.9rem !important;
}

.cp-archive-pagination a:hover,
#et-boc .et-l .cp-archive-pagination a:hover {
	border-color: var(--cp-accent-gold);
	color: var(--cp-accent-gold) !important;
}

.cp-archive-pagination .current,
#et-boc .et-l .cp-archive-pagination .current {
	background: var(--cp-accent-gold) !important;
	border-color: var(--cp-accent-gold);
	color: #fff !important;
}
