/* Webstix Portfolio frontend styles.
 * Ported from prototype and scoped under .webstix-portfolio-wrap.
 */

.webstix-portfolio-wrap {
  --red: #a51720;
  --red-hover: #8a1119;
  --red-light: rgba(165, 23, 32, 0.06);
  --red-glow: rgba(165, 23, 32, 0.15);
  --black: #000000;
  --charcoal: #1c1c1c;
  --dark-gray: #252525;
  --gray-900: #2e2e2e;
  --gray-800: #3a3a3a;
  --gray-700: #555555;
  --gray-500: #888888;
  --gray-300: #cccccc;
  --gray-200: #e0e0e0;
  --gray-100: #eeeeee;
  --white: #ffffff;
  --off-white: #f9f9f9;
  --cream: #f6f0e8;
  --font: 'Plus Jakarta Sans', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

.webstix-portfolio-wrap,
.webstix-portfolio-wrap * {
  box-sizing: border-box;
}

.webstix-portfolio-wrap {
  font-family: var(--font);
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* Homepage section wrapper (from reference HTML) */
.webstix-portfolio-wrap.home-portfolio {
  background: var(--cream);
  padding: 80px 40px;
}
.webstix-portfolio-wrap .home-portfolio-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.webstix-portfolio-wrap .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
}
.webstix-portfolio-wrap .section-header-left {
  min-width: 0;
}
.webstix-portfolio-wrap .section-header .view-all-btn {
  flex: 0 0 auto;
}
@media (max-width: 768px) {
  .webstix-portfolio-wrap .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .webstix-portfolio-wrap .section-header .view-all-btn {
    margin-top: 10px;
  }
}
.webstix-portfolio-wrap .section-header h2 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.webstix-portfolio-wrap .section-header p {
  max-width: 440px;
  margin-top: 8px;
  font-size: 16px;
  color: var(--gray-700);
}
.webstix-portfolio-wrap.home-portfolio .view-all-btn {
  white-space: nowrap;
}

.webstix-portfolio-wrap img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*
 * Theme safety: many themes set aggressive global `svg { width:100% }` rules
 * which breaks our small inline icons and makes them render as giant black shapes.
 * Reset within the plugin scope and rely on our component-level svg sizing rules.
 */
.webstix-portfolio-wrap svg {
  width: initial !important;
  height: initial !important;
  max-width: none !important;
  max-height: none !important;
  display: inline-block !important;
}

/* ════════════════════════════════════════════
   VIEW 1: HOMEPAGE / SHORTCODE FEATURED
   ════════════════════════════════════════════ */

.webstix-portfolio-wrap .label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  margin-bottom: 10px;
  display: block;
}

.webstix-portfolio-wrap .home-cat-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.webstix-portfolio-wrap .home-cat-pill {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.webstix-portfolio-wrap .home-cat-pill:hover,
.webstix-portfolio-wrap .home-cat-pill.active {
  color: var(--white);
  background: var(--charcoal);
  border-color: var(--charcoal);
}

.webstix-portfolio-wrap .featured-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-rows: auto auto;
  gap: 20px;
  margin-bottom: 20px;
}
.webstix-portfolio-wrap .featured-card {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--white);
  transition: transform 0.4s var(--ease);
  text-decoration: none;
  color: inherit;
}
.webstix-portfolio-wrap .featured-card:hover {
  transform: translateY(-3px);
}
.webstix-portfolio-wrap .featured-card.tall {
  grid-row: span 2;
}

