/**
 * Our Little Place frontend design system.
 *
 * Sections:
 * 1. Tokens and foundations
 * 2. Typography and controls
 * 3. Login and welcome
 * 4. Dashboard and editorial cards
 * 5. Memory form and uploads
 * 6. Memory detail and media
 * 7. Responsive behavior and motion
 */

body:has(.olp-app) {
	background: #5a1023;
}

.olp-app {
	--olp-color-bg: #5a1023;
	--olp-color-bg-deep: #3e0917;
	--olp-color-text: #fff;
	--olp-color-muted: rgb(255 255 255 / 72%);
	--olp-color-faint: rgb(255 255 255 / 52%);
	--olp-color-surface: rgb(255 255 255 / 4%);
	--olp-color-surface-strong: rgb(255 255 255 / 8%);
	--olp-color-border: rgb(255 255 255 / 22%);
	--olp-color-action: #fff;
	--olp-color-action-hover: #f1e9eb;
	--olp-color-danger: #ffd0d7;
	--olp-color-success: #d6f6df;
	--olp-font-display: "Libre Baskerville", serif;
	--olp-font-body: "Cormorant Garamond", serif;
	--olp-radius-sm: 0.8rem;
	--olp-radius: 1.15rem;
	--olp-radius-lg: 1.7rem;
	--olp-gap: clamp(0.9rem, 2vw, 1.5rem);
	--olp-columns: 1;

	background:
		radial-gradient(circle at 85% 5%, rgb(135 23 53 / 32%), transparent 38rem),
		linear-gradient(145deg, var(--olp-color-bg), var(--olp-color-bg-deep));
	color: var(--olp-color-text);
	font-family: var(--olp-font-body);
	font-size: clamp(1.05rem, 1rem + 0.18vw, 1.22rem);
	inline-size: 100%;
	line-height: 1.55;
	padding: clamp(1.25rem, 4vw, 3.5rem);
}

.olp-app,
.olp-app * {
	box-sizing: border-box;
}

.olp-app [hidden] {
	display: none !important;
}

.olp-app .screen-reader-text {
	block-size: 1px;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	inline-size: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
}

.olp-app :where(h1, h2, h3, h4, button, .olp-button, strong) {
	font-family: var(--olp-font-display);
}

.olp-title {
	color: #fff;
	font-size: clamp(1.8rem, 5vw, 3.35rem);
	font-weight: 400;
	letter-spacing: -0.035em;
	line-height: 1.2;
	margin-block: 0 1rem;
}

.olp-eyebrow {
	color: var(--olp-color-muted);
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	margin-block: 0 0.45rem;
	text-transform: uppercase;
}

.olp-page-header {
	margin-block-end: clamp(1.75rem, 5vw, 3.5rem);
	max-inline-size: 44rem;
}

.olp-form {
	display: grid;
	gap: clamp(1rem, 2.5vw, 1.6rem);
}

.olp-form:not([hidden]) {
	animation: olp-enter 320ms ease both;
}

.olp-form-grid {
	display: grid;
	gap: var(--olp-gap);
}

.olp-field {
	display: grid;
	gap: 0.45rem;
}

.olp-field label,
.olp-progress label {
	color: #fff;
	font-weight: 600;
}

.olp-field input,
.olp-field textarea,
.olp-field select {
	appearance: none;
	background: rgb(255 255 255 / 3%);
	border: 1px solid var(--olp-color-border);
	border-radius: var(--olp-radius-sm);
	color: #fff;
	font-family: var(--olp-font-body);
	font-size: 1.05rem;
	inline-size: 100%;
	padding: 0.9rem 1rem;
	transition:
		background-color 180ms ease,
		border-color 180ms ease,
		box-shadow 180ms ease;
}

.olp-field textarea {
	min-block-size: 9rem;
	resize: vertical;
}

.olp-field input::placeholder,
.olp-field textarea::placeholder {
	color: var(--olp-color-faint);
}

.olp-field input[type="date"]::-webkit-calendar-picker-indicator {
	filter: invert(1);
}

.olp-field input:focus,
.olp-field textarea:focus,
.olp-button:focus-visible,
.olp-back-link:focus-visible,
.olp-memory-card__link:focus-visible,
.olp-choice-card:focus-within,
.olp-upload-zone:focus-within {
	border-color: rgb(255 255 255 / 70%);
	box-shadow: 0 0 0 3px rgb(255 255 255 / 16%);
	outline: none;
}

.olp-field small {
	color: var(--olp-color-muted);
	font-size: 0.9rem;
}

.olp-check {
	align-items: center;
	color: #fff;
	display: flex;
	gap: 0.65rem;
}

.olp-check input {
	accent-color: #fff;
	block-size: 1.1rem;
	inline-size: 1.1rem;
}

.olp-button {
	align-items: center;
	background: var(--olp-color-action);
	border: 1px solid #fff;
	border-radius: 0.85rem;
	color: var(--olp-color-bg-deep);
	cursor: pointer;
	display: inline-flex;
	font-family: var(--olp-font-display);
	font-size: 0.95rem;
	font-weight: 700;
	justify-content: center;
	min-block-size: 3rem;
	padding: 0.75rem 1.25rem;
	text-decoration: none;
	transition:
		background-color 180ms ease,
		box-shadow 180ms ease,
		transform 180ms ease;
}

