/* Styles for cassetti (drawer) grid on Digitalizzazione Processi page */
.drawer-section {
  padding: 3.5rem 0;
}
.drawer-title {
  text-align: center;
  margin-bottom: 1.5rem;
  flex-direction: column;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  align-items: stretch;
  width: 100%;
}

/* Marquee (infinite scrolling tiles) */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 10px 0 20px;
}
.marquee-track {
  display: flex;
  gap: 18px;
  align-items: center;
  white-space: nowrap;
}
.marquee-track .drawer-tile { flex: 0 0 auto; width: 160px; }

/* animations: track must contain duplicated items for seamless loop */
@keyframes marquee-left {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}
@keyframes marquee-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0%); }
}
.marquee-top .marquee-track { animation: marquee-right 36s linear infinite; }
.marquee-bottom .marquee-track { animation: marquee-left 40s linear infinite; }

/* Fade/blur overlays at edges */
.marquee::before, .marquee::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 8%;              /* ← aumenta da 8% a 18% per più spazio alla dissolvenza */
  pointer-events: none;
  z-index: 5;
  backdrop-filter: blur(3px);
  /* Maschera: il lato opaco rimane visibile, il lato interno svanisce */
  -webkit-mask-image: linear-gradient(90deg, black 30%, transparent 100%);
  mask-image: linear-gradient(90deg, black 30%, transparent 100%);
}
.marquee::before {
  left: 0;
  /* Gradiente con più stop = curva ease-out percettiva */
  background: linear-gradient(90deg,
    rgba(255,255,255,1.00)  0%,
    rgba(255,255,255,0.95) 15%,
    rgba(255,255,255,0.80) 35%,
    rgba(255,255,255,0.55) 60%,
    rgba(255,255,255,0.15) 82%,
    rgba(255,255,255,0.00) 100%
  );
}

.marquee::after {
  right: 0;
  /* Stessa curva, direzione invertita */
  background: linear-gradient(270deg,
    rgba(255,255,255,1.00)  0%,
    rgba(255,255,255,0.95) 15%,
    rgba(255,255,255,0.80) 35%,
    rgba(255,255,255,0.55) 60%,
    rgba(255,255,255,0.15) 82%,
    rgba(255,255,255,0.00) 100%
  );
  /* Specchia la maschera */
  -webkit-mask-image: linear-gradient(270deg, black 30%, transparent 100%);
  mask-image: linear-gradient(270deg, black 30%, transparent 100%);
}
/* Demo carousel center */
.demo-carousel {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  padding: 22px 0 22px;
  width:100%;
  max-width: 1100px;
  margin: 0 auto;
}

.demo-carousel::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 360px;
  z-index: 0;
  pointer-events: none;
  /* background:
    radial-gradient(circle at 22% 38%, rgba(109, 244, 154, 0.979), transparent 28%),
    radial-gradient(circle at 52% 34%, rgba(207, 122, 244, 0.699), transparent 30%),
    radial-gradient(circle at 80% 60%, rgba(109, 148, 212, 0.1), transparent 28%),
    radial-gradient(circle at 50% 60%, rgba(255,255,255,0.12), transparent 35%);*/
  filter: blur(30px);
  border-radius: 40%;
  mix-blend-mode: normal;
}

.demo-carousel .demo-slide{
  position: relative;
  width: calc((100% - 36px) / 3);
  max-width: 360px;
  height: 260px;
  border-radius: 12px;
  overflow: hidden;
  /* box-shadow: 0 18px 44px rgba(0,0,0,0.07); */
  background: linear-gradient(180deg,#ffffff, #f6fbff);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
  pointer-events: auto;
}

.demo-caption#foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  z-index: 4;

  /* Improved linear fade: stronger, more perceptually smooth stops */
  /* background: linear-gradient(
    to top,
    rgba(255,255,255,0.68) 0%,
    rgba(255,255,255,0.68) 6%,
    rgba(255,255,255,0.68) 18%,
    rgba(255,255,255,0.68) 32%,
    rgba(255,255,255,0.48) 50%,
    rgba(255,255,255,0.22) 74%,
    rgba(255,255,255,0.00) 100%
  )!important; */



  /* ensure no mask interferes with the fade */
mask: linear-gradient(transparent, transparent,black, black, black, black, black);
backdrop-filter: blur(2px);

  /* soft inner shadow to avoid a hard edge look */
  box-shadow: inset 0 12px 26px rgba(0,0,0,0.03);
  gap: 10px;
  color: #1f2430 !important;
  font-size: 15px;
  font-family:  Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  transition: background 240ms ease;
}

.demo-caption .caption-icon,
.demo-caption svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px; /* piccolo spazio tra icona e testo */
}

.demo-carousel .demo-slide img{ width:100%; height:100%; object-fit:cover; display:block; }

/* responsive tweaks */
@media(max-width:991px){
  .marquee-track .drawer-tile { width: 140px; }
  .demo-carousel { gap:12px; max-width:900px; }
  .demo-carousel .demo-slide{ max-width:300px; height:180px; width: calc((100% - 24px) / 3); }
}

@media(max-width:680px){
  .demo-carousel{ flex-wrap:wrap; }
  .demo-carousel .demo-slide{ width: 48%; max-width:380px; height:160px; }
}

.drawer-tile {
  background: rgba(255,255,255,0.98);
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  border: 1px solid rgba(34,34,34,0.04);
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
  min-height: 110px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  transition: transform .18s ease, box-shadow .18s ease;
  color: #222;
}
.drawer-tile .icon {
  font-size: 22px;
  opacity: 1;
  margin-bottom: 8px;
  color: var(--cloe-secondary); /* keep same icon color as other icons */
  display:flex;
  align-items:center;
  justify-content:center;
}
.drawer-tile .icon i { display:inline-flex; }
.drawer-tile .icon svg { width:26px; height:26px; stroke: currentColor; color: inherit; opacity: 1; }
.drawer-tile:hover .icon svg { filter: brightness(0.92); }
.drawer-tile .label {
  font-size: 13px;
  font-weight:600;
  opacity: 0.85;
}
.drawer-tile:hover{ transform: translateY(-6px); box-shadow: 0 22px 48px rgba(0,0,0,0.12); }

/* central highlighted cards */
.drawer-highlight {
  background: linear-gradient(180deg,#ffffff 0%, #f7fbff 100%);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.12), 0 8px 18px rgba(38,154,242,0.12);
  border: 1px solid rgba(255,255,255,0.8);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  min-height: 160px;
}
.drawer-highlight .h-title{ font-weight:700; font-size:18px; margin-bottom:8px; }
.drawer-highlight .h-desc{ font-size:13px; color:#4a4a4a; }

/* place highlights in the center of the grid on large screens */

@media(min-width:992px){
  .drawer-grid { grid-template-columns: repeat(6, 1fr); }
  .highlight-span2{ grid-column: span 2; }
}

@media(max-width:991px){
  .drawer-grid { grid-template-columns: repeat(3, 1fr); }
  .drawer-tile{ min-height:80px; }
  .drawer-highlight{ min-height:140px; }
}

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

/* subtle focus outline for accessibility */
.drawer-tile:focus{ outline: none; box-shadow: 0 8px 26px rgba(0,0,0,0.12), 0 0 0 4px rgba(38,154,242,0.08); }
