/*--------------------------------------------------
---- Raccolte / Ricerche: archivio -----------------
--------------------------------------------------*/

#inner-wrapper:has(.collection),
#inner-wrapper:has(.saved-search) {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-top: 1.5rem;
}

#inner-wrapper:has(.collection)::after,
#inner-wrapper:has(.saved-search)::after {
	content: "";
	grid-column: 1 / -1;
	height: 0.175rem;
}


/*--------------------------------------------------
---- Raccolte / Ricerche: card ---------------------
--------------------------------------------------*/

.collection,
.saved-search {
	background-color: #ffffff;
	border-radius: 1rem;
	display: grid;
	grid-template-areas:
		"title"
		"body";
	padding: 1rem;
	text-align: left;
}

.collection {
	box-shadow:
		0 -4px 0 var(--anad-color-success),
		0 2px 4px rgba(0, 0, 0, 0.04),
		0 8px 16px rgba(0, 0, 0, 0.06);
}

.saved-search {
	box-shadow:
		0 -4px 0 var(--anad-color-searches),
		0 2px 4px rgba(0, 0, 0, 0.04),
		0 8px 16px rgba(0, 0, 0, 0.06);
}

.collection h3,
.saved-search h3 {
	grid-area: title;
	line-height: 1;
	margin-bottom: calc(0.75rem - 0.125rem);
	margin-top: 0;
	min-width: 0;
}

.collection h3 a,
.saved-search h3 a {
	color: var(--anad-color-primary);
	display: block;
	font-family: var(--anad-font-body);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1;
	overflow: hidden;
	padding-bottom: 0.125rem;
	text-decoration: none;
	text-overflow: ellipsis;
	transition: color var(--anad-transition-fast);
	white-space: nowrap;
}

.collection h3 a:focus,
.collection h3 a:hover {
	color: var(--anad-color-success);
}

.saved-search h3 a:focus,
.saved-search h3 a:hover {
	color: var(--anad-color-searches);
}

.collection h3 a:active,
.saved-search h3 a:active {
	color: var(--anad-color-primary);
	transition: none;
}


/*--------------------------------------------------
---- Raccolte / Ricerche: dettagli -----------------
--------------------------------------------------*/

.library-card-contents {
	grid-area: body;
}

.library-card-contents summary {
	display: none;
}

.library-card-wrapper {
	display: grid;
	grid-template-areas:
		"meta preview"
		"actions actions";
	grid-template-columns: minmax(0, 1fr) auto;
}


/*--------------------------------------------------
---- Raccolte / Ricerche: stato --------------------
--------------------------------------------------*/

.status {
	align-self: start;
	display: grid;
	gap: 0.25rem 0.5rem;
	grid-area: meta;
	grid-template-columns: 1rem minmax(0, auto);
	justify-content: start;
	margin: 0;
}

.status dt {
	align-items: center;
	display: flex;
	font-size: 0;
	height: var(--anad-line-height-xs);
	justify-content: center;
	line-height: 1;
	margin: 0;
	width: 1rem;
}

.status dt::before {
	color: rgba(24, 31, 73, 0.4);
	display: block;
	font-family: dashicons;
	font-size: 1rem;
	line-height: 1;
	transform: translateY(1px);
}

.collection dt.date-created::before {
	content: "\f480";
}

.collection dt.date-modified::before {
	content: "\f113";
}

.saved-search dt.date-created::before {
	content: "\f179";
}

.saved-search dt.date-checked::before {
	content: "\f463";
}

.status dt.content-qty:not(.screen-reader-text),
.status dd.content-qty:not(.screen-reader-text),
.status dt.content-status:not(.screen-reader-text),
.status dd.content-status:not(.screen-reader-text) {
	display: none;
}

.status dd {
	font-size: var(--anad-font-size-xs);
	line-height: var(--anad-line-height-xs);
	margin: 0;
	min-width: 0;
}


/*--------------------------------------------------
---- Raccolte / Ricerche: anteprime ----------------
--------------------------------------------------*/

.preview {
	align-items: center;
	align-self: center;
	display: flex;
	grid-area: preview;
	justify-self: start;
	list-style: none;
	margin: 0 0 0 0.75rem;
	padding: 0;
}

.preview-image {
	flex-shrink: 0;
	margin-left: -1rem;
	position: relative;
}

.preview-image:first-child {
	margin-left: 0;
}

.preview-image img,
.preview-placeholder,
.preview-badge {
	border: 2px solid #ffffff;
	border-radius: 50%;
	box-sizing: border-box;
	display: block;
	height: 2.25rem;
	width: 2.25rem;
}

.preview-image img,
.preview-placeholder {
	background-color: #ffffff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
	object-fit: cover;
}

