/* ============================================================================
   SLIDE-3.CSS — Портфолио (Figma node 81:59)
   Source of truth: CLAUDE.md Phase 2 Figma Design Context
   ============================================================================ */

.slide-3 {
  position: relative;
  width: 100%;
  background-color: var(--color-black);
  padding-bottom: 80px;
}

/* ── Title ────────────────────────────────────────────────────────────── */
.slide-3__title {
  margin: 0;
  padding-top: 60px;
  text-align: center;
  font-family: var(--font-oswald);
  font-size: 64px;
  font-weight: 300;
  line-height: 1.1;
  color: var(--color-white);
}

/* ── Sticky filter ────────────────────────────────────────────────────── */
.slide-3__filter-wrap {
  position: sticky;
  top: var(--header-height);
  z-index: 10;
  background-color: var(--color-black);
  padding: 40px 0 20px;
}

.portfolio__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 38px;
  padding: 0 24px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 7px 35px;
  border-radius: 44.5px;
  background-color: var(--color-filter-inactive-bg);
  border: 1px solid var(--color-white);
  color: var(--color-white);
  font-family: var(--font-oswald);
  font-size: 24px;
  font-weight: 400;
  line-height: 30px;
  cursor: pointer;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover {
  background-color: var(--color-white-10);
}

.filter-btn--active {
  background-color: var(--color-orange);
  color: var(--color-black);
  border-color: var(--color-orange);
}

.filter-btn--active:hover {
  background-color: var(--color-orange);
}

.slide-3__filter-line {
  width: 1282px;
  max-width: calc(100% - 48px);
  margin: 20px auto 0;
  border-top: 1px solid var(--color-white);
}

/* ── Grid ─────────────────────────────────────────────────────────────── */
.slide-3__grid {
  display: grid;
  grid-template-columns: repeat(2, 899px);
  gap: 21px;
  justify-content: center;
  margin-top: 58px;
}

.slide-3__grid > .portfolio-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 899px;
  width: 100%;
  justify-self: center;
}

.slide-3__grid--single > .portfolio-card:last-child:nth-child(odd) {
  max-width: 1282px;
}

.slide-3__grid--single {
  grid-template-columns: 1282px;
}

@media (max-width: 1920px) {
  .slide-3__grid--single {
    grid-template-columns: minmax(0, 1282px);
    max-width: 1302px;
  }
}

@media (max-width: 1440px) {
  .slide-3__grid--single { grid-template-columns: 1fr; max-width: 700px; }
}

/* ── Card ─────────────────────────────────────────────────────────────── */
.portfolio-card {
  display: flex;
  flex-direction: column;
}

.portfolio-card__image-wrap {
  width: 100%;
  height: 100%;
  max-width: 100%;
  border-radius: 13px;
  overflow: hidden;
  background-color: var(--color-black);
}

.portfolio-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease-out;
}

.portfolio-card:hover .portfolio-card__img {
  transform: scale(1.02);
}

.portfolio-card__title {
  margin: 25px 0 0;
  font-family: var(--font-oswald);
  font-size: 32px;
  font-weight: 400;
  line-height: 30px;
  color: var(--color-white);
}

.portfolio-card__subtitle {
  margin: 8px 0 0;
  font-family: var(--font-oswald);
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
  color: var(--color-white-50);
}

/* ── Empty state ──────────────────────────────────────────────────────── */
.slide-3__empty {
  text-align: center;
  margin: 60px auto 0;
  padding: 0 24px;
  font-family: var(--font-onest);
  font-size: 20px;
  font-weight: 300;
  color: var(--color-white-50);
}

/* ── Load more ────────────────────────────────────────────────────────── */
.slide-3__load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 60px;
  padding: 0 24px;
}

.slide-3__load-more {
  width: 296px;
  height: 54px;
  border-radius: 27px;
  background-color: var(--color-black);
  border: 1px solid var(--color-white);
  color: var(--color-white);
  font-family: var(--font-oswald);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color var(--transition-fast),
              color var(--transition-fast);
}

.slide-3__load-more:hover:not(:disabled) {
  background-color: var(--color-white);
  color: var(--color-black);
}

.slide-3__load-more:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Video card ───────────────────────────────────────────────────────── */
.portfolio-card {
  cursor: pointer;
}

.portfolio-card__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease-out;
}

.portfolio-card:hover .portfolio-card__video {
  transform: scale(1.02);
}

.portfolio-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.portfolio-card__tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

/* ── Portfolio Modal ──────────────────────────────────────────────────── */
.pf-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-modal[hidden] {
  display: none;
}

.pf-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.pf-modal__panel {
  position: relative;
  width: 95vw;
  max-width: 1500px;
  max-height: 92vh;
  background: #0d0d0d;
  border-radius: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 1;
  /* horizontal padding leaves room for arrows on the sides */
  padding: 48px 80px 56px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.pf-modal__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms;
  z-index: 2;
}

.pf-modal__close:hover {
  background: rgba(255,255,255,0.15);
}

/* mobile nav bar — hidden on desktop */
.pf-modal__nav {
  display: none;
}