.olp-button:hover {
	background: var(--olp-color-action-hover);
	box-shadow: 0 0.8rem 2rem rgb(25 0 8 / 24%);
	color: var(--olp-color-bg-deep);
	transform: translateY(-2px);
}

.olp-button:disabled {
	cursor: wait;
	opacity: 0.55;
	transform: none;
}

.olp-button--secondary {
	background: transparent;
	border-color: var(--olp-color-border);
	color: #fff;
}

.olp-button--secondary:hover {
	background: var(--olp-color-surface-strong);
	border-color: rgb(255 255 255 / 50%);
	color: #fff;
}

.olp-status {
	color: var(--olp-color-muted);
	margin-block: 1rem 0;
	min-block-size: 1.5em;
}

.olp-status[data-status="error"] {
	color: var(--olp-color-danger);
}

.olp-status[data-status="success"] {
	color: var(--olp-color-success);
}

/* Login and welcome. */
.olp-login {
	align-content: center;
	border: 1px solid var(--olp-color-border);
	border-radius: var(--olp-radius-lg);
	display: grid;
	margin-inline: auto;
	max-inline-size: 34rem;
	min-block-size: min(48rem, calc(100svh - 2rem));
	padding: clamp(2rem, 7vw, 4.5rem);
}

.olp-login__brand {
	margin-block-end: 1.6rem;
	text-align: center;
}

.olp-login__brand .olp-title {
	font-size: clamp(2rem, 7vw, 3rem);
	margin-block-end: 0.35rem;
}

.olp-login__brand .olp-title span {
	color: #b72d51;
	font-size: 0.75em;
}

.olp-login__brand p {
	color: var(--olp-color-muted);
	margin: 0;
}

.olp-login__mark {
	fill: none;
	inline-size: 6.5rem;
	margin-block-end: 1rem;
	stroke: #fff;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

.olp-login__form {
	inline-size: 100%;
}

.olp-login__form .olp-button {
	inline-size: 100%;
}

.olp-login__footer {
	align-items: center;
	color: var(--olp-color-muted);
	display: flex;
	flex-direction: column;
	font-size: 0.9rem;
	gap: 0.4rem;
	margin-block-start: 3.5rem;
	text-align: center;
}

.olp-welcome {
	border: 1px solid var(--olp-color-border);
	border-radius: var(--olp-radius-lg);
	margin-block-end: 1rem;
}

.olp-welcome__greeting {
	white-space: normal;
}

.olp-welcome__date,
.olp-welcome__counter {
	background: var(--olp-color-surface);
	border: 1px solid var(--olp-color-border);
	border-radius: var(--olp-radius);
	margin-block: 0.75rem 0;
	padding: 1rem 1.15rem;
}

.olp-welcome__counter {
	font-family: var(--olp-font-display);
	font-size: clamp(1.15rem, 3vw, 1.65rem);
}

/* Dashboard and editorial Memory cards. */
.olp-dashboard {
	border-radius: var(--olp-radius-lg);
}

.olp-dashboard__header {
	align-items: flex-start;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
}

.olp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-block: clamp(1.5rem, 4vw, 2.5rem);
}

.olp-dashboard__section {
	margin-block-start: clamp(2.5rem, 6vw, 4rem);
}

.olp-dashboard__section > h3,
.olp-memory-detail__section > h2 {
	font-size: clamp(1.35rem, 3vw, 2rem);
	font-weight: 400;
}

.olp-memory-grid {
	display: grid;
	gap: var(--olp-gap);
	grid-auto-flow: dense;
	grid-template-columns: repeat(12, minmax(0, 1fr));
}

.olp-memory-card {
	background: var(--olp-color-surface);
	border: 1px solid var(--olp-color-border);
	border-radius: var(--olp-radius);
	grid-column: span 12;
	min-inline-size: 0;
	overflow: hidden;
	transition:
		border-color 200ms ease,
		box-shadow 200ms ease,
		transform 200ms ease;
}

.olp-memory-card:hover {
	border-color: rgb(255 255 255 / 38%);
	box-shadow: 0 1.25rem 3rem rgb(22 0 7 / 30%);
	transform: translateY(-3px) scale(1.01);
}

.olp-memory-card__link {
	color: #fff;
	display: block;
	text-decoration: none;
}

.olp-memory-card__media {
	background: rgb(0 0 0 / 12%);
	margin: 0;
}

.olp-memory-card__image {
	block-size: auto;
	display: block;
	inline-size: 100%;
}

.olp-memory-card__preview {
	display: grid;
	gap: 0.3rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	padding: 0.35rem 0.35rem 0;
	position: relative;
}

.olp-memory-card__preview-image {
	aspect-ratio: 1;
	block-size: auto;
	border-radius: 0.55rem;
	inline-size: 100%;
	object-fit: cover;
}

