/* CC Astrophotos — library of a member: grid, viewer, form and "add" button. */

.cc-astrophotos-library__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}

.cc-astrophotos-library__header p {
	flex: 1 1 280px;
	margin: 0;
}

.cc-astrophotos-library__notice:empty {
	display: none;
}

.cc-astrophotos-banner--error {
	background: #fadcdc;
	border-left-color: #b32d2e;
}

.cc-astrophotos-library__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
}

.cc-astrophotos-library__filters[hidden] {
	display: none;
}

.cc-astrophotos-filter {
	padding: 4px 14px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	color: #1d2327;
	cursor: pointer;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 16px;
}

.cc-astrophotos-filter:hover {
	border-color: #1d4f91;
}

.cc-astrophotos-filter.is-active {
	color: #fff;
	background: #1d4f91;
	border-color: #1d4f91;
}

.cc-astrophotos-filter:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.cc-astrophotos-library__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cc-astrophotos-card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	overflow: hidden;
	color: #1d2327;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}

.cc-astrophotos-card__view {
	display: block;
	width: 100%;
	padding: 0;
	cursor: zoom-in;
	background: #101418;
	border: 0;
}

.cc-astrophotos-card__view[disabled] {
	cursor: default;
}

.cc-astrophotos-card__image {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.cc-astrophotos-card__image--missing {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	color: #c3c4c7;
}

.cc-astrophotos-card__badges {
	position: absolute;
	top: 8px;
	left: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-width: calc(100% - 16px);
	pointer-events: none;
}

.cc-astrophotos-badge {
	padding: 2px 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: #1d2327;
	background: #fcf0d4;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.cc-astrophotos-badge--draft {
	color: #fff;
	background: #b45309;
}

.cc-astrophotos-badge--rejected {
	background: #fadcdc;
}

.cc-astrophotos-badge--private {
	color: #fff;
	background: #50575e;
}

.cc-astrophotos-badge--sky {
	color: #fff;
	background: #1d4f91;
}

.cc-astrophotos-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 4px;
	padding: 10px 12px 12px;
	font-size: 14px;
}

.cc-astrophotos-card__title {
	overflow-wrap: anywhere;
}

.cc-astrophotos-card__meta,
.cc-astrophotos-card__reason {
	font-size: 13px;
	color: #50575e;
}

.cc-astrophotos-card__reason {
	color: #8a2424;
}

.cc-astrophotos-card__link {
	font-size: 13px;
}

.cc-astrophotos-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
}

.cc-astrophotos-card__actions .cc-astrophotos-button {
	padding: 4px 12px;
	font-size: 13px;
}

.cc-astrophotos-button--danger {
	color: #b32d2e;
	border-color: #b32d2e;
}

.cc-astrophotos-card__view:focus-visible,
.cc-astrophotos-viewer__close:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Viewer */

.cc-astrophotos-viewer {
	max-width: min(96vw, 1600px);
	max-height: 96vh;
	padding: 0;
	overflow: hidden;
	color: #f0f0f1;
	background: #101418;
	border: 0;
	border-radius: 6px;
}

.cc-astrophotos-viewer::backdrop {
	background: rgba(0, 0, 0, 0.85);
}

/* The block that goes full screen: buttons, picture and status, not the caption. */
.cc-astrophotos-viewer__screen {
	position: relative;
	background: #000;
}

/* Not positioned: the buttons, which are, stay above the zoomed picture. */
.cc-astrophotos-viewer__stage {
	overflow: hidden;
}

.cc-astrophotos-viewer img {
	display: block;
	max-width: 100%;
	max-height: calc(96vh - 56px);
	margin: 0 auto;
	object-fit: contain;
}

.cc-astrophotos-viewer__caption {
	margin: 0;
	padding: 10px 48px 10px 16px;
	font-size: 14px;
}

.cc-astrophotos-viewer__close,
.cc-astrophotos-viewer__expand {
	position: absolute;
	z-index: 1;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 24px;
	line-height: 1;
	color: #fff;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.6);
	border: 0;
	border-radius: 50%;
}

.cc-astrophotos-viewer__close:hover,
.cc-astrophotos-viewer__expand:hover {
	background: rgba(0, 0, 0, 0.85);
}

/* Next to the close button. */
.cc-astrophotos-viewer__expand {
	right: 52px;
}

.cc-astrophotos-viewer__expand:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* "Chargement de la haute définition…" while the original arrives. */
.cc-astrophotos-viewer__status {
	position: absolute;
	z-index: 1;
	bottom: 16px;
	left: 50%;
	margin: 0;
	padding: 4px 12px;
	font-size: 13px;
	color: #fff;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 6px;
	transform: translateX(-50%);
}

.cc-astrophotos-viewer__status:empty {
	display: none;
}

/* Full screen: the picture alone, edge to edge, letterboxed. The screen
   block is native fullscreen when the browser allows it (its own size then);
   otherwise the dialog fills the viewport. */
.cc-astrophotos-viewer--full {
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	max-height: 100vh;
	background: #000;
	border-radius: 0;
}

.cc-astrophotos-viewer--full .cc-astrophotos-viewer__screen,
.cc-astrophotos-viewer--full .cc-astrophotos-viewer__stage {
	height: 100%;
}

.cc-astrophotos-viewer--full img {
	width: 100%;
	height: 100%;
	max-height: 100%;
}

.cc-astrophotos-viewer--full .cc-astrophotos-viewer__caption {
	display: none;
}

/* Form */

.cc-astrophotos-dialog--library {
	width: min(94vw, 760px);
}

.cc-astrophotos-form--library {
	display: block;
}

.cc-astrophotos-form--library .cc-astrophotos-form__image {
	display: block;
	max-width: 240px;
	margin: 0 0 12px;
}

.cc-astrophotos-form__hint {
	display: block;
	margin: 4px 0 0;
	font-size: 13px;
	color: #50575e;
}

.cc-astrophotos-form__sky {
	margin: 16px 0 0;
	padding: 12px 16px 16px;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.cc-astrophotos-form__sky legend {
	padding: 0 6px;
	font-weight: 600;
}

.cc-astrophotos-form__object {
	position: relative;
}

.cc-astrophotos-objects {
	position: absolute;
	right: 0;
	left: 0;
	z-index: 3;
	max-height: 240px;
	margin: 0;
	padding: 4px 0;
	overflow-y: auto;
	list-style: none;
	color: #1d2327;
	background: #fff;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cc-astrophotos-objects li {
	margin: 0;
	padding: 6px 12px;
	cursor: pointer;
}

.cc-astrophotos-objects li:hover {
	background: #f0f6fc;
}

.cc-astrophotos-form__coordinates {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
}

.cc-astrophotos-form__coordinates .cc-astrophotos-form__field {
	flex: 1 1 140px;
	margin: 0;
}

.cc-astrophotos-form__private {
	margin: 16px 0 0;
}

.cc-astrophotos-form__private input {
	margin-right: 8px;
}

.cc-astrophotos-form__private label {
	font-weight: 600;
}

/* "Add" button away from the library */

.cc-astrophotos-add {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 16px;
	margin: 0 0 20px;
}

.cc-astrophotos-add__notice:empty {
	display: none;
}

.cc-astrophotos-add__notice {
	font-weight: 600;
	color: #007017;
}
