/* Portfolio 2 - layout completamente isolato
   Prefisso classi: p2-
*/

body.p2-portfolio-page {
  background-color: #050816;
  color: #f9fafb;
  width: 100% !important; /* sovrascrive il layout a larghezza fissa del tema */
  max-width: 100% !important;
}

body.p2-modal-open .global-bottom-menu {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.p2-portfolio-root {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: 0;
  background: radial-gradient(circle at top, #111827 0, #020617 55%, #020617 100%);
}

@media (min-width: 768px) {
  .p2-portfolio-root {
    padding: 0;
  }
}

.p2-portfolio-shell {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.p2-portfolio-heading {
  margin-bottom: 32px;
}

.p2-portfolio-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #a5b4fc;
  margin-bottom: 8px;
}

.p2-portfolio-title {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #e5e7eb;
  margin: 0 0 12px;
}

.p2-portfolio-subtitle {
  max-width: 640px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #9ca3af;
  margin: 0;
}

/* Viewport scrollabile per la griglia "infinita" */

.p2-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  border: none;
  background-color: #7d252a;
  box-shadow: none;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  width: 100%;
}

.p2-infinite-grid {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.p2-card {
  position: absolute;
  border-radius: 18px;
  overflow: hidden;
  /* Sfondo condiviso per tutte le card (uguale alla card centrale) */
  background: #7b3a3a;
  border: 1px solid #933325;
  box-shadow:
    0 18px 35px rgba(147, 51, 37, 0.75),
    0 0 0 1px rgba(147, 51, 37, 0.9);
  isolation: isolate;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
  cursor: grab;
  filter: none;
  -webkit-filter: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  /* Dimensioni fisiche 320x480; il gutter è gestito dal posizionamento JS */
  width: 320px;
  height: 480px;
}

/* Tablet: card leggermente più piccole */
@media (max-width: 1023px) {
  .p2-card {
    width: 280px;
    height: 420px;
  }
}

/* Mobile: card compatte (220x330) */
@media (max-width: 767px) {
  .p2-card {
    width: 220px;
    height: 330px;
  }
}

.p2-viewport--dragging {
  cursor: grabbing;
}

.p2-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  /* Highlight coerente con la palette rossa */
  background: radial-gradient(circle at 0 0, rgba(248, 113, 113, 0.55), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.p2-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 22px 45px rgba(147, 51, 37, 0.9),
    0 0 0 1px rgba(147, 51, 37, 1);
  border-color: #933325;
  /* Leggero schiarimento in hover mantenendo lo stesso tono */
  background: radial-gradient(circle at top left, #8f3a3f 0, #6a1f23 65%);
}

.p2-card:hover::before {
  opacity: 1;
}

.p2-card-image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.p2-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.05);
  transition: transform 0.45s ease;
  filter: none;
  -webkit-filter: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: auto;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

.p2-card:hover .p2-card-image {
  transform: scale(1.12);
}

.p2-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.3),
    transparent
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 16px 14px;
}

.p2-card-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.p2-card-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #a5b4fc, #4f46e5);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.35);
}

.p2-card-chip-label {
  opacity: 0.8;
}

.p2-card-body {
  padding: 14px 16px 16px;
}

.p2-card-title {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #e5e7eb;
  margin: 0 0 6px;
}

.p2-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: #9ca3af;
}

.p2-card-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.p2-card-meta-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #6b7280;
}

.p2-card-description {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #9ca3af;
  margin: 0 0 10px;
}

.p2-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.p2-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: linear-gradient(to right, #4f46e5, #7c3aed);
  color: #e5e7eb;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    0 10px 20px rgba(67, 56, 202, 0.5),
    0 0 0 1px rgba(191, 219, 254, 0.22);
}

.p2-card-cta:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.p2-card-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.p2-card-tagline {
  font-size: 0.74rem;
  color: #6b7280;
}

.p2-card-tagline span {
  color: #a5b4fc;
}

/* Varianti specifiche per i due tipi di card */

.p2-card--hero {
  /* Usa lo stesso stile base delle altre card; cambia solo il contenuto */
}

.p2-card--simple {
  /* Stesso stile base; differenze solo nel contenuto (immagine/testo) */
}

.p2-card-hero-content {
  text-align: center;
  padding: 32px 20px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.p2-card-hero-logo {
  margin: 8px 0 10px;
}

.p2-card-hero-logo img {
  max-width: 200px;
  width: 100%;
  height: auto;
  display: inline-block;
}

.p2-card-hero-title {
  margin: 0 0 10px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.p2-card-hero-subtitle {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #f3f4f6;
}

.p2-card-simple-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  filter: none;
  -webkit-filter: none;
}

.p2-card-simple-size {
  opacity: 0.9;
}

.p2-card-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  filter: none;
  -webkit-filter: none;
}


.p2-portfolio-empty {
  margin-top: 32px;
  padding: 24px 18px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top left, rgba(55, 65, 81, 0.7), rgba(15, 23, 42, 0.96));
  color: #d1d5db;
}

.p2-portfolio-empty-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.p2-portfolio-empty-text {
  font-size: 0.86rem;
  margin: 0 0 12px;
  color: #9ca3af;
}

.p2-portfolio-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.8rem;
  color: #e5e7eb;
  text-decoration: none;
}

.p2-portfolio-empty-cta:hover {
  text-decoration: none;
  border-color: #a5b4fc;
}

.p2-portfolio-footer-note {
  margin-top: 24px;
  font-size: 0.76rem;
  color: #6b7280;
}

.p2-portfolio-footer-note strong {
  color: #d1d5db;
}


