:root {
  --_colors---colortext: #777;
  --_colors---colortitle: #333;
  --_colors---colorprimary: #fca733;
  --_colors---colorsecondary: #026ca0;
}

.w-layout-blockcontainer {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.w-layout-vflex {
  flex-direction: column;
  align-items: flex-start;
  display: flex;
}

.w-layout-hflex {
  flex-direction: row;
  align-items: flex-start;
  display: flex;
}

.w-layout-layout {
  grid-row-gap: 20px;
  grid-column-gap: 20px;
  grid-auto-columns: 1fr;
  justify-content: center;
  padding: 20px;
}

.w-layout-cell {
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  display: flex;
}

@media screen and (max-width: 991px) {
  .w-layout-blockcontainer {
    max-width: 728px;
  }
}

@media screen and (max-width: 767px) {
  .w-layout-blockcontainer {
    max-width: none;
  }
}

body {
  color: var(--_colors---colortext);
  font-family: DM Sans, sans-serif;
  font-size: 16px;
  line-height: 20px;
}

h1 {
  color: var(--_colors---colortitle);
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 48px;
  font-weight: 500;
  line-height: 120%;
}

h2 {
  color: var(--_colors---colortitle);
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 40px;
  font-weight: 500;
  line-height: 120%;
}

h3 {
  color: var(--_colors---colortitle);
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 36px;
  font-weight: 500;
  line-height: 120%;
}

h4 {
  color: var(--_colors---colortitle);
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 28px;
  font-weight: 500;
  line-height: 120%;
}

p {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 160%;
}

a {
  background-color: var(--_colors---colorprimary);
  text-decoration: underline;
  all:unset;
  cursor: pointer;
}

.container {
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  flex-flow: column;
  flex: none;
  grid-template-rows: auto;
  grid-template-columns: 1fr 1fr;
  grid-auto-columns: 1fr;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 0;
  display: flex;
}

.container.cfscontainer {
  grid-column-gap: 40px;
  grid-row-gap: 40px;
  flex-flow: row;
  grid-template-rows: auto;
  grid-template-columns: 1fr 1.5fr;
  grid-auto-columns: 1fr;
  place-items: center stretch;
  margin-bottom: 40px;
  display: grid;
}

.section {
  grid-column-gap: 16px;
  grid-row-gap: 16px;
  flex-flow: column;
  grid-template-rows: auto auto;
  grid-template-columns: 1fr 1fr;
  grid-auto-columns: 1fr;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  padding: 80px 16px;
  display: flex;
}

/* Styles for the Research Hub Center section (ID: servizi) - REVERTED TO LIGHT THEME */
#servizi.section {
  background-color: #ffffff; 
  overflow-x: hidden; /* Prevent horizontal scrollbar from full-width slider */
  padding-left: 0; /* Remove side padding for full-width slider effect */
  padding-right: 0; /* Remove side padding for full-width slider effect */
}

#servizi .w-layout-blockcontainer.container {
  /* This container will hold the heading and paragraph, so it needs its usual padding */
  padding-left: 16px; /* Re-apply side padding for the inner container */
  padding-right: 16px; /* Re-apply side padding for the inner container */
  max-width: 1200px; /* Ensure this container is still boxed */
  margin-left: auto;
  margin-right: auto;
}

#servizi .heading-5,
#servizi .paragraph-5 {
  color: var(--_colors---colortitle); /* Default title/text color for dark text on light background */
}

#servizi .button.w-button {
  background-color: var(--_colors---colorsecondary);
  color: #ffffff;
  border: none; /* Remove border if not in original design */
}

#servizi .button.w-button:hover {
  background-color: #005a8c; 
}

.button {
  grid-column-gap: 4px;
  grid-row-gap: 4px;
  background-color: var(--_colors---colorsecondary);
  color: #fff;
  border-radius: 8px;
  flex: 0 auto;
  justify-content: flex-start;
  align-items: center;
  height: 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 100%;
  display: inline-flex;
}

.arrow-icon {
  font-family: Inter, sans-serif;
  font-size: 18px;
}