.olp-memory-card__count {
	background: rgb(28 2 11 / 82%);
	border-radius: 999px;
	color: #fff;
	font-size: 0.76rem;
	inset-block-end: 0.5rem;
	inset-inline-end: 0.5rem;
	padding: 0.35rem 0.65rem;
	position: absolute;
}

.olp-memory-card__body {
	padding: 1rem 1.1rem 1.2rem;
	position: relative;
}

.olp-memory-card__title {
	color: #fff;
	font-size: clamp(1.05rem, 2.5vw, 1.35rem);
	font-weight: 400;
	line-height: 1.35;
	margin: 0;
	padding-inline-end: 2rem;
}

.olp-memory-card__meta {
	color: var(--olp-color-muted);
	font-size: 0.92rem;
	margin-block: 0.45rem 0;
}

.olp-memory-card__favorite {
	color: #fff;
	font-family: var(--olp-font-display);
	font-size: 1.35rem;
	inset-block-start: 0.9rem;
	inset-inline-end: 1rem;
	position: absolute;
}

.olp-load-more {
	display: flex;
	justify-content: center;
	margin-block-start: 2rem;
}

.olp-empty {
	color: var(--olp-color-muted);
	grid-column: 1 / -1;
}

/* Memory form and uploads. */
.olp-memory-form {
	border-radius: var(--olp-radius-lg);
}

.olp-memory-kind {
	border: 0;
	display: grid;
	gap: 1rem;
	margin: 0 0 2rem;
	padding: 0;
}

.olp-choice-card {
	align-items: center;
	background: var(--olp-color-surface);
	border: 1px solid var(--olp-color-border);
	border-radius: var(--olp-radius);
	cursor: pointer;
	display: grid;
	gap: 1rem;
	grid-template-columns: auto 1fr;
	padding: 1.2rem;
	transition:
		background-color 180ms ease,
		border-color 180ms ease,
		transform 180ms ease;
}

.olp-choice-card:hover,
.olp-choice-card:has(input:checked) {
	background: var(--olp-color-surface-strong);
	border-color: rgb(255 255 255 / 50%);
	transform: translateY(-2px);
}

.olp-choice-card input {
	opacity: 0;
	position: absolute;
}

.olp-choice-card__icon {
	align-items: center;
	border: 1px solid var(--olp-color-border);
	border-radius: 50%;
	display: flex;
	font-family: var(--olp-font-display);
	font-size: 1.8rem;
	block-size: 3.5rem;
	inline-size: 3.5rem;
	justify-content: center;
}

.olp-choice-card strong,
.olp-choice-card small {
	display: block;
}

.olp-choice-card strong {
	font-size: 1.08rem;
	font-weight: 400;
}

.olp-choice-card small {
	color: var(--olp-color-muted);
	line-height: 1.4;
	margin-block-start: 0.3rem;
}

.olp-upload-zone {
	align-items: center;
	background: var(--olp-color-surface);
	border: 1px dashed rgb(255 255 255 / 38%);
	border-radius: var(--olp-radius);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	min-block-size: 9rem;
	justify-content: center;
	padding: 1.5rem;
	position: relative;
	text-align: center;
	transition:
		background-color 180ms ease,
		border-color 180ms ease;
}

.olp-upload-zone:hover {
	background: var(--olp-color-surface-strong);
	border-color: rgb(255 255 255 / 68%);
}

.olp-upload-zone input {
	block-size: 1px;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	inline-size: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
}

.olp-upload-zone__icon {
	font-family: var(--olp-font-display);
	font-size: 2rem;
}

