/**
 * Specialist Instagram-style stories modal — Figma 842:12733.
 */

.specialist-story-modal {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
}

.specialist-story-modal[hidden] {
	display: none !important;
}

.specialist-story-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
}

.specialist-story-modal__shell {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 24px;
	width: min(100%, 720px);
	padding: 24px 24px 72px;
	box-sizing: border-box;
}

.specialist-story-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 8px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	line-height: 0;
}

.specialist-story-modal__close-icon {
	display: block;
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.specialist-story-modal__stage {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	justify-content: center;
}

.specialist-story-modal__nav {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 12px;
	border: 0;
	border-radius: 12px;
	background: #fff;
	color: #434855;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.specialist-story-modal__card {
	position: relative;
	width: min(100%, 562px);
	height: min(80vh, 800px);
	overflow: hidden;
	border-radius: 24px;
	background: #1a1a1a;
}

.specialist-story-modal__media {
	position: absolute;
	inset: 0;
}

.specialist-story-modal__media img,
.specialist-story-modal__media video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
}

.specialist-story-modal__header {
	position: absolute;
	inset: 0 0 auto;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 24px;
	background: linear-gradient(
		180deg,
		rgba(61, 59, 57, 0.8) 0%,
		rgba(61, 59, 57, 0.4) 60%,
		rgba(61, 59, 57, 0) 100%
	);
	pointer-events: none;
}

.specialist-story-modal__header .specialist-story-modal__icon-btn {
	pointer-events: auto;
}

.specialist-story-modal__progress {
	display: flex;
	gap: 4px;
	width: 100%;
}

.specialist-story-modal__segment {
	position: relative;
	flex: 1 1 0;
	height: 4px;
	overflow: hidden;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.35);
}

.specialist-story-modal__segment-fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	background: var(--dr-hug-pink, #f04b60);
	border-radius: 8px;
}

.specialist-story-modal__segment.is-done .specialist-story-modal__segment-fill {
	width: 100%;
}

.specialist-story-modal__meta {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

.specialist-story-modal__user {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.specialist-story-modal__avatar {
	width: 40px;
	height: 40px;
	border-radius: 32px;
	object-fit: cover;
	background: #fef8f4;
}

.specialist-story-modal__user-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	color: #fff;
}

.specialist-story-modal__name {
	margin: 0;
	font-size: 18px;
	font-weight: var(--dr-hug-font-weight-bold, 700);
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.specialist-story-modal__time {
	margin: 0;
	font-size: 16px;
	font-weight: var(--dr-hug-font-weight-medium, 500);
	line-height: 1.4;
}

.specialist-story-modal__actions {
	display: flex;
	gap: 8px;
}

.specialist-story-modal__icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 8px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	line-height: 0;
	flex-shrink: 0;
}

.specialist-story-modal__ctrl-icon {
	display: block;
	width: 24px;
	height: 24px;
	max-width: 24px;
	max-height: 24px;
	object-fit: contain;
	object-position: center;
	flex-shrink: 0;
}

.specialist-story-modal__tap {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 1;
	width: 40%;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.specialist-story-modal__tap--prev {
	left: 0;
}

.specialist-story-modal__tap--next {
	right: 0;
	width: 60%;
}

.specialist-card__media {
	position: relative;
}

.specialist-card__story-ring {
	display: block;
	height: 100%;
	box-sizing: border-box;
	border: 4px solid #dadce0;
	border-radius: 24px 24px 0 0;
	overflow: hidden;
}

.specialist-card__story-ring--unread {
	border-color: #c81d58;
}

.specialist-card__story-ring--read,
.specialist-card__story-ring--none {
	border-color: #dadce0;
}

.specialist-card__story-ring .specialist-card__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	border-radius: 20px 20px 0 0;
}

html.specialist-story-modal-open,
html.specialist-story-modal-open body {
	overflow: hidden;
	overscroll-behavior: none;
}

@media (max-width: 767px) {
	.specialist-story-modal {
		align-items: stretch;
		justify-content: stretch;
		height: 100%;
		height: 100dvh;
		padding: 0;
		box-sizing: border-box;
	}

	.specialist-story-modal__backdrop {
		background: rgba(0, 0, 0, 0.72);
		/* Sit above shell margins so outside taps always close. */
		z-index: 0;
	}

	.specialist-story-modal__nav {
		display: none;
	}

	.specialist-story-modal__shell {
		position: relative;
		z-index: 1;
		width: auto;
		max-width: none;
		height: auto;
		max-height: none;
		flex: 1 1 auto;
		margin: 40px 20px;
		padding: 0;
		gap: 0;
		align-items: stretch;
		justify-content: stretch;
		box-sizing: border-box;
		min-height: 0;
	}

	.specialist-story-modal__close {
		display: none;
	}

	.specialist-story-modal__stage {
		flex: 1 1 auto;
		width: 100%;
		min-height: 0;
		height: auto;
		gap: 0;
		align-items: stretch;
	}

	.specialist-story-modal__card {
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 24px;
		background: #1a1a1a;
	}

	.specialist-story-modal__media img,
	.specialist-story-modal__media video {
		object-fit: contain;
	}

	.specialist-story-modal__header {
		gap: 12px;
		padding: 16px;
	}

	.specialist-story-modal__name {
		font-size: 16px;
	}

	.specialist-story-modal__time {
		font-size: 14px;
	}
}