.heading-5 {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.paragraph-5 {
  text-align: center;
  max-width: 545px;
  margin-left: auto;
  margin-right: auto;
}

.timeline-card {
  grid-column-gap: 4px;
  grid-row-gap: 4px;
}

.gridcfs {
  grid-column-gap: 24px;
  grid-row-gap: 24px;
  order: 0;
  align-self: center;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}

.cfsgrid-card-img {
  height: 72px;
  margin-bottom: 12px;
}

.cfsgrid-card-text {
  color: var(--_colors---colortext);
  font-size: 20px;
}

.cfsgrid-title {
  color: var(--_colors---colorsecondary);
  font-size: 30px;
}

.arrow-list {
  grid-column-gap: 16px;
  grid-row-gap: 16px;
  justify-content: flex-start;
  align-items: center;
}

.arrow-img {
  width: 32px;
  height: 32px;
}

.arrow-list-title {
  line-height: 100%;
}

.div-block-4 {
  grid-column-gap: 8px;
  grid-row-gap: 8px;
  flex-flow: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  display: flex;
}

.image-3 {
  border-radius: 20px;
  width: 100%;
}

@media screen and (max-width: 991px) {
  .container.cfscontainer {
    flex-flow: column;
    display: flex;
  }
}

@media screen and (max-width: 767px) {
  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 28px;
  }

  p {
    font-size: 16px;
  }

  .container.cfscontainer {
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    display: flex;
  }

  .section {
    padding-top: 40px;
    padding-bottom: 40px;
  }
}

@media screen and (max-width: 479px) {
  h2 {
    font-size: 28px;
  }

  .cfsgrid-card-img {
    margin-bottom: 0;
  }

  .cfsgrid-card-text {
    font-size: 16px;
  }

  .cfsgrid-title {
    margin-top: 10px;
  }

  .arrow-list {
    grid-column-gap: 12px;
    grid-row-gap: 12px;
  }

  .arrow-img {
    width: 24px;
    height: 24px;
  }

  .arrow-list-title {
    font-size: 20px;
    line-height: 120%;
  }
}

#w-node-_8a3d3768-373e-5b52-dbd9-2706440f20b0-d0186fba {
  grid-area: 1 / 1 / 2 / 2;
}

#w-node-_3c1a8971-c8ea-49a3-62cd-6c6c22625089-d0186fba {
  grid-template-rows: auto;
  grid-template-columns: minmax(1px, 1fr) minmax(1px, 1fr) minmax(1px, 1fr) minmax(1px, 1fr);
}

@media screen and (max-width: 991px) {
  #w-node-_3c1a8971-c8ea-49a3-62cd-6c6c22625089-d0186fba {
    display: flex;
   flex-direction: column;
  }
}

/* Articles Grid Section Styles */
.articles-section {
  padding: 60px 16px;
  background-color: #ffffff; /* CHANGED: White background */
}

.articles-grid {
  display: flex;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

/* Left column: 2 large articles */
.articles-left-column {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Right column: 3 small articles */  
.articles-right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Default article card style within .articles-section */
.articles-section .article-card {
  background: #ffffff;
  box-shadow: none;
  border-radius: 2px;
  overflow: hidden; 
  display: flex; 
  flex-direction: column; 
}

.articles-section .article-card:hover {
  transform: none;
  box-shadow: none;
}

/* Large Articles: 2 lines title with ellipsis */
.large-article-1 .article-title,
.large-article-2 .article-title {
  font-size: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin: 0 0 8px 0;
}

/* Small Articles: 1 line title with ellipsis */
.small-article-1 .article-title,
.small-article-2 .article-title,
.small-article-3 .article-title {
  font-size: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin: 0 0 8px 0;
}

/* Adjust image ratios */
.large-article-1 .article-image-wrapper,
.large-article-2 .article-image-wrapper {
  padding-top: 55.5%; /* 16:9 per articoli grandi */
}

.small-article-1 .article-image-wrapper,
.small-article-2 .article-image-wrapper,
.small-article-3 .article-image-wrapper {
  padding-top: 56.25%; /* 16:9 per articoli piccoli */
}

.article-card {
  background: white;
  border-radius: 2px; /* Minimal border radius */
  overflow: visible; /* Allow category to be outside if absolutely needed, but prefer structure */
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.12); /* Subtle shadow like in image */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; 
  flex-direction: column; 
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.08), 0 3px 6px rgba(0,0,0,0.15); /* Slightly more pronounced on hover */
}

/* First article (large-card) spans two columns - THIS IS THE OLD .large-card style, will be overridden by .large-main-article or adjusted */
.article-card.large-card {
  grid-column: 1 / -1; /* Span full width - This was for the previous layout */
}

