/* WOW Stories viewer. */
.wst {
	width: 100vw;
	max-width: 100vw;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	background: #000;
	color: #fff;
}

.wst::backdrop { background: rgba(0, 0, 0, 0.92); }
.wst[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.wst__stage { display: flex; flex: 1; align-items: center; justify-content: center; gap: 24px; width: 100%; min-height: 0; }

.wst__card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #111;
	isolation: isolate;
}

@media (min-width: 768px) {
	.wst { background: transparent; }
	.wst__card { width: min(420px, calc((100dvh - 96px) * 9 / 16)); height: auto; aspect-ratio: 9 / 16; border-radius: 18px; }
}

.wst__card[aria-busy="true"] { opacity: .6; }

.wst__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }

/* Dark fade top and bottom so white text stays readable on any photo. */
.wst__card::after {
	position: absolute;
	inset: 0;
	z-index: -1;
	content: "";
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.85) 100%);
	pointer-events: none;
}

.wst__bars { position: relative; z-index: 3; display: flex; gap: 4px; padding: 12px 12px 0; }
.wst__bar { flex: 1; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, 0.35); }
.wst__bar i { display: block; width: 0; height: 100%; background: #fff; }

.wst__head { position: relative; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 10px 8px 0 14px; }
.wst__who { flex: 1; min-width: 0; }
.wst__name { margin: 0; overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.wst__meta { margin: 0; font-size: 12px; opacity: .85; }

.wst__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.wst__btn:hover { background: rgba(255, 255, 255, 0.15); }

/* Tap and swipe surfaces: left third back, the rest next. Invisible, under the text and buttons. */
.wst__tap { position: absolute; top: 0; bottom: 0; z-index: 1; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.wst__tap--prev { left: 0; width: 33%; }
.wst__tap--next { right: 0; width: 67%; }

/* Visible back and next arrows, mid-height at the card's edges. */
.wst__arrow { position: absolute; top: 50%; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: rgba(0, 0, 0, .38); color: #fff; cursor: pointer; transform: translateY(-50%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.wst__arrow:hover { background: rgba(0, 0, 0, .6); }
.wst__arrow--prev { left: 10px; }
.wst__arrow--next { right: 10px; }
.wst__arrow[hidden] { display: none; }

.wst__body { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: auto; padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.wst__body > * { pointer-events: auto; }
.wst__label { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--wow-red-ink, #e00000); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; transform: rotate(-3deg); }
.wst__label[hidden] { display: none; }
.wst__title { margin: 0; color: #fff; font-size: clamp(1.5rem, 1.2rem + 1.5vw, 1.9rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; }
.wst__line { margin: 0; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, 0.92); }
.wst__read { margin-top: 4px; }

/* Desktop: the neighbouring stories as named buttons beside the card. */
.wst__story {
	display: none;
	max-width: 140px;
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font: 600 14px/1.2 var(--wow-font, sans-serif);
	cursor: pointer;
}
.wst__story:hover { background: rgba(255, 255, 255, 0.18); }
.wst__story[hidden] { visibility: hidden; }

@media (min-width: 768px) { .wst__story { display: inline-flex; } }

.wst__help { display: none; margin: 10px 0 16px; font-size: 12px; color: rgba(255, 255, 255, 0.7); }

@media (min-width: 768px) { .wst__help { display: block; } }

.wst :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.wst * { transition: none !important; animation: none !important; }
}
