/* ======================================
   PORTFOLIO PAGE — Styles
   ====================================== */

/* ---- PORTFOLIO HERO ---- */
.port-hero {
  position: relative;
  height: 60vh; min-height: 520px;
  display: flex; align-items: flex-end;
  padding-bottom: 80px;
  overflow: hidden;
}
.port-hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.port-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.port-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    105deg,
    rgba(8,4,4,0.88) 0%,
    rgba(8,4,4,0.55) 60%,
    rgba(8,4,4,0.25) 100%
  );
}
.port-hero-content {
  position: relative; z-index: 2;
}
.ph-breadcrumb {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 24px;
}
.ph-breadcrumb a { color: rgba(255,255,255,0.45); transition: color 0.25s; }
.ph-breadcrumb a:hover { color: var(--red); }
.ph-breadcrumb span { color: rgba(255,255,255,0.2); }

.port-hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 6.5vw, 80px);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--white);
  margin-bottom: 24px;
}
.port-hero-title em { font-style: italic; color: var(--red-light); font-weight: 400; }

.port-hero-sub {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  max-width: 520px;
}
.port-hero-scroll {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, transparent 60%);
  z-index: 2;
}

/* ---- STATS STRIP ---- */
.port-stats-strip {
  background: var(--black);
  padding: 48px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pss-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.pss-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; text-align: center;
}
.pss-num {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.03em;
}
.pss-plus {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  display: inline;
}
.pss-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.pss-divider {
  width: 1px; height: 52px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ---- FILTER BAR ---- */
.port-main { background: var(--off-white); }

.port-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.pfb-filters {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.pfb-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--grey-600);
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  transition: all 0.25s ease;
  cursor: pointer;
}
.pfb-btn:hover { border-color: var(--red); color: var(--red); }
.pfb-btn.active { background: var(--red); border-color: var(--red); color: var(--white); }
.pfb-btn.active .pfb-count { background: rgba(255,255,255,0.2); color: var(--white); }

.pfb-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  background: var(--grey-100);
  color: var(--grey-400);
  border-radius: 10px;
  transition: all 0.25s;
}

.pfb-view { display: flex; gap: 4px; }
.pfb-view-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--grey-200);
  background: var(--white);
  color: var(--grey-400);
  cursor: pointer;
  transition: all 0.25s;
}
.pfb-view-btn:hover,
.pfb-view-btn.active { border-color: var(--red); color: var(--red); background: rgba(212,0,26,0.04); }
.pfb-view-btn svg { width: 14px; height: 14px; }

/* ---- PORTFOLIO FULL GRID ---- */
.port-full-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 280px;
  gap: 3px;
  transition: all 0.3s ease;
}

.pfg-item {
  position: relative;
  overflow: hidden;
  background: var(--grey-200);
  cursor: pointer;
}
.pfg-wide { grid-column: span 2; }
.pfg-tall { grid-row: span 2; }

.pfg-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}
.pfg-item:hover img { transform: scale(1.07); }

.pfg-hover {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(8,4,4,0.88) 0%,
    rgba(8,4,4,0.3) 50%,
    transparent 100%
  );
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.pfg-item:hover .pfg-hover { opacity: 1; }

.pfg-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-light);
  margin-bottom: 8px;
  display: block;
}
.pfg-hover h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.pfg-client {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  display: block;
  margin-bottom: 16px;
}
.pfg-open {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--red);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  cursor: pointer;
  transform: scale(0) rotate(-90deg);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pfg-item:hover .pfg-open { transform: scale(1) rotate(0deg); }
.pfg-open:hover { background: var(--red-dark); transform: scale(1.1) !important; }
.pfg-open svg { width: 18px; height: 18px; }

/* Hidden state for filter */
.pfg-item.pfg-hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

/* ---- LIST VIEW ---- */
.port-full-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 2px;
  grid-template-columns: none;
  grid-auto-rows: none;
}
.port-full-grid.list-view .pfg-item {
  height: 100px;
  grid-column: span 1;
  grid-row: span 1;
  display: flex; align-items: center;
}
.port-full-grid.list-view .pfg-item.pfg-wide,
.port-full-grid.list-view .pfg-item.pfg-tall {
  grid-column: span 1;
  grid-row: span 1;
}
.port-full-grid.list-view .pfg-hover {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  background: linear-gradient(90deg, rgba(8,4,4,0.92) 0%, rgba(8,4,4,0.75) 100%);
  opacity: 1;
}
.port-full-grid.list-view .pfg-cat { margin-bottom: 0; flex-shrink: 0; min-width: 100px; }
.port-full-grid.list-view .pfg-hover h3 { margin-bottom: 0; font-size: 16px; flex: 1; }
.port-full-grid.list-view .pfg-client { margin-bottom: 0; flex-shrink: 0; }
.port-full-grid.list-view .pfg-open { position: static; transform: scale(1) rotate(0deg); flex-shrink: 0; }

