/* ==========================================================================
   Portfolio Grid + Modal — Dribbble-style
   ========================================================================== */

/* ---------- Filter Tabs ---------- */

.portfolio-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 1rem;
  margin: 2rem auto 1.5rem;
  max-width: 1200px;
}

.portfolio-filters button {
  background: none;
  border: 1.5px solid #ccc;
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.85rem;
  color: #666;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  font-family: inherit;
}

.portfolio-filters button:hover {
  border-color: #333;
  color: #333;
}

.portfolio-filters button.--active {
  background: #333;
  border-color: #333;
  color: #fff;
}

/* ---------- Grid ---------- */

.portfolio-grid-new {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

/* ---------- Card ---------- */

.portfolio-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #eee;
  aspect-ratio: 4 / 3;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.portfolio-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-card__img {
  transform: scale(1.04);
}

.portfolio-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.portfolio-card:hover .portfolio-card__overlay {
  opacity: 1;
}

.portfolio-card__title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}

.portfolio-card__category {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portfolio-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: #999;
  font-size: 1rem;
}

/* ==========================================================================
   Modal — Full Dribbble-style shot view
   ========================================================================== */

/* ---------- Overlay ---------- */

.portfolio-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-modal.--visible {
  display: flex;
}

.portfolio-modal.--active {
  opacity: 1;
}

/* ---------- Close button ---------- */

.pm-close {
  position: fixed;
  top: 12px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  transition: background 0.2s ease;
}

.pm-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pm-close svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

/* ---------- Side Navigation Arrows ---------- */

.pm-side-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  transition: background 0.2s ease;
}

.pm-side-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pm-side-nav svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

.pm-side-nav.--prev-project { left: 16px; }
.pm-side-nav.--next-project { right: 16px; }

.pm-side-nav[hidden] { display: none; }

/* ---------- Scrollable area ---------- */

.pm-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 20px 0;
}

.pm-content {
  background: #fff;
  border-radius: 16px 16px 0 0;
  max-width: 900px;
  width: 100%;
  transform: translateY(30px);
  transition: transform 0.35s ease;
}

.portfolio-modal.--active .pm-content {
  transform: translateY(0);
}

/* ==========================================================================
   Section 1 — Header
   ========================================================================== */

.pm-header {
  padding: 24px 32px 16px;
}

.pm-header__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 14px;
  line-height: 1.3;
}

.pm-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-header__author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: #f0f0f0;
  padding: 2px;
}

.pm-header__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.pm-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-header__badge {
  display: inline-block;
  background: #FC0;
  color: #333;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 12px;
  border-radius: 50px;
}

.pm-header__cta {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 50px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.pm-header__cta:hover {
  background: #444;
  text-decoration: none;
}

/* ==========================================================================
   Section 2 — Main Image Gallery
   ========================================================================== */

.pm-gallery {
  position: relative;
  background: #f5f5f5;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pm-gallery__image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.pm-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s ease;
}

.pm-gallery__arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}

.pm-gallery__arrow svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

.pm-gallery__arrow.--prev { left: 12px; }
.pm-gallery__arrow.--next { right: 12px; }

.pm-gallery__arrow[hidden] { display: none; }

/* ==========================================================================
   Section 3 — Thumbnail Gallery
   ========================================================================== */

.pm-thumbs {
  display: flex;
  gap: 10px;
  padding: 16px 32px;
  overflow-x: auto;
  background: #fff;
}

.pm-thumbs[hidden] { display: none; }

.pm-thumbs__item {
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: #eee;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.55;
}

.pm-thumbs__item.--active {
  border-color: #FC0;
  opacity: 1;
}

.pm-thumbs__item:hover {
  opacity: 1;
}

.pm-thumbs__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Section 4 — Description + Links
   ========================================================================== */

.pm-body {
  padding: 28px 32px 32px;
}

.pm-body__text p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0 0 16px;
}

.pm-body__text p:last-child {
  margin-bottom: 20px;
}

.pm-body__links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pm-body__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 50px;
  background: #333;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.pm-body__link:hover {
  background: #555;
  text-decoration: none;
}

.pm-body__link svg {
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

/* ==========================================================================
   Section 5 — Author Profile Card
   ========================================================================== */

.pm-profile {
  text-align: center;
  padding: 40px 32px 48px;
}

.pm-profile__divider {
  width: 100%;
  height: 1px;
  background: #eee;
  margin-bottom: 40px;
}

.pm-profile__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: contain;
  background: #f5f5f5;
  padding: 4px;
  margin: 0 auto 14px;
  display: block;
}

.pm-profile__name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
}

.pm-profile__tagline {
  color: #888;
  font-size: 0.88rem;
  margin: 0 0 20px;
  line-height: 1.5;
}

.pm-profile__cta {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 50px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.pm-profile__cta:hover {
  background: #444;
  text-decoration: none;
}

/* ==========================================================================
   Section 6 — Related Projects
   ========================================================================== */

.pm-related {
  padding: 0 32px 40px;
}

.pm-related[hidden] { display: none; }

.pm-related__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pm-related__title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.pm-related__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.pm-related__card {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease;
}

.pm-related__card:hover {
  transform: translateY(-3px);
}

.pm-related__card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin-bottom: 8px;
  background: #f0f0f0;
}

.pm-related__card span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Section 7 — Footer Navigation
   ========================================================================== */

.pm-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pm-footer__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.pm-footer__btn:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.pm-footer__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pm-footer__btn svg {
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.pm-footer__hint {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 1024px) {
  .portfolio-grid-new {
    grid-template-columns: repeat(3, 1fr);
  }

  .pm-related__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .portfolio-grid-new {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .portfolio-filters {
    gap: 6px;
  }

  .portfolio-filters button {
    font-size: 0.78rem;
    padding: 5px 14px;
  }

  .pm-scroll {
    padding: 16px 8px 0;
  }

  .pm-header {
    padding: 18px 20px 12px;
  }

  .pm-header__title {
    font-size: 1.25rem;
  }

  .pm-header__bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .pm-thumbs {
    padding: 12px 20px;
  }

  .pm-body {
    padding: 20px;
  }

  .pm-profile {
    padding: 28px 20px 36px;
  }

  .pm-related {
    padding: 0 20px 32px;
  }

  .pm-related__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .pm-side-nav {
    display: none;
  }
}

@media screen and (max-width: 480px) {
  .portfolio-grid-new {
    grid-template-columns: 1fr;
  }

  .portfolio-card {
    border-radius: 8px;
  }

  .pm-content {
    border-radius: 10px 10px 0 0;
  }

  .pm-footer {
    gap: 12px;
    padding: 10px 12px;
  }

  .pm-footer__btn span {
    display: none;
  }
}
