/**
 * APSP page content inside Design Comuni templates.
 */

/* Hero + body share one col-lg-10 column (see comuni-page.php) */
.apsp-comuni-page-column .cmp-hero {
	margin-bottom: 0;
}

.apsp-comuni-page-column .apsp-comuni-page {
	margin-top: 0;
}

/* Bootstrap .variable-gutters uses negative side margins; keep content aligned in narrow column */
.apsp-comuni-page-column .apsp-comuni-page__body-row.variable-gutters,
.apsp-comuni-page-column .apsp-at-page-row.variable-gutters {
	margin-left: 0;
	margin-right: 0;
}

.apsp-comuni-page-column .apsp-comuni-page__body-row > [class*='col-'] {
	padding-left: 0;
	padding-right: 0;
}

/* Breathing room before site footer (all pages, including homepage) */
body.wp-theme-design-comuni-wordpress-theme main {
	padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

main .article-wrapper,
main .apsp-homepage-article {
	padding-bottom: clamp(1.25rem, 3vw, 2rem);
}

footer.it-footer {
	margin-top: 0;
}

/* Readable typography in article body */
.apsp-comuni-page .entry-content,
.apsp-comuni-page .page-content-wrapper {
	color: #262626;
	font-size: 1rem;
	line-height: 1.6;
	max-width: 52rem;
}

/* Albo pretorio: tabella dati a tutta larghezza colonna (non limite tipografico 52rem) */
body.apsp-albo-page .apsp-comuni-page .entry-content,
body.apsp-albo-page .apsp-comuni-page .page-content-wrapper {
	max-width: none;
	width: 100%;
}

/* Pagine indice (News, Album, …): testo + griglia usano tutta la col-lg-10 */
body.apsp-section-hub .apsp-comuni-page .entry-content,
body.apsp-section-hub .apsp-comuni-page .page-content-wrapper,
.apsp-comuni-page .entry-content:has(.apsp-section-index),
.apsp-comuni-page .page-content-wrapper:has(.apsp-section-index) {
	max-width: none;
	width: 100%;
}

.apsp-comuni-page .entry-content > h2:first-child,
.apsp-comuni-page .entry-content > h3 {
	margin-top: 0;
}

.apsp-comuni-page .entry-content a {
	color: #0066cc;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.apsp-comuni-page .entry-content a:hover {
	color: #004d99;
}

/* Documenti — Bootstrap Italia cmp-icon-link (AGID) */
.apsp-comuni-page .cmp-icon-link-list.apsp-documents {
	margin: 1rem 0 1.5rem;
}

.apsp-comuni-page .cmp-icon-link-list.apsp-documents .cmp-icon-link + .cmp-icon-link {
	margin-top: 0.5rem;
}

.apsp-comuni-page .cmp-icon-link-list.apsp-documents .list-item.icon-left {
	display: block;
	padding: 0.875rem 1rem;
	border: 1px solid #e6e6e6;
	border-radius: 4px;
	background: #fff;
	text-decoration: none;
	font-weight: 600;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apsp-comuni-page .cmp-icon-link-list.apsp-documents .list-item.icon-left:hover {
	border-color: #0066cc;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	color: #0066cc;
	text-decoration: none;
}

.apsp-comuni-page .cmp-icon-link-list.apsp-documents .list-item-title-icon-wrapper {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.apsp-comuni-page .cmp-icon-link-list.apsp-documents .icon {
	width: 1.5rem;
	height: 1.5rem;
	flex-shrink: 0;
}

.apsp-comuni-page .cmp-icon-link-list.apsp-documents .list-item .list-item.t-primary {
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-weight: 600;
	line-height: 1.4;
}

/* Section hub cards: whole card is one link; do not inherit body link underline */
.apsp-comuni-page .entry-content a.apsp-section-card__link,
.apsp-comuni-page .entry-content a.apsp-section-card__link:hover,
.apsp-comuni-page .entry-content a.apsp-section-card__link:focus {
	text-decoration: none;
	font-weight: inherit;
	color: inherit;
}

.apsp-comuni-page .entry-content .apsp-section-card__title {
	color: #003366;
	font-weight: 600;
}

.apsp-comuni-page .entry-content .apsp-section-card__excerpt {
	color: #5c6f82;
	font-weight: 400;
}

body.apsp-albo-page .apsp-comuni-page .entry-content .apsp-section-card__title {
	color: #003366;
}

body.apsp-albo-page .apsp-comuni-page .entry-content .apsp-section-card__excerpt {
	color: #5c6f82;
}

/* Chi siamo — list / card sections (Avio migrated markup) */
.in-evidenza-list,
.documenti-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin: 1.5rem 0 0;
	padding: 0;
}

.in-evidenza-item,
.documento-item {
	padding: 0 0 1.5rem;
	border-bottom: 1px solid #e6e6e6;
}

.in-evidenza-item:last-child,
.documento-item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.in-evidenza-item h3,
.documento-item h3 {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	line-height: 1.35;
}

.in-evidenza-item h3 a,
.documento-item h3 a {
	text-decoration: none;
}

.in-evidenza-item h3 a:hover,
.documento-item h3 a:hover {
	text-decoration: underline;
}

.in-evidenza-item p,
.documento-item p {
	margin: 0;
}

.struttura-sections {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	margin-top: 1.5rem;
}

.struttura-item {
	display: grid;
	grid-template-columns: minmax(140px, 220px) 1fr;
	gap: 1.25rem 1.5rem;
	align-items: start;
	padding-bottom: 2rem;
	border-bottom: 1px solid #e6e6e6;
}

.struttura-item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.struttura-image img,
.struttura-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.struttura-content h3 {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
}

.struttura-content h3 a {
	text-decoration: none;
}

.struttura-content h3 a:hover {
	text-decoration: underline;
}

.struttura-content p {
	margin: 0;
}

@media (max-width: 767.98px) {
	.struttura-item {
		grid-template-columns: 1fr;
	}
}
