/* ============================================================
   PORTFOLIO — Avatar Studio
   CSS Grid asimetric 3 coloane cu itemi "large" pe 2 coloane.
   Hover: zoom ușor pe imagine + overlay cu icon și titlu.
   ============================================================ */

/* ── Grid ──────────────────────────────────────────────────── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(220px, 22vw, 320px);
  /* dense: fără asta, un item "large" (span 2) care nu mai încape pe
     rândul curent lasă o celulă goală în urmă în loc să fie umplută
     de următorul item mic — vizibil la 3 și la 2 coloane */
  grid-auto-flow: dense;
  gap: 4px;
  margin-bottom: clamp(20px, 3vw, 36px);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Item normal: 1 coloană × 1 rând */
.portfolio-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background-color: var(--bg-card);
}

/* Item "large": 2 coloane × 1 rând */
.portfolio-item--large {
  grid-column: span 2;
}


/* ── Imagine ───────────────────────────────────────────────── */
.portfolio-item__media {
  position: absolute;
  inset: 0;
}

.portfolio-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition:
    transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    filter 0.6s ease;
  filter: brightness(0.85);
}

.portfolio-item:hover .portfolio-item__img {
  transform: scale(1.07);
  filter: brightness(0.5);
}

/* ── Overlay (ascuns implicit, fade-in la hover) ───────────── */
.portfolio-item__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio-item:hover .portfolio-item__overlay {
  opacity: 1;
}

/* Icon zoom centrat */
.portfolio-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  transform: scale(0.7);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portfolio-item:hover .portfolio-item__icon {
  transform: scale(1);
}

/* Info text (categorie + titlu) jos în overlay */
.portfolio-item__info {
  text-align: center;
  transform: translateY(12px);
  transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-item__info {
  transform: translateY(0);
}

.portfolio-item__category {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.portfolio-item__title {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  margin: 0;
}

/* ── Linie decorativă aurie jos-stânga (fără hover) ───────── */
.portfolio-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.4s ease;
  z-index: 2;
}

.portfolio-item:hover::after {
  width: 60px;
}

/* ── Focus keyboard ────────────────────────────────────────── */
.portfolio-item:focus-within .portfolio-item__overlay {
  opacity: 1;
}

.portfolio-item:focus-within .portfolio-item__img {
  transform: scale(1.05);
  filter: brightness(0.5);
}

/* ── CTA centrat ───────────────────────────────────────────── */
.portfolio__cta {
  margin-top: 8px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 270px;
  }

  /* Pe 2 coloane, "large" rămâne span 2 */
  .portfolio-item--large {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
    gap: 3px;
  }

  /* Pe 1 coloană, "large" la fel ca normal */
  .portfolio-item--large {
    grid-column: span 1;
  }

  .portfolio-item__overlay {
    /* Pe mobile: overlay mereu parțial vizibil în jos */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 60%);
    opacity: 1;
    justify-content: flex-end;
    padding: 16px;
  }

  .portfolio-item__icon {
    display: none;
  }

  .portfolio-item__info {
    transform: none;
    text-align: left;
    width: 100%;
  }
}
