/* /share/ and the Guest Photos block. The header overlays the page, so the top is a brand band behind it. */

.sa-share {
	--sa-header: 150px;
	--sa-open: #2f9e5b;
	--sa-open-text: #237a45; /* --sa-open darkened to 4.5:1 for text and white-on-green */
	--sa-closed: #b5432a;
	--sa-line: color-mix(in srgb, var(--theme-palette-color-3) 12%, transparent);
	padding: calc(var(--sa-header) + clamp(2rem, 5vw, 4rem)) 0 clamp(3rem, 6vw, 5rem);
	background: linear-gradient(var(--theme-palette-color-1) var(--sa-header), var(--theme-palette-color-6) var(--sa-header));
	color: var(--theme-palette-color-3);
}

.sa-share .ct-container {
	display: grid;
	gap: clamp(2.5rem, 5vw, 4rem);
}

.sa-share h1,
.sa-share h2,
.sa-share p {
	margin: 0;
}

.sa-share__head {
	display: grid;
	gap: 1rem;
	max-width: 720px;
}

.sa-share__lede {
	color: var(--theme-palette-color-4);
	font-size: 18px;
}

/* Form and steps */

.sa-share__layout {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}

@media (max-width: 899px) {
	.sa-share__layout {
		grid-template-columns: 1fr;
	}
}

.sa-share__form {
	position: relative;
	display: grid;
	gap: 1.25rem;
	margin: 0;
	padding: clamp(1.25rem, 3vw, 2rem);
	border-radius: 8px;
	background: var(--theme-palette-color-7);
}

.sa-share__drop {
	position: relative;
	min-height: 240px;
	border: 2px dashed color-mix(in srgb, var(--theme-palette-color-1) 35%, transparent);
	border-radius: 8px;
	background: color-mix(in srgb, var(--theme-palette-color-1) 4%, var(--theme-palette-color-7));
	transition: border-color 0.15s, background-color 0.15s;
}

.sa-share__drop.is-dragging {
	border-color: var(--theme-palette-color-1);
	background: color-mix(in srgb, var(--theme-palette-color-1) 10%, var(--theme-palette-color-7));
}

.sa-share__drop input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.sa-share__drop-label {
	display: grid;
	gap: 0.4rem;
	place-content: center;
	justify-items: center;
	min-height: 236px;
	padding: 1.5rem;
	color: var(--theme-palette-color-4);
	font-size: 15px;
	text-align: center;
	cursor: pointer;
}

.sa-share__drop-label svg {
	color: var(--theme-palette-color-1);
}

.sa-share__drop-label strong {
	color: var(--theme-palette-color-1);
	font-size: 20px;
}

.sa-share__drop input:focus-visible + .sa-share__drop-label {
	outline: 2px solid var(--theme-palette-color-1);
	outline-offset: -6px;
	border-radius: 8px;
}

.sa-share__drop.has-photo .sa-share__drop-label {
	display: none;
}

.sa-share__preview {
	position: relative;
	display: grid;
	place-items: center;
	padding: 0.75rem;
}

.sa-share__preview[hidden] {
	display: none;
}

.sa-share__preview img {
	max-height: 420px;
	border-radius: 6px;
}