.webstix-portfolio-wrap .card-thumb {
  width: 100%;
  aspect-ratio: 16/11;
  background: var(--gray-100);
  position: relative;
  overflow: hidden;
}
.webstix-portfolio-wrap .featured-card.tall .card-thumb {
  aspect-ratio: auto;
  height: 100%;
}
.webstix-portfolio-wrap .card-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.6s var(--ease);
}
.webstix-portfolio-wrap .featured-card:hover .card-thumb-inner {
  transform: scale(1.04);
}
.webstix-portfolio-wrap .card-thumb-placeholder {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.webstix-portfolio-wrap .card-thumb svg {
  width: 40px !important;
  height: 40px !important;
  stroke: var(--gray-300);
  fill: none;
  stroke-width: 1.5;
}

.webstix-portfolio-wrap .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 28, 28, 0.9) 0%, rgba(28, 28, 28, 0.3) 40%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
}
.webstix-portfolio-wrap .featured-card:hover .card-overlay {
  opacity: 1;
}
.webstix-portfolio-wrap .card-overlay h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.webstix-portfolio-wrap .card-overlay .card-cat {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.webstix-portfolio-wrap .card-overlay .card-arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(10px, -10px);
  opacity: 0;
  transition: all 0.35s var(--ease);
}
.webstix-portfolio-wrap .featured-card:hover .card-overlay .card-arrow {
  opacity: 1;
  transform: translate(0, 0);
}
.webstix-portfolio-wrap .card-arrow svg {
  width: 16px;
  height: 16px;
  stroke: var(--charcoal);
  fill: none;
  stroke-width: 2;
}

.webstix-portfolio-wrap .card-info {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}
.webstix-portfolio-wrap .featured-card.tall .card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}
.webstix-portfolio-wrap .card-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 2px;
}
.webstix-portfolio-wrap .card-info .card-meta {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.webstix-portfolio-wrap .featured-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.webstix-portfolio-wrap .view-all-cta {
  text-align: center;
}
.webstix-portfolio-wrap .view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  background: var(--charcoal);
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  text-decoration: none;
}
.webstix-portfolio-wrap .view-all-btn:hover {
  background: var(--red);
  transform: translateY(-1px);
}
.webstix-portfolio-wrap .view-all-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.webstix-portfolio-wrap .portfolio-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.webstix-portfolio-wrap .stat-item {
  text-align: center;
}
.webstix-portfolio-wrap .stat-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--charcoal);
  letter-spacing: -0.02em;
}
.webstix-portfolio-wrap .stat-label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 4px;
}

/* ════════════════════════════════════════════
   VIEW 2: LISTING PAGE
   ════════════════════════════════════════════ */

.webstix-portfolio-wrap .listing-header {
  background: var(--charcoal);
  padding: 48px 40px;
}
.webstix-portfolio-wrap .listing-header-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.webstix-portfolio-wrap .listing-breadcrumb {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 16px;
}
.webstix-portfolio-wrap .listing-breadcrumb a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}
.webstix-portfolio-wrap .listing-breadcrumb a:hover {
  color: rgba(255, 255, 255, 0.8);
}
.webstix-portfolio-wrap .listing-breadcrumb span {
  margin: 0 8px;
}
.webstix-portfolio-wrap .listing-header h1 {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.webstix-portfolio-wrap .listing-header p {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.55);
  max-width: 560px;
}

.webstix-portfolio-wrap .filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}
.webstix-portfolio-wrap .filter-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.webstix-portfolio-wrap .filter-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.webstix-portfolio-wrap .filter-pills::-webkit-scrollbar {
  display: none;
}
.webstix-portfolio-wrap .filter-pill {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  background: transparent;
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.webstix-portfolio-wrap .filter-pill .webstix-pill-count {
  margin-left: 6px;
  font-weight: 700;
  opacity: 0.8;
}
.webstix-portfolio-wrap .filter-pill:hover {
  border-color: var(--charcoal);
  color: var(--charcoal);
}
.webstix-portfolio-wrap .filter-pill.active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--white);
}
.webstix-portfolio-wrap .filter-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.webstix-portfolio-wrap .result-count {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
  white-space: nowrap;
}
.webstix-portfolio-wrap .view-toggle {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
}
.webstix-portfolio-wrap .view-toggle-btn {
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-300);
}
.webstix-portfolio-wrap .view-toggle-btn:first-child {
  border-right: 1px solid var(--gray-200);
}
.webstix-portfolio-wrap .view-toggle-btn.active {
  background: var(--off-white);
  color: var(--charcoal);
}
.webstix-portfolio-wrap .view-toggle-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.webstix-portfolio-wrap .listing-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 80px;
}

