/* SERVISO — Portfolio grid, filters, and the detail carousel. */
/* ============================================================
   PORTFOLIO SECTION
   ============================================================ */
.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin-bottom: 3rem;
}
.filter-btn {
  padding: .625rem 1.5rem;
  border-radius: 100px;
  border: 2px solid var(--gray-300);
  background: transparent;
  color: var(--gray-700);
  font-weight: 500;
  font-size: .9375rem;
  cursor: pointer;
  transition: all .3s var(--ease-smooth);
  font-family: 'Inter', sans-serif;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary-gradient); color: white; border-color: transparent; box-shadow: var(--shadow-md); }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.portfolio-item {
  display: block;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .4s var(--ease-smooth);
  text-decoration: none;
  aspect-ratio: 4 / 3;
  background: var(--gray-100);
}
.portfolio-item:hover { box-shadow: var(--shadow-xl); transform: translateY(-4px); }
.portfolio-item.hidden { display: none; }
.portfolio-item > img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease-smooth);
}
.portfolio-item:hover > img { transform: scale(1.05); }

.portfolio-placeholder {
  position: absolute;
  inset: 0;
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
}
.portfolio-placeholder svg { width: 48px; height: 48px; color: var(--gray-400); }
.portfolio-placeholder span { display: none; }

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%, rgba(0,0,0,.82));
  opacity: 0;
  transition: opacity .4s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-overlay-title { color: white; font-weight: 600; font-size: 1.0625rem; line-height: 1.3; margin-bottom: .5rem; }
.portfolio-tags { display: flex; flex-wrap: wrap; gap: .375rem; }
.portfolio-tag {
  font-size: .75rem;
  padding: .25rem .75rem;
  border-radius: 100px;
  background: rgba(255,255,255,.2);
  color: white;
  backdrop-filter: blur(4px);
}
.portfolio-more { text-align: center; margin-top: 3rem; }

/* ── Portfolio detail page — image carousel ── */
.portfolio-carousel {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--gray-100);
}
.portfolio-carousel-track {
  display: flex;
  height: 480px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.portfolio-carousel-track::-webkit-scrollbar { height: 6px; }
.portfolio-carousel-track::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 3px; }
.portfolio-carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  cursor: pointer;
  background: var(--gray-100);
}
.portfolio-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--gray-900);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background .2s var(--ease-smooth), transform .2s var(--ease-smooth);
}
.carousel-arrow:hover { background: white; transform: translateY(-50%) scale(1.08); }
.carousel-arrow-prev { left: 12px; }
.carousel-arrow-next { right: 12px; }

@media (max-width: 640px) {
  .portfolio-carousel-track { height: 320px; }
}

.portfolio-detail { padding: 2.5rem 0 5rem; }
.portfolio-meta {
  margin-top: 2rem;
  padding: 0 3rem;
}
@media (max-width: 860px) {
  .portfolio-meta { padding: 0 1.25rem; }
}
@media (max-width: 640px) {
  .portfolio-meta { padding: 0; }
}

.portfolio-description {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}
.portfolio-description > * + * { margin-top: 1em; }
.portfolio-description ul,
.portfolio-description ol { margin-left: 1.25em; }
.portfolio-description li + li { margin-top: .35em; }
.portfolio-description h1, .portfolio-description h2, .portfolio-description h3,
.portfolio-description h4, .portfolio-description h5, .portfolio-description h6 {
  color: var(--text-primary);
  line-height: 1.3;
}

/* ── Responsive ─────────────────────────────────────────────── */
/* Kept beside the component these rules modify, instead of in a single
 * block at the bottom of the stylesheet, separated from everything they
 * apply to. */

@media (max-width: 768px) {
  .portfolio-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .portfolio-filters { gap: .5rem; }
  .filter-btn { padding: .5rem 1rem; font-size: .875rem; }
}

@media (max-width: 576px) {
  .portfolio-grid { grid-template-columns: 1fr; }
}
