/* El Atlante Digital — homepage v0.6
 * Proportions and motion are based on the previous newspaper theme, while
 * keeping this implementation independent from that theme and from jQuery.
 */

:root {
	--atlante-ink: #171a22;
	--atlante-muted: #747981;
	--atlante-line: #d9dce2;
	--atlante-panel: #f1f2f4;
	--atlante-blue: #505a78;
	--atlante-blue-dark: #333b53;
	--atlante-white: #fff;
	--atlante-column-gap: 16px;
}

/* Astra normally constrains page content. The editorial front page owns its width. */
body.home .site-content > .ast-container {
	display: block;
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

body.home #primary.atlante-home.site-main {
	float: none;
	margin: 0 auto;
	max-width: 1350px;
	padding: 20px 0 64px;
	width: calc(100% - 40px);
}

.atlante-home,
.atlante-home * {
	box-sizing: border-box;
}

.atlante-home {
	background: var(--atlante-panel);
	color: var(--atlante-ink);
}

.atlante-home__container {
	margin: 0 auto;
	max-width: 1240px;
	width: calc(100% - 40px);
}

.atlante-section-heading {
	align-items: flex-end;
	border-bottom: 3px solid var(--atlante-blue);
	display: flex;
	gap: 12px;
	justify-content: space-between;
	margin-bottom: 14px;
}

.atlante-section-heading h2 {
	background: var(--atlante-blue);
	color: var(--atlante-white);
	font-size: 1.12rem;
	font-weight: 700;
	line-height: 1.1;
	margin: 0;
	padding: 12px 16px;
	white-space: nowrap;
}

.atlante-section-heading h2 a {
	color: inherit;
	text-decoration: none;
}

/* Headings in the three-column lead area are intentionally plain. */
.atlante-section-heading--lead {
	align-items: center;
	border: 0;
	margin-bottom: 10px;
	min-height: 34px;
}

.atlante-section-heading--lead h2 {
	background: transparent;
	color: var(--atlante-ink);
	font-size: clamp(1.2rem, 1.45vw, 1.35rem);
	line-height: 1.08;
	padding: 0;
	white-space: normal;
}

.atlante-section-heading--compact {
	align-items: stretch;
	border: 0;
	margin-bottom: 0;
}

.atlante-section-heading--compact h2 {
	align-items: center;
	display: inline-flex;
	font-size: .85rem;
	gap: 8px;
	letter-spacing: .065em;
	padding: 7px 10px;
	text-transform: uppercase;
}

.atlante-section-heading__link {
	color: var(--atlante-blue-dark);
	font-size: .85rem;
	font-weight: 700;
	margin: 0 5px 7px 0;
	text-decoration: none;
}

.atlante-section-heading__link:hover,
.atlante-section-heading__link:focus-visible {
	text-decoration: underline;
}

.atlante-control {
	align-items: center;
	background: var(--atlante-white);
	border: 1px solid var(--atlante-line);
	border-radius: 1px;
	color: var(--atlante-blue-dark);
	cursor: pointer;
	display: inline-flex;
	font-family: Arial, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	height: 38px;
	justify-content: center;
	line-height: 1;
	min-width: 38px;
	padding: 0;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}

.atlante-control:hover,
.atlante-control:focus-visible {
	background: var(--atlante-blue);
	border-color: var(--atlante-blue);
	color: var(--atlante-white);
}

.atlante-control--pause {
	align-self: flex-start;
	background: var(--atlante-blue);
	border-color: var(--atlante-blue);
	color: var(--atlante-white);
	height: 30px;
	min-width: 32px;
	width: 32px;
}

.atlante-section-controls {
	display: flex;
	gap: 8px;
}

/* Trending ticker */
.atlante-trending {
	background: var(--atlante-white);
	margin-bottom: 20px;
	overflow: hidden;
}

.atlante-trending__pulse {
	animation: atlante-trending-blink .6s ease-in-out infinite alternate;
	background: var(--atlante-white);
	border-radius: 50%;
	display: inline-block;
	flex: 0 0 10px;
	height: 10px;
	width: 10px;
}

