/*
 * Instagram reels strip, above the footer.
 *
 * The strip is a native horizontal scroller with scroll snapping, so it works
 * with a trackpad, a finger and the arrow keys without any script. The arrows
 * are progressive: they stay hidden until instagram.js confirms the strip
 * actually overflows.
 */

.reels {
	position: relative;
	padding-block: clamp(2.4rem, 4.5vw, 3.8rem) clamp(2.2rem, 4vw, 3.2rem);
	background: linear-gradient(180deg, #f6efe3 0%, #f1e6d2 100%);
	border-block-start: 1px solid var(--line);
	overflow: hidden;
}

.reels__head {
	margin-block-end: clamp(1.2rem, 2vw, 1.6rem);
}

.reels .shead__title {
	font-size: clamp(1.6rem, 2.8vw, 2.35rem);
}

.reels .shead__side {
	gap: 0.85rem;
}

.reels .shead__row {
	align-items: center;
	padding-block-start: clamp(0.8rem, 1.4vw, 1.1rem);
}

@media (max-width: 760px) {
	.reels .shead__row {
		grid-template-columns: 1fr;
		gap: 0.8rem;
	}
}

/* ---------- follow pill ---------- */
.reels__follow {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.55rem 0.95rem 0.55rem 0.8rem;
	border: 1px solid rgba(18, 59, 37, 0.16);
	border-radius: 100px;
	background: #fffdf8;
	color: var(--forest);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 2px 0 rgba(18, 59, 37, 0.04);
	transition: border-color var(--cooprtim-duration, 200ms) var(--cooprtim-ease, ease), transform var(--cooprtim-duration, 200ms) var(--cooprtim-ease, ease);
}

.reels__follow svg {
	width: 18px;
	height: 18px;
	color: var(--gold-dp);
	flex: 0 0 auto;
}

.reels__follow b {
	font-family: var(--num);
	font-weight: 700;
	color: var(--gold-dp);
	direction: ltr;
	unicode-bidi: isolate;
}

.reels__follow:hover {
	border-color: rgba(169, 115, 31, 0.45);
	transform: translateY(-1px);
}

.reels__follow:focus-visible {
	outline: var(--cooprtim-focus-ring, 3px solid rgba(200, 138, 30, 0.55));
	outline-offset: 3px;
}

/* ---------- strip ---------- */
.reels__frame {
	position: relative;
}

.reels__strip {
	display: flex;
	gap: clamp(0.65rem, 1.3vw, 0.95rem);
	margin: 0;
	padding: 0.15rem 0 0.5rem;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.reels__strip::-webkit-scrollbar {
	display: none;
}

.reels__item {
	position: relative;
	flex: 0 0 auto;
	width: clamp(148px, 15.5vw, 206px);
	aspect-ratio: 9 / 16;
	overflow: hidden;
	border-radius: 16px;
	background: #0a2416;
	scroll-snap-align: start;
	box-shadow: 0 10px 22px -14px rgba(10, 36, 22, 0.55);
}

.reels__card {
	display: block;
	position: relative;
	height: 100%;
	color: #f8f2e5;
	text-decoration: none;
}

.reels__card img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 420ms var(--cooprtim-ease, ease);
}

.reels__card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(6, 18, 11, 0) 46%, rgba(6, 18, 11, 0.72) 100%);
	pointer-events: none;
}

.reels__card:hover img {
	transform: scale(1.04);
}

.reels__card:focus-visible {
	outline: 3px solid var(--orange-2);
	outline-offset: -3px;
}

.reels__play {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.78);
	background: rgba(10, 36, 22, 0.42);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	color: #fff;
	box-shadow: 0 4px 14px rgba(6, 18, 11, 0.35);
	transition: background var(--cooprtim-duration, 200ms) var(--cooprtim-ease, ease);
	z-index: 1;
}

.reels__play svg {
	width: 20px;
	height: 20px;
	margin-inline-start: 2px;
}

.reels__card:hover .reels__play {
	background: rgba(247, 178, 63, 0.92);
	border-color: rgba(255, 255, 255, 0.92);
	color: #10261a;
}

.reels__meta {
	position: absolute;
	inset-block-end: 0.55rem;
	inset-inline: 0.7rem;
	z-index: 1;
	font-size: 0.68rem;
	letter-spacing: 0.02em;
	color: rgba(248, 242, 229, 0.82);
}

/* ---------- lightbox ---------- */
.reelsbox {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: grid;
	place-items: center;
	padding: clamp(0.8rem, 3vw, 2rem);
	background: rgba(6, 18, 11, 0.82);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.reelsbox[hidden] {
	display: none;
}

.reelsbox__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: min(92vw, 400px);
	max-height: 92vh;
	padding: 0.5rem 0.5rem 0.6rem;
	border-radius: 18px;
	background: #fffdf8;
	box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.65);
}

.reelsbox__media {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	aspect-ratio: 9 / 16;
	max-height: 76vh;
	border-radius: 13px;
	overflow: hidden;
	background: #fff;
}

.reelsbox__media iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.reelsbox__close {
	position: absolute;
	inset-block-start: -2.6rem;
	inset-inline-end: 0;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 2.2rem;
	height: 2.2rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	background: rgba(10, 36, 22, 0.5);
	color: #f8f2e5;
	cursor: pointer;
}

.reelsbox__close svg {
	width: 18px;
	height: 18px;
}

.reelsbox__close:hover {
	background: rgba(10, 36, 22, 0.8);
}

.reelsbox__close:focus-visible,
.reelsbox__link:focus-visible {
	outline: 3px solid var(--orange-2);
	outline-offset: 2px;
}

.reelsbox__link {
	align-self: center;
	color: var(--forest);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.reelsbox__link:hover {
	color: var(--gold-dp);
}

/* Keep the page still while the lightbox is open. */
.reelsbox-open {
	overflow: hidden;
}

/* ---------- arrows ---------- */
.reels__nav {
	position: absolute;
	inset-block-start: calc(50% - 1.1rem);
	z-index: 3;
	display: grid;
	place-items: center;
	width: 2.3rem;
	height: 2.3rem;
	padding: 0;
	border: 1px solid rgba(18, 59, 37, 0.14);
	border-radius: 50%;
	background: #fffdf8;
	color: var(--forest);
	box-shadow: 0 6px 18px -10px rgba(10, 36, 22, 0.6);
	cursor: pointer;
	transition: opacity var(--cooprtim-duration, 200ms) var(--cooprtim-ease, ease), background var(--cooprtim-duration, 200ms) var(--cooprtim-ease, ease);
}

.reels__nav[hidden] {
	display: none;
}

.reels__nav--prev {
	inset-inline-start: -0.35rem;
}

.reels__nav--next {
	inset-inline-end: -0.35rem;
}

.reels__nav svg {
	width: 18px;
	height: 18px;
}

.reels__nav:hover {
	background: #fff;
}

.reels__nav[disabled] {
	opacity: 0;
	pointer-events: none;
}

.reels__nav:focus-visible {
	outline: var(--cooprtim-focus-ring, 3px solid rgba(200, 138, 30, 0.55));
	outline-offset: 3px;
}

/* Touch and small screens: the strip itself is the control. */
@media (max-width: 900px) {
	.reels__nav {
		display: none;
	}

	.reels__item {
		width: clamp(136px, 40vw, 172px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.reels__strip {
		scroll-behavior: auto;
	}

	.reels__card img,
	.reels__follow {
		transition: none;
	}

	.reels__card:hover img {
		transform: none;
	}
}