.webstix-portfolio-wrap .sidebar {
  position: sticky;
  top: 152px;
  align-self: start;
  max-height: calc(100vh - 172px);
  overflow-y: auto;
  padding-right: 8px;
}
.webstix-portfolio-wrap .sidebar::-webkit-scrollbar {
  width: 3px;
}
.webstix-portfolio-wrap .sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 3px;
}

.webstix-portfolio-wrap .filter-group {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 20px;
}
.webstix-portfolio-wrap .filter-group:last-child {
  border-bottom: none;
}
.webstix-portfolio-wrap .filter-group-toggle {
  display: block;
  padding: 4px 0;
  margin-bottom: 10px;
  cursor: default;
  pointer-events: none;
}
.webstix-portfolio-wrap .filter-group-toggle h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}
.webstix-portfolio-wrap .filter-group-toggle svg {
  display: none !important;
}
.webstix-portfolio-wrap .filter-group .filter-group-body,
.webstix-portfolio-wrap .filter-group.collapsed .filter-group-body {
  display: block;
}

.webstix-portfolio-wrap .filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
  transition: color 0.15s;
}
.webstix-portfolio-wrap .filter-option:hover {
  color: var(--charcoal);
}
.webstix-portfolio-wrap .filter-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.webstix-portfolio-wrap .filter-option.active .filter-check {
  background: var(--red);
  border-color: var(--red);
}
.webstix-portfolio-wrap .filter-check svg {
  width: 10px;
  height: 10px;
  stroke: var(--white);
  fill: none;
  stroke-width: 3;
  opacity: 0;
}
.webstix-portfolio-wrap .filter-option.active .filter-check svg {
  opacity: 1;
}
.webstix-portfolio-wrap .filter-option .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--gray-300);
  font-weight: 500;
}

.webstix-portfolio-wrap .clear-filters {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  display: none;
}
.webstix-portfolio-wrap .clear-filters.show {
  display: block;
}

.webstix-portfolio-wrap .project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.webstix-portfolio-wrap .project-grid.webstix-gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 54px;
  align-items: center;
  background: var(--white);
}
.webstix-portfolio-wrap .webstix-gallery-card {
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0;
  cursor: pointer;
  text-align: center;
  animation: fadeInUp 0.45s var(--ease) both;
}
.webstix-portfolio-wrap .webstix-gallery-card-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  transition: transform 0.25s var(--ease);
}
.webstix-portfolio-wrap .webstix-gallery-card:focus {
  outline: 2px solid rgba(165, 23, 32, 0.25);
  outline-offset: 8px;
}
.webstix-portfolio-wrap .webstix-gallery-card:hover .webstix-gallery-card-inner {
  transform: translateY(-2px);
}
.webstix-portfolio-wrap .webstix-gallery-card img {
  max-width: 100%;
  max-height: 82px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.webstix-portfolio-wrap .project-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--gray-100);
  cursor: pointer;
  transition: all 0.35s var(--ease);
  text-decoration: none;
  color: inherit;
}
.webstix-portfolio-wrap .project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  border-color: transparent;
}
.webstix-portfolio-wrap .project-card .card-thumb {
  aspect-ratio: 16/11;
  background: var(--off-white);
  position: relative;
  overflow: hidden;
}
.webstix-portfolio-wrap .project-card .card-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.5s var(--ease);
}
.webstix-portfolio-wrap .project-card:hover .card-thumb-inner {
  transform: scale(1.05);
}
.webstix-portfolio-wrap .project-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 28, 28, 0.8), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px;
}
.webstix-portfolio-wrap .project-card:hover .card-overlay {
  opacity: 1;
}
.webstix-portfolio-wrap .card-view-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.webstix-portfolio-wrap .card-view-label svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.webstix-portfolio-wrap .project-card .card-info {
  padding: 16px 18px;
  border-top: 1px solid var(--gray-100);
}
.webstix-portfolio-wrap .project-card .card-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 4px;
}
.webstix-portfolio-wrap .project-card .card-info .card-meta {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}
.webstix-portfolio-wrap .project-card .card-info .card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gray-300);
}