.sa-share__change {
	position: absolute;
	right: 1.25rem;
	bottom: 1.25rem;
	padding: 0.5rem 0.9rem;
	border: 0;
	border-radius: 999px;
	background: rgb(0 0 0 / 0.65);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.sa-share__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

@media (max-width: 600px) {
	.sa-share__fields {
		grid-template-columns: 1fr;
	}
}

.sa-share__field {
	display: grid;
	gap: 0.3rem;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
}

.sa-share__field small {
	color: var(--theme-palette-color-4);
	font-size: 13px;
	font-weight: 400;
}

.sa-share .is-wide {
	grid-column: 1 / -1;
}

.sa-share__field input {
	width: 100%;
	min-height: 48px;
	padding: 0 0.85rem;
	border: 1px solid var(--sa-line);
	border-radius: 6px;
	background: var(--theme-palette-color-7);
	font: inherit;
	font-size: 16px;
	font-weight: 400;
}

.sa-share__consent {
	display: flex;
	gap: 0.65rem;
	align-items: flex-start;
	margin: 0;
	color: var(--theme-palette-color-4);
	font-size: 14px;
	line-height: 1.45;
}

.sa-share__consent input {
	flex: none;
	width: 20px;
	height: 20px;
	margin-top: 1px;
}

.sa-share__trap {
	position: absolute;
	left: -9999px;
}

.sa-share__error {
	padding: 0.75rem 1rem;
	border-radius: 6px;
	background: color-mix(in srgb, var(--sa-closed) 10%, var(--theme-palette-color-7));
	color: var(--sa-closed);
	font-weight: 600;
}

.sa-share__submit {
	justify-self: start;
	min-height: 52px;
	padding-inline: 2rem;
}

.sa-share__done {
	position: absolute;
	inset: 0;
	display: grid;
	gap: 0.75rem;
	place-content: center;
	justify-items: center;
	padding: 2rem;
	border-radius: 8px;
	background: var(--theme-palette-color-7);
	text-align: center;
}

.sa-share__done[hidden] {
	display: none;
}

.sa-share__done svg {
	color: var(--sa-open-text);
}

.sa-share__done p {
	max-width: 40ch;
	color: var(--theme-palette-color-4);
}

.sa-share__link {
	border: 0;
	background: none;
	color: var(--theme-palette-color-1);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.sa-share__steps {
	display: grid;
	gap: 1.25rem;
	padding: 1.5rem;
	border-radius: 8px;
	background: var(--theme-palette-color-1);
	color: var(--theme-palette-color-7);
}

.sa-share__steps ol {
	display: grid;
	gap: 1.1rem;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.sa-share__steps li {
	display: grid;
	grid-template-columns: 2.25rem 1fr;
	column-gap: 0.75rem;
	margin: 0;
	font-size: 15px;
	line-height: 1.45;
	counter-increment: step;
}

.sa-share__steps li::before {
	content: counter(step);
	grid-row: span 2;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--theme-palette-color-5);
	color: var(--theme-palette-color-3);
	font-family: Anton, sans-serif;
	font-size: 18px;
}

.sa-share__steps strong {
	font-size: 17px;
}

.sa-share__steps > p {
	padding-top: 1rem;
	border-top: 1px solid rgb(255 255 255 / 0.2);
	font-size: 14px;
	opacity: 0.85;
}

/* Section heads */

.sa-share__section-head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.sa-share__title {
	display: flex;
	gap: 0.6rem;
	align-items: center;
	font-family: "DM Sans", sans-serif;
	font-size: 22px;
	font-weight: 700;
	text-transform: none;
}

.sa-share__badge {
	display: grid;
	place-items: center;
	min-width: 1.75rem;
	height: 1.75rem;
	padding: 0 0.5rem;
	border-radius: 999px;
	background: var(--theme-palette-color-5);
	color: var(--theme-palette-color-3);
	font-size: 14px;
}

.sa-share__note,
.sa-share__empty {
	color: var(--theme-palette-color-4);
	font-size: 14px;
}

/* Review queue */

.sa-share__review {
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 2px solid var(--theme-palette-color-5);
	border-radius: 8px;
	background: var(--theme-palette-color-7);
	scroll-margin-top: 140px;
}

.sa-share__queue {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sa-share__pending {
	display: grid;
	grid-template-rows: auto 1fr auto;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--sa-line);
	border-radius: 8px;
	transition: opacity 0.25s, transform 0.25s;
}

.sa-share__pending.is-busy {
	opacity: 0.5;
	pointer-events: none;
}

.sa-share__pending.is-approved,
.sa-share__pending.is-rejected {
	opacity: 0;
	transform: scale(0.96);
}

.sa-share__thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: var(--theme-palette-color-6);
	cursor: zoom-in;
}

.sa-share__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.sa-share__meta {
	display: grid;
	gap: 0.2rem;
	align-content: start;
	padding: 0.85rem 1rem 0.5rem;
	font-size: 14px;
}

.sa-share__meta span,
.sa-share__meta time {
	color: var(--theme-palette-color-4);
	font-size: 13px;
	overflow-wrap: anywhere;
}

.sa-share__meta p {
	margin: 0.25rem 0;
}

.sa-share__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	padding: 0.5rem 1rem 1rem;
}