.article-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden; /* Ensures image is clipped to the border-radius */
  border-radius: 12px; /* Rounded corners for the image container */
}

.article-card.large-card .article-image-wrapper {
  padding-top: 40%; /* Adjust for larger card, can be specific if needed */
}

.article-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  /* border-radius: 2px 2px 0 0; */ /* If image is direct child and needs top rounding */
}

.article-card:hover .article-image {
  transform: scale(1.03);
}

.article-category {
  color: var(--_colors---colorsecondary); 
  padding: 8px 0 0px 0; /* Padding: top, NO SIDES, bottom */
  font-size: 14px; /* SPECIFIED: 14px */
  font-weight: 500; 
  text-transform: none; 
  letter-spacing: normal; 
  display: block; 
  /* Text alignment can be set if needed, e.g., text-align: center; or text-align: left; */
}

.article-card.large-card .article-category {
  font-size: 15px; /* Keep slightly larger for large card or make 14px too? For now, keeping it relative */
  padding: 12px 0 0px 0;  /* Padding: top, NO SIDES, bottom */
}

.slider-article-card .article-category {
  font-size: 13px; /* Keep slightly smaller for slider or make 14px too? For now, keeping it relative */
  padding: 6px 0 0px 0; /* Padding: top, NO SIDES, bottom */
  color: var(--_colors---colorsecondary); 
}

.article-content {
  padding: 0px 0px 16px 0px; /* Padding: NO TOP, NO SIDES, bottom */
  flex-grow: 1; 
  display: flex;
  flex-direction: column;
}

.large-card .article-content {
  padding: 0px 0px 20px 0px; /* Padding: NO TOP, NO SIDES, bottom for large card */
}

.article-title {
  color: var(--_colors---colortitle);
  font-weight: 500; 
  line-height: 1.4;
  margin: 0 0 8px 0; 
  font-family: "DM Sans", sans-serif; 
  /* font-size: 20px; */ /* Base size, overridden by specific card types */

  /* Text truncation for 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.4em * 3); /* line-height * number of lines */
}

.article-card.large-card .article-title {
  font-size: 24px; 
  /* max-height: calc(1.4em * DESIRED_LINES_FOR_LARGE_CARD_TITLE); */
}

.article-card:not(.large-card) .article-title {
  font-size: 22px; /* INCREASED to 22px as per new request */
}

.slider-article-card .article-title {
  font-size: 20px; /* Adjusted slider title */
  line-height: 1.2;
  max-height: calc(1.2em * 3); /* line-height * number of lines for slider */
  /* Truncation styles are inherited from .article-title */
}

/* Articles Slider Styles - Adjusted for image */
.articles-slider-container {
  margin-top: 40px; /* Keep top margin */
  margin-bottom: 40px; /* Keep bottom margin */
  position: relative;
  /* Default: Boxed layout */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Make slider container full-width specifically for #servizi section */
#servizi .articles-slider-container {
  max-width: none; /* Remove max-width to allow full bleed */
  margin-left: 0; /* Remove side margins */
  margin-right: 0;
  width: 100%; /* Ensure it takes full available width */
  /* The actual slides will have padding if needed, via .slider-article-card */
}

.articles-slider {
  overflow: hidden;
}

.slider-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smoother transition */
  /* Width will be dynamically set by JS based on number of slides to show */
}

.slider-article-card {
  /* Flex basis will be set by JS */
  padding: 0 8px; /* Keep padding between slider cards */
  box-sizing: border-box;
  /* Prevent text selection within slider cards */
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10+ */
  user-select: none; /* Standard syntax */
}

.slider-article-card .article-card {
  height: 100%;
  margin: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07); /* Lighter shadow for slider items */
  line-height: 1.3;
  max-height: calc(1.3em * 3); /* line-height * number of lines for slider */
  /* Truncation styles are inherited from .article-title */
}

.slider-article-card .article-image-wrapper {
 padding-top: 66.66%; /* 3:2 Aspect ratio for slider images */
}

.slider-article-card .article-content {
  padding: 0px 0px 12px 0px; /* Padding: NO TOP, NO SIDES, bottom for slider cards */
}

/* .slider-article-card .article-title is handled above */

/* Slider Navigation - Minimalist style from image */
.slider-navigation {
  display: flex;
  justify-content: flex-end; 
  gap: 10px;
  margin-top: 20px; 
  padding-right: 8px; 
}