@keyframes atlante-trending-blink {
	from { opacity: 1; transform: scale(1); }
	to { opacity: .25; transform: scale(.72); }
}

.atlante-trending__viewport {
	overflow: hidden;
	padding: 8px 0;
	position: relative;
}

.atlante-trending__viewport::before,
.atlante-trending__viewport::after {
	content: '';
	height: 100%;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 28px;
	z-index: 2;
}

.atlante-trending__viewport::before {
	background: linear-gradient(90deg, var(--atlante-white), transparent);
	left: 0;
}

.atlante-trending__viewport::after {
	background: linear-gradient(270deg, var(--atlante-white), transparent);
	right: 0;
}

.atlante-trending__track {
	display: flex;
	overflow: hidden;
	scrollbar-width: none;
	width: 100%;
}

.atlante-trending__track::-webkit-scrollbar {
	display: none;
}

.atlante-trending__item {
	align-items: center;
	border-right: 1px solid var(--atlante-line);
	display: flex;
	flex: 0 0 clamp(340px, 33.333%, 450px);
	gap: 15px;
	height: 96px;
	min-width: 0;
	padding: 8px 18px;
}

.atlante-trending__image {
	background: #d8dbe1;
	border-radius: 7px;
	display: block;
	flex: 0 0 90px;
	height: 80px;
	overflow: hidden;
}

.atlante-trending__image img,
.atlante-latest__image img,
.atlante-category-card__image img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.atlante-trending__copy {
	min-width: 0;
}

.atlante-trending__copy time,
.atlante-category-card__copy time {
	color: var(--atlante-muted);
	display: block;
	font-size: .76rem;
	font-weight: 600;
	margin-bottom: 6px;
}

.atlante-trending__copy h3,
.atlante-category-card__copy h3 {
	display: -webkit-box;
	font-size: 1rem;
	line-height: 1.28;
	margin: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.atlante-trending__copy a,
.atlante-category-card__copy a {
	color: inherit;
	text-decoration: none;
}

.atlante-trending__copy a:hover,
.atlante-trending__copy a:focus-visible,
.atlante-category-card__copy a:hover,
.atlante-category-card__copy a:focus-visible {
	text-decoration: underline;
}

/* Main newspaper lead: exact proportions of the reference theme. */
.atlante-home__lead-grid {
	align-items: start;
	display: grid;
	grid-template-columns: minmax(0, 22fr) minmax(0, 55fr) minmax(0, 23fr);
	margin-bottom: 36px;
}

.atlante-latest,
.atlante-hero,
.atlante-advertising {
	min-width: 0;
}

.atlante-latest {
	padding-right: 8px;
}

.atlante-latest .atlante-control {
	height: 28px;
	min-width: 32px;
	width: 32px;
}

.atlante-hero {
	padding: 0 8px;
	position: relative;
}

.atlante-advertising {
	padding-left: 8px;
}

/* Latest news vertical rail */
.atlante-latest__viewport {
	height: 581px;
	overflow: hidden;
}

.atlante-latest__list {
	display: grid;
	gap: 16px;
}

.atlante-latest__item {
	background: var(--atlante-blue-dark);
	height: 170px;
	min-width: 0;
	overflow: hidden;
	position: relative;
}

.atlante-latest__image {
	display: block;
	height: 100%;
	overflow: hidden;
}

.atlante-latest__item::after {
	background: linear-gradient(0deg, rgba(17, 20, 28, .94) 0%, rgba(17, 20, 28, .28) 54%, transparent 82%);
	bottom: 0;
	content: '';
	height: 72%;
	left: 0;
	pointer-events: none;
	position: absolute;
	right: 0;
}

.atlante-latest__item h3 {
	bottom: 0;
	display: -webkit-box;
	font-size: clamp(.92rem, 1.1vw, 1.06rem);
	left: 0;
	line-height: 1.26;
	margin: 0;
	overflow: hidden;
	padding: 28px 18px 14px;
	position: absolute;
	right: 0;
	z-index: 1;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.atlante-home .atlante-latest__item h3 a {
	color: var(--atlante-white);
	text-decoration: none;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .38);
}

.atlante-home .atlante-latest__item h3 a:hover,
.atlante-home .atlante-latest__item h3 a:focus-visible {
	text-decoration: underline;
}

.atlante-image-placeholder {
	background:
		linear-gradient(135deg, transparent 45%, rgba(80, 90, 120, .14) 46%, rgba(80, 90, 120, .14) 54%, transparent 55%),
		#e5e7ec;
	display: block;
	height: 100%;
	width: 100%;
}

/* Main hero */
.atlante-section-heading--hero {
	border: 0;
	height: 0;
	margin: 0;
	position: relative;
	z-index: 4;
}

.atlante-hero__controls {
	display: flex;
	justify-content: space-between;
	left: 10px;
	pointer-events: none;
	position: absolute;
	right: 10px;
	top: 290px;
	transform: translateY(-50%);
}

.atlante-control--overlay {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, .85);
	border-radius: 2px;
	color: var(--atlante-white);
	height: 38px;
	min-width: 38px;
	opacity: 0;
	pointer-events: auto;
	visibility: hidden;
	width: 38px;
}

