/**
 * Stili CPT (realizzazioni / showcase / gallery).
 * Separati da style.css perché specifici del contenuto custom, non del layout AGID base.
 */

/* —— Single / gallery —— */
.realizzazione-panel .page-section__title {
	color: #fff;
	margin-bottom: 0.75rem;
	font-size: clamp(1.25rem, 2vw, 1.625rem);
	padding-bottom: 0.3rem;
}

.realizzazione-panel .page-section__title-line {
	width: clamp(16rem, 48vw, 32rem);
	max-width: none;
	height: 4px;
	background: linear-gradient(
		90deg,
		#fff 0%,
		#fff 28%,
		rgba(255, 255, 255, 0.45) 58%,
		transparent 100%
	);
	transform-origin: left center;
}

.realizzazione-panel .article-body,
.realizzazione-panel .article-body p,
.realizzazione-panel .article-body li,
.realizzazione-panel .article-body a {
	color: #fff;
}

.realizzazione-panel .article-body a:hover,
.realizzazione-panel .article-body a:focus-visible {
	color: #fff;
	text-decoration: underline;
}

.realizzazione-panel__block + .realizzazione-panel__block {
	margin-top: 2.25rem;
}

.realizzazione-gallery {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.realizzazione-gallery__item {
	margin: 0;
	overflow: hidden;
	border-radius: 16px;
	aspect-ratio: 4 / 3;
	background-color: color-mix(in srgb, var(--bs-primary) 12%, #fff);
}

.realizzazione-gallery__trigger {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
}

.realizzazione-gallery__trigger:focus-visible {
	outline: 2px solid var(--bs-primary);
	outline-offset: 2px;
}

.realizzazione-gallery__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s cubic-bezier(0.33, 0, 0.2, 1);
}

.realizzazione-gallery__trigger:hover img,
.realizzazione-gallery__trigger:focus-visible img {
	transform: scale(1.04);
}

.gallery-lightbox .modal-content {
	box-shadow: none;
}

.gallery-lightbox .modal-header {
	padding: 0.5rem 0.5rem 0.75rem;
}

.gallery-lightbox .carousel-inner {
	position: relative;
	overflow: hidden;
	width: 100%;
}

.gallery-lightbox .carousel-item {
	display: none;
	float: none;
	margin-right: 0;
	text-align: center;
	background: transparent;
}

.gallery-lightbox .carousel-item.active,
.gallery-lightbox .carousel-item-next,
.gallery-lightbox .carousel-item-prev {
	display: block;
}

.gallery-lightbox__image {
	max-height: min(80vh, 900px);
	width: auto;
	max-width: 100%;
	margin: 0 auto;
	object-fit: contain;
	border-radius: 8px;
}

.gallery-lightbox .carousel-control-prev,
.gallery-lightbox .carousel-control-next {
	width: 3.5rem;
}

@media (prefers-reduced-motion: reduce) {
	.realizzazione-gallery__item img {
		transition: none;
	}
}

@media (max-width: 991.98px) {
	.page-section--realizzazione .page-contacts__info {
		margin-left: 0;
		padding-left: 1.25rem;
	}

	.realizzazione-single .realizzazione-panel {
		margin-left: -0.8rem;
		margin-right: -0.8rem;
	}
}

/* —— Titoli CPT uppercase —— */
.hero--cpt .hero-banner__title,
.cpt-showcase .page-section__title-text,
.cpt-showcase .news-card__title,
.cpt-archive .news-card__title,
.cpt-article .news-latest .news-card__title {
	text-transform: uppercase;
}

/* —— Homepage showcase —— */
.cpt-showcase.page-section--primary {
	padding-top: 100px;
	padding-bottom: 100px;
}

.cpt-showcase__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	flex-wrap: wrap;
	margin-bottom: 2rem;
}

.cpt-showcase__header .page-section__title {
	margin-bottom: 0;
}

