/**
 * assets/css/portfolio.css
 * Complete styles for the Portfolio / Work archive page.
 * Covers hero, filter bar, grid, cards, pagination, and responsive.
 *
 * @package 9A_Production
 */

/* ══════════════════════════════════════════════════════════════════════════════
   PORTFOLIO HERO
══════════════════════════════════════════════════════════════════════════════ */

.page-hero--portfolio {
  position: relative;
  padding-top: calc(var(--header-height) + var(--space-20));
  padding-bottom: var(--space-20);
  background: linear-gradient(165deg,
      #0A0A0A 0%,
      #0F0F0F 40%,
      #141414 100%);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
}

/* Subtle noise / film-grain texture overlay */
.page-hero--portfolio::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 1;
}

/* Gold decorative accent line */
.page-hero--portfolio::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg,
      transparent 0%,
      var(--color-accent-gold) 30%,
      var(--color-accent-gold) 70%,
      transparent 100%);
  opacity: 0.4;
}

.page-hero--portfolio .page-hero__inner {
  position: relative;
  z-index: 2;
}

/* Decorative gradient orbs */
.portfolio-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.08;
  pointer-events: none;
}

.portfolio-hero__orb--gold {
  width: 500px;
  height: 500px;
  background: var(--color-accent-gold);
  top: -150px;
  right: -100px;
}

.portfolio-hero__orb--blue {
  width: 400px;
  height: 400px;
  background: #3b82f6;
  bottom: -200px;
  left: -150px;
}

.page-hero--portfolio .page-hero__content {
  max-width: 720px;
}

.page-hero--portfolio .page-hero__headline {
  font-family: var(--font-display);
  font-size: var(--type-h1);
  text-transform: uppercase;
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-5);
}

.page-hero--portfolio .page-hero__headline .text-gold {
  display: block;
}

.page-hero--portfolio .page-hero__subtext {
  font-size: var(--type-body-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 580px;
  margin-bottom: var(--space-8);
}

/* Hero stat counter */
.portfolio-hero__stats {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.portfolio-hero__stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.portfolio-hero__stat-number {
  font-family: var(--font-display);
  font-size: var(--type-h2);
  color: var(--color-accent-gold);
  line-height: 1;
}

.portfolio-hero__stat-label {
  font-size: var(--type-body-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.portfolio-hero__stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}


/* ══════════════════════════════════════════════════════════════════════════════
   PORTFOLIO FILTER BAR
══════════════════════════════════════════════════════════════════════════════ */

.portfolio-archive-section {
  padding-block: var(--space-20) var(--space-16);
  background: var(--color-bg-primary);
}

.portfolio-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.portfolio-filter__select-wrap {
  display: none;
  width: 100%;
}

.portfolio-filter__select-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portfolio-filter__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.portfolio-filter__btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
  transition:
    background var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
  outline: none;
}

.portfolio-filter__btn:hover {
  background: var(--color-bg-elevated);
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
  transform: translateY(-1px);
}

.portfolio-filter__btn:focus-visible {
  box-shadow: 0 0 0 2px var(--color-accent-gold);
}

.portfolio-filter__btn.is-active {
  background: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  color: #000;
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-gold);
}

.portfolio-filter__btn.is-active:hover {
  background: #fecc40;
  border-color: #fecc40;
}


/* ══════════════════════════════════════════════════════════════════════════════
   PORTFOLIO GRID
══════════════════════════════════════════════════════════════════════════════ */

.portfolio-grid--full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap-lg);
}


/* ══════════════════════════════════════════════════════════════════════════════
   WORK CARD — PORTFOLIO PAGE ENHANCEMENTS (REDESIGN)
══════════════════════════════════════════════════════════════════════════════ */

.portfolio-archive-section .work-card {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-bg-card);
  aspect-ratio: 16 / 10;
  text-decoration: none;
  transform: translateZ(0);
  /* Force hardware acceleration */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.portfolio-archive-section .work-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(245, 166, 35, 0.15);
}

/* Image Wrapper and Image */
.portfolio-archive-section .work-card__image-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.portfolio-archive-section .work-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-archive-section .work-card:hover .work-card__img {
  transform: scale(1.06);
}

/* Gradient Overlay */
.portfolio-archive-section .work-card__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.1) 50%,
      rgba(0, 0, 0, 0.85) 100%);
  transition: opacity 0.4s ease;
}

.portfolio-archive-section .work-card:hover .work-card__gradient {
  opacity: 0.9;
}

/* Center Play Button */
.portfolio-archive-section .work-card__play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background-color: var(--color-accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.portfolio-archive-section .work-card__play-btn svg {
  width: 24px;
  height: 24px;
  margin-left: 4px;
  /* visually center the triangle */
}

.portfolio-archive-section .work-card:hover .work-card__play-btn {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: #ffda6a;
  /* slightly brighter gold on hover */
}

/* Text Info Area */
.portfolio-archive-section .work-card__info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--space-6);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.portfolio-archive-section .work-card__title {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.1;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0 0 4px 0;
  letter-spacing: 0.5px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-archive-section .work-card__subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-archive-section .work-card:hover .work-card__title {
  transform: translateY(-2px);
}

.portfolio-archive-section .work-card:hover .work-card__subtitle {
  transform: translateY(-2px);
}

/* Placeholder for cards with no image */
.portfolio-archive-section .work-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
      var(--color-bg-elevated) 0%,
      var(--color-bg-card) 100%);
}

.portfolio-archive-section .work-card__placeholder span {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--color-accent-gold);
  opacity: 0.3;
}


/* ══════════════════════════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════════════════════════ */

.portfolio-archive-section .pagination {
  margin-top: var(--space-16);
  display: flex;
  justify-content: center;
}

