*,
*::before,
*::after{
  box-sizing:border-box;
}

.portfolio-page{
  min-height:100vh;
  background:var(--bg-color);
  color:var(--text-color);
  overflow-x:hidden;
}

.portfolio-hero{
  padding:130px 0 28px;
}

.section-kicker{
  display:inline-block;
  margin-bottom:10px;
  font-size:.74rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--primary-color);
}

.portfolio-hero h1{
  color:var(--white);
  font-size:clamp(2.2rem, 4.5vw, 3.8rem);
  line-height:1;
  letter-spacing:-.03em;
  text-align: center;
}

.portfolio-grid-section{
  padding:0 0 68px;
}

.portfolio-grid-section .container{
  width:min(1200px, calc(100% - 32px));
  margin:0 auto;
}

.template-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}

.template-card{
  min-width:0;
  display:block;
  overflow:hidden;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  text-decoration:none;
  transition:transform .2s ease, border-color .2s ease;
}

.template-card:hover{
  transform:translateY(-2px);
  border-color:rgba(255,255,255,.18);
}

.template-card__preview{
  width:100%;
  aspect-ratio:16/9;
  background:center/cover no-repeat;
  display:block;
}

.template-card__body{
  min-width:0;
  padding:10px 12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.template-card__tag{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  color:var(--primary-color);
  font-size:.6rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
}

.template-card h2{
  margin:5px;
  color:var(--white);
  font-size: 20px;
  font-weight:500;
  line-height:1.2;
  word-break:break-word;
  
}

/* Preview backgrounds */
.template-card__preview--fashion{
  background-image:url("/assets/img/template/negozio/shopscreen.png");
}
.template-card__preview--barber{
  background-image:url("/assets/img/template/barber/screenbarber.png");
}
.template-card__preview--restaurant{
  background-image:url("/assets/img/template/ristorante/ristorantescree.png");
}
.template-card__preview--gym{
  background-image:url("/assets/img/template/palestra/palestrascreen.png");
}
.template-card__preview--law{
  background-image:url("/assets/img/template/studiolegale/studioscreen.png");
}
.template-card__preview--dental{
  background-image:url("/assets/img/template/dentista/dentstascreen.png");
}
.template-card__preview--hotel{
  background-image:url("/assets/img/template/hotel/hotelscreen.png");
}
.template-card__preview--realestate{
  background-image:url("/assets/img/template/immobiliare/casascreen.png");
}
.template-card__preview--beauty{
  background-image:url("/assets/img/template/estetica/esteticascreen.png");
}
.template-card__preview--bakery{
  background-image:url("/assets/img/template/pasticceria/pasticceriascreen.png");
}

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

@media (max-width:768px){
  .portfolio-hero{
    padding:110px 0 18px;
  }

  .portfolio-grid-section{
    padding:0 0 52px;
  }

  .portfolio-grid-section .container{
    width:calc(100% - 20px);
  }

  .template-grid{
    grid-template-columns:1fr;
    gap:12px;
  }

  .template-card h2{
    font-size:.84rem;
  }
}