/**
 * Project story: the story dialog (archtide_project_dialog), the single
 * project page (archtide/project-story) and the browser frame used for
 * website screenshots. Handle: archtide-story.
 */

/* ---------- Story dialog: ivory panel over a dark backdrop ---------- */

.arch-dialog.arch-story {
	width: min(1080px, calc(100vw - 40px));
	max-height: calc(100dvh - 40px);
	border: 0;
	border-radius: 20px;
	background: var(--arch-ivory);
	color: var(--arch-navy);
	box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
	font-size: 17px;
	line-height: 1.6;
}

.arch-dialog.arch-story:focus,
.arch-dialog.arch-story:focus-visible {
	outline: none;
}

.arch-dialog.arch-story::backdrop {
	background: rgba(6, 14, 17, 0.92);
	backdrop-filter: none;
}

.arch-story .arch-story__close {
	top: 14px;
	width: 44px;
	height: 44px;
	margin: 14px 14px -58px 0;
	border: 0;
	background: rgba(244, 245, 241, 0.92);
	color: var(--arch-navy);
}

.arch-story .arch-story__close:hover {
	background: var(--arch-ivory);
	color: var(--arch-copper-dark);
}

.arch-story__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}

.arch-story__media {
	position: relative;
	min-width: 0;
	min-height: 320px;
	overflow: hidden;
	background: var(--arch-navy);
}

.arch-story__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Website screenshots start at the top and scroll down on hover. */
.arch-story__media.is-screenshot img {
	object-position: 50% 0;
	transition: object-position 0.9s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.arch-story__media.is-screenshot:hover img {
		object-position: 50% 100%;
		transition: object-position var(--arch-scroll, 10s) linear;
	}
}

.arch-story__body {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
	padding: clamp(28px, 4vw, 52px);
}

.arch-story__label,
.arch-story__sublabel {
	margin: 0;
	font-family: var(--arch-font-body);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--arch-copper-dark);
}

.arch-story__sublabel {
	color: #6B7B7F;
}

.arch-story__title {
	margin: 0;
	font-family: var(--arch-font-display);
	font-size: clamp(30px, 3.4vw, 42px);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: normal;
	color: inherit;
}

.arch-story__text {
	display: flex;
	flex-direction: column;
	gap: 12px;
	color: #33454A;
}

.arch-story__text > * {
	margin: 0;
}

.arch-story__text a {
	color: inherit;
	text-decoration-color: var(--arch-copper-dark);
	text-underline-offset: 0.2em;
}

.arch-story__deliverables {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 6px;
}

.arch-story__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.arch-story__chips li {
	padding: 7px 14px;
	border: 1px solid rgba(16, 35, 42, 0.2);
	border-radius: 999px;
	font-size: 14px;
	line-height: 1.6;
}

.arch-story__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 8px;
}

.arch-story__button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	min-height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: var(--arch-navy);
	color: var(--arch-ivory);
	font-family: var(--arch-font-body);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--arch-ease), color var(--arch-ease);
}

.arch-story__button:hover {
	background: var(--arch-copper-dark);
	color: var(--arch-ivory);
}

.arch-story__button--copper {
	background: var(--arch-copper);
	color: var(--arch-navy);
	font-weight: 600;
}

.arch-story__button--copper:hover {
	background: #E09C6C;
	color: var(--arch-navy);
}

/* ---------- Browser frame around a website screenshot ---------- */

.arch-browser {
	overflow: hidden;
	padding: 0 0 8px;
	border-radius: 16px;
	background: var(--arch-navy);
	box-shadow: 0 30px 60px -30px rgba(16, 35, 42, 0.55);
}

.arch-browser__bar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
}

.arch-browser__dots {
	display: flex;
	gap: 7px;
}

.arch-browser__dots span {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #4C6469;
}

.arch-browser__dots span:first-child {
	background: var(--arch-copper);
}

.arch-browser__address {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 0;
	min-height: 30px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--arch-panel);
	color: #C8D4D2;
	font-size: 13px;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-decoration: none;
	white-space: nowrap;
}

.arch-browser__address > span:first-child {
	overflow: hidden;
	text-overflow: ellipsis;
}

a.arch-browser__address:hover {
	color: var(--arch-copper);
}

.arch-browser__screen {
	position: relative;
	margin: 0 8px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--arch-ivory);
	aspect-ratio: 16 / 10;
}

.arch-browser__screen img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 0;
	transition: object-position 0.9s ease;
}

/* Hover (or keyboard focus inside the card) scrolls the page from top to bottom. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.arch-scroll-host:hover .arch-browser__screen img,
	.arch-scroll-host:focus-within .arch-browser__screen img {
		object-position: 50% 100%;
		transition: object-position var(--arch-scroll, 10s) linear;
	}
}

/* Touch screens and reduced motion: scroll the screenshot inside the frame instead. */
@media (hover: none), (prefers-reduced-motion: reduce) {
	.arch-browser__screen {
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.arch-browser__screen img {
		height: auto;
		object-fit: fill;
	}
}
