/* Responsive Styles for the Site */

/* ============================================
   MOBILE MENU FIX
   ============================================ */

/* Fix per il menu mobile - rimuove il transform che nasconde il menu */
@media (max-width: 991px) {
  .navbar-collapsable.collapse.show {
    transform: translateX(0) !important;
  }
}

/* ============================================
   HERO SECTION RESPONSIVE
   ============================================ */

/* Tablet and below (max-width: 991px) */
@media (max-width: 991px) {
  /* Hero section adjustments */
  .hero-with-bg {
    background-size: cover;
    background-position: center center;
  }

  /* Hero wrapper padding */
  .home .it-hero-wrapper {
    padding: 0px 20px;
  }

  .it-hero-wrapper {
    padding: 100px 20px;
  }

  /* Hero title */
  .hero-title {
    font-size: 1.75rem;
    line-height: 1.3;
  }

  /* Hero text */
  .home .hero-text {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .home .hero-text p {
    font-size: 1rem;
  }

  /* Hero link button */
  .hero-link {
    margin-top: 1.5rem;
  }

  .hero-link .btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
  }
}

/* Mobile (max-width: 575px) */
@media (max-width: 575px) {

  /* Hero wrapper padding */
  .home .it-hero-wrapper {
    padding: 0px 15px;
  }

  .it-hero-wrapper {
    padding: 60px 15px;
  }

  /* Hero text wrapper padding */
  .it-hero-text-wrapper {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  /* Hero title */
  .hero-title {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }

  /* Hero text */
  .home .hero-text {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .home .hero-text p {
    font-size: 1rem !important;
  }

  /* Hero link button */
  .hero-link {
    margin-top: 1rem;
  }

  .hero-link .btn {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
    display: block;
    text-align: center;
  }

  .hero-link .btn .icon {
    width: 14px;
    height: 14px;
  }
}

/* ============================================
   BOXES SECTION RESPONSIVE
   ============================================ */

/* Tablet and below (max-width: 991px) */
@media (max-width: 991px) {
  /* Boxes section */
  .home-boxes {
    padding: 60px 0;
  }

  /* Title above, remove sticky */
  .home-boxes .boxes-title {
    position: static;
    padding-left: 0;
    padding-right: 0;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
  }

  /* Full width for title column */
  .home-boxes .col-4 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Full width for boxes column */
  .home-boxes .col-8 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Boxes grid: 2 columns */
  .boxes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Icon as background */
  .box-card {
    position: relative;
    overflow: hidden;
  }

  .box-icon {
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    width: 200px;
    height: 200px;
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
  }

  .box-icon svg {
    width: 100%;
    height: 100%;
  }

  .box-card-inner {
    position: relative;
    z-index: 1;
  }
}

/* Mobile (max-width: 575px) */
@media (max-width: 575px) {
  /* Boxes section */
  .home-boxes {
    padding: 40px 0;
  }

  /* Title */
  .home-boxes .boxes-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Boxes grid: 1 column (stacked) */
  .boxes-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  /* Box card padding */
  .box-card-inner {
    padding: 1.2rem;
    position: relative;
    z-index: 1;
  }

  /* Icon as background - larger on mobile */
  .box-icon {
    position: absolute;
    top: 50%;
    right: -30px;
    transform: translateY(-50%);
    width: 180px;
    height: 180px;
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
  }

  .box-icon svg {
    width: 100%;
    height: 100%;
  }

  .box-card {
    position: relative;
    overflow: hidden;
  }
}

/* ============================================
   RECENT NEWS SECTION RESPONSIVE
   ============================================ */

/* Tablet and below (max-width: 991px) */
@media (max-width: 991px) {
  /* Recent news section */
  .recent-news-section {
    padding: 2rem 0 120px;
  }

  /* Grid: 2 columns */
  .recent-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Remove right border from middle item */
  .recent-news-item {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
  }

  .recent-news-item:nth-child(2n) {
    border-right: none;
  }

  .recent-news-item:last-child {
    border-right: none;
  }

  /* Title font size */
  .recent-news-title {
    font-size: 1.1rem;
  }

  /* CTA margin */
  .recent-news-cta {
    margin-top: 2rem;
  }
}

/* Mobile (max-width: 575px) */
@media (max-width: 575px) {
  /* Recent news section */
  .recent-news-section {
    padding: 1.5rem 0 100px;
  }

  /* Grid: 1 column (stacked) */
  .recent-news-grid {
    grid-template-columns: 1fr;
  }

  /* Remove all right borders, keep only bottom */
  .recent-news-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.25rem;
  }

  .recent-news-item:last-child {
    border-bottom: none;
  }

  /* Title font size */
  .recent-news-title {
    font-size: 1rem;
  }

  /* Link font size */
  .recent-news-link {
    font-size: 0.85rem;
  }

  /* CTA margin */
  .recent-news-cta {
    margin-top: 1.5rem;
  }

  /* CTA button full width on mobile */
  .recent-news-cta .btn {
    width: 100%;
    display: block;
  }
}

/* ============================================
   EVENT CTA SECTION RESPONSIVE
   ============================================ */

/* Tablet and below (max-width: 991px) */
@media (max-width: 991px) {
  /* Event CTA section */
  .event-cta {
    margin-top: -60px;
    padding: 1.5rem;
  }

  /* Label above content */
  .event-cta-label {
    margin-bottom: 1.5rem;
    text-align: center;
  }

  .event-cta-label h2 {
    font-size: 1.75rem;
  }

  /* Content adjustments */
  .event-cta-content {
    padding-left: 0;
    border-left: none;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
  }

  /* Date font size */
  .event-date {
    font-size: 1.25rem;
  }

  /* Title font size */
  .event-title {
    font-size: 1.5rem;
  }

  /* Excerpt font size */
  .event-excerpt {
    font-size: 0.95rem;
  }
}

/* Mobile (max-width: 575px) */
@media (max-width: 575px) {
  /* Event CTA section */
  .event-cta {
    margin-top: -40px;
    padding: 1.25rem;
  }

  /* Label */
  .event-cta-label {
    margin-bottom: 1rem;
  }

  .event-cta-label h2 {
    font-size: 1.5rem;
  }

  /* Content */
  .event-cta-content {
    padding-top: 1rem;
  }

  /* Date font size */
  .event-date span {
    font-size: 1.1rem !important;
    margin-bottom: 0.75rem;
  }

  /* Title font size */
  .event-title {
    margin-bottom: 1rem;
  }
  .event-title a {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  /* Excerpt font size */
  .event-excerpt {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
  }

  /* Button full width on mobile */
  .event-cta-content .btn {
    width: 100%;
    display: block;
    text-align: center;
  }
}

/* ============================================
   GENERAL RESPONSIVE STYLES
   ============================================ */

/* Scroll to Top Button */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
  }

  .scroll-to-top .icon {
    width: 20px;
    height: 20px;
  }
}

