/* Locality and locality/category pages only. Keep the global portal shell intact. */
.portal-locality-page {
    --locality-ink: #003c70;
    --locality-copy: #374f60;
    --locality-muted: #526b7d;
    --locality-line: #dce6ed;
    --locality-soft: #f3f8fb;
    --locality-accent: #fa7636;
    min-width: 0;
    color: var(--locality-copy);
}

.portal-locality-page [hidden] { display: none !important; }
.portal-locality-page .locality-page-navigation:empty { display: none; }
.portal-locality-page .customer-grid::before,
.portal-locality-page .customer-grid::after,
.portal-locality-page .locality-place-grid::before,
.portal-locality-page .locality-place-grid::after { display: none; }
.portal-locality-page .locality-card-action { display: block; margin-top: 14px; color: var(--locality-ink); font-size: 14px; font-weight: 600; }
.portal-locality-page .locality-guide-section > summary > h2 { display: inline; font-size: 18px; line-height: 1.6; margin: 0; padding: 0; border: 0; }
.portal-locality-page .locality-place-arrow { display: none; }

.portal-locality-page > .container,
.portal-locality-page > .container-fluid {
    box-sizing: border-box;
    width: 100%;
    max-width: 1170px;
    margin-inline: auto;
    padding-inline: 15px;
}

.portal-locality-page .locality-overview {
    padding-top: 28px;
    padding-bottom: 0;
}

.portal-locality-page .locality-overview > .container {
    width: 100%;
    max-width: none;
    padding-inline: 0;
}

/* These grids supply their own gaps; nested Bootstrap rows must not add gutters. */
.portal-locality-page .locality-overview > .container > .row,
.portal-locality-page .row:has(> .customer-grid),
.portal-locality-page .row:has(> .col-lg-12 > .customer-grid),
.portal-locality-page #ContentPlaceHolderMain_ListaLocalitaComune > .row {
    margin-inline: 0;
}

.portal-locality-page .row > .col-lg-12:has(> .customer-grid) {
    padding-inline: 0;
}

#page .portal-locality-page .portal-page-title {
    width: 100%;
    max-width: none;
    margin: 0 0 18px !important;
    padding: 0;
    color: var(--locality-ink);
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -.025em;
    text-align: start;
    text-transform: none;
    text-wrap: balance;
    white-space: normal;
    overflow-wrap: anywhere !important;
}

#page .portal-locality-page .portal-page-title strong { font-weight: inherit; }

#page .portal-locality-page .portal-page-title::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin: 17px 0 0;
    border-radius: 3px;
    background: var(--locality-accent);
}

.portal-locality-page .locality-context {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 0 0 12px;
    color: var(--locality-muted);
    font-size: 14px;
    line-height: 1.6;
}

.portal-locality-page .locality-context a { color: inherit; }
.portal-locality-page .locality-context .fa { flex: 0 0 auto; }

.portal-locality-page .locality-intro {
    max-width: 76ch;
    margin: 12px 0 0;
    color: var(--locality-copy);
    font-size: 16px;
    line-height: 1.75;
    text-align: start;
    overflow-wrap: anywhere;
}

.portal-locality-page .locality-intro > :last-child { margin-bottom: 0; }

.portal-locality-page .locality-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 18px;
}

.portal-locality-page .locality-back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 100%;
    min-height: 44px;
    padding: 11px 15px;
    border: 1px solid var(--locality-line);
    border-radius: 10px;
    background: #fff;
    color: var(--locality-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    white-space: normal;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.portal-locality-page .locality-back-link:hover {
    border-color: #8aabbf;
    background: var(--locality-soft);
    text-decoration: none;
}

#page .portal-locality-page .page-index {
    max-width: none;
    margin: 22px 0 26px !important;
    padding: 12px 0 10px;
    border-top: 0;
    border-bottom: 1px solid var(--locality-line);
}

#page .portal-locality-page .page-index-title { font-size: 14px; }
#page .portal-locality-page .page-index-links { gap: 4px 24px; }
#page .portal-locality-page .page-index-links > [data-scrollto] { font-size: 15px !important; }

#page .portal-locality-page h2.section-title,
#page .portal-locality-page h1.section-title {
    max-width: none;
    margin: 30px 0 18px !important;
    padding: 0;
    color: var(--locality-ink);
    font-size: clamp(22px, 2.1vw, 26px);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -.015em;
    text-align: start;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere !important;
    border: 0 !important;
    background: none;
}