.olp-upload-preview {
	display: grid;
	gap: 0.65rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.olp-upload-preview:empty {
	display: none;
}

.olp-upload-preview__item {
	background: var(--olp-color-surface);
	border-radius: var(--olp-radius-sm);
	margin: 0;
	overflow: hidden;
}

.olp-upload-preview__media {
	aspect-ratio: 1;
	block-size: auto;
	display: block;
	inline-size: 100%;
	object-fit: cover;
}

.olp-upload-preview figcaption {
	color: var(--olp-color-muted);
	font-size: 0.8rem;
	overflow: hidden;
	padding: 0.5rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.olp-progress {
	align-items: center;
	display: grid;
	gap: 0.5rem;
	grid-template-columns: 1fr auto;
}

.olp-progress label {
	grid-column: 1 / -1;
}

.olp-progress progress {
	accent-color: #fff;
	inline-size: 100%;
}

/* Memory detail and orientation-aware media. */
.olp-back-link {
	align-items: center;
	color: #fff;
	display: inline-flex;
	gap: 0.5rem;
	margin-block-end: 2rem;
	text-decoration: none;
}

.olp-memory-detail__header {
	margin-block-end: clamp(1.5rem, 5vw, 3rem);
}

.olp-memory-detail__favorite {
	color: #fff;
	font-family: var(--olp-font-display);
}

.olp-memory-detail__cover {
	background: var(--olp-color-surface);
	border-radius: var(--olp-radius);
	margin: 0 auto clamp(2rem, 6vw, 4rem);
	overflow: hidden;
}

.olp-memory-detail__cover.olp-media--landscape {
	max-inline-size: 90rem;
}

.olp-memory-detail__cover.olp-media--portrait {
	max-inline-size: 38rem;
}

.olp-memory-detail__cover.olp-media--square {
	max-inline-size: 58rem;
}

.olp-memory-detail__cover-image {
	block-size: auto;
	display: block;
	inline-size: 100%;
}

.olp-memory-detail__description {
	font-size: clamp(1.1rem, 2vw, 1.35rem);
	line-height: 1.75;
	max-inline-size: 52rem;
	white-space: pre-wrap;
}

.olp-memory-detail__story {
	max-inline-size: 52rem;
}

.olp-memory-detail__story h2 {
	font-size: clamp(1.35rem, 3vw, 2rem);
	font-weight: 400;
}

.olp-memory-facts {
	display: grid;
	gap: 0.6rem 1.5rem;
	grid-template-columns: max-content minmax(0, 1fr);
	margin-block: 2rem;
	max-inline-size: 52rem;
}

.olp-memory-facts dt {
	font-family: var(--olp-font-display);
	font-weight: 700;
}

.olp-memory-facts dd {
	color: var(--olp-color-muted);
	margin: 0;
}

.olp-memory-detail__section {
	margin-block-start: clamp(3rem, 8vw, 6rem);
}

.olp-gallery {
	display: grid;
	gap: var(--olp-gap);
	grid-auto-flow: dense;
	grid-template-columns: repeat(12, minmax(0, 1fr));
}

.olp-gallery__item {
	background: var(--olp-color-surface);
	border-radius: var(--olp-radius);
	grid-column: span 12;
	margin: 0;
	overflow: hidden;
}

.olp-gallery__image {
	block-size: auto;
	display: block;
	inline-size: 100%;
}

.olp-videos {
	display: grid;
	gap: clamp(2rem, 6vw, 4rem);
}

.olp-videos__item {
	background: #000;
	border-radius: var(--olp-radius);
	display: block;
	inline-size: 100%;
	margin-inline: auto;
	max-block-size: 80svh;
}

.olp-videos__item.olp-media--portrait {
	max-inline-size: 38rem;
}

.olp-videos__item.olp-media--square {
	max-inline-size: 58rem;
}

/* Responsive behavior and restrained motion. */
@keyframes olp-enter {
	from {
		opacity: 0;
		transform: translateY(0.65rem);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.olp-app {
	animation: olp-enter 220ms ease both;
}

@media (min-width: 40rem) {
	.olp-form-grid,
	.olp-memory-kind {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.olp-upload-preview {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.olp-memory-card--portrait {
		grid-column: span 5;
	}

	.olp-memory-card--square {
		grid-column: span 6;
	}

	.olp-memory-card--landscape {
		grid-column: span 7;
	}

	.olp-gallery__item.olp-media--portrait {
		grid-column: span 5;
	}

	.olp-gallery__item.olp-media--square {
		grid-column: span 6;
	}

	.olp-gallery__item.olp-media--landscape {
		grid-column: span 7;
	}
}

@media (min-width: 64rem) {
	.olp-memory-card--portrait {
		grid-column: span 4;
	}

	.olp-memory-card--square {
		grid-column: span 5;
	}

	.olp-memory-card--landscape {
		grid-column: span 8;
	}

	.olp-gallery__item.olp-media--portrait {
		grid-column: span 4;
	}

	.olp-gallery__item.olp-media--square {
		grid-column: span 6;
	}

	.olp-gallery__item.olp-media--landscape {
		grid-column: span 8;
	}

	.olp-memories--columns-1 .olp-memory-card {
		grid-column: span 12;
	}

	.olp-memories--columns-2 .olp-memory-card--portrait,
	.olp-memories--columns-2 .olp-memory-card--square {
		grid-column: span 6;
	}

	.olp-memories--columns-2 .olp-memory-card--landscape {
		grid-column: span 12;
	}

	.olp-memories--columns-4 .olp-memory-card--portrait,
	.olp-memories--columns-5 .olp-memory-card--portrait,
	.olp-memories--columns-6 .olp-memory-card--portrait {
		grid-column: span 3;
	}

	.olp-memories--columns-4 .olp-memory-card--square,
	.olp-memories--columns-5 .olp-memory-card--square,
	.olp-memories--columns-6 .olp-memory-card--square {
		grid-column: span 4;
	}

	.olp-memories--columns-4 .olp-memory-card--landscape,
	.olp-memories--columns-5 .olp-memory-card--landscape,
	.olp-memories--columns-6 .olp-memory-card--landscape {
		grid-column: span 6;
	}
}

@media (prefers-reduced-motion: reduce) {
	.olp-app,
	.olp-form:not([hidden]) {
		animation: none;
	}

	.olp-button,
	.olp-choice-card,
	.olp-memory-card {
		scroll-behavior: auto;
		transition: none;
	}
}

/* Premium Memory Detail experience. */
.olp-memory-detail__navigation {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-block-end: clamp(1.5rem, 4vw, 2.75rem);
}

.olp-memory-detail__navigation .olp-back-link {
	margin: 0;
}

.olp-memory-detail__menu {
	background: transparent;
	border: 0;
	color: #fff;
	font-family: var(--olp-font-display);
	font-size: 1.35rem;
	letter-spacing: 0.12em;
	opacity: 1;
	padding: 0.5rem;
}

.olp-memory-actions {
	position: relative;
}

.olp-memory-actions__menu {
	position: absolute;
	z-index: 20;
	top: calc(100% + .5rem);
	right: 0;
	min-width: 13rem;
	padding: .4rem;
	border: 1px solid rgb(255 255 255 / 20%);
	border-radius: .8rem;
	background: #70172d;
	box-shadow: 0 1rem 2.5rem rgb(20 0 6 / 35%);
}

.olp-memory-actions__menu button {
	display: block;
	width: 100%;
	padding: .75rem .85rem;
	border: 0;
	border-radius: .55rem;
	color: #fff;
	background: transparent;
	text-align: left;
	cursor: pointer;
}

.olp-memory-actions__menu button:hover,
.olp-memory-actions__menu button:focus-visible {
	background: rgb(255 255 255 / 10%);
}

.olp-memory-actions__danger,
.olp-editor__media-action.is-danger {
	color: #ffd6dc !important;
}

.olp-editor,
.olp-confirm {
	width: min(46rem, calc(100% - 2rem));
	max-height: calc(100dvh - 2rem);
	padding: 0;
	border: 1px solid rgb(255 255 255 / 18%);
	border-radius: 1rem;
	color: #fff;
	background: #5a1023;
	box-shadow: 0 2rem 5rem rgb(20 0 6 / 45%);
}

.olp-editor::backdrop,
.olp-confirm::backdrop {
	background: rgb(15 0 5 / 70%);
	backdrop-filter: blur(5px);
}

.olp-editor__form,
.olp-confirm__body {
	overflow: auto;
	max-height: calc(100dvh - 2rem);
	padding: clamp(1rem, 4vw, 2rem);
}

.olp-editor__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.olp-editor__header h2,
.olp-editor__media h3,
.olp-confirm h2 {
	font-family: var(--olp-font-heading);
}

.olp-editor__close {
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	color: #fff;
	background: transparent;
	font-size: 2rem;
	cursor: pointer;
}

.olp-editor__media {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgb(255 255 255 / 15%);
}

.olp-editor__progress {
	width: 100%;
	margin-block: 1rem;
	accent-color: #fff;
}

.olp-editor__media-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 1rem;
	margin-top: 1.25rem;
}

.olp-editor__media-item {
	position: relative;
	min-width: 0;
	border: 1px solid rgb(255 255 255 / 15%);
	border-radius: .75rem;
	background: rgb(255 255 255 / 5%);
}

.olp-editor__media-preview,
.olp-editor__media-item video {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: calc(.75rem - 1px);
	object-fit: cover;
}

.olp-editor__media-menu-toggle {
	position: absolute;
	z-index: 3;
	top: .6rem;
	right: .6rem;
	display: grid;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	place-items: center;
	border: 1px solid rgb(255 255 255 / 20%);
	border-radius: 50%;
	color: #fff;
	background: rgb(28 4 12 / 48%);
	box-shadow: 0 .3rem 1rem rgb(10 0 3 / 20%);
	opacity: .58;
	backdrop-filter: blur(12px);
	transition: opacity 160ms ease, background-color 160ms ease, transform 160ms ease;
	cursor: pointer;
}

.olp-editor__media-item:hover .olp-editor__media-menu-toggle,
.olp-editor__media-menu-toggle:focus-visible,
.olp-editor__media-menu-toggle[aria-expanded="true"] {
	background: rgb(28 4 12 / 78%);
	opacity: 1;
}

.olp-editor__media-menu-toggle:active {
	transform: scale(.94);
}

.olp-editor__media-menu-toggle .olp-icon {
	width: 1.15rem;
	height: 1.15rem;
}

.olp-editor__media-menu {
	position: absolute;
	z-index: 10;
	top: 3.75rem;
	right: .6rem;
	display: grid;
	width: max-content;
	min-width: 10.5rem;
	padding: .35rem;
	border: 1px solid rgb(255 255 255 / 18%);
	border-radius: .8rem;
	background: rgb(74 10 28 / 88%);
	box-shadow: 0 1rem 2.5rem rgb(20 0 6 / 38%);
	backdrop-filter: blur(18px) saturate(130%);
	transform-origin: top right;
}

.olp-editor__media-menu[hidden] {
	display: none;
}

.olp-editor__media-action {
	display: flex;
	align-items: center;
	gap: .65rem;
	min-height: 2.75rem;
	padding: .55rem .7rem;
	border: 0;
	border-radius: .45rem;
	color: #fff;
	background: transparent;
	text-align: left;
	font: inherit;
	font-size: .9rem;
	cursor: pointer;
}

.olp-editor__media-action-icon {
	flex: 0 0 auto;
	width: 1.05rem;
	height: 1.05rem;
}

.olp-editor__media-action:hover,
.olp-editor__media-action:focus-visible {
	background: rgb(255 255 255 / 10%);
}

.olp-button--danger {
	color: #5a1023;
	background: #fff;
}

@media (prefers-reduced-motion: no-preference) {
	.olp-editor[open],
	.olp-confirm[open],
	.olp-memory-actions__menu:not([hidden]) {
		animation: olp-fade-in 180ms ease-out;
	}

	.olp-editor__media-menu {
		animation: olp-media-menu-in 160ms cubic-bezier(.2, .75, .25, 1);
	}

	.olp-editor__media-menu.is-closing {
		animation: olp-media-menu-out 140ms ease-in forwards;
	}
}

@keyframes olp-media-menu-in {
	from {
		opacity: 0;
		transform: translateY(-.25rem) scale(.96);
	}
}

@keyframes olp-media-menu-out {
	to {
		opacity: 0;
		transform: translateY(-.2rem) scale(.97);
	}
}

@media (hover: none), (pointer: coarse) {
	.olp-editor__media-menu-toggle {
		opacity: .86;
	}
}

.olp-trash {
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px solid rgb(255 255 255 / 14%);
}

.olp-trash summary {
	width: fit-content;
	cursor: pointer;
}

.olp-trash__list {
	display: grid;
	gap: .75rem;
	margin-top: 1rem;
}

.olp-trash__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .8rem 1rem;
	border: 1px solid rgb(255 255 255 / 14%);
	border-radius: .7rem;
}

.olp-memory-detail__hero {
	background: rgb(0 0 0 / 14%);
	border-radius: var(--olp-radius);
	margin: 0 auto clamp(2rem, 6vw, 4rem);
	overflow: hidden;
}

.olp-memory-detail__hero.olp-media--landscape,
.olp-memory-detail__hero--video {
	max-inline-size: 92rem;
}

.olp-memory-detail__hero.olp-media--portrait {
	max-inline-size: 40rem;
}

.olp-memory-detail__hero.olp-media--square {
	max-inline-size: 60rem;
}

.olp-memory-detail__hero-button,
.olp-gallery__button {
	background: transparent;
	border: 0;
	color: inherit;
	cursor: zoom-in;
	display: block;
	inline-size: 100%;
	padding: 0;
}

.olp-memory-detail__hero-button:focus-visible,
.olp-gallery__button:focus-visible {
	box-shadow: inset 0 0 0 3px #fff;
	outline: 0;
}

.olp-memory-detail__hero-image {
	block-size: auto;
	display: block;
	inline-size: 100%;
}

.olp-memory-detail__hero .olp-videos__item {
	border-radius: 0;
	max-inline-size: none;
}

.olp-memory-detail__header {
	margin-inline: auto;
	max-inline-size: 72rem;
}

.olp-memory-detail__header .olp-title {
	font-size: clamp(2.1rem, 6vw, 4.5rem);
}

.olp-memory-detail__metadata {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.olp-memory-detail__metadata-item {
	align-items: center;
	color: var(--olp-color-muted);
	display: inline-flex;
	gap: 0.4rem;
}

.olp-memory-detail__metadata-icon {
	color: #fff;
	font-family: var(--olp-font-display);
	font-size: 1.05em;
}

.olp-memory-detail__metadata-item--count {
	flex-basis: 100%;
	font-family: var(--olp-font-display);
}

.olp-memory-detail__story {
	margin-block-start: clamp(2rem, 7vw, 5rem);
	margin-inline: auto;
	max-inline-size: 60rem;
}

.olp-memory-detail__story h2 {
	margin-block-end: 1rem;
}

.olp-memory-detail__description {
	font-size: clamp(1.2rem, 2.2vw, 1.55rem);
	line-height: 1.8;
}

.olp-memory-detail .olp-memory-facts {
	border-block-start: 1px solid var(--olp-color-border);
	margin-block-start: 2rem;
	padding-block-start: 1.5rem;
}

.olp-memory-detail .olp-gallery__item {
	transition:
		box-shadow 200ms ease,
		transform 200ms ease;
}

.olp-memory-detail .olp-gallery__item:hover {
	box-shadow: 0 1.2rem 3rem rgb(20 0 7 / 28%);
	transform: translateY(-3px);
}

.olp-memory-detail .olp-gallery__image {
	transition: transform 280ms ease;
}

.olp-memory-detail .olp-gallery__button:hover .olp-gallery__image {
	transform: scale(1.012);
}

.olp-memory-detail .olp-videos__item {
	max-block-size: 82svh;
	object-fit: contain;
}

.olp-related {
	border-block-start: 1px solid var(--olp-color-border);
	padding-block-start: clamp(2rem, 5vw, 4rem);
}

.olp-lightbox {
	background: transparent;
	border: 0;
	color: #fff;
	height: 100dvh;
	margin: 0;
	max-height: none;
	max-width: none;
	padding: 0;
	width: 100vw;
}

.olp-lightbox::backdrop {
	background: rgb(12 0 4 / 96%);
	backdrop-filter: blur(12px);
}

.olp-lightbox__figure {
	align-items: center;
	display: grid;
	height: 100%;
	justify-items: center;
	margin: 0;
	padding: clamp(4rem, 8vw, 6rem) clamp(1rem, 8vw, 7rem);
}

.olp-lightbox__image {
	max-block-size: calc(100dvh - 9rem);
	max-inline-size: 100%;
	object-fit: contain;
}

.olp-lightbox__caption {
	background: rgb(0 0 0 / 45%);
	border-radius: 999px;
	inset-block-end: 1.25rem;
	inset-inline-start: 50%;
	padding: 0.35rem 0.8rem;
	position: fixed;
	transform: translateX(-50%);
	white-space: nowrap;
}

.olp-lightbox__close,
.olp-lightbox__previous,
.olp-lightbox__next {
	align-items: center;
	background: rgb(255 255 255 / 10%);
	border: 1px solid rgb(255 255 255 / 25%);
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	font-family: var(--olp-font-display);
	justify-content: center;
	position: fixed;
	z-index: 2;
}

.olp-lightbox__close {
	block-size: 2.8rem;
	font-size: 1.65rem;
	inline-size: 2.8rem;
	inset-block-start: 1rem;
	inset-inline-end: 1rem;
}

.olp-lightbox__previous,
.olp-lightbox__next {
	block-size: 3rem;
	font-size: 1.25rem;
	inline-size: 3rem;
	inset-block-start: 50%;
	transform: translateY(-50%);
}

.olp-lightbox__previous {
	inset-inline-start: 1rem;
}

.olp-lightbox__next {
	inset-inline-end: 1rem;
}

.olp-lightbox__close:hover,
.olp-lightbox__previous:hover,
.olp-lightbox__next:hover {
	background: rgb(255 255 255 / 18%);
}

@media (max-width: 39.99rem) {
	.olp-memory-detail__metadata {
		align-items: flex-start;
		flex-direction: column;
	}

	.olp-lightbox__previous,
	.olp-lightbox__next {
		block-size: 2.6rem;
		inline-size: 2.6rem;
		inset-block-start: auto;
		inset-block-end: 1rem;
		transform: none;
	}

	.olp-lightbox__previous {
		inset-inline-start: 1rem;
	}

	.olp-lightbox__next {
		inset-inline-end: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.olp-memory-detail .olp-gallery__image,
	.olp-memory-detail .olp-gallery__item {
		transition: none;
	}
}

/* Sprint 2 native-app polish. */
@view-transition {
	navigation: auto;
}

::view-transition-old(root) {
	animation: olp-page-out 200ms ease both;
}

::view-transition-new(root) {
	animation: olp-page-in 220ms ease both;
}

.olp-app {
	margin-inline: auto;
	max-inline-size: 96rem;
	padding-block-end: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-bottom));
	padding-block-start: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-top));
	padding-inline-end: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-right));
	padding-inline-start: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-left));
}