/* Navbar Submenu */
@media (max-width: 991px) {
  .navbar-nav .sub-menu {
    position: static;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0;
    padding-left: 1rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: translateY(0);
    transition: opacity 0.3s ease, visibility 0.3s ease, max-height 0.3s ease;
  }
  
  .navbar-nav .nav-item.mobile-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    max-height: 1000px;
  }
  
  .navbar-nav .sub-menu .sub-menu {
    margin-left: 1rem;
  }
  
  .navbar-nav .sub-menu .nav-link {
    padding: 0.5rem 1rem;
  }
  
  .navbar-nav .nav-item:has(.sub-menu) > a,
  .navbar-nav .nav-item:has(.sub-menu) > span {
    cursor: pointer;
  }
}

/* ============================================
   PARTNERS SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .partners-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  
  .partners-title {
    font-size: 2rem;
  }
}

@media (max-width: 767px) {
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .partner-card-inner {
    padding: 1.5rem 1rem;
  }
  
  .partner-image {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
  }
  
  .partner-title {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .partners-grid {
    grid-template-columns: 1fr;
  }
  
  .partners-title {
    font-size: 1.75rem;
  }
}

/* ============================================
   FEATURE BLOCKS SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .feature-section-title h2 {
    font-size: 2rem;
  }
  
  .feature-blocks-section {
    padding: 2rem 0;
  }
}

@media (max-width: 767px) {
  .feature-block-item {
    flex-direction: column;
    padding: 1.5rem;
  }
  
  .feature-block-content {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .feature-block-number span {
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
  }
  
  .feature-block-right {
    width: 100%;
    min-width: auto;
  }
  
  .feature-section-title h2 {
    font-size: 1.75rem;
  }
  
  .feature-block-label {
    padding: 1rem;
  }
}

/* ============================================
   TIMELINE SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  /* Timeline section tablet */
  .timeline-section {
    padding: 2rem 0 !important;
  }

  .timeline-wrapper {
    max-width: 100%;
    padding: 0 1rem;
  }

  .timeline-item {
    grid-template-columns: 100px 30px 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  
  .timeline-item::after {
    left: calc(100px + 1rem + 15px - 1px);
  }
  
  .timeline-year {
    font-size: 1.75rem;
  }
  
  .timeline-dot {
    width: 16px;
    height: 16px;
    border-width: 3px;
  }

  .timeline-content {
    padding: 1.5rem;
  }
}

