/* Portfolio grid + lightbox, shared by index.html and portfolio.html (markup and logic: portfolio.js) */

/* Portfolio */
.portfolio-section {
  padding: 5rem 1.5rem;
  background: #253a46;
  color: #fcfdfd;
}

.portfolio-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.portfolio-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.portfolio-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fcfdfd;
}

.portfolio-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.portfolio-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: #1f2937;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.portfolio-card img,
.portfolio-card video.portfolio-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  background: #1f2937;
}

.portfolio-card:hover img {
  transform: scale(1.06);
}

.portfolio-meta {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.65) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  color: #fff;
}

.portfolio-title-sm {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.portfolio-tag {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Video Cards */
.portfolio-card.video-card {
  position: relative;
}

.video-card .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(249, 115, 22, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
}

.video-card .play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 18px solid white;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}

.video-card:hover .play-icon {
  transform: translate(-50%, -50%) scale(1.1);
  background: #f97316;
  box-shadow: 0 6px 30px rgba(249, 115, 22, 0.6);
}

/* Lightbox */
.portfolio-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  padding: 1.5rem;
}

.portfolio-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 1100px;
  width: 100%;
  background: #0b1524;
  border-radius: 1rem;
  overflow: hidden;
}

.lightbox-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #0f172a;
}

.lightbox-video {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  object-fit: contain;
  background: #000;
}

/* Fullscreen video lightbox */
.portfolio-lightbox.video-mode {
  padding: 0;
}

.portfolio-lightbox.video-mode .lightbox-content {
  max-width: 100%;
  width: 100%;
  height: 100vh;
  border-radius: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Vertical phone videos: blurred copy of the frame fills the sides instead of black bars */
.lightbox-backdrop {
  display: none;
}

.portfolio-lightbox.video-mode .lightbox-backdrop {
  display: block;
  position: absolute;
  inset: -60px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.45);
}

.portfolio-lightbox.video-mode .lightbox-video {
  position: relative;
  z-index: 1;
  width: auto;
  height: 100%;
  max-width: 100%;
  background: transparent;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

.portfolio-lightbox.video-mode .lightbox-meta {
  z-index: 2;
  pointer-events: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 3rem 1.25rem 1.25rem;
}

.portfolio-lightbox.video-mode .lightbox-close {
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  z-index: 10;
}

.portfolio-lightbox.video-mode .lightbox-controls {
  display: none;
}

.portfolio-lightbox.video-mode .lightbox-image {
  display: none;
}

.lightbox-meta {
  padding: 1rem 1.25rem 1.25rem;
  color: #e2e8f0;
}

.lightbox-meta h4 {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.lightbox-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
}

.lightbox-btn {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-btn:hover {
  background: var(--primary);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: var(--primary);
}
