/* Lista immobili ambient — preset definitivo (PORTAL_LIST_AMBIENT=1) */

/* —— Hero —— */

body.portal-list-ambient.is-hero-ambient-on .hero-shell.portal-list-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.94),
      color-mix(in srgb, var(--brand-ghost) 88%, rgba(255, 255, 255, 0.55))
    ),
    linear-gradient(180deg, rgba(var(--brand-rgb), 0.06), transparent 55%);
  border-color: rgba(var(--brand-rgb), 0.14);
}

body.portal-list-ambient.is-hero-ambient-on .hero-shell.portal-list-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(80% 80% at 18% 0%, rgba(var(--brand-rgb), 0.14), transparent 68%);
}

body.portal-list-ambient.is-hero-ambient-on .portal-list-hero .portal-results-head {
  position: relative;
  z-index: 1;
}

body.portal-list-ambient.is-hero-entrance-on.is-hero-entrance-play .portal-list-entrance-target {
  opacity: 0;
  transform: translateY(22px);
  animation: portal-list-hero-entrance 0.78s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.portal-list-ambient.is-hero-entrance-on.is-hero-entrance-play .portal-list-entrance-target:nth-child(1) {
  animation-delay: 0.05s;
}

body.portal-list-ambient.is-hero-entrance-on.is-hero-entrance-play .portal-list-entrance-target:nth-child(2) {
  animation-delay: 0.18s;
}

body.portal-list-ambient.is-hero-entrance-on.is-hero-entrance-play .portal-list-entrance-target:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes portal-list-hero-entrance {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Bridge hero → risultati —— */

body.portal-list-ambient.is-results-bridge-on .portal-list-shell {
  position: relative;
}

body.portal-list-ambient.is-results-bridge-on .portal-list-shell::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 0;
  right: 0;
  height: 48px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(var(--brand-rgb), 0.08),
    rgba(var(--brand-rgb), 0.02),
    transparent
  );
  animation: portal-list-bridge-pulse 3.4s ease-in-out infinite alternate;
}

@keyframes portal-list-bridge-pulse {
  from {
    opacity: 0.65;
    transform: scaleY(0.94);
  }

  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* —— Card glass + reveal —— */

body.portal-list-ambient.is-card-glass-on .portal-result-card {
  position: relative;
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.82) !important;
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

body.portal-list-ambient.is-card-glass-on .portal-result-card:hover {
  transform: translateY(-4px) !important;
  box-shadow:
    0 26px 56px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(var(--brand-rgb), 0.12);
}

body.portal-list-ambient.is-card-glass-on .portal-result-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 48%,
    transparent 100%
  );
  transform: translateX(-120%);
}

body.portal-list-ambient.is-card-glass-on .portal-result-card:hover::after {
  opacity: 1;
  animation: portal-list-card-shine 1.1s ease forwards;
}

@keyframes portal-list-card-shine {
  to {
    transform: translateX(120%);
  }
}

body.portal-list-ambient.is-card-glass-on .portal-result-media img {
  transform-origin: center center;
}

body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card.is-card-revealed {
  opacity: 1;
  transform: translateY(0);
}

body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card:nth-child(1) {
  transition-delay: 0.02s;
}
body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card:nth-child(2) {
  transition-delay: 0.08s;
}
body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card:nth-child(3) {
  transition-delay: 0.14s;
}
body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card:nth-child(4) {
  transition-delay: 0.2s;
}
body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card:nth-child(5) {
  transition-delay: 0.26s;
}
body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card:nth-child(6) {
  transition-delay: 0.32s;
}
body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card:nth-child(7) {
  transition-delay: 0.38s;
}
body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card:nth-child(8) {
  transition-delay: 0.44s;
}

/* —— Mappa glass —— */

body.portal-list-ambient.is-map-glass-on .portal-map-card {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    0 22px 50px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 1px rgba(var(--brand-rgb), 0.08);
}

@media (prefers-reduced-motion: reduce) {
  body.portal-list-ambient.is-hero-entrance-on .portal-list-entrance-target,
  body.portal-list-ambient.is-card-reveal-on .portal-results-grid .portal-result-card,
  body.portal-list-ambient.is-card-glass-on .portal-result-card::after {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  body.portal-list-ambient.is-results-bridge-on .portal-list-shell::before {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