@media (max-width: 767px) {
  /* Timeline section mobile */
  .timeline-section {
    padding: 1.5rem 0 !important;
  }

  .timeline-wrapper {
    padding: 0 0.75rem;
  }

  /* Layout completamente verticale su mobile */
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-left: 2rem;
    position: relative;
  }
  
  /* Linea verticale su mobile - posizionata a sinistra */
  .timeline-item::after {
    left: 7px;
    top: 20px;
    width: 2px;
    height: calc(100% + 2rem);
    background: var(--bs-primary);
    z-index: 0;
  }

  /* Anno e marker in una riga sopra il contenuto */
  .timeline-year-marker {
    text-align: left;
    padding-top: 0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .timeline-year {
    font-size: 1.25rem;
    margin: 0;
  }

  /* Marker posizionato a sinistra */
  .timeline-marker {
    position: absolute;
    left: 0;
    top: 0.25rem;
    align-items: flex-start;
  }
  
  .timeline-dot {
    width: 14px;
    height: 14px;
    border-width: 2px;
    margin-top: 0;
  }
  
  /* Contenuto a larghezza piena */
  .timeline-content {
    padding: 1.25rem;
    width: 100%;
  }
  
  .timeline-month {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }
  
  .timeline-text {
    font-size: 0.9375rem;
    line-height: 1.6;
  }
}

/* ============================================
   GLOSSARY SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .glossary-filter-btn {
    min-width: 38px;
    height: 38px;
    font-size: 0.875rem;
  }
}

@media (max-width: 767px) {
  .glossary-section {
    padding: 0;
  }
  .glossary-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .glossary-letter {
    font-size: 1.75rem;
  }
  
  .glossary-accordion .accordion-button {
    font-size: 1rem;
  }
  
  .glossary-filter-bar {
    gap: 0.25rem;
    padding: 0.75rem;
  }
  
  .glossary-filter-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.75rem;
    padding: 0.25rem;
  }
  
  .glossary-filter-btn[data-filter="all"] {
    padding: 0.25rem 0.75rem;
  }
}

/* ============================================
   GALLERY SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .gallery-title h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  .gallery-title {
    position: static;
  }
  
  .gallery-grid.gallery-cols-3,
  .gallery-grid.gallery-cols-4,
  .gallery-grid.gallery-cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .gallery-grid.gallery-cols-3,
  .gallery-grid.gallery-cols-4,
  .gallery-grid.gallery-cols-5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
  }
  
  .gallery-pagination {
    gap: 0.5rem;
  }
  
  .gallery-page-btn,
  .gallery-page-num {
    min-width: 38px;
    height: 38px;
    font-size: 0.875rem;
  }
  
  .gallery-icon {
    width: 32px;
    height: 32px;
  }
}

/* ============================================
   EVENTI BANNER SLIDER RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .eventi-banner-slider .splide__arrow {
    width: 40px;
    height: 40px;
  }
  
  .eventi-banner-slider .splide__arrow--prev {
    left: 1rem;
  }
  
  .eventi-banner-slider .splide__arrow--next {
    right: 1rem;
  }
}

@media (max-width: 575px) {
  .eventi-banner-slider .splide__arrow {
    width: 36px;
    height: 36px;
  }
  
  .eventi-banner-slider .splide__arrow svg {
    width: 20px;
    height: 20px;
  }
}

/* ============================================
   ARTICLE SECTION RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .article-title {
    font-size: 2rem;
  }
  
  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .article-meta .col-md-6 {
    width: 100%;
  }
}

/* ============================================
   ARCHIVE SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .archive-page-title {
    font-size: 2rem;
  }
  
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 767px) {
  .archive-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ============================================
   ARTICLE GALLERY RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .article-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .article-gallery-title {
    font-size: 1.5rem;
  }
}

/* ============================================
   RATING STARS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .rating-star-icon {
    width: 32px;
    height: 32px;
  }
  
  fieldset.rating {
    gap: 0.25rem;
  }
}

/* ============================================
   NEWS HERO RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .news-hero-content {
    max-width: 100%;
  }
}

/* ============================================
   NEWS GRID RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .news-card-body {
    padding: 1.25rem;
  }
}

/* ============================================
   NEWS TITLE RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .news-title {
    position: relative;
    top: 0;
    margin-bottom: 2rem;
  }
  
  .news-title h2 {
    font-size: 2rem;
  }
}

/* ============================================
   NEWS PAGINATION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .news-page-btn,
  .news-page-num {
    min-width: 38px;
    height: 38px;
    font-size: 0.875rem;
  }
}

@media (max-width: 575px) {
  .news-pagination,
  .gallery-pagination {
    gap: 0.25rem;
    padding: 0.75rem;
  }
  
  .news-page-btn,
  .news-page-num,
  .gallery-page-btn,
  .gallery-page-num {
    min-width: 32px;
    height: 32px;
    font-size: 0.75rem;
    padding: 0.25rem;
  }
  
  .news-page-icon,
  .gallery-page-icon {
    width: 16px;
    height: 16px;
  }
}

/* ============================================
   NEWS SIDEBAR RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  /* Sidebar news e eventi - altezza 100% invece di 100vh su mobile */
  .news-sidebar,
  .news-sidebar.eventi-sidebar-archive {
    height: 100% !important;
    max-height: 100% !important;
    position: relative;
    top: 0;
    margin-top: 3rem;
    min-height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
}