/* ---- NO RESULTS ---- */
.no-results {
  text-align: center;
  padding: 80px 0;
  color: var(--grey-400);
  font-size: 16px;
}

/* ---- LIGHTBOX ---- */
.port-lightbox {
  position: fixed; inset: 0;
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  visibility: hidden;
  pointer-events: none;
}
.port-lightbox.open { visibility: visible; pointer-events: all; }

.plb-backdrop {
  position: absolute; inset: 0;
  background: rgba(5,3,3,0.88);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s ease;
  cursor: pointer;
}
.port-lightbox.open .plb-backdrop { opacity: 1; }

.plb-panel {
  position: relative; z-index: 1;
  background: var(--white);
  max-width: 1000px; width: 100%;
  max-height: 90vh;
  display: grid;
  grid-template-columns: 1fr 380px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(32px) scale(0.97);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.4s ease;
}
.port-lightbox.open .plb-panel { transform: translateY(0) scale(1); opacity: 1; }

.plb-close {
  position: absolute; top: 16px; right: 16px;
  z-index: 10;
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.5);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  cursor: pointer;
  transition: background 0.25s;
}
.plb-close:hover { background: var(--red); }
.plb-close svg { width: 18px; height: 18px; }

.plb-image-wrap {
  overflow: hidden;
  background: var(--grey-200);
}
.plb-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.plb-info {
  padding: 48px 40px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--white);
}
.plb-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.plb-cat::before { content: ''; width: 20px; height: 2px; background: var(--red); }

.plb-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--black);
  line-height: 1.2;
  margin-bottom: 28px;
}

.plb-meta {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--grey-100);
  border-bottom: 1px solid var(--grey-100);
  margin-bottom: 24px;
}
.plb-meta-item { display: flex; align-items: baseline; gap: 12px; }
.plb-meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-400);
  min-width: 56px;
  flex-shrink: 0;
}
.plb-meta-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-800);
}

.plb-desc {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--grey-600);
  flex: 1;
  margin-bottom: 32px;
}

/* ---- CTA STRIP ---- */
.port-cta-strip {
  background: var(--cream);
  padding: 72px 0;
  border-top: 1px solid var(--grey-200);
}
.pcs-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.pcs-left h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.pcs-left p {
  font-size: 15px;
  color: var(--grey-600);
}
.pcs-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-outline-dark {
  background: transparent;
  color: var(--grey-800);
  border: 1.5px solid var(--grey-800);
}
.btn-outline-dark:hover { background: var(--grey-800); color: var(--white); }

/* Active nav link style for current page */
.nav-link.active-page {
  color: var(--red) !important;
}
.nav-link.active-page::after {
  transform: scaleX(1) !important;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) {
  .port-full-grid { grid-template-columns: repeat(3, 1fr); }
  .pfg-wide { grid-column: span 2; }
}

@media (max-width: 900px) {
  .pss-inner { gap: 0; flex-wrap: wrap; }
  .pss-item { flex: 0 0 50%; padding: 24px 0; }
  .pss-divider { display: none; }
  .port-full-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 240px; }
  .pfg-wide { grid-column: span 2; }
  .pfg-tall { grid-row: span 1; }
  .plb-panel { grid-template-columns: 1fr; max-height: 85vh; overflow-y: auto; }
  .plb-image-wrap { height: 300px; flex-shrink: 0; }
  .plb-info { padding: 32px 28px; }
}

@media (max-width: 640px) {
  .port-hero { height: auto; padding-top: 140px; padding-bottom: 52px; min-height: 0; }
  .port-full-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .pfg-wide { grid-column: span 1; }
  .pfb-filters { gap: 4px; }
  .pfb-btn { padding: 8px 12px; font-size: 11px; }
  .pfb-count { display: none; }
  .pfb-view { display: none; }
  .pcs-inner { flex-direction: column; text-align: center; }
  .pcs-actions { justify-content: center; }
  .pss-num { font-size: 36px; }
  .port-filter-bar { flex-direction: column; align-items: flex-start; }
  .pfg-hover { opacity: 1; background: linear-gradient(to top, rgba(8,4,4,0.85) 0%, transparent 60%); }
  .pfg-open { display: none; }
}