.olp-app.olp-login {
	max-inline-size: 34rem;
}

.olp-page-subtitle {
	color: var(--olp-color-muted);
	font-size: clamp(1.05rem, 2vw, 1.3rem);
	line-height: 1.6;
	margin: -0.25rem 0 0;
	max-inline-size: 44rem;
}

.olp-icon {
	block-size: 1.25em;
	fill: none;
	flex: 0 0 auto;
	inline-size: 1.25em;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.olp-button,
.olp-choice-card,
.olp-memory-card__link,
.olp-gallery__button,
.olp-memory-detail__hero-button,
.olp-lightbox button {
	touch-action: manipulation;
}

.olp-button {
	min-block-size: 3.25rem;
}

.olp-button:active {
	box-shadow: 0 0.3rem 0.8rem rgb(25 0 8 / 18%);
	transform: translateY(0) scale(0.975);
	transition-duration: 80ms;
}

.olp-memory-card:hover {
	border-color: rgb(255 255 255 / 48%);
	box-shadow: 0 1.5rem 3.5rem rgb(20 0 7 / 36%);
	transform: translateY(-4px);
}

.olp-memory-card:active {
	transform: translateY(-1px) scale(0.988);
	transition-duration: 90ms;
}

.olp-memory-card:focus-within {
	border-color: rgb(255 255 255 / 72%);
	box-shadow: 0 0 0 3px rgb(255 255 255 / 18%);
}

.olp-image--loading {
	opacity: 0.08;
	transform: scale(1.03);
}

.olp-image--loaded {
	opacity: 1;
	transform: scale(1);
	transition:
		opacity 320ms ease,
		transform 420ms ease;
}

.olp-skeleton {
	animation: olp-skeleton-pulse 1.45s ease-in-out infinite;
	background:
		linear-gradient(
			100deg,
			rgb(255 255 255 / 5%) 25%,
			rgb(255 255 255 / 12%) 42%,
			rgb(255 255 255 / 5%) 60%
		);
	background-size: 240% 100%;
	border-radius: 0.65rem;
	display: block;
}

.olp-skeleton-card {
	background: var(--olp-color-surface);
	border: 1px solid var(--olp-color-border);
	border-radius: var(--olp-radius);
	display: grid;
	gap: 0.75rem;
	grid-column: span 12;
	overflow: hidden;
	padding-block-end: 1rem;
}

.olp-skeleton-card__media {
	aspect-ratio: 4 / 3;
	border-radius: 0;
}

.olp-skeleton-card__title {
	block-size: 1.2rem;
	inline-size: 68%;
	margin-inline: 1rem;
}

.olp-skeleton-card__meta {
	block-size: 0.8rem;
	inline-size: 45%;
	margin-inline: 1rem;
}

.olp-memory-detail__skeleton {
	display: grid;
	gap: 1rem;
}

.olp-memory-detail__skeleton-hero {
	aspect-ratio: 16 / 9;
	border-radius: var(--olp-radius);
	inline-size: 100%;
}

.olp-memory-detail__skeleton-title {
	block-size: clamp(2rem, 5vw, 4rem);
	inline-size: min(70%, 46rem);
}

.olp-memory-detail__skeleton-meta {
	block-size: 1rem;
	inline-size: min(55%, 32rem);
}

.olp-memory-detail__skeleton-gallery {
	display: grid;
	gap: var(--olp-gap);
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-block-start: 2rem;
}

.olp-memory-detail__skeleton-gallery .olp-skeleton {
	aspect-ratio: 1;
}

.olp-empty {
	align-items: center;
	background: var(--olp-color-surface);
	border: 1px solid var(--olp-color-border);
	border-radius: var(--olp-radius);
	display: flex;
	flex-direction: column;
	grid-column: 1 / -1;
	justify-content: center;
	min-block-size: 15rem;
	padding: clamp(2rem, 6vw, 4rem);
	text-align: center;
}

.olp-empty__icon {
	block-size: 2.25rem;
	inline-size: 2.25rem;
	margin-block-end: 1rem;
}

.olp-empty__title {
	font-size: clamp(1.25rem, 3vw, 1.7rem);
	font-weight: 400;
	margin: 0;
}

.olp-empty__text {
	color: var(--olp-color-muted);
	margin-block: 0.65rem 0;
	max-inline-size: 30rem;
}

.olp-status[data-status="success"] {
	background: rgb(255 255 255 / 9%);
	border: 1px solid rgb(255 255 255 / 24%);
	border-radius: var(--olp-radius);
	color: #fff;
	font-family: var(--olp-font-display);
	font-size: 1.15rem;
	padding: 1rem 1.2rem;
}

.olp-memory-form--complete .olp-form {
	opacity: 0.68;
}

.olp-memory-form--complete > .olp-status[data-status="success"] {
	box-shadow: 0 1rem 3rem rgb(20 0 7 / 38%);
	inset-block-end: max(1rem, env(safe-area-inset-bottom));
	inset-inline-start: 50%;
	margin: 0;
	max-inline-size: calc(100vw - 2rem);
	position: fixed;
	transform: translateX(-50%);
	z-index: 20;
}

.olp-lightbox[open] {
	animation: olp-lightbox-in 220ms ease both;
}

.olp-lightbox[open]::backdrop {
	animation: olp-backdrop-in 220ms ease both;
}

.olp-lightbox.is-closing {
	animation: olp-lightbox-out 180ms ease both;
}

.olp-lightbox.is-closing::backdrop {
	animation: olp-backdrop-out 180ms ease both;
}

@keyframes olp-page-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes olp-page-out {
	from {
		opacity: 1;
		transform: translateY(0);
	}

	to {
		opacity: 0;
		transform: translateY(-8px);
	}
}

@keyframes olp-skeleton-pulse {
	0% {
		background-position: 100% 0;
	}

	100% {
		background-position: -100% 0;
	}
}

@keyframes olp-lightbox-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.99);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes olp-lightbox-out {
	to {
		opacity: 0;
		transform: translateY(8px) scale(0.99);
	}
}