/* ============================================
   ICONS GRID SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .icons-grid-section .boxes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .icons-grid-section .boxes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .icons-grid-item .icon-circle {
    width: 56px;
    height: 56px;
  }
  
  .icons-grid-item .icon-circle .icon {
    width: 28px;
    height: 28px;
  }
}

/* ============================================
   TEXT IMAGE SECTION RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .text-image-top::before {
    display: none;
  }

  .text-image-section .row.has-decor::before {
    display: none;
  }
}

/* ============================================
   COUNTDOWN SECTION RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .countdown-value {
    font-size: 1.75rem;
  }
  
  .countdown-item {
    min-width: 50px;
  }
  
  .countdown-row {
    gap: 0.75rem;
  }
  
  .countdown-label {
    font-size: 0.75rem;
  }
  
  .info-box {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .countdown-value {
    font-size: 1.5rem;
  }
  
  .countdown-item {
    min-width: 45px;
  }
  
  .countdown-row {
    gap: 0.5rem;
  }
  
  .countdown-label {
    font-size: 0.7rem;
  }
}

/* ============================================
   DTT FEATURES RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .dtt-feature {
    grid-template-columns: 1fr;
  }

  .dtt-feature__number {
    font-size: 2rem;
  }
}

/* ============================================
   LIGHTBOX RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .lightbox-nav {
    width: 45px;
    height: 45px;
    padding: 10px;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
}

/* ============================================
   FOOTER RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
}

/* ============================================
   CONTATTI PAGE RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .contatti-info-row {
    flex-direction: column;
  }
  
  .contatti-info-item {
    min-width: 100%;
  }
  
  .contatti-mappe-grid {
    grid-template-columns: 1fr;
  }
  
  .contatti-mappa-item .contatti-mappa-wrapper {
    height: 300px;
  }
}

/* ============================================
   TENDERS SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .tenders-section {
    padding: 2rem 0;
  }

  .tenders-section .section-title {
    font-size: 1.75rem;
  }

  .tenders-table {
    font-size: 0.9rem;
  }

  .tenders-table th,
  .tenders-table td {
    padding: 0.75rem;
  }
}

@media (max-width: 767px) {
  .tenders-intro-section {
    padding: 2rem 0;
  }

  .tenders-section {
    padding: 1.5rem 0;
  }

  .tenders-section .section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  /* Tabella responsive: stack su mobile */
  .tenders-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tenders-table {
    min-width: 800px;
    font-size: 0.85rem;
  }

  .tenders-table th,
  .tenders-table td {
    padding: 0.5rem;
  }

  .tenders-table th {
    font-size: 0.8rem;
  }

  /* Tender Detail Page */
  .tender-detail-section {
    padding: 2rem 0;
  }

  .tender-title {
    font-size: 2rem;
  }

  .tender-meta {
    padding: 1.5rem;
  }

  .tender-meta-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tender-meta-item strong {
    min-width: auto;
  }

  /* Tender atti link - testo che va a capo su mobile */
  .tender-atti-link {
    /* flex-wrap: wrap; */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .tender-atti-link span {
    flex: 1 1 100%;
    min-width: 0;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
  }
}