.sa-share__actions button {
	min-height: 42px;
	border: 0;
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.sa-share__approve {
	background: var(--sa-open-text);
	color: #fff;
}

.sa-share__reject {
	background: color-mix(in srgb, var(--sa-closed) 12%, var(--theme-palette-color-7));
	color: var(--sa-closed);
}

.sa-share__actions button:focus-visible,
.sa-gallery__open:focus-visible,
.sa-share__thumb:focus-visible {
	outline: 2px solid var(--theme-palette-color-1);
	outline-offset: 2px;
}

/* Gallery: masonry columns */

.sa-gallery {
	columns: 4 240px;
	column-gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sa-gallery__item {
	margin: 0 0 1rem;
	break-inside: avoid;
}

.sa-gallery__open {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 8px;
	background: var(--theme-palette-color-6);
	cursor: zoom-in;
}

.sa-gallery__open img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--ratio, 1.5);
	object-fit: cover;
	transition: transform 0.4s ease;
}

.sa-gallery__open:hover img {
	transform: scale(1.04);
}

.sa-gallery__credit {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 2rem 0.85rem 0.7rem;
	background: linear-gradient(transparent, rgb(0 0 0 / 0.6));
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-align: left;
}

.sa-gallery__more {
	display: flex;
	justify-content: center;
	margin-top: 1.5rem;
}

/* Lightbox */

.sa-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: rgb(10 18 26 / 0.92);
	width: 100%!important;
	max-width: 100%;
}

.sa-lightbox[hidden] {
	display: none;
}

body.sa-lightbox-open {
	overflow: hidden;
}

.sa-lightbox__dialog {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 0.75rem;
	align-items: center;
	width: min(1200px, 100%);
	max-height: 100%;
}

.sa-lightbox figure {
	display: grid;
	gap: 0.75rem;
	justify-items: center;
	margin: 0;
}

.sa-lightbox img {
	max-width: 100%;
	max-height: calc(100vh - 8rem);
	border-radius: 6px;
}

.sa-lightbox figcaption {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	color: #fff;
	font-size: 16px;
	text-align: center;
}

.sa-lightbox__close,
.sa-lightbox__nav {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.12);
	color: #fff;
	cursor: pointer;
}

.sa-lightbox__close:hover,
.sa-lightbox__nav:hover {
	background: rgb(255 255 255 / 0.22);
}

.sa-lightbox__close {
	position: fixed;
	top: 1rem;
	right: 1rem;
}

.sa-lightbox__nav[hidden] {
	visibility: hidden;
	display: grid;
}

.sa-lightbox__remove {
	position: fixed;
	bottom: 1rem;
	right: 1rem;
	padding: 0.6rem 1rem;
	border: 0;
	border-radius: 999px;
	background: var(--sa-closed, #b5432a);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

@media (max-width: 600px) {
	.sa-lightbox__dialog {
		grid-template-columns: 1fr;
	}

	.sa-lightbox__nav {
		display: none;
	}
}

/* Toast */

.sa-share__toast {
	position: fixed;
	bottom: 1.25rem;
	left: 50%;
	z-index: 10002;
	padding: 0.6rem 1.1rem;
	border-radius: 999px;
	background: var(--theme-palette-color-3);
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	opacity: 0;
	transform: translate(-50%, 1rem);
	transition: opacity 0.2s, transform 0.2s;
	pointer-events: none;
}

.sa-share__toast.is-shown {
	opacity: 1;
	transform: translate(-50%, 0);
}

.sa-share__toast.is-error {
	background: #b5432a;
}

/* Guest Photos block */

.sa-guest-photos {
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.sa-guest-photos__head {
	display: flex;
	gap: 1.5rem;
	align-items: flex-end;
	justify-content: space-between;
	margin-bottom: 2rem;
}

.sa-guest-photos__intro {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.sa-guest-photos__intro h2 {
	margin: 0;
}

@media (max-width: 899px) {
	.sa-guest-photos > .ct-container {
		display: flex;
		flex-direction: column;
		gap: 2rem;
	}

	.sa-guest-photos__head {
		display: contents;
	}

	.sa-guest-photos__intro {
		order: 1;
	}

	.sa-guest-photos .sa-gallery,
	.sa-guest-photos .sa-share__empty {
		order: 2;
	}

	.sa-guest-photos__head > .ct-button {
		order: 3;
		align-self: flex-start;
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sa-gallery__open img,
	.sa-share__pending {
		transition: none;
	}
}