.webstix-portfolio-wrap .project-grid.view-list {
  grid-template-columns: 1fr;
}
.webstix-portfolio-wrap .project-grid.view-list .project-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: stretch;
}
.webstix-portfolio-wrap .project-grid.view-list .project-card .card-thumb {
  aspect-ratio: auto;
  height: 100%;
}
.webstix-portfolio-wrap .project-grid.view-list .project-card .card-info {
  border-top: none;
  display: flex;
  align-items: center;
}

.webstix-portfolio-wrap .active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.webstix-portfolio-wrap .active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  background: var(--red-light);
  border: 1px solid rgba(165, 23, 32, 0.15);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.webstix-portfolio-wrap .active-filter-tag:hover {
  background: rgba(165, 23, 32, 0.12);
}
.webstix-portfolio-wrap .active-filter-tag-text {
  line-height: 1.3;
}
.webstix-portfolio-wrap .active-filter-tag-count {
  font-weight: 600;
}
.webstix-portfolio-wrap .active-filter-tag-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 2px;
}
.webstix-portfolio-wrap .active-filter-tag-close svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.webstix-portfolio-wrap .load-more-row {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 0;
}
.webstix-portfolio-wrap .load-more-btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px 28px;
  cursor: pointer;
  transition: all 0.25s;
}
.webstix-portfolio-wrap .load-more-btn:hover {
  border-color: var(--charcoal);
}

body.webstix-gallery-lightbox-open {
  overflow: hidden;
}
.webstix-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 72px;
  background: rgba(0, 0, 0, 0.66);
}
.webstix-gallery-lightbox[hidden] {
  display: none;
}
.webstix-gallery-lightbox-figure {
  margin: 0;
  max-width: min(620px, 78vw);
  max-height: 78vh;
  text-align: center;
}
.webstix-gallery-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--white);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}
.webstix-gallery-lightbox-title {
  margin-top: 12px;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}
.webstix-gallery-lightbox-close,
.webstix-gallery-lightbox-arrow {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}
.webstix-gallery-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 34px;
  line-height: 1;
}
.webstix-gallery-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 42px;
  line-height: 1;
  padding: 16px;
}
.webstix-gallery-lightbox-prev {
  left: 12px;
}
.webstix-gallery-lightbox-next {
  right: 12px;
}
.webstix-gallery-lightbox-arrow span {
  display: block;
}

/* ════════════════════════════════════════════
   VIEW 3: DETAIL PAGE
   ════════════════════════════════════════════ */