.pf-modal__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, border-color 150ms;
  z-index: 2;
  flex-shrink: 0;
}

.pf-modal__arrow:hover:not([disabled]) {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

.pf-modal__arrow--prev {
  left: 18px;
}

.pf-modal__arrow--next {
  right: 18px;
}

.pf-modal__arrow[disabled] {
  opacity: 0.2;
  cursor: not-allowed;
}

.pf-modal__content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.pf-modal__video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.pf-modal__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pf-modal__iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pf-modal__info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pf-modal__title {
  font-family: var(--font-oswald);
  font-size: 36px;
  font-weight: 400;
  color: var(--color-white);
  margin: 0;
}

.pf-modal__subtitle {
  font-family: var(--font-oswald);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-white-50);
  margin: 0;
}

.pf-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pf-modal__tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 14px;
  color: rgba(255,255,255,0.65);
}

.pf-modal__desc {
  font-family: var(--font-onest);
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.75);
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
}

.pf-modal__story-wrap {
  margin-top: 8px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
}

.pf-modal__story-label {
  font-family: var(--font-oswald);
  font-size: 14px;
  font-weight: 400;
  color: var(--color-orange);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.pf-modal__story {
  font-family: var(--font-onest);
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1920px) {
  .slide-3__grid {
    grid-template-columns: repeat(2, minmax(0, 899px));
    max-width: 1819px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px;
  }

  .slide-3__grid--single {
    grid-template-columns: minmax(0, 1282px);
    max-width: 1302px;
  }

  .portfolio-card__image-wrap {
    width: 100%;
    aspect-ratio: 899 / 482;
    height: auto;
  }
}

@media (max-width: 1440px) {
  .slide-3__grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1200px;
    gap: 24px;
  }

  .slide-3__grid--single {
    grid-template-columns: 1fr;
    max-width: 900px;
  }
}

@media (max-width: 1024px) {
  .slide-3__title {
    font-size: 48px;
    line-height: 1.1;
  }

  .portfolio__filters {
    gap: 16px;
  }

  .filter-btn {
    height: 40px;
    padding: 6px 24px;
    font-size: 18px;
    line-height: 24px;
  }
}

@media (max-width: 768px) {
  .slide-3__title {
    font-size: 36px;
    padding-top: 40px;
  }

  .slide-3__filter-wrap {
    padding: 24px 0 16px;
  }

  .portfolio__filters {
    gap: 12px;
  }

  .filter-btn {
    height: 36px;
    padding: 4px 18px;
    font-size: 16px;
  }

  .slide-3__grid {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 32px;
  }

  .portfolio-card__title {
    font-size: 24px;
    line-height: 1.2;
  }

  .portfolio-card__subtitle {
    font-size: 16px;
    line-height: 1.3;
  }

  .slide-3__load-more {
    width: 100%;
    max-width: 296px;
  }
}

/* Modal responsive */
@media (max-width: 768px) {
  .pf-modal {
    align-items: flex-end;
  }

  .pf-modal__panel {
    padding: 24px 20px 0;
    border-radius: 12px 12px 0 0;
    margin-top: 60px;
    max-height: calc(100vh - 60px);
    width: 100%;
    align-self: flex-end;
  }

  .pf-modal__title {
    font-size: 26px;
  }

  /* hide desktop controls */
  .pf-modal__close--desktop,
  .pf-modal__arrow--desktop {
    display: none;
  }

  /* show mobile nav bar */
  .pf-modal__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0 24px;
    margin-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.07);
    position: sticky;
    bottom: 0;
    background: #0d0d0d;
  }

  .pf-modal__nav-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms;
  }

  .pf-modal__nav-btn:active {
    background: rgba(255,255,255,0.14);
  }

  .pf-modal__nav-btn--close {
    font-size: 16px;
    flex: 0 0 44px;
    border-color: rgba(255,255,255,0.2);
  }

  .pf-modal__nav-btn[disabled] {
    opacity: 0.2;
    cursor: not-allowed;
  }
}

/* ── Related videos strip ─────────────────────────────────────────────────── */
.pf-modal__related {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
}

.pf-modal__related[hidden] {
  display: none;
}

.pf-modal__related-track-wrap {
  flex: 1;
  overflow: hidden;
}

.pf-modal__related-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 0;
  list-style: none;
  margin: 0;
  justify-content: center;
}

.pf-modal__related-track::-webkit-scrollbar {
  display: none;
}

.pf-modal__related-item {
  flex-shrink: 0;
  width: 120px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

@media (max-width: 768px) {
  .pf-modal__related-item {
    width: 90px;
  }
}

.pf-modal__related-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a1a;
  border: 2px solid transparent;
  transition: border-color 150ms;
}

.pf-modal__related-item:hover .pf-modal__related-thumb {
  border-color: var(--color-orange);
}

.pf-modal__related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf-modal__related-title {
  font-family: var(--font-oswald);
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.3;
}

.pf-modal__related-arrow {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms;
}

.pf-modal__related-arrow:hover:not([disabled]) {
  background: rgba(255,255,255,0.15);
}

.pf-modal__related-arrow[disabled] {
  opacity: 0.2;
  cursor: not-allowed;
}