#page .portal-locality-page h2.section-title::before,
#page .portal-locality-page h2.section-title::after,
#page .portal-locality-page h1.section-title::before,
#page .portal-locality-page h1.section-title::after {
    display: none;
    content: none;
}

#page .portal-locality-page .portal-recommendations-title {
    margin-top: 26px !important;
    margin-bottom: 18px !important;
}

/* Bootstrap's repeated columns may be direct children or nested one level. */
.portal-locality-page .customer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 22px;
    float: none;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 !important;
}

.portal-locality-page .customer-grid > .customer-card-column,
.portal-locality-page .customer-grid > .customer-grid-column,
.portal-locality-page .customer-grid-column > .customer-card-column {
    display: flex;
    flex-direction: column;
    float: none;
    width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.portal-locality-page .customer-grid-column > .customer-card-column { flex: 1 1 auto; }

.portal-locality-page .customer-grid .widget.box-item.customer-card {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 1px solid var(--locality-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 45, 78, .045);
}

.portal-locality-page .customer-grid .customer-card > .box-item-content,
.portal-locality-page .customer-grid .customer-card .box-item-content img,
.portal-locality-page .customer-grid .customer-card .flex-viewport {
    aspect-ratio: 16 / 10;
}

.portal-locality-page .customer-grid .customer-card .box-item-content img {
    height: auto;
    object-fit: cover;
}

.portal-locality-page .customer-grid .customer-card .customer-card-info {
    flex: 1 1 auto;
    gap: 14px;
    padding: 20px;
    background: #fff;
}

.portal-locality-page .customer-grid .customer-card-name {
    font-size: 19px;
    line-height: 1.45;
    overflow-wrap: anywhere !important;
}

.portal-locality-page .customer-grid .customer-card .box-item-bottom {
    margin-top: auto;
    border-top: 1px solid var(--locality-line);
    padding-top: 14px;
}

.portal-locality-page .customer-grid .customer-card .customer-card-location {
    color: var(--locality-muted) !important;
    font-size: 14px !important;
    line-height: 1.65;
}

.portal-locality-page .customer-card-name .portal-whole-word,
.portal-locality-page .customer-card-location .portal-whole-word,
.portal-locality-page .locality-place-grid .portal-whole-word {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.portal-locality-page .customer-grid.locality-two-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-locality-page .customer-grid.locality-single-result { grid-template-columns: minmax(0, 1fr); }
.portal-locality-page #panelPagination:has(> .pagination:empty) { display: none; }

/* Preserve complete place names and make each existing destination easy to tap. */
.portal-locality-page .locality-place-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    float: none;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 !important;
    text-align: start;
}

.portal-locality-page .locality-place-grid::before,
.portal-locality-page .locality-place-grid::after { display: none; }

.portal-locality-page .locality-place-grid > .portal-place-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    float: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 62px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--locality-line);
    border-radius: 11px;
    background: var(--locality-soft);
    color: var(--locality-ink);
    font-size: 15px;
    line-height: 1.5;
    text-align: start;
    text-transform: none;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.portal-locality-page .locality-place-grid > .portal-place-link .portal-icon-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.portal-locality-page .locality-place-grid > .portal-place-link::after {
    content: "";
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    margin-inline-start: auto;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.portal-locality-page .locality-place-grid > .portal-place-link:hover {
    border-color: #92b0c4;
    background: #fff;
    color: var(--locality-ink);
    text-decoration: none;
}

.portal-locality-page .locality-place-grid > .portal-place-link[aria-current="page"] {
    border-color: #f1d5c5;
    background: #fff2e9;
}

.portal-locality-page .locality-place-grid > .portal-place-link[aria-current="page"]::after { display: none; }

.portal-locality-page .locality-current-label {
    display: inline-block;
    margin-inline-start: 6px;
    color: #744b31;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.portal-locality-page .locality-back-link:focus-visible,
.portal-locality-page .locality-place-grid > .portal-place-link:focus-visible {
    outline: 3px solid #1479b8;
    outline-offset: 3px;
}

/* Existing translated editorial copy is kept, with a quieter reading surface. */
.portal-locality-page .portal-editorial { padding-top: 30px; padding-bottom: 40px; }
.portal-locality-page .portal-editorial .widget.guida.portal-editorial-panel {
    max-width: 1140px;
    margin: 0 auto;
    padding: 28px 0 0;
    border: 0;
    border-top: 1px solid var(--locality-line);
    border-radius: 0;
    box-shadow: none;
}

.portal-locality-page .portal-editorial .portal-editorial-content {
    max-width: 80ch;
    margin-inline: 0;
    font-size: 16px;
    line-height: 1.8;
}

.portal-locality-page .locality-guide-section {
    border-top: 1px solid var(--locality-line);
    padding: 16px 0;
}

.portal-locality-page .locality-guide-section > summary {
    min-height: 44px;
    padding: 8px 0;
    color: var(--locality-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.portal-locality-page .locality-guide-section > summary:focus-visible {
    outline: 2px solid #1479b8;
    outline-offset: 3px;
}

@media (min-width: 768px) {
    .portal-locality-page .customer-grid.locality-single-result .customer-card {
        display: grid;
        grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
        align-items: stretch;
    }
    .portal-locality-page .customer-grid.locality-single-result .customer-card > .banner-icon { position: absolute; }
    .portal-locality-page .customer-grid.locality-single-result .customer-card > .box-item-content {
        height: 100%;
        min-height: 260px;
        aspect-ratio: auto;
    }
    .portal-locality-page .customer-grid.locality-single-result .customer-card .flex-viewport,
    .portal-locality-page .customer-grid.locality-single-result .customer-card .slides,
    .portal-locality-page .customer-grid.locality-single-result .customer-card .slides > li,
    .portal-locality-page .customer-grid.locality-single-result .customer-card .slides > li > a {
        display: block;
        height: 100% !important;
        aspect-ratio: auto;
    }
    .portal-locality-page .customer-grid.locality-single-result .customer-card .box-item-content img {
        height: 100%;
        min-height: 260px;
        aspect-ratio: auto;
        object-fit: cover;
    }
    .portal-locality-page .customer-grid.locality-single-result .customer-card .customer-card-info {
        justify-content: center;
        gap: 20px;
        padding: 30px;
    }
    .portal-locality-page .customer-grid.locality-single-result .customer-card-name { font-size: 25px; }
    .portal-locality-page .customer-grid.locality-single-result .customer-card .box-item-bottom { margin-top: 0; }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .portal-locality-page .customer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .portal-locality-page .locality-place-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-locality-page .customer-grid.locality-single-result .customer-card .customer-card-info { padding: 24px; }
}

@media (max-width: 767px) {
    .portal-locality-page .locality-overview { padding-top: 24px; }
    #page .portal-locality-page .portal-page-title { font-size: 30px; line-height: 1.3; }
    #page .portal-locality-page .page-index { margin-top: 18px !important; margin-bottom: 22px !important; }
    #page .portal-locality-page .page-index-links { gap: 4px 18px; }
    #page .portal-locality-page h2.section-title,
    #page .portal-locality-page h1.section-title { margin-top: 26px !important; font-size: 22px; }
    .portal-locality-page .customer-grid,
    .portal-locality-page .customer-grid.locality-two-results,
    .portal-locality-page .customer-grid.locality-single-result { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .portal-locality-page .customer-grid .customer-card > .box-item-content,
    .portal-locality-page .customer-grid .customer-card .box-item-content img,
    .portal-locality-page .customer-grid .customer-card .flex-viewport { aspect-ratio: 16 / 9; }
    .portal-locality-page .customer-grid .customer-card .customer-card-info { padding: 18px; gap: 12px; }
    .portal-locality-page .customer-grid .customer-card-name { font-size: 19px; }
    .portal-locality-page .locality-place-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .portal-locality-page .locality-place-grid > .portal-place-link { min-height: 58px; padding: 15px; }
    .portal-locality-page .portal-editorial .widget.guida.portal-editorial-panel { padding: 24px 0 0; }
    .portal-locality-page .portal-editorial .portal-editorial-content { font-size: 16px; }
}

@media (max-width: 359px) {
    #page .portal-locality-page .portal-page-title { font-size: 27px; }
    .portal-locality-page .customer-grid .customer-card .customer-card-info { padding: 15px; }
    .portal-locality-page .customer-grid .customer-card-name { font-size: 18px; }
    .portal-locality-page .customer-grid .customer-card-location-row { gap: 8px; }
}

@media print {
    .portal-locality-page .locality-guide-section > :not(summary) { display: block; }
    .portal-locality-page .customer-grid .customer-card { break-inside: avoid; box-shadow: none; }
}