.preview-badge {
	align-items: center;
	background-color: #9ca3af;
	color: #ffffff;
	display: inline-flex;
	flex-shrink: 0;
	font-size: var(--anad-font-size-xs);
	font-weight: 700;
	justify-content: center;
	line-height: 1;
	margin-left: -1rem;
	position: relative;
	z-index: 10;
}


/*--------------------------------------------------
---- Ricerche: badge stato -------------------------
--------------------------------------------------*/

.preview-badge-snapshot,
.preview-badge-unchanged {
	background-color: #9ca3af;
}

.preview-badge-added {
	background-color: var(--anad-color-success);
}

.preview-badge-empty {
	background-color: var(--anad-color-secondary);
}

.preview-badge-removed {
	background-color: var(--anad-color-warning);
}


/*--------------------------------------------------
---- Raccolte / Ricerche: azioni -------------------
--------------------------------------------------*/

.collection .button-group,
.saved-search .button-group {
	display: flex;
	gap: 0.5rem;
	grid-area: actions;
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
}

.collection .button-group li,
.saved-search .button-group li {
	line-height: 1;
}

.collection .button-group a,
.collection .button-group button,
.saved-search .button-group a,
.saved-search .button-group button {
	align-items: center;
	background-color: #ffffff;
	border: 0;
	border-radius: 9999px;
	box-shadow: inset 0 0 0 1px rgba(24, 31, 73, 0.12);
	color: var(--anad-color-primary);
	cursor: pointer;
	display: inline-flex;
	font-size: var(--anad-font-size-xs);
	font-weight: 500;
	gap: 0.25rem;
	height: 36px;
	justify-content: center;
	line-height: 1;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	text-decoration: none;
	transition:
		background-color var(--anad-transition-fast),
		box-shadow var(--anad-transition-fast),
		color var(--anad-transition-fast);
}

.collection .button-group a::before,
.collection .button-group button::before,
.saved-search .button-group a::before,
.saved-search .button-group button::before {
	color: inherit;
	display: block;
	font-family: dashicons;
	font-size: 1rem;
	line-height: 1;
}

.collection .button-group .button--icon,
.saved-search .button-group .button--icon {
	font-size: 0;
	padding: 0;
	width: 36px;
}

.collection .button-group .to-collection::before,
.saved-search .button-group .to-search::before {
	content: "\f177";
	font-size: 1rem;
}

.collection .button-group .to-delete::before,
.saved-search .button-group .to-delete::before {
	content: "\f182";
}

.collection .button-group .to-editor::before,
.saved-search .button-group .to-editor::before {
	content: "\f464";
}

.collection .button-group a:focus,
.collection .button-group a:hover,
.collection .button-group button:focus,
.collection .button-group button:hover,
.saved-search .button-group a:focus,
.saved-search .button-group a:hover,
.saved-search .button-group button:focus,
.saved-search .button-group button:hover {
	background-color: rgba(24, 31, 73, 0.08);
	box-shadow: none;
}

.collection .button-group a:active,
.collection .button-group button:active,
.saved-search .button-group a:active,
.saved-search .button-group button:active {
	background-color: var(--anad-color-primary);
	color: #ffffff;
	transition: none;
}

.collection .button-group .to-delete:active,
.saved-search .button-group .to-delete:active {
	background-color: var(--anad-color-secondary);
	color: #ffffff;
}


/*--------------------------------------------------
---- Raccolte / Ricerche: responsive ---------------
--------------------------------------------------*/

@media screen and (max-width: 1200px) {

	#inner-wrapper:has(.collection),
	#inner-wrapper:has(.saved-search) {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

}

@media screen and (max-width: 924px) {

	#inner-wrapper:has(.collection),
	#inner-wrapper:has(.saved-search) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

}

@media screen and (max-width: 630px) {

	#inner-wrapper:has(.collection),
	#inner-wrapper:has(.saved-search) {
		grid-template-columns: 1fr;
	}

	.collection,
	.saved-search {
		position: relative;
	}

	.collection:has(.library-card-contents:not([open])),
	.saved-search:has(.library-card-contents:not([open])) {
		padding-bottom: 0.5rem;
	}

	.library-card-contents summary {
		align-items: center;
		color: var(--anad-color-primary);
		cursor: pointer;
		display: flex;
		font-size: 0;
		height: 2rem;
		justify-content: center;
		line-height: 1;
		position: absolute;
		right: 1rem;
		top: 0.5rem;
		width: 2rem;
		z-index: 2;
	}

	.library-card-contents summary::-webkit-details-marker {
		display: none;
	}

	.library-card-contents summary::before {
		content: "\f347";
		font-family: dashicons;
		font-size: 1rem;
		line-height: 1;
        transform: rotate(90deg);
		transition: transform var(--anad-transition-fast);
	}

	.library-card-contents[open] summary::before {
		transform: rotate(0deg);
	}

}

/* Centratura ottica dell'occhio */
.collection .button-group .to-collection::before,
.saved-search .button-group .to-search::before {
    transform: translateX(2px);
}