.portfolio-archive-section .pagination .page-numbers {
  list-style: none;
  display: flex;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
}

.portfolio-archive-section .pagination .page-numbers li a,
.portfolio-archive-section .pagination .page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  font-size: var(--type-body-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition:
    background var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out);
}

.portfolio-archive-section .pagination .page-numbers li a:hover {
  background: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  color: #000;
}

.portfolio-archive-section .pagination .page-numbers li span.current {
  background: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  color: #000;
  font-weight: var(--weight-bold);
}


/* ══════════════════════════════════════════════════════════════════════════════
   NO POSTS MESSAGE
══════════════════════════════════════════════════════════════════════════════ */

.no-posts-msg {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--type-body-lg);
  padding: var(--space-20) 0;
}


/* ══════════════════════════════════════════════════════════════════════════════
   CARD STAGGER ANIMATION
══════════════════════════════════════════════════════════════════════════════ */

.portfolio-grid--full .work-card {
  opacity: 0;
  transform: translateY(30px);
  animation: portfolioCardReveal 0.6s var(--ease-out) forwards;
}

.portfolio-grid--full .work-card:nth-child(1) {
  animation-delay: 0.05s;
}

.portfolio-grid--full .work-card:nth-child(2) {
  animation-delay: 0.12s;
}

.portfolio-grid--full .work-card:nth-child(3) {
  animation-delay: 0.19s;
}

.portfolio-grid--full .work-card:nth-child(4) {
  animation-delay: 0.26s;
}

.portfolio-grid--full .work-card:nth-child(5) {
  animation-delay: 0.33s;
}

.portfolio-grid--full .work-card:nth-child(6) {
  animation-delay: 0.40s;
}

.portfolio-grid--full .work-card:nth-child(7) {
  animation-delay: 0.47s;
}

.portfolio-grid--full .work-card:nth-child(8) {
  animation-delay: 0.54s;
}

.portfolio-grid--full .work-card:nth-child(9) {
  animation-delay: 0.61s;
}

.portfolio-grid--full .work-card:nth-child(10) {
  animation-delay: 0.68s;
}

.portfolio-grid--full .work-card:nth-child(11) {
  animation-delay: 0.75s;
}

.portfolio-grid--full .work-card:nth-child(12) {
  animation-delay: 0.82s;
}

@keyframes portfolioCardReveal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {

  .page-hero--portfolio {
    padding-top: calc(var(--header-height) + var(--space-16));
    padding-bottom: var(--space-16);
    min-height: 340px;
  }

  .page-hero--portfolio .page-hero__headline {
    font-size: clamp(32px, 5vw, 52px);
  }

  .portfolio-grid--full {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--grid-gap);
  }

  .portfolio-hero__stats {
    gap: var(--space-6);
  }

  .portfolio-hero__stat-number {
    font-size: var(--type-h3);
  }
}


/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  .page-hero--portfolio {
    min-height: 0;
    padding-top: calc(70px + 28px);
    padding-bottom: 32px;
    align-items: flex-start;
  }

  .page-hero--portfolio .page-hero__inner {
    width: 100%;
  }

  .page-hero--portfolio .page-hero__content {
    max-width: 100%;
  }

  .page-hero--portfolio .page-hero__headline {
    font-size: clamp(28px, 8vw, 40px);
    margin-bottom: 12px;
    overflow-wrap: break-word;
  }

  .page-hero--portfolio .page-hero__subtext {
    font-size: 15px;
    line-height: 1.55;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .portfolio-hero__orb--gold,
  .portfolio-hero__orb--blue {
    width: 220px;
    height: 220px;
    filter: blur(70px);
  }

  .portfolio-hero__orb--gold {
    top: -80px;
    right: -90px;
  }

  .portfolio-hero__orb--blue {
    bottom: -100px;
    left: -90px;
  }

  .portfolio-hero__stats {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-top: 4px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
  }

  .portfolio-hero__stat {
    flex: 1 1 0;
    min-width: 0;
    gap: 10px;
  }

  .portfolio-hero__stat-number {
    font-size: clamp(28px, 8vw, 40px);
  }

  .portfolio-hero__stat-label {
    font-size: 11px;
    line-height: 1.35;
  }

  .portfolio-hero__stat-divider {
    width: 1px;
    height: 36px;
    flex-shrink: 0;
  }

  .portfolio-filter {
    display: block;
    overflow: visible;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-8);
  }

  .portfolio-filter__pills {
    display: none;
  }

  .portfolio-filter__select-wrap {
    display: block;
    width: 100%;
    position: relative;
  }

  .portfolio-filter__select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
  }

  .portfolio-filter__select {
    display: block;
    width: 100%;
    max-width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: #f5a623;
    border: 1px solid #f5a623;
    color: #000;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: var(--weight-medium);
    line-height: 1.4;
    padding: 14px 44px 14px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    outline: none;
  }

  .portfolio-filter__select:focus {
    border-color: var(--color-accent-gold);
    box-shadow: 0 0 0 2px var(--color-accent-gold-glow);
  }

  .portfolio-grid--full {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .portfolio-archive-section {
    padding-block: var(--space-12) var(--space-10);
  }

  .portfolio-archive-section .work-card:hover {
    transform: translateY(-4px);
  }
}


/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤480px)
══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {

  .page-hero--portfolio {
    padding-top: calc(65px + 20px);
    padding-bottom: 28px;
  }

  .page-hero--portfolio .page-hero__headline {
    font-size: clamp(26px, 9vw, 34px);
  }

  .page-hero--portfolio .section-label {
    margin-bottom: 10px;
  }

  .portfolio-archive-section .work-card__title {
    font-size: 24px;
  }

  .portfolio-archive-section .work-card__subtitle {
    font-size: 11px;
  }
}