/* OURO Capas: the magazine covers' carousel. The cover in front in a gold frame, the next
   ones stacked behind it; on the cover's foot, the title, its note and the dots (the current one
   filling with gold until the next cover); round arrows on its sides. It takes no more room than the
   cover itself, and covers changing stay inside its column. */
.ouro-capas {
	--oc-foil: linear-gradient(100deg, #8c6a24 0%, #c9a646 7%, #fff3d0 11%, #e9cf7e 15%, #9a7428 24%, #6e5018 30%, #b38a36 38%, #dcbd62 45%, #fff6dc 48%, #dcbd62 52%, #a37b2c 60%, #7a5a1c 68%, #c9a646 78%, #f3dc94 84%, #b38a36 92%, #8c6a24 100%);
	--oc-ease: cubic-bezier(.22, .75, .2, 1);
	--oc-peek: 12px;
	position: relative;
	width: 100%;
	max-width: 260px;
	margin: 0 auto;
	text-align: center;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	overflow: clip;
	overflow-clip-margin: 18px;
}

.ouro-capas__stage {
	position: relative;
	aspect-ratio: 3 / 4;
	margin-right: var(--oc-peek);
	touch-action: pan-y;
}

.ouro-capas__slide {
	position: absolute;
	inset: 0;
	display: block;
	border-radius: 6px;
	opacity: 0;
	pointer-events: none;
	transform-origin: 100% 50%;
	transition: transform .8s var(--oc-ease), opacity .6s var(--oc-ease), filter .8s var(--oc-ease);
	will-change: transform, opacity;
}

/* The deck: in front, then two behind, peeking out to the right. */
.ouro-capas__slide[data-pos="0"] { z-index: 3; opacity: 1; pointer-events: auto; transform: none; }
.ouro-capas__slide[data-pos="1"] { z-index: 2; opacity: .75; filter: brightness(.55); transform: translateX(calc(var(--oc-peek) * .55)) scale(.94); }
.ouro-capas__slide[data-pos="2"] { z-index: 1; opacity: .45; filter: brightness(.4); transform: translateX(var(--oc-peek)) scale(.88); }
/* The cover just left: a short step to the left as it fades. */
.ouro-capas__slide[data-pos="-1"] { z-index: 4; opacity: 0; transform: translateX(-6%) scale(.94); transition-duration: .55s, .35s, .55s; }
.ouro-capas__slide[data-pos="hidden"] { z-index: 0; transform: translateX(var(--oc-peek)) scale(.84); }

/* The gold frame: flat gold here (the moving metallic foil is the new site's, beta). */
.ouro-capas__frame {
	display: block;
	height: 100%;
	padding: 2px;
	border-radius: inherit;
	background-color: #c9a646;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
	transition: box-shadow .4s var(--oc-ease);
}

.ouro-capas__slide[data-pos="0"]:hover .ouro-capas__frame,
.ouro-capas__slide[data-pos="0"]:focus-visible .ouro-capas__frame {
	box-shadow: 0 10px 26px rgba(0, 0, 0, .6), 0 0 0 1px rgba(233, 207, 126, .35);
}

.ouro-capas__slide:focus-visible { outline: none; }

.ouro-capas .ouro-capas__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 4px;
}

@keyframes ouro-capas-foil {
	to { background-position: -133.333% 0; }
}

/* The cover's foot: title, note and dots over a soft shade (clicks go through to the cover). */
.ouro-capas__foot {
	position: absolute;
	z-index: 5;
	inset: auto calc(var(--oc-peek) + 2px) 2px 2px;
	padding: 30px 8px 9px;
	border-radius: 0 0 4px 4px;
	background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, .82));
	color: #fff;
	pointer-events: none;
}

/* Every cover's caption in the same place, so the shade is the tallest one's and doesn't jump. */
.ouro-capas__info {
	display: grid;
}

.ouro-capas__caption {
	grid-area: 1 / 1;
	align-self: end;
	visibility: hidden;
	opacity: 0;
	transform: translateY(3px);
	transition: opacity .45s var(--oc-ease), transform .45s var(--oc-ease), visibility 0s .45s;
}

.ouro-capas__caption.is-current {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition-delay: .1s, .1s, 0s;
}

.ouro-capas .ouro-capas__title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .01em;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.ouro-capas .ouro-capas__note {
	margin: 3px 0 0;
	font-size: 9px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #e9cf7e;
}

/* Round arrows on the cover's sides, centred on it. */
.ouro-capas .ouro-capas__arrow {
	position: absolute;
	z-index: 6;
	top: 50%;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .6);
	border-radius: 50%;
	background: rgba(15, 16, 19, .72);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	color: #fff;
	cursor: pointer;
	translate: 0 -50%;
	transition: border-color .3s, background-color .3s, opacity .3s;
}

.ouro-capas .ouro-capas__arrow--prev { left: 6px; }
.ouro-capas .ouro-capas__arrow--next { right: calc(var(--oc-peek) + 6px); }

.ouro-capas .ouro-capas__arrow:hover,
.ouro-capas .ouro-capas__arrow:focus-visible {
	border-color: #fff;
	background: rgba(15, 16, 19, .9);
	outline: none;
}

.ouro-capas__arrow svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ouro-capas__dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 5px;
	margin-top: 8px;
	pointer-events: auto;
}

.ouro-capas .ouro-capas__dot {
	position: relative;
	width: 5px;
	height: 5px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .4);
	overflow: hidden;
	cursor: pointer;
	transition: width .45s var(--oc-ease), background-color .3s;
}

/* A bigger target than the dot itself. */
.ouro-capas__dot::before {
	content: "";
	position: absolute;
	inset: -7px -3px;
}

.ouro-capas .ouro-capas__dot:hover { background: rgba(255, 255, 255, .7); }
.ouro-capas .ouro-capas__dot[aria-current="true"] { width: 20px; background: rgba(255, 255, 255, .28); }

/* The current dot fills with gold until the next cover. */
.ouro-capas__dot span {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background-color: #c9a646;
	transform: scaleX(0);
	transform-origin: left;
}

.ouro-capas__dot[aria-current="true"] span {
	animation: ouro-capas-fill var(--oc-interval, 5s) linear forwards;
}

.ouro-capas.is-paused .ouro-capas__dot[aria-current="true"] span { animation-play-state: paused; }
.ouro-capas.is-still .ouro-capas__dot[aria-current="true"] span { animation: none; transform: none; }

@keyframes ouro-capas-fill {
	to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
	.ouro-capas__slide, .ouro-capas__frame { transition-duration: .01s; }
	.ouro-capas__dot[aria-current="true"] span { animation: none; transform: none; }
}
