/* ══════════════════════════════════════
   PORTAFOLIO v2 — Editorial / Immersive
   Inspired by ShiftWalk, Nanna Lagerman, Folk Studio
   ══════════════════════════════════════ */

/* ── Override base palette to match v8 homepage ── */
:root {
  --bg: #E8E0D4;
  --bg-alt: #EDE7DB;
  --dark: #2f2e2e;
  --secondary: #6B5D4D;
  --muted: #958776;
  --line: rgba(58,36,21,0.15);
  --line-light: rgba(58,36,21,0.08);
}

/* ── Portfolio Hero ── */
.port-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
  border-radius: 0;
}
.port-hero__bg {
  position: absolute;
  inset: 0;
}
.port-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.port-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.40) 0%,
    rgba(0,0,0,0.20) 35%,
    rgba(0,0,0,0.15) 50%,
    rgba(0,0,0,0.50) 100%);
  pointer-events: none;
}
.port-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px 44px;
  max-width: 640px;
}
.port-hero__eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(240,233,223,0.6);
  margin-bottom: 12px;
}
.port-hero__title {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  color: #fff;
  margin: 0 0 16px;
}
.port-hero__sub {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: rgba(240,233,223,0.7);
  max-width: 360px;
  margin: 0 auto;
}

/* ── Header unified (title + sub + filters) ── */
.port-header {
  padding: 28px 24px;
  background: var(--bg);
  border-bottom: 0.95px solid var(--line);
}
.port-header__title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
  color: var(--dark);
  margin: 0 0 10px;
}
.port-header__sub {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--secondary);
  margin: 0 0 28px;
}

/* ── Inline filters ── */
.port-header__filters {
  display: flex;
  align-items: center;
  gap: 8px;
}
.port-header__filter-label {
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.port-filter {
  flex: none;
  white-space: nowrap;
  background: rgba(58,36,21,0.04);
  border: 0.75px solid #4a4542;
  border-radius: 0;
  cursor: pointer;
  padding: 8px 20px;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--dark);
  text-align: center;
  transition: all 0.3s ease;
}
.port-filter:hover {
  background: rgba(58,36,21,0.08);
}
.port-filter.is-active {
  background: rgba(58,36,21,0.12);
  border-color: #4a4542;
}
.port-filter__count {
  font-weight: 300;
  opacity: 0.5;
  margin-left: 2px;
}

/* ── Project list ── */
.port-list {
  padding: 0 24px;
  background: var(--bg);
}

/* ── Hidden state for filtered items ── */
.port-item.is-hidden {
  display: none;
}

/* ── Individual project item ── */
.port-item {
  display: block;
  text-decoration: none;
  padding: 32px 0;
}
.port-item__header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}
.port-item__num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--muted);
  flex-shrink: 0;
  position: relative;
  top: 2px;
}
.port-item__info {
  flex: 1;
  min-width: 0;
}
.port-item__name {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  color: var(--dark);
  margin: 0;
  line-height: 1.1;
  transition: color 0.4s ease;
}
.port-item__style {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}
.port-item__arrow {
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: transform 0.4s ease, color 0.4s ease;
}
.port-item:hover .port-item__arrow {
  transform: translate(4px, -4px);
  color: var(--dark);
}
.port-item:hover .port-item__name {
  color: var(--secondary);
}

/* ── Project image ── */
.port-item__img {
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 16px;
}
.port-item__img img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.port-item:hover .port-item__img img {
  transform: scale(1.03);
}

/* ── Project description ── */
.port-item__desc {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--secondary);
  margin: 0;
  max-width: 300px;
}

/* ── Text rise wrappers (overflow hidden for slide-up reveal) ── */
.port-item__header,
.port-item__desc {
  overflow: hidden;
}

/* ── Divider between projects ── */
.port-item__divider {
  height: 0;
  border: none;
  border-top: 1px solid var(--line);
  transform-origin: left center;
}
/* Hide dividers for hidden items */
.port-item.is-hidden + .port-item__divider {
  display: none;
}

/* ── CTA ── */
.port-cta {
  text-align: center;
  padding: 56px 24px 72px;
  background: var(--bg);
}
.port-cta__text {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  margin: 0 0 24px;
}
.port-cta__btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dark);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 12px 28px;
  transition: all 0.3s ease;
}
.port-cta__btn:hover {
  background: var(--dark);
  color: var(--cream);
  border-color: var(--dark);
}

/* ══════════════════════════════════════
   TABLET (768px+)
   ══════════════════════════════════════ */
