/* Striders Photos: albums, photo grid, full-size view and upload page.
   Colors and fonts come from the theme. */

/* Album list and photo grid */
.sp-albums,
.sp-grid,
.sp-recent {
	list-style: none;
	margin: 1em 0;
	padding: 0;
	display: grid;
	gap: 1rem;
}

.sp-albums {
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.sp-grid {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.sp-recent {
	grid-template-columns: repeat(2, 1fr);
	gap: 0.5rem;
}

.sp-album a {
	display: block;
	text-decoration: none;
	color: inherit;
}

.sp-album img,
.sp-photo img,
.sp-recent img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 4px;
	background: color-mix(in srgb, currentColor 8%, transparent);
}

.sp-album img {
	aspect-ratio: 4 / 3;
}

.sp-album a:hover img,
.sp-photo a:hover img,
.sp-recent a:hover img {
	opacity: 0.85;
}

.sp-album-name {
	display: block;
	font-weight: 600;
	margin-top: 0.4em;
}

.sp-album a:hover .sp-album-name {
	text-decoration: underline;
}

.sp-album-count,
.sp-title {
	display: block;
	font-size: 0.85em;
	opacity: 0.75;
}

.sp-title {
	margin-top: 0.3em;
	line-height: 1.3;
}

.sp-back,
.sp-more-photos {
	font-size: 0.9em;
}

.sp-album-title {
	margin-top: 0.25em;
}

.sp-upload-link {
	margin: 0.5em 0 1em;
}

/* Full-size view */
.sp-lb-open {
	overflow: hidden;
}

.sp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
}

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

.sp-lightbox figure {
	margin: 0;
	max-width: calc(100vw - 7rem);
	max-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.sp-lightbox img {
	max-width: 100%;
	max-height: calc(100vh - 5rem);
	object-fit: contain;
}

.sp-lightbox figcaption {
	color: #fff;
	padding: 0.6em 0;
	text-align: center;
}

.sp-lb-count {
	opacity: 0.6;
	font-size: 0.85em;
	margin-left: 0.5em;
}

.sp-lightbox button {
	background: none;
	border: 0;
	color: #fff;
	font-size: 3rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.5rem 1rem;
	opacity: 0.8;
}

.sp-lightbox button:hover,
.sp-lightbox button:focus-visible {
	opacity: 1;
}

.sp-lb-close {
	position: absolute;
	top: 0.25rem;
	right: 0.25rem;
}

.sp-lightbox.is-single .sp-lb-prev,
.sp-lightbox.is-single .sp-lb-next {
	visibility: hidden;
}

@media (max-width: 600px) {
	.sp-lightbox figure {
		max-width: 100vw;
	}

	.sp-lb-prev,
	.sp-lb-next {
		position: absolute;
		bottom: 0;
	}

	.sp-lb-prev {
		left: 0;
	}

	.sp-lb-next {
		right: 0;
	}

	.sp-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.5rem;
	}

	.sp-albums {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Upload page */
.sp-upload h2 {
	margin-top: 1.5em;
}

.sp-upload select,
.sp-upload input[type="text"] {
	box-sizing: border-box;
	font: inherit;
	padding: 0.4em 0.5em;
	max-width: 100%;
	min-width: min(22em, 100%);
	border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
	border-radius: 4px;
	background: #fff;
	color: inherit;
}

.sp-new-album {
	display: block;
	margin-top: 0.6em;
}

.sp-new-album[hidden] {
	display: none;
}

.sp-field {
	margin: 1.25em 0;
}

.sp-drop {
	display: flex;
	align-items: center;
	gap: 1em;
	flex-wrap: wrap;
	margin-top: 0.5em;
	padding: 1.25em;
	border: 2px dashed color-mix(in srgb, currentColor 30%, transparent);
	border-radius: 6px;
	cursor: pointer;
}

.sp-drop.is-over {
	border-color: currentColor;
	background: color-mix(in srgb, currentColor 6%, transparent);
}

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

.sp-drop:focus-within .wp-element-button {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.sp-hint {
	font-size: 0.9em;
	opacity: 0.8;
}

.sp-queue,
.sp-edit-list {
	list-style: none;
	margin: 0.5em 0;
	padding: 0;
}

.sp-item,
.sp-edit-list li {
	display: flex;
	align-items: center;
	gap: 1em;
	padding: 0.6em 0;
	border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

.sp-thumb {
	flex: 0 0 80px;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75em;
	text-align: center;
	background: color-mix(in srgb, currentColor 8%, transparent);
	border-radius: 4px;
	overflow: hidden;
}

.sp-thumb img,
.sp-edit-list img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 4px;
	flex: 0 0 80px;
}

.sp-item-fields,
.sp-edit-fields {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	min-width: 0;
}

.sp-item-fields input[type="text"] {
	width: 100%;
	min-width: 0;
}

.sp-edit-fields {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.6em 1.2em;
}

.sp-edit-fields input[type="text"],
.sp-edit-fields select {
	min-width: min(16em, 100%);
}

.sp-status {
	font-size: 0.9em;
}

.sp-item.is-sending .sp-status {
	font-style: italic;
}

.sp-item.is-done .sp-status {
	color: #2f7d32;
	font-weight: 600;
}

.sp-item.is-failed .sp-status,
.sp-message.is-error {
	color: #c00;
}

.sp-remove {
	font: inherit;
	font-size: 0.85em;
	background: none;
	border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
	border-radius: 4px;
	padding: 0.3em 0.6em;
	cursor: pointer;
	color: inherit;
}

.sp-remove[hidden] {
	display: none;
}

.sp-submit[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.sp-delete {
	color: #c00;
}

.sp-notice {
	padding: 0.5em 0.8em;
	border-left: 4px solid #2f7d32;
	background: color-mix(in srgb, #2f7d32 8%, transparent);
}

.sp-edit {
	margin-top: 2.5em;
	padding-top: 0.5em;
	border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.sp-edit-pick select {
	margin-left: 0.5em;
}

@media (max-width: 600px) {
	.sp-item {
		flex-wrap: wrap;
	}

	.sp-item-fields {
		flex-basis: calc(100% - 100px);
	}
}

/* Edit photos: move all, new album (1.0.1) */
.sp-move-all {
	margin: 1em 0 0.5em;
}

.sp-move-all select {
	margin: 0.25em 0;
}

.sp-edit-new-album {
	margin: 1em 0;
	padding: 0.75em 1em;
	border-left: 4px solid currentColor;
	background: color-mix(in srgb, currentColor 5%, transparent);
}

.sp-edit-new-album[hidden] {
	display: none;
}

.sp-edit-new-album.is-error input {
	border-color: #c00;
	outline: 2px solid #c00;
}

.sp-notice.is-error {
	border-left-color: #c00;
	background: color-mix(in srgb, #c00 8%, transparent);
}