/* ============================================
   HEADER RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  /* Nascondi lo slimheader su mobile */
  .it-header-slim-wrapper {
    display: none !important;
  }

  .it-header-center-wrapper {
    padding: 0 !important;
  }
  .it-brand-wrapper {
    padding-left: 0 !important;
  }
  /* Nascondi il testo del brand su tablet e mobile, mostra solo il logo */
  .it-brand-text > div {
    display: none !important;
  }

  /* Assicura che il logo sia visibile */
  .it-brand-text {
    display: flex;
    align-items: center;
  }

  /* Stile per il burger menu */
  .custom-navbar-toggler {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    background-color: transparent;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 1;
  }

  .custom-navbar-toggler:hover,
  .custom-navbar-toggler:focus {
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
  }

  .custom-navbar-toggler .icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
  }

  /* Bootstrap gestisce già il collapse, ma assicuriamoci che funzioni su mobile */
  .navbar-collapsable.collapse:not(.show) {
    display: none;
  }

  .navbar-collapsable.collapse.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bs-primary) !important;
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    width: 100% !important;
    max-width: 100vw !important;
    height: 100vh;
    box-sizing: border-box;
    transform: translateX(0) !important;
  }

  /* Nascondi l'overlay se presente */
  .navbar-collapsable.collapse.show .overlay {
    display: none !important;
  }

  /* Stile per il close button nel menu hamburger */
  .navbar-collapsable.show .close-div {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10001;
    right: 0;
    left: auto;
    top: 0;
  }

  .navbar-collapsable.show .close-menu {
    background-color: transparent;
    border: none;
    color: #fff !important;
    padding: 0.5rem;
    cursor: pointer;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10002;
  }

  .navbar-collapsable.show .close-menu:hover,
  .navbar-collapsable.show .close-menu:focus {
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
  }

  .navbar-collapsable.show .close-menu .icon {
    width: 24px !important;
    height: 24px !important;
    stroke: #fff !important;
    fill: none !important;
    color: #fff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Stile per il logo nel menu hamburger */
  .logo-hamburger {
    display: none !important
  }

  /* Menu wrapper nel hamburger */
  .navbar-collapsable.show .menu-wrapper {
    padding: 1rem 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 10001;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden;
    transform: translateX(0) !important;
    background-color: transparent;
  }

  /* Menu Slim Header nel mobile - in basso - visibile solo su mobile */
  .mobile-slim-menu {
    display: none !important;
  }

  .navbar-collapsable.show .mobile-slim-menu {
    display: block !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .navbar-collapsable.show .slim-header-menu-mobile {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  .navbar-collapsable.show .slim-header-menu-mobile .nav-item {
    margin: 0;
    padding: 0;
  }

  .navbar-collapsable.show .slim-header-menu-mobile .nav-link {
    color: #fff !important;
    padding: 0.75rem 1rem !important;
    display: block !important;
    text-decoration: none;
    transition: background-color 0.3s ease;
  }

  .navbar-collapsable.show .slim-header-menu-mobile .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }

  /* Ricerca nel mobile - in alto nel close-div */
  .navbar-collapsable.show .mobile-search-wrapper {
    margin: 0;
    padding: 0;
    border: none;
  }

  .navbar-collapsable.show .search-link-mobile {
    color: #fff !important;
    padding: 0.5rem 1rem !important;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 4px;
    pointer-events: auto !important;
    z-index: 1000;
    position: relative;
  }

  .navbar-collapsable.show .search-link-mobile:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }

  .navbar-collapsable.show .search-link-mobile .icon {
    width: 20px;
    height: 20px;
    stroke: #fff !important;
    fill: none !important;
  }

  .navbar-collapsable.show .search-link-mobile span {
    color: #fff !important;
    font-size: 1rem;
  }

  /* Voci di menu nel hamburger devono essere bianche */
  .navbar-collapsable.show .navbar-nav {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .navbar-collapsable.show .navbar-nav .nav-item {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0;
    padding: 0;
  }

  .navbar-collapsable.show .navbar-nav .nav-link,
  .navbar-collapsable.show .navbar-nav .nav-item > span,
  .navbar-collapsable.show .navbar-nav .nav-item > a {
    color: #fff !important;
    background-color: transparent !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    box-sizing: border-box;
    white-space: normal !important;
    word-wrap: break-word;
  }

  .navbar-collapsable.show .navbar-nav .nav-link:hover,
  .navbar-collapsable.show .navbar-nav .nav-item:hover > span,
  .navbar-collapsable.show .navbar-nav .nav-item:hover > a {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
  }

  .navbar .navbar-collapsable .navbar-nav li a.nav-link.active {
    border-color: #fff !important;
}

  /* Submenu nel hamburger */
  .navbar-collapsable.show .navbar-nav .sub-menu {
    background-color: rgba(255, 255, 255, 0.05) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0;
    margin: 0;
  }

  .navbar-collapsable.show .navbar-nav .sub-menu .nav-link,
  .navbar-collapsable.show .navbar-nav .sub-menu span,
  .navbar-collapsable.show .navbar-nav .sub-menu .nav-item > a {
    color: #fff !important;
    background-color: transparent !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .navbar-collapsable.show .navbar-nav .sub-menu .nav-link:hover,
  .navbar-collapsable.show .navbar-nav .sub-menu .nav-item:hover > a {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
  }

  /* Social links nel hamburger */
  .navbar-collapsable.show .it-socials {
    color: #fff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .navbar-collapsable.show .it-socials span {
    color: #fff !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .navbar-collapsable.show .it-socials ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .navbar-collapsable.show .it-socials li {
    margin: 0;
    padding: 0;
  }

  .navbar-collapsable.show .it-socials a {
    color: #fff !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
  }

  .navbar-collapsable.show .it-socials a:hover {
    opacity: 0.8;
  }

  .navbar-collapsable.show .it-socials .icon {
    width: 22px !important;
    height: 22px !important;
    stroke: #fff !important;
    fill: none !important;
    color: #fff !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Assicura che tutto il testo nel menu hamburger sia bianco e visibile */
  .navbar-collapsable.show nav,
  .navbar-collapsable.show nav * {
    color: #fff !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Logo hamburger */
  .logo-hamburger {
    display: none
  }

  /* Forza tutti gli SVG nel menu a essere bianchi */
  .navbar-collapsable.show svg,
  .navbar-collapsable.show svg * {
    stroke: #fff !important;
    fill: none !important;
  }

  /* Forza tutti i link e span a essere visibili */
  .navbar-collapsable.show a,
  .navbar-collapsable.show span:not(.visually-hidden),
  .navbar-collapsable.show li {
    color: #fff !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Nascondi il menu slim header su desktop */
@media (min-width: 992px) {
  .mobile-slim-menu {
    display: none !important;
  }

  .navbar-collapsable.show .mobile-slim-menu {
    display: none !important;
  }
}

/* ============================================
   PAGE BANNER RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  /* Banner delle pagine - contenuto */
  section.hero-with-bg:not(.home) .it-hero-wrapper {
    padding: 0;
  }

  section.hero-with-bg:not(.home) .it-hero-text-wrapper {
    width: 100%;
  }

  /* Breadcrumb nel banner */
  section.hero-with-bg:not(.home) .banner-breadcrumb {
    margin-bottom: 1rem;
  }

  /* Titolo del banner delle pagine (non homepage) */
  section.hero-with-bg:not(.home) .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    margin-bottom: 1rem;
  }

  /* Testo del banner delle pagine */
  section.hero-with-bg:not(.home) .hero-text {
    font-size: 1rem;
    line-height: 1.6;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  section.hero-with-bg:not(.home) .hero-text p {
    margin-bottom: 0;
    font-size: 1rem;
  }

  /* Bottone del banner */
  section.hero-with-bg:not(.home) .hero-link {
    margin-top: 1rem !important;
  }

  section.hero-with-bg:not(.home) .hero-link .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 767px) {
  /* Banner su mobile piccolo */
  section.hero-with-bg:not(.home) .hero-title {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }

  section.hero-with-bg:not(.home) .hero-text {
    font-size: 0.9375rem;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  section.hero-with-bg:not(.home) .hero-text p {
    font-size: 0.9375rem;
  }

  section.hero-with-bg:not(.home) .banner-breadcrumb {
    margin-bottom: 0.75rem;
  }
}

/* ============================================
   TEXT IMAGE SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  /* Sezione text-image */
  .text-image-section {
    padding: 2rem 0;
  }

  .text-image-section .container {
    padding: 0 1rem;
  }

  /* Titoli delle sezioni */
  .text-image-section .section-title {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    margin-bottom: 1.5rem !important;
  }

  /* Contenuto delle sezioni */
  .text-image-section .section-content {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  /* Immagini */
  .text-image-section .section-image,
  .text-image-section .section-image-under {
    margin-top: 2rem;
  }

  .text-image-section .section-image img,
  .text-image-section .section-image-under img {
    max-width: 100%;
    height: auto;
  }

  /* Bottone */
  .text-image-section .hero-link {
    margin-top: 1.5rem;
  }

  .text-image-section .hero-link .btn {
    width: 100%;
    justify-content: center;
  }

  /* Top content */
  .text-image-top {
    margin-bottom: 2rem;
  }

  /* Info box */
  .text-image-section .info-box {
    margin-top: 2rem;
  }
}

@media (max-width: 767px) {
  /* Sezione text-image su mobile */
  .text-image-section {
    padding: 1.5rem 0;
  }

  .text-image-section .container {
    padding: 0 0.75rem;
  }

  /* Titoli delle sezioni */
  .text-image-section .section-title {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
    margin-bottom: 1rem !important;
  }

  /* Contenuto delle sezioni */
  .text-image-section .section-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  /* Immagini */
  .text-image-section .section-image,
  .text-image-section .section-image-under {
    margin-top: 1.5rem;
  }

  /* Bottone */
  .text-image-section .hero-link {
    margin-top: 1rem;
  }

  /* Top content */
  .text-image-top {
    margin-bottom: 1.5rem;
  }

  /* Info box */
  .text-image-section .info-box {
    margin-top: 1.5rem;
  }

  /* Padding ridotto per text-image-section-wrapper */
  .text-image-section-wrapper {
    padding: 2rem 0 !important;
  }

  .text-image-section:not(:first-child) {
    margin-top: 2rem !important;
  }

  /* Padding ridotto per section-text nelle pagine */
  .page-template-pages .section-text {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .page-template-pages .section-text.odd {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Font size ridotto per section-content */
  .page-template-pages .section-content p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  /* Text image top padding ridotto */
  .text-image-top {
    padding: 3rem 0 !important;
  }

  .text-image-top p {
    font-size: 1.25rem !important;
  }

  /* Home section padding ridotto */
  .home .section-text {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .home .section-text.odd {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .home .section-content p {
    font-size: 1.125rem !important;
    line-height: 1.6 !important;
  }

  /* Boxes title padding ridotto */
  .home-boxes .boxes-title {
    padding-left: 0 !important;
    padding-right: 0 !important;
    font-size: 2rem !important;
    position: static !important;
  }

  /* Feature section title padding ridotto */
  .feature-section-title {
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: static !important;
  }

  /* Gallery title padding ridotto */
  .gallery-title {
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: static !important;
  }

  /* News title padding ridotto */
  .news-title {
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: static !important;
  }

  .news-title h2 {
    font-size: 2rem !important;
  }

  /* Icons grid title padding ridotto */
  .icons-grid-section .boxes-title {
    padding-left: 0 !important;
    position: static !important;
  }

  /* Icons grid section - titolo sopra, griglia sotto */
  .icons-grid-section {
    padding: 2rem 0 !important;
  }

  .icons-grid-section .row {
    flex-direction: column;
  }

  .icons-grid-section .col-lg-5,
  .icons-grid-section .col-lg-7 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .icons-grid-section .boxes-title {
    margin-bottom: 2rem;
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Icons grid boxes-grid responsive */
  .icons-grid-section .boxes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Gallery section - titolo sopra, griglia sotto */
  .gallery-section {
    padding: 2rem 0 !important;
  }

  .gallery-section .row {
    flex-direction: column;
  }

  .gallery-section .col-lg-4,
  .gallery-section .col-lg-8 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .gallery-section .gallery-title {
    margin-bottom: 2rem;
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: static !important;
  }

  /* Feature blocks section - titolo sopra, lista sotto */
  .feature-blocks-section {
    padding: 2rem 0 !important;
    margin-top: 2rem !important;
  }

  .feature-blocks-section .row {
    flex-direction: column;
  }

  .feature-blocks-section .col-lg-3,
  .feature-blocks-section .col-lg-9 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .feature-blocks-section .feature-section-title {
    margin-bottom: 2rem;
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: static !important;
  }

  .feature-blocks-section .feature-section-title h2 {
    font-size: 2rem !important;
  }

  /* Feature block item responsive */
  .feature-block-item {
    flex-direction: column;
    gap: 1.5rem;
  }

  .feature-block-content {
    flex-direction: column;
  }

  .feature-block-right {
    width: 100% !important;
    min-width: 100% !important;
    height: 250px;
  }

  .feature-block-image {
    min-height: 250px;
  }
}

@media (max-width: 767px) {
  /* Icons grid section mobile */
  .icons-grid-section {
    padding: 1.5rem 0 !important;
  }

  .icons-grid-section .boxes-title {
    font-size: 1.75rem !important;
    margin-bottom: 1.5rem;
  }

  /* Icons grid boxes-grid mobile - 1 colonna */
  .icons-grid-section .boxes-grid {
    grid-template-columns: 1fr;
  }

  /* Gallery section mobile */
  .gallery-section {
    padding: 1.5rem 0 !important;
  }

  .gallery-section .gallery-title {
    margin-bottom: 1.5rem;
  }

  .gallery-section .gallery-title p {
    font-size: 1.25rem !important;
  }

  /* Gallery grid responsive */
  .gallery-grid.gallery-cols-3,
  .gallery-grid.gallery-cols-4,
  .gallery-grid.gallery-cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Feature blocks section mobile */
  .feature-blocks-section {
    padding: 1.5rem 0 !important;
    margin-top: 1.5rem !important;
  }

  .feature-blocks-section .feature-section-title {
    margin-bottom: 1.5rem;
  }

  .feature-blocks-section .feature-section-title h2 {
    font-size: 1.75rem !important;
  }

  .feature-block-item {
    padding: 2rem 1.5rem;
    gap: 1rem;
  }

  .feature-block-number span {
    font-size: 4rem !important;
  }

  .feature-block-right {
    height: 200px;
  }

  .feature-block-image {
    min-height: 200px;
  }
}

/* ============================================
   CALL TO ACTION SECTION RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
  /* Call to action section mobile - testo centrato */
  .call-to-action-section {
    padding: 1.5rem 0 !important;
  }

  .call-to-action-box {
    padding: 2rem 1.5rem !important;
  }

  .call-to-action-box .row {
    text-align: center;
  }

  .call-to-action-box .col-lg-8 {
    text-align: center;
  }

  .call-to-action-box .cta-title {
    text-align: center;
  }

  .call-to-action-box .cta-content {
    text-align: center;
  }

  .call-to-action-box .col-lg-4 {
    text-align: center !important;
    margin-top: 1.5rem;
  }

  .call-to-action-box .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   TIMELINE SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  /* Timeline section */
  .timeline-section {
    padding: 2rem 0 !important;
  }

  .timeline-wrapper {
    max-width: 100%;
    padding: 0 1rem;
  }

  /* Timeline item - layout verticale su tablet */
  .timeline-item {
    grid-template-columns: 80px 30px 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  /* Linea verticale ridotta */
  .timeline-item::after {
    left: calc(80px + 1rem + 15px - 1px);
  }

  /* Anno più piccolo */
  .timeline-year {
    font-size: 1.5rem;
  }

  /* Dot più piccolo */
  .timeline-dot {
    width: 16px;
    height: 16px;
    border-width: 3px;
  }

  /* Contenuto con padding ridotto */
  .timeline-content {
    padding: 1.5rem;
  }
}

@media (max-width: 767px) {
  /* Timeline section mobile */
  .timeline-section {
    padding: 1.5rem 0 !important;
  }

  .timeline-wrapper {
    padding: 0 0.75rem;
  }

  /* Timeline item - layout completamente verticale su mobile */
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-left: 2rem;
    position: relative;
  }

  /* Nascondi la linea verticale su mobile */
  .timeline-item::after {
    left: 7px;
    top: 20px;
    width: 2px;
    height: calc(100% + 2rem);
    background: var(--bs-primary);
    z-index: 0;
  }

  /* Anno e marker in una riga sopra il contenuto */
  .timeline-year-marker {
    text-align: left;
    padding-top: 0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .timeline-year {
    font-size: 1.25rem;
    margin: 0;
  }

  /* Marker posizionato a sinistra */
  .timeline-marker {
    position: absolute;
    left: 0;
    top: 0.25rem;
    align-items: flex-start;
  }

  .timeline-dot {
    width: 14px;
    height: 14px;
    border-width: 2px;
    margin-top: 0;
  }

  /* Contenuto a larghezza piena */
  .timeline-content {
    padding: 1.25rem;
    width: 100%;
  }

  .timeline-month {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }

  .timeline-text {
    font-size: 0.9375rem;
  }
}

@media (max-width: 767px) {
  /* Padding ancora più ridotto su mobile piccolo */
  .text-image-section-wrapper {
    padding: 1.5rem 0 !important;
  }

  .text-image-section:not(:first-child) {
    margin-top: 1.5rem !important;
  }

  .text-image-top {
    padding: 2rem 0 !important;
  }

  .text-image-top p {
    font-size: 1.125rem !important;
  }

  .home-boxes .boxes-title {
    font-size: 1.75rem !important;
  }

  .news-title h2 {
    font-size: 1.75rem !important;
  }

  /* Search page - rimuovi rounded dalle card e riduci h3 */
  .search .card {
    border-radius: 0 !important;
  }

  .search .card.rounded {
    border-radius: 0 !important;
  }

  .search .card h3,
  .search .card .card-title h3,
  .search h3 {
    font-size: 1.1rem;
    line-height: 1.3;
  }
}