@media (min-width: 768px) {
  .port-hero {
    min-height: 55vh;
  }
  .port-hero__title {
    font-size: 52px;
  }
  .port-hero__sub {
    font-size: 18px;
  }
  .port-header {
    padding: 32px 48px;
  }
  .port-header__title {
    font-size: 38px;
  }
  .port-header__sub {
    font-size: 13px;
    max-width: 400px;
  }
  .port-header__filters {
    max-width: 360px;
  }
  .port-filter {
    font-size: 9px;
    padding: 7px 18px;
  }

  .port-list {
    padding: 0 48px;
  }

  /* Two-column staggered layout */
  .port-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 32px;
  }
  .port-item {
    width: calc(50% - 16px);
    padding: 40px 0;
  }
  /* Offset even items for stagger */
  .port-item:nth-of-type(even) {
    margin-top: 80px;
  }
  .port-item__divider {
    display: none;
  }
  .port-item__name {
    font-size: 28px;
  }

  .port-cta {
    padding: 56px 48px 80px;
  }
  .port-cta__text {
    font-size: 30px;
  }
}

/* ══════════════════════════════════════
   DESKTOP (1024px+)
   Asymmetric zigzag layout — Melanie Hay inspired
   ══════════════════════════════════════ */
@media (min-width: 1024px) {
  .port-hero {
    height: 680px;
    min-height: auto;
  }
  .port-hero__content {
    padding: 0 64px 56px;
  }
  .port-hero__eyebrow {
    font-size: 11px;
    letter-spacing: 3px;
  }
  .port-hero__title {
    font-size: 64px;
  }
  .port-hero__sub {
    font-size: 18px;
    max-width: 440px;
  }
  .port-header {
    padding: 36px 64px;
  }
  .port-header__title {
    font-size: 44px;
  }
  .port-header__sub {
    font-size: 15px;
    max-width: 440px;
  }
  .port-header__filters {
    max-width: 400px;
  }
  .port-filter {
    flex: 1;
    font-size: 10px;
    padding: 8px 18px;
  }

  .port-list {
    padding: 0 64px;
    gap: 0 64px;
  }
  .port-item {
    padding: 32px 0;
    width: calc(50% - 32px);
  }

  /* ── Zigzag stagger pattern ──
     Row 1 (items 1,2): left=LARGE, right=SMALL+offset
     Row 2 (items 3,4): left=SMALL+offset, right=LARGE
     Repeat... */

  /* Reset uniform even stagger */
  .port-item:nth-of-type(even) {
    margin-top: 0;
  }

  /* Odd rows: right side (4n+2) staggers down */
  .port-item:nth-of-type(4n+2) {
    margin-top: 140px;
  }

  /* Even rows: left side (4n+3) staggers down */
  .port-item:nth-of-type(4n+3) {
    margin-top: 60px;
  }

  /* Large images — left in odd rows, right in even rows */
  .port-item:nth-of-type(4n+1) .port-item__img img,
  .port-item:nth-of-type(4n+4) .port-item__img img {
    aspect-ratio: 3 / 4;
  }

  /* Small images — right in odd rows, left in even rows */
  .port-item:nth-of-type(4n+2) .port-item__img img,
  .port-item:nth-of-type(4n+3) .port-item__img img {
    aspect-ratio: 1 / 1;
  }

  /* Narrow the small-image items for asymmetric feel */
  .port-item:nth-of-type(4n+2) .port-item__img,
  .port-item:nth-of-type(4n+3) .port-item__img {
    width: 85%;
  }

  /* Larger project names — editorial scale */
  .port-item__name {
    font-size: 40px;
  }
  .port-item__desc {
    font-size: 18px;
    max-width: 360px;
    line-height: 1.75;
  }
  .port-item__num {
    font-size: 12px;
  }

  .port-cta {
    padding: 64px 64px 96px;
  }
  .port-cta__text {
    font-size: 34px;
  }
  .port-cta__btn {
    font-size: 9px;
    padding: 14px 40px;
  }
}

/* ══════════════════════════════════════
   WIDE DESKTOP (1440px+)
   ══════════════════════════════════════ */
@media (min-width: 1440px) {
  .port-hero {
    height: 680px;
    min-height: auto;
  }
  .port-hero__content {
    padding: 0 80px 64px;
  }
  .port-hero__title {
    font-size: 72px;
  }
  .port-hero__sub {
    font-size: 19px;
    max-width: 480px;
  }
  .port-header {
    padding: 40px 80px;
    max-width: 1400px;
    margin: 0 auto;
  }
  .port-header__title {
    font-size: 48px;
  }
  .port-header__sub {
    max-width: 480px;
  }

  .port-list {
    padding: 0 80px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 0 72px;
  }
  .port-item {
    width: calc(50% - 36px);
    padding: 40px 0;
  }

  /* More dramatic stagger at wide screens */
  .port-item:nth-of-type(4n+2) {
    margin-top: 180px;
  }
  .port-item:nth-of-type(4n+3) {
    margin-top: 80px;
  }

  .port-item__name {
    font-size: 48px;
  }
  .port-item__desc {
    font-size: 18px;
    max-width: 400px;
  }

  .port-cta {
    padding: 72px 80px 110px;
  }
}