.cpt-showcase__cta {
	flex-shrink: 0;
	margin-left: auto;
}

.cpt-showcase__footer {
	display: flex;
	justify-content: center;
	margin-top: 2rem;
}

.cpt-showcase__footer .cpt-showcase__cta {
	margin-left: 0;
}

.cpt-showcase__tabs {
	margin-bottom: 2rem;
	border-bottom-color: transparent;
	background: transparent;
}

.cpt-showcase__tabs .nav-link {
	background: transparent;
	border-color: transparent;
	color: #fff;
}

.cpt-showcase__tabs .nav-link:hover,
.cpt-showcase__tabs .nav-link:focus-visible {
	background: transparent;
	border-color: transparent transparent #fff;
	color: #fff;
}

.cpt-showcase__tabs .nav-link.active {
	background: transparent;
	border-color: transparent transparent #fff;
	color: #fff;
}

.cpt-showcase .news-card {
	background-color: var(--bs-secondary);
	color: #fff;
}

.cpt-showcase .news-card:focus-within {
	box-shadow: inset 0 0 0 3px #fff;
}

.cpt-showcase .news-card__date,
.cpt-showcase .news-card__title,
.cpt-showcase .news-card__cats,
.cpt-showcase .news-card__cats a {
	color: #fff;
}

.cpt-showcase .news-card__cats a:hover,
.cpt-showcase .news-card__cats a:focus-visible {
	color: #fff;
	text-decoration-color: currentColor;
}

.cpt-showcase .news-card__body {
	background-color: var(--bs-secondary);
}

.cpt-showcase .news-card__media {
	background-color: rgba(0, 0, 0, 0.12);
}

@media (max-width: 991.98px) {
	.hero--cpt .hero-banner--custom--no-media .hero-banner--custom__text {
		width: 100%;
		flex: 1 1 100%;
		max-width: none;
	}

	.cpt-showcase.page-section--primary {
		padding-top: 3rem;
		padding-bottom: 3rem;
	}

	.cpt-showcase__header {
		margin-bottom: 1.5rem;
		gap: 0.75rem 1rem;
	}

	.cpt-showcase__tabs {
		margin-bottom: 1.5rem;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}

	.cpt-showcase__tabs .nav-item {
		flex: 0 0 auto;
	}

	.cpt-showcase .tab-pane .row > [class*="col-"]:nth-child(n + 5) {
		display: none;
	}

	.cpt-archive {
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}

	.sidebar-wrapper.cpt-taxonomy-nav {
		border-right: none;
	}

	.cpt-taxonomy-nav .sidebar-linklist-wrapper .link-list-wrapper .link-list {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
		padding-bottom: 0;
		margin-bottom: 0;
	}

	.cpt-taxonomy-nav .link-list > li {
		flex: 0 1 auto;
		max-width: 100%;
	}

	.cpt-taxonomy-nav .sidebar-linklist-wrapper .link-list-wrapper ul li a.list-item {
		display: block;
		padding: 0.5rem 1rem;
		line-height: 1.4;
		border: 1px solid color-mix(in srgb, var(--bs-primary) 30%, transparent);
		border-radius: 1.25rem;
		white-space: normal;
		max-width: 100%;
	}

	.cpt-taxonomy-nav .sidebar-linklist-wrapper .link-list-wrapper ul li a.list-item:hover {
		border-color: var(--bs-primary);
	}

	.cpt-taxonomy-nav .sidebar-linklist-wrapper .link-list-wrapper ul li a.active::after {
		content: none;
	}

	.cpt-taxonomy-nav .sidebar-linklist-wrapper .link-list-wrapper ul li a.list-item.active {
		background-color: var(--bs-primary);
		border-color: var(--bs-primary);
	}

	.cpt-taxonomy-nav .sidebar-linklist-wrapper .link-list-wrapper ul li a.list-item.active span {
		color: #fff;
	}
}