.atlante-hero:hover .atlante-control--overlay,
.atlante-hero:focus-within .atlante-control--overlay {
	opacity: 1;
	visibility: visible;
}

.atlante-control--overlay:hover,
.atlante-control--overlay:focus-visible {
	background: var(--atlante-white);
	border-color: var(--atlante-white);
	color: var(--atlante-blue-dark);
}

.atlante-control--overlay span {
	font-size: 1.55rem;
	font-weight: 400;
	line-height: .8;
}

.atlante-hero__viewport {
	background: var(--atlante-blue-dark);
	height: 581px;
	overflow: hidden;
	position: relative;
}

.atlante-hero__slide {
	background: var(--atlante-blue-dark);
	inset: 0;
	opacity: 0;
	position: absolute;
	transition: opacity .5s ease;
	visibility: hidden;
}

.atlante-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
}

.atlante-hero__media,
.atlante-hero__media img {
	display: block;
	height: 100%;
	width: 100%;
}

.atlante-hero__media img {
	object-fit: cover;
}

.atlante-hero__slide::after {
	background: linear-gradient(0deg, rgba(16, 18, 24, .95) 0%, rgba(16, 18, 24, .56) 40%, rgba(16, 18, 24, .05) 76%);
	content: '';
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.atlante-hero__overlay {
	bottom: 30px;
	color: var(--atlante-white);
	left: 20px;
	max-width: calc(100% - 40px);
	position: absolute;
	z-index: 1;
}

.atlante-hero__overlay time {
	color: rgba(255, 255, 255, .94);
	font-size: .8rem;
	font-weight: 600;
	margin-left: 9px;
}

.atlante-hero__overlay h3 {
	display: -webkit-box;
	font-size: clamp(1.8rem, 2.65vw, 2.55rem);
	line-height: 1.08;
	margin: 13px 0 8px;
	max-width: 92%;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.atlante-home .atlante-hero__overlay h3 a,
.atlante-home .atlante-hero__overlay h3 a:visited {
	-webkit-text-fill-color: var(--atlante-white);
	color: var(--atlante-white) !important;
	text-decoration: none;
	text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}

.atlante-hero__overlay p {
	color: rgba(255, 255, 255, .94);
	display: -webkit-box;
	font-size: .91rem;
	line-height: 1.45;
	margin: 0;
	max-width: 680px;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.atlante-kicker {
	background: var(--atlante-blue);
	color: var(--atlante-white);
	display: inline-block;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .055em;
	padding: 6px 9px;
	text-transform: uppercase;
}

.atlante-hero__dots {
	bottom: 12px;
	display: flex;
	gap: 7px;
	left: 50%;
	position: absolute;
	transform: translateX(-50%);
	z-index: 3;
}

.atlante-hero__dot {
	background: rgba(255, 255, 255, .55);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	height: 9px;
	padding: 0;
	width: 9px;
}

.atlante-hero__dot.is-active,
.atlante-hero__dot:focus-visible {
	background: var(--atlante-white);
	outline: 2px solid var(--atlante-white);
	outline-offset: 2px;
}

.atlante-hero__empty,
.atlante-advertising__placeholder,
.atlante-advertising__card {
	background: var(--atlante-white);
	padding: 24px;
}

/* Advertising / collaborators */
.atlante-advertising__placeholder {
	align-items: center;
	background: linear-gradient(135deg, #e1e4eb, #f8f9fb);
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 360px;
	text-align: center;
}

.atlante-advertising__label {
	color: var(--atlante-blue-dark);
	display: block;
	font-size: 1.18rem;
	font-weight: 800;
	margin-bottom: 10px;
}

.atlante-advertising__placeholder p {
	color: var(--atlante-muted);
	font-size: .89rem;
	line-height: 1.55;
	margin: 0;
}

.atlante-advertising__card {
	border: 1px solid var(--atlante-line);
	margin-top: 14px;
}

.atlante-advertising__card strong,
.atlante-advertising__card a {
	display: block;
}

.atlante-advertising__card a {
	color: var(--atlante-blue-dark);
	font-size: .85rem;
	font-weight: 700;
	margin-top: 9px;
}

.atlante-advertising__partners {
	position: relative;
}

.atlante-advertising__partner {
	background: var(--atlante-white);
	border-top: 4px solid var(--atlante-blue);
	display: none;
	padding: 22px 22px 23px;
}

.atlante-advertising__partner.is-active {
	display: block;
}

.atlante-advertising__controls {
	display: flex;
	gap: 6px;
}

.atlante-advertising__controls .atlante-control {
	height: 28px;
	min-width: 30px;
	width: 30px;
}

.atlante-advertising__partner-label {
	color: var(--atlante-muted);
	display: block;
	font-size: .66rem;
	font-weight: 800;
	letter-spacing: .1em;
	margin-bottom: 14px;
	text-transform: uppercase;
}

.atlante-advertising__partner-brand {
	color: var(--atlante-blue-dark);
	display: block;
	font-size: clamp(1.8rem, 2.8vw, 2.45rem);
	font-weight: 800;
	letter-spacing: -.045em;
	line-height: 1;
	text-decoration: none;
}

.atlante-advertising__partner-brand--logo {
	align-items: center;
	background: var(--atlante-blue-dark);
	display: flex;
	justify-content: center;
	min-height: 124px;
	padding: 18px;
}

.atlante-advertising__partner-brand img {
	display: block;
	height: auto;
	max-height: 88px;
	max-width: 90%;
	object-fit: contain;
	object-position: center;
	width: auto;
}

.atlante-advertising__partner p {
	color: var(--atlante-muted);
	font-size: .86rem;
	line-height: 1.5;
	margin: 14px 0 17px;
}

.atlante-advertising__partner-link {
	color: var(--atlante-blue);
	display: inline-block;
	font-size: .76rem;
	font-weight: 800;
	text-decoration: none;
}

.atlante-advertising__partner-link:hover,
.atlante-advertising__partner-link:focus-visible,
.atlante-advertising__partner-brand:hover,
.atlante-advertising__partner-brand:focus-visible {
	color: var(--atlante-blue-dark);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Category blocks */
.atlante-category-section {
	margin-bottom: 34px;
}

.atlante-category-section__grid {
	display: grid;
	gap: 18px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.atlante-category-card {
	background: transparent;
	min-width: 0;
}

.atlante-category-card__image {
	background: #d8dbe1;
	display: block;
	height: 205px;
	overflow: hidden;
}

.atlante-category-card__copy {
	background: var(--atlante-white);
	margin: -38px 14px 0;
	min-height: 108px;
	padding: 14px 15px;
	position: relative;
}

.atlante-category-card__copy h3 {
	font-size: 1.02rem;
}

@media (max-width: 1025px) {
	.atlante-home__lead-grid {
		grid-template-columns: minmax(0, 30fr) minmax(0, 70fr);
	}

	.atlante-latest {
		grid-column: 1;
		grid-row: 1;
	}

	.atlante-hero {
		grid-column: 2;
		grid-row: 1;
		padding-right: 0;
	}

	.atlante-advertising {
		grid-column: 1 / -1;
		padding: 24px 0 0;
	}

	.atlante-advertising__placeholder {
		min-height: 170px;
	}

	.atlante-category-section__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.atlante-home__container {
		width: calc(100% - 30px);
	}

	.atlante-home__lead-grid {
		display: flex;
		flex-direction: column;
		gap: 22px;
	}

	.atlante-hero {
		order: 1;
		padding: 0;
		width: 100%;
	}

	.atlante-latest {
		order: 2;
		padding: 0;
		width: 100%;
	}

	.atlante-advertising {
		order: 3;
		padding: 0;
		width: 100%;
	}

	.atlante-hero__viewport {
		height: 420px;
	}

	.atlante-hero__controls {
		top: 210px;
	}

	.atlante-latest__viewport {
		height: 356px;
	}

	.atlante-latest__item {
		height: 170px;
	}

	.atlante-hero__overlay {
		bottom: 28px;
	}

	.atlante-hero__overlay h3 {
		font-size: clamp(1.45rem, 6vw, 2rem);
	}
}

/* On phones Trending becomes a native swipe carousel instead of an animation. */
@media (max-width: 700px) {
	body.home #primary.atlante-home.site-main {
		max-width: none;
		width: 100%;
	}

	.atlante-trending__viewport {
		padding: 6px 0 10px;
	}

	.atlante-trending__viewport::before,
	.atlante-trending__viewport::after {
		display: none;
	}

	.atlante-trending__track {
		-webkit-overflow-scrolling: touch;
		cursor: grab;
		overflow-x: auto;
		overscroll-behavior-inline: contain;
		scroll-padding-left: 10px;
		scroll-snap-type: x mandatory;
		touch-action: pan-x;
	}

	.atlante-trending__item {
		flex-basis: calc(100% - 32px);
		scroll-snap-align: start;
		scroll-snap-stop: always;
	}

	.atlante-control--pause {
		display: none;
	}
}

@media (max-width: 560px) {
	body.home #primary.atlante-home.site-main {
		padding-top: 14px;
	}

	.atlante-home__container {
		width: calc(100% - 20px);
	}

	.atlante-trending__item {
		flex-basis: min(88vw, 355px);
	}

	.atlante-trending__image {
		flex-basis: 78px;
		height: 68px;
	}

	.atlante-trending__item {
		height: 84px;
		padding: 8px 12px;
	}

	.atlante-trending__copy h3 {
		font-size: .93rem;
	}

	.atlante-section-heading--lead h2 {
		font-size: 1.3rem;
	}

	.atlante-hero__viewport {
		height: 390px;
	}

	.atlante-hero__controls {
		left: 8px;
		right: 8px;
		top: 195px;
	}

	.atlante-control--overlay {
		opacity: 1;
		visibility: visible;
	}

	.atlante-hero__overlay {
		bottom: 27px;
		left: 16px;
		max-width: calc(100% - 32px);
	}

	.atlante-hero__overlay p {
		display: none;
	}

	.atlante-category-section__grid {
		gap: 16px;
		grid-template-columns: 1fr;
	}

	.atlante-category-card__image {
		height: 230px;
	}
}

@media (hover: none) {
	.atlante-control--overlay {
		opacity: 1;
		visibility: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	.atlante-hero__slide {
		transition: none;
	}

	.atlante-trending__pulse {
		animation: none;
	}
}
