/*
====================================================
	Multiple flex items (Figures as Carts) that wrap within a sole column
	- used in footer, header or anywhere for 
	- Adds, Navigations, Spots, mutly-image sliders, etc
	- Obs! grid_cards can exist without grid_cards_wrapper
====================================================
*/

/*
	Use .grid_cards_wrapper only for flex items that lack a 
		defining container (are placed on the botton of .page)
		Used mainly in footer ads, outside the .content
	You hae 2 alternative options: 
		1. give it a max-width equal to the max-width of the .content
		   and set left-right margins to auto
		2. define left-right mrgins in %
*/

.grid_cards_wrapper {
	margin: 4rem auto;
	max-width: 1280px;
}

/*
	Remove left-right margins of .grid_cards_wrapper (if any, case 2 above)
	when it is (automatically, by a comon function) used in .content
*/
.content .grid_cards_wrapper {
	margin: 4rem 0;
}

/*
	H1 for advertises cards on the footer of the ,page,
	H2 for Text cards under the open text
*/

.grid_cards_wrapper h1 {
	text-align: center;
	line-height: 100%;
}

.grid_cards_wrapper h2 {
	line-height: 150%;
}

.grid_cards_wrapper .head_notes {
	text-align: center;
	padding: 0.25rem 5%;
	margin-bottom: 2rem;
	background-color: #ffffff90;
}

/*
	grid_cards can exist without grid_cards_wrapper
*/

.grid_cards {
	display: grid;
	grid-template-columns: 1fr;
	align-items: stretch;
	gap: 2rem 0.5rem;
	margin-bottom: 2rem;
}

.grid_cards figure {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	margin: 0;
	overflow: hidden;
	background-color: transparent;
	border: 0 solid var(--grey-tint-80);
}

.grid_cards figure:hover {
	border: 0 solid var(--grey-tint-90);
}

/*
	If The image of texts is a portrate,
	do no include the class .img_wrapper is those cases
*/
.grid_cards .img_wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.grid_cards .img_wrapper img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	position: absolute;
	top: 0;
	left: 0;
}

.grid_cards img {
	width: 100%;
	height: auto;
}

.grid_cards figure h4 {
	line-height: 120%;
}

.grid_cards figcaption {
	text-align: left;
	padding: 0 0.5rem;
	line-height: 140%;
	font-size: 0.9em;
	font-style: normal;
}



/*
	Is placed within the some element as the class .grid_cards
	and changes some of its attributes
*/
.grid_cards_portrait {
	margin-top: 1rem !important;
	justify-content: center;
	gap: 1rem;
}

.grid_cards_portrait figcaption {
	margin-top: auto;
	padding: 0.5rem 0.25rem;
	text-align: center;
	font-size: 0.8rem;
}

/*	A button with a link to read more
	Set margin-top to auto ,
	in case the card includes multiple buttons
*/
.grid_cards a.read_more {
	background-color: var(--basic-color);
	color: rgba(255, 255, 255, 0.90);
	padding: 10px 1rem;
	margin: auto 0 2px 0;
	text-align: center;
	text-decoration: none;
}

.grid_cards a.read_more:hover {
	background-color: var(--complement);
}

@media (min-width: 576px) {
	.grid_cards {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Stretch cards if fewer than 2 */
	.grid_cards:not(:has(figure:nth-child(2))) {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 1024px) {
	.grid_cards {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Stretch cards if fewer than 3 */
	.grid_cards:not(:has(figure:nth-child(3))) {
		grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	}
}

@media (min-width: 1280px) {
	.grid_cards {
		grid-template-columns: repeat(4, 1fr);
	}

	/* Stretch cards if fewer than 4 */
	.grid_cards:not(:has(figure:nth-child(4))) {
		grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
		column-gap: 1rem;
	}
}

/*
	==============================================
	SPOTLIGHTS - highlight texts in spot groups
	- Uses grid_cards
	================================================
*/

.spots {
	clear: both;
	margin-bottom: 2rem;
}


.spots h2 {
	position: relative;
	background: var(--tetrad-2);
	background-image: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
	padding: 0 0 0.4rem 1.5rem;
	margin: 0 0 5px 0;
	border-radius: 6px 0 0 0;
	font-size: 1.25rem;
	font-weight: normal;
	color: rgba(255, 255, 255, 1);
}

.spots h2:before {
	content: '\2023';
	font-size: 2.5rem;
	position: absolute;
	top: 25%;
	left: 4px;
}

.spots h2 span {
	display: block;
	padding: 1rem 0.4rem;
	background: var(--tetrad-2);
	background-image: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
	border-left: 1px solid #fff;
	border-bottom: 1px solid #fff;
	border-radius: 0;
}

.spots .spot_column {
	margin-bottom: 2rem;
}

.spots article {
	background-color: #f6f6f6;
	border: 1px solid #e6e6e6;
	border-radius: 4px;
	padding: 0.6rem;
	margin-bottom: 0.5rem;
	clear: both;
	overflow: hidden;
}

.spots h3 {
	margin-top: 0.2rem;
}


.spots footer {
	text-align: right;
	margin-top: 1rem;
	border: 0;
}

.spots .text {
	font-size: 0.96rem;
	line-height: 140%;
}

/*
	If spots are positioned on the aside column
	the width of cards (figure) will always be 100%
*/

.aside .spots .grid_cards {
	grid-template-columns: 1fr;
	align-items: flex-start;
	gap: 1rem 0;
	margin-bottom: 0;
}

.aside .spots .grid_cards figure {
	width: 100%;
	background: #f3f3f3;
	border: 1px solid #e3e3e3;
}

.aside .spots .grid_cards figcaption {
	padding: 0 2% 0.5rem 2%;
}