.webstix-portfolio-wrap .detail-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  background: var(--off-white);
  border-bottom: 1px solid var(--gray-200);
  transition: color 0.2s;
  cursor: pointer;
}
.webstix-portfolio-wrap .webstix-listing-back {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: relative;
  z-index: 5;
}
.webstix-portfolio-wrap .detail-back:hover {
  color: var(--charcoal);
}
.webstix-portfolio-wrap .detail-back svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.webstix-portfolio-wrap .detail-hero {
  width: 100%;
  height: 500px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.webstix-portfolio-wrap .detail-hero svg {
  width: 64px;
  height: 64px;
  stroke: var(--gray-300);
  fill: none;
  stroke-width: 1.2;
}
.webstix-portfolio-wrap .detail-hero span {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-300);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.webstix-portfolio-wrap .detail-breadcrumb {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 40px 0;
  font-size: 13px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.webstix-portfolio-wrap .detail-breadcrumb a {
  color: inherit;
  text-decoration: none;
}
.webstix-portfolio-wrap .detail-breadcrumb a:hover {
  color: var(--charcoal);
}
.webstix-portfolio-wrap .detail-breadcrumb .current {
  color: var(--charcoal);
  font-weight: 600;
}

.webstix-portfolio-wrap .detail-scroll-image {
  height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 12px;
  background: var(--off-white);
  border: 1px solid var(--gray-200);
  scrollbar-width: thin;
}
.webstix-portfolio-wrap .detail-scroll-image::-webkit-scrollbar {
  width: 8px;
}
.webstix-portfolio-wrap .detail-scroll-image::-webkit-scrollbar-track {
  background: transparent;
}
.webstix-portfolio-wrap .detail-scroll-image::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
}
.webstix-portfolio-wrap .detail-scroll-image img {
  width: 100%;
  height: auto;
  display: block;
}

.webstix-portfolio-wrap .webstix-testimonial-meta {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-style: normal;
  font-size: 14px;
  color: var(--gray-700);
}
.webstix-portfolio-wrap .webstix-testimonial-author {
  font-weight: 700;
  color: var(--charcoal);
}
.webstix-portfolio-wrap .webstix-testimonial-org {
  font-weight: 600;
  color: var(--gray-700);
}

.webstix-portfolio-wrap .webstix-testimonial-section {
  margin-top: 28px;
}
.webstix-portfolio-wrap .webstix-testimonial-section-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.webstix-portfolio-wrap .webstix-testimonial-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}
.webstix-portfolio-wrap .webstix-testimonial-visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  background: var(--white);
  border: 1.5px solid var(--red);
  border-radius: 6px;
  padding: 10px 18px;
  text-decoration: none;
  transition: all 0.25s var(--ease);
}
.webstix-portfolio-wrap .webstix-testimonial-visit:hover {
  background: var(--red);
  color: var(--white);
}
.webstix-portfolio-wrap .webstix-testimonial-visit svg {
  width: 14px !important;
  height: 14px !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.webstix-portfolio-wrap .sidebar.is-empty {
  display: none;
}
.webstix-portfolio-wrap .listing-body:has(.sidebar.is-empty) > main {
  grid-column: 1 / -1;
}
.webstix-portfolio-wrap .filter-empty {
  font-size: 12px;
  color: var(--gray-500);
  padding: 6px 0 4px;
}

.webstix-portfolio-wrap .filter-subgroup {
  padding: 10px 0 14px;
}
.webstix-portfolio-wrap .filter-subgroup + .filter-subgroup {
  border-top: 1px dashed var(--gray-200);
}
.webstix-portfolio-wrap .filter-subgroup-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.webstix-portfolio-wrap .detail-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 40px 80px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
}

.webstix-portfolio-wrap .detail-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  color: var(--charcoal);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.webstix-portfolio-wrap .detail-subtitle {
  font-size: 18px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 640px;
}

.webstix-portfolio-wrap .detail-section {
  margin-bottom: 48px;
}
.webstix-portfolio-wrap .detail-section h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.webstix-portfolio-wrap .detail-section p {
  font-size: 16px;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 16px;
}
.webstix-portfolio-wrap .detail-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  margin-bottom: 12px;
}

.webstix-portfolio-wrap .detail-image {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--off-white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0;
  overflow: hidden;
  position: relative;
}
.webstix-portfolio-wrap .detail-image svg {
  width: 40px;
  height: 40px;
  stroke: var(--gray-300);
  fill: none;
  stroke-width: 1.5;
}
.webstix-portfolio-wrap .detail-image span {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.webstix-portfolio-wrap .detail-image-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.webstix-portfolio-wrap .detail-image-row .detail-image {
  aspect-ratio: 4/3;
  margin: 0;
}

/* Results metrics */
.webstix-portfolio-wrap .detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.webstix-portfolio-wrap .metric-card {
  background: var(--off-white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
}
.webstix-portfolio-wrap .metric-card .metric-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.02em;
}
.webstix-portfolio-wrap .metric-card .metric-label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 4px;
}

