/* Reset e stili base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #007cb6;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

html {
    scroll-behavior: smooth;
}


/* forza il colore di sfondo, sovrascrivendo stili di tema/elementor */
body {
    background-color: #007cb6 !important;
}

.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

footer.elementor-location-footer {
    margin-top: auto;
}

.container {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Hero section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem;
    background-color: #01408D;
    /* border-bottom: 2px solid #FCC658; */
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #FCC658;
    text-align: center;
    font-family: "Gujarati MT";
    font-size: 70px;
    font-style: normal;
    font-weight: 400;
    line-height: 100%;
    letter-spacing: -2.1px;
}

.hero-image {
    width: 60%;
    /* background-color: #ddd; */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    margin-bottom: 2rem;
    margin-top: 2em;
}

.hero-image img {
    max-width: 40%;
    height: auto;
}

.image {
    width: 100%;
    height: 10em;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Sezioni comuni */
section {
    padding: 3rem 2rem;
    scroll-margin-top: 90px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Chi siamo */
.chi-siamo {
    background-color: #01408D;
    color: #FFF;
    text-align: center;
    padding-bottom: 4rem;
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text h2 {
    color: var(--Background-Background-3, #F6F0E4);
    text-align: center;
    font-family: "DM Sans";
    font-size: 96px;
    font-style: normal;
    font-weight: 200;
    line-height: 140%;
    /* 134.4px */
    letter-spacing: -2.4px;
}

.about-text p {
    color: #FFF;
    text-align: center;
    font-family: "DM Sans";
    font-size: 16px;
    font-style: normal;
    font-weight: 300;
    line-height: 200%;
    letter-spacing: -0.32px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.about-item h3 {
    color: var(--Background-Background-3, #F6F0E4);
    text-align: center;
    font-family: "DM Sans";
    font-size: 32px;
    font-style: normal;
    font-weight: 200;
    line-height: 130%;
    letter-spacing: -0.64px;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: none;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
    text-underline-position: from-font;
}

.about-item p {
    color: #FFF;
    text-align: center;
    font-family: "DM Sans";
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 200%;
    /* 32px */
    letter-spacing: -0.32px;
}

.about-item a {
    color: #FFF;
    text-decoration: none;
}

/* Chi siamo: avatar tondo */
.about-avatar {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Discipline */
.disciplines {
    background-color: #f8f8f8;
}

.disciplines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.discipline-item {
    padding: 1rem;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Comuni */
.comuni-search {
    margin-bottom: 2rem;
}

.comuni-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.comune-item {
    padding: 1rem;
    background-color: #f8f8f8;
    border-radius: 4px;
}

/* Ricercatori */
.researchers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.researcher-item {
    text-align: center;
}

.researcher-img {
    width: 150px;
    height: 150px;
    background-color: #ddd;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Contatti */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-item {
    padding: 1.5rem;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.contact-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Site-wide search under navbar */
.site-search {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
    box-sizing: border-box;
    position: relative;
    margin-bottom: 1.5rem;
}

.site-search input {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

/* Autocomplete dropdown */
.autocomplete-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 700px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 1100;
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #f2f2f2;
}



/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Utility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 1px, 1px) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Comuni: Search */
.comuni-search {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

#search-comuni {
    width: min(700px, 100%);
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

/* Carousel */
.carousel {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
}

.carousel-viewport {
    overflow: hidden;
}

.carousel-track {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0.25rem;
    margin: 0;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

.carousel-item {
    flex: 0 0 auto;
    min-width: 220px;
    scroll-snap-align: start;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    text-align: center;
}

.carousel-btn {
    border: none;
    background: #333;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.carousel-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.is-hidden {
    display: none !important;
}

.container-1 {
    margin-bottom: 2rem;
    margin-top: 2rem;
    width: calc(100% - 2rem);
    margin-left: 1rem;
    margin-right: 1rem;
}

.container-1 .row {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 2rem;;
}

.container-1 [class^="col"] {
    padding-left: 0;
    padding-right: 0;
}

/* Aggiunge un piccolo gap interno tra sidebar (col-3) e mappa (col-9) */
.container-1 .col-3 {
    padding-right: 0.6rem;
}

.container-1 .col-9 {
    padding-left: 0.6rem;
}

.container-2 {
    margin-bottom: 2rem;
}
/* Stili per la sidebar dei filtri */
.filters-sidebar {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.search-container {
    display: flex;
    margin-bottom: 2rem;
}

.search-input {
    flex-grow: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.reset-btn {
    background-color: transparent;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 4px 4px 0;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reset-btn:hover {
    background-color: transparent;
}

.reset-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.categories-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Stile per la scrollbar */
.categories-container::-webkit-scrollbar {
    width: 6px;
}

.categories-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.categories-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.categories-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.category {
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-header:hover {
    background-color: #f8f9fa;
}

.category.active .category-header {
    background-color: #f0f7ff;
    border-bottom: 1px solid #eaeaea;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.dot.green {
    background-color: #96C7B2;
}

.dot.yellow {
    background-color: #e7c077;
}

.dot.red {
    background-color: #e39e80;
}

.dot.blue {
    background-color: #95c7e1;
}

.dot.tan {
    background-color: #C8A894;
}

.dot.pea{
    background-color: #8FB67C;
}
.dot.peach{
    background-color: #E39E80;
}

.category-title {
    font-weight: 500;
    flex-grow: 1;
}

.toggle-icon {
    font-size: 0.8rem;
    color: #6c757d;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.category.active .toggle-icon {
    transform: rotate(180deg);
}

.subcategories {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #fafafa;
}

.category.active .subcategories {
    max-height: 1000px;
}

.subcategory {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 2rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    cursor: pointer;
}

.subcategory:last-child {
    border-bottom: none;
}

.subcategory:hover {
    background-color: #f0f0f0;
}

.subcategory.active {
    background-color: #e0f0ff;
}

.subcategory .dot {
    width: 8px;
    height: 8px;
    margin-right: 8px;
    flex-shrink: 0;
}

.subcategory-label {
    font-size: 0.9rem;
}

/* Stili per nascondere elementi non corrispondenti alla ricerca */
.category.hidden,
.subcategory.hidden {
    display: none;
}

/* Stili per l'evidenziazione del testo */
mark {
    background-color: #ffeb3b;
    padding: 0;
}

/* Stili per la mappa */
.map-container {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 622px;
    width: 100%;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
}

.content-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    /* margin-left: auto;
    margin-right: auto; */
}

.content-container.empty {
    background-color: transparent;
    box-shadow: none;
}

.content-header {
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eaeaea;
}

.content-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.content-body {
    height: auto;
    overflow: visible;
}

.content-frame {
    width: 100%;
    height: auto;
    border: none;
}

@media (max-width: 768px) {
    .container .row {
        flex-direction: column;
    }

    .filters-sidebar {
        position: static;
        margin-bottom: 2rem;
    }

    .categories-container {
        height: 400px;
    }
}

.citta-container {
    position: relative;
}

.citta-search-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.citta-list {
    position: absolute;
    background: white;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.citta-item:hover {
    background-color: #f5f5f5;
}

/* Popup stile tooltip */
.citta-popup {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid #ddd;
    display: none;
    /* Rimuovi qualsiasi transform o transition che potrebbe interferire */
    transform: none;
    transition: none;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.citta-popup-content {
    padding: 0;
}

.citta-popup-header {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.citta-popup-header h5 {
    margin: 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.btn-close-popup {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close-popup:hover {
    background: #e9ecef;
    color: #495057;
}

.citta-popup-body {
    padding: 15px;
}

.citta-info-section {
    margin-bottom: 12px;
}

.citta-info-section:last-child {
    margin-bottom: 0;
}

.citta-info-section strong {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-size: 1rem;
}

.citta-info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.citta-info-tag {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 1rem;
    color: #495057;
    transition: all 0.2s ease;
}

.citta-info-tag.disciplina {
    background: #e7f3ff;
    color: #01408D;
    color: #0066cc;
    border: 1px solid #b3d9ff;
}

.citta-info-tag.percorso {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    cursor: pointer;
}

.citta-info-tag.percorso:hover {
    background: #ffeaa7;
    transform: translateY(-1px);
}

.citta-popup-body span {
    color: #6c757d;
    font-family: 'Segoe UI';
    font-size: 0.8rem;
}

.city-highlight {
    background-color: #fff3cd !important;
    border: 2px solid #ffc107 !important;
}

.hidden {
    display: none !important;
}

/* Migliora lo stile dei marker per renderli più cliccabili */
.google-map-marker {
    cursor: pointer;
}