.slider-btn {
  width: 40px; /* Smaller buttons */
  height: 40px;
  border-radius: 50%;
  border: 1px solid #ddd; /* Lighter border */
  background-color: white;
  color: var(--_colors---colortext); /* Use text color */
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.slider-btn:hover {
  background-color: #f5f5f5; /* Slight hover effect */
  border-color: #ccc;
  transform: translateY(-1px);
}

.slider-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  background-color: #f9f9f9;
}

/* Ensure slider cards in light section have appropriate text colors */
#servizi .slider-article-card .article-title {
  color: var(--_colors---colortitle); /* Default title color for dark text */
}

/* #servizi .slider-article-card .article-category - Will be handled by global .article-category style changes */

/* Adjust slider buttons for light theme */
#servizi .slider-btn {
  background-color: white;
  color: var(--_colors---colortext);
  border: 1px solid #ddd; 
}

#servizi .slider-btn:hover {
  background-color: #f5f9f9;
  border-color: #ccc;
}

#servizi .slider-btn:disabled {
  background-color: #f9f9f9;
  color: #ccc;
  border-color: #eee;
  opacity: 0.6;
}

/* The navigation for the full-width slider might need to be contained or adjusted */
#servizi .slider-navigation {
  max-width: 1200px; /* Keep navigation boxed within the main content width */
  margin-left: auto; /* Center the navigation */
  margin-right: auto; /* Center the navigation */
  padding-left: 16px; /* Add padding to align with content if needed */
  padding-right: 16px; /* Add padding to align with content if needed */
  justify-content: center; /* Keep buttons to the right */
}

/* Prevent image dragging within slider cards */
.slider-article-card .article-image {
  pointer-events: none;
}

/* RESPONSIVE DESIGN FOR ARTICLES SECTION */

/* TABLET: 4 articoli (2x2 grid) della stessa grandezza */
@media screen and (max-width: 991px) {
  .articles-grid {
    display: grid !important; /* Force grid over flexbox */
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
  }
  
  .articles-left-column,
  .articles-right-column {
    display: contents; /* I figli si comportano come figli diretti del grid */
  }
  
  /* Nasconde il 5° articolo su tablet */
  .articles-section .small-article-3 {
    display: none !important;
  }
  
  /* Tutti gli articoli della stessa dimensione su tablet */
  .articles-section .large-article-1 .article-image-wrapper,
  .articles-section .large-article-2 .article-image-wrapper,
  .articles-section .small-article-1 .article-image-wrapper,
  .articles-section .small-article-2 .article-image-wrapper {
    padding-top: 56.25% !important; /* 16:9 per tutti */
  }
  
  /* Tutti i titoli con le stesse dimensioni su tablet */
  .articles-section .large-article-1 .article-title,
  .articles-section .large-article-2 .article-title,
  .articles-section .small-article-1 .article-title,
  .articles-section .small-article-2 .article-title {
    font-size: 20px !important;
    -webkit-line-clamp: 2 !important;
  }
}

/* MOBILE: 3 articoli uno sotto l'altro della stessa grandezza */
@media screen and (max-width: 767px) {
  .articles-section {
    padding: 40px 16px;
  }
  
  .articles-grid {
    display: flex !important; /* Force flex over grid */
    flex-direction: column;
    gap: 20px;
  }
  
  .articles-left-column,
  .articles-right-column {
    display: contents; /* Flatten structure - articles become direct children of grid */
  }
  
  /* Ensure all visible articles take full width */
  .articles-section .large-article-1,
  .articles-section .large-article-2,
  .articles-section .small-article-1 {
    width: 100%;
    flex: none;
  }
  
  /* Mostra solo 3 articoli su mobile: large-article-1, small-article-1, e large-article-2 */
  .articles-section .small-article-2,
  .articles-section .small-article-3 {
    display: none !important;
  }
  
  /* Tutti gli articoli della stessa dimensione su mobile */
  .articles-section .large-article-1 .article-image-wrapper,
  .articles-section .large-article-2 .article-image-wrapper,
  .articles-section .small-article-1 .article-image-wrapper {
    padding-top: 56.25% !important; /* 16:9 per tutti */
  }
  
  /* Tutti i titoli con le stesse dimensioni su mobile */
  .articles-section .large-article-1 .article-title,
  .articles-section .large-article-2 .article-title,
  .articles-section .small-article-1 .article-title {
    font-size: 18px !important;
    -webkit-line-clamp: 2 !important;
  }
}