.webstix-portfolio-wrap .detail-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
}
.webstix-portfolio-wrap .sidebar-card {
  background: var(--off-white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 28px 24px;
  margin-bottom: 20px;
}
.webstix-portfolio-wrap .sidebar-card h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.webstix-portfolio-wrap .sidebar-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
}
.webstix-portfolio-wrap .sidebar-row:last-child {
  border-bottom: none;
}
.webstix-portfolio-wrap .sidebar-row .sidebar-key {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
}
.webstix-portfolio-wrap .sidebar-row .sidebar-val {
  font-size: 13px;
  color: var(--charcoal);
  font-weight: 600;
}
.webstix-portfolio-wrap .sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.webstix-portfolio-wrap .sidebar-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 4px 12px;
  border-radius: 100px;
}

.webstix-portfolio-wrap .sidebar-cta {
  background: var(--charcoal);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
}
.webstix-portfolio-wrap .sidebar-cta h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.webstix-portfolio-wrap .sidebar-cta p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 16px;
}
.webstix-portfolio-wrap .btn-filled {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  background: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 6px;
  padding: 8px 16px;
  text-decoration: none;
  transition: all 0.25s;
}
.webstix-portfolio-wrap .btn-filled:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
}
.webstix-portfolio-wrap .sidebar-cta .btn-filled {
  display: block;
  text-align: center;
  font-size: 14px;
  padding: 12px 24px;
}

.related-section {
  background: var(--off-white);
  border-top: 1px solid var(--gray-200);
  padding: 60px 40px 80px;
}
.related-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.related-section h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.related-grid .project-card .card-thumb {
  aspect-ratio: 16/12;
}

.webstix-portfolio-wrap .webstix-testimonial {
  margin: 0;
  padding: 22px 22px;
  background: var(--cream);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  font-size: 18px;
  font-style: italic;
  color: var(--charcoal);
  line-height: 1.7;
}

.webstix-portfolio-wrap .featured-card,
.webstix-portfolio-wrap .project-card {
  animation: fadeIn 0.35s ease both;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Detail page: optional gallery section ── */
.webstix-portfolio-wrap .detail-gallery .detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.webstix-portfolio-wrap .detail-gallery-item {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--off-white, #f9f9f9);
  border: 1px solid var(--gray-200, #e0e0e0);
  transition: transform 0.3s var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
}
.webstix-portfolio-wrap .detail-gallery-item:hover {
  transform: translateY(-2px);
}
.webstix-portfolio-wrap .detail-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 1024px) {
  .webstix-portfolio-wrap .featured-grid {
    grid-template-columns: 1fr 1fr;
  }
  .webstix-portfolio-wrap .featured-card.tall {
    grid-row: span 1;
  }
  .webstix-portfolio-wrap .featured-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .webstix-portfolio-wrap .listing-body {
    grid-template-columns: 220px 1fr;
  }
  .webstix-portfolio-wrap .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .webstix-portfolio-wrap .detail-body {
    grid-template-columns: 1fr 280px;
    gap: 40px;
  }
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .webstix-portfolio-wrap .detail-gallery .detail-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .webstix-portfolio-wrap .featured-grid {
    grid-template-columns: 1fr;
  }
  .webstix-portfolio-wrap .featured-row {
    grid-template-columns: 1fr;
  }
  .webstix-portfolio-wrap .listing-body {
    grid-template-columns: 1fr;
  }
  .webstix-portfolio-wrap .sidebar {
    position: static;
    max-height: none;
  }
  .webstix-portfolio-wrap .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .webstix-portfolio-wrap .project-grid.view-list .project-card {
    grid-template-columns: 1fr;
  }
  .webstix-portfolio-wrap .detail-body {
    grid-template-columns: 1fr;
  }
  .webstix-portfolio-wrap .detail-sidebar {
    position: static;
  }
  .webstix-portfolio-wrap .detail-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .webstix-portfolio-wrap .portfolio-stats {
    gap: 32px;
    flex-wrap: wrap;
  }
  .webstix-portfolio-wrap .detail-gallery .detail-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .webstix-portfolio-wrap .detail-gallery .detail-gallery-grid {
    grid-template-columns: 1fr;
  }
}