@keyframes olp-backdrop-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes olp-backdrop-out {
	to {
		opacity: 0;
	}
}

@media (min-width: 40rem) {
	.olp-skeleton-card {
		grid-column: span 4;
	}
}

@media (max-width: 39.99rem) {
	.olp-app {
		padding-block-end: max(1.35rem, env(safe-area-inset-bottom));
		padding-block-start: max(1.35rem, env(safe-area-inset-top));
		padding-inline-end: max(1rem, env(safe-area-inset-right));
		padding-inline-start: max(1rem, env(safe-area-inset-left));
	}

	.olp-memory-form .olp-actions {
		backdrop-filter: blur(16px);
		background: rgb(62 9 23 / 90%);
		border-block-start: 1px solid var(--olp-color-border);
		bottom: 0;
		margin-block-end: calc(-1 * max(1.35rem, env(safe-area-inset-bottom)));
		margin-inline: -1rem;
		padding:
			0.75rem
			max(1rem, env(safe-area-inset-right))
			max(0.75rem, env(safe-area-inset-bottom))
			max(1rem, env(safe-area-inset-left));
		position: sticky;
		z-index: 5;
	}

	.olp-memory-form .olp-actions .olp-button {
		inline-size: 100%;
	}

	.olp-memory-detail__skeleton-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	::view-transition-old(root),
	::view-transition-new(root),
	.olp-image--loaded,
	.olp-skeleton,
	.olp-lightbox[open],
	.olp-lightbox[open]::backdrop,
	.olp-lightbox.is-closing,
	.olp-lightbox.is-closing::backdrop {
		animation: none;
		transition: none;
	}
}
