/* ============================================================
   SECTION 5 — PORTFOLIO (Pogledajte šta smo do sada izgradili)
   ============================================================
   Same spacing as section 2. Black bg, white text.
   ============================================================ */


/* ── SECTION WRAPPER ── */
.section-portfolio {
  background: #111111;
  width: 100%;
  width: 100%;
  margin: 0 auto;
  padding-top: 90px;
  padding-bottom: 120px;
}


/* ── HEADING ── */
.portfolio__heading {
  margin: 0 0 50px 0;
  padding: 0;
  font-weight: var(--fw-regular);
  display: block;
}

.portfolio__heading-line {
  display: block;
}

.portfolio__heading-line .h2-mont {
  font-family: var(--font-mont);
  font-size: var(--fs-h2-mont);
  font-weight: 400;
  line-height: var(--lh-h2-mont);
  letter-spacing: -0.07em;
  color: #ffffff;
}

.portfolio__heading-line .h2-dutch {
  font-family: var(--font-dutch);
  font-size: var(--fs-h2-dutch);
  font-weight: 400;
  font-style: italic;
  line-height: var(--lh-h2-mont);
  letter-spacing: var(--ls-default);
  color: #ffffff;
}

.portfolio__heading-line .h2-anchor {
  font-family: var(--font-mont);
  font-size: var(--fs-h2-mont);
  font-weight: 400;
  line-height: var(--lh-h2-mont);
  color: transparent;
  user-select: none;
  pointer-events: none;
  width: 0;
  overflow: hidden;
  display: inline-block;
}


/* ── SUB TEXT ── */
.portfolio__sub {
  font-family: var(--font-mont);
  font-size: calc(var(--fs-p) * 0.816);
  font-weight: var(--fw-regular);
  line-height: var(--lh-p);
  letter-spacing: var(--ls-default);
  color: #ffffff;
  max-width: var(--max-content);
  opacity: 0.9;
  margin: 0;
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

.section-portfolio.will-animate .portfolio__heading,
.section-portfolio.will-animate .portfolio__sub {
  opacity: 0;
  transition: opacity 1s ease-out;
}

.section-portfolio.anim-visible .portfolio__heading {
  opacity: 1;
}

.section-portfolio.anim-visible .portfolio__sub {
  opacity: 1;
  transition-delay: 0.12s;
}


/* ── TAG BUTTON — same as section 3 but white bg, black text ── */
.portfolio__tag {
  display: block;
  text-align: center;
  margin-bottom: 30px;
}

.portfolio__tag {
  display: inline-block;
  font-family: var(--font-mont);
  font-size: var(--fs-nav);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-default);
  color: #000000;
  background: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 12px 25px;
  white-space: nowrap;
  cursor: default;
  line-height: 1;
}

/* ── CENTER heading, sub ── */
.portfolio__heading {
  text-align: center;
}

.portfolio__sub {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ── Center tag via block + margin auto ── */
.portfolio__tag {
  display: block;
  width: fit-content;
  margin: 0 auto 30px;
}


/* ══════════════════════════════════════════════════
   PORTFOLIO GRID — 4×4 layout, 1480×1480px
   ══════════════════════════════════════════════════

   Grid positions:
   A  A  C  C      col1-2 row1    / col3-4 row1-2
   B  B  C  C      col1-2 row2
   D  F  F  F      col1 row3      / col2-4 row3-4
   E  F  F  F      col1 row4

   ══════════════════════════════════════════════════ */

.portfolio__grid-wrap {
  width: 1372px;
  margin: 70px auto 0;
}

.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 14px;
  width: 1372px;
  height: 1372px;
}

/* Shared box styles */
.pg-box {
  border-radius: 12px;
  background: #222222; /* placeholder — update per box */
  overflow: hidden;
}

/* ── Placements ── */
.pg-box--a { grid-column: 1 / 3; grid-row: 1 / 2; }   /* 1+2 */
.pg-box--b { grid-column: 1 / 3; grid-row: 2 / 3; }   /* 5+6 */
.pg-box--c { grid-column: 3 / 5; grid-row: 1 / 3; }   /* 3+4+7+8 */
.pg-box--d { grid-column: 1 / 2; grid-row: 3 / 4; }   /* 9 */
.pg-box--e { grid-column: 1 / 2; grid-row: 4 / 5; }   /* 13 */
.pg-box--f { grid-column: 2 / 4; grid-row: 3 / 5; }   /* 10+11+14+15 */
.pg-box--g { grid-column: 4 / 5; grid-row: 3 / 5; }   /* 12+16 */


/* ── BOX IMAGE — covers entire box ── */
.pg-box {
  position: relative;
  overflow: hidden;
}

.pg-box__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
}

/* ── DARK OVERLAY — fades in on hover ── */
.pg-box__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.pg-box:hover .pg-box__overlay {
  opacity: 1;
}

/* ── CORNER BUTTON — bottom right, 20px padding from edges ── */
.pg-box__btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-decoration: none;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

.pg-box__btn svg {
  width: 16px;
  height: 16px;
  transition: stroke 0.3s ease;
}

.pg-box:hover .pg-box__btn {
  background: #111111;
}

.pg-box:hover .pg-box__btn svg {
  stroke: #ffffff;
}


/* ── BOTTOM BAR — text left, button right, vertically bottom-aligned ── */
.pg-box__bottom {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  z-index: 2;
}

/* ── TEXT BLOCK — title, sub, date ── */
.pg-box__text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.pg-box:hover .pg-box__text {
  opacity: 1;
  transform: translateY(0);
}

.pg-box__title {
  font-family: var(--font-mont);
  font-size: calc(var(--fs-p) * 0.96 * 1.452);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-default);
  color: #ffffff;
  line-height: 1.2;
}

.pg-box__desc {
  font-family: var(--font-mont);
  font-size: calc(var(--fs-p) * 0.816);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-default);
  color: #ffffff;
  line-height: 1.4;
  opacity: 0.85;
}

.pg-box__date {
  font-family: var(--font-mont);
  font-size: calc(var(--fs-p) * 0.605);
  font-weight: var(--fw-medium);
  letter-spacing: 0.05em;
  color: #ffffff;
  opacity: 0.7;
  text-transform: uppercase;
}

/* ── CORNER BUTTON — bottom right ── */
.pg-box__btn {
  width: 43px;
  height: 43px;
  flex-shrink: 0;
  position: static;
  bottom: auto;
  right: auto;
}

.pg-box__btn svg {
  width: 19px;
  height: 19px;
}

/* ── Make entire box clickable via invisible overlay link ── */
.pg-box {
  cursor: pointer;
}

.pg-box__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

/* Button sits above the link overlay */
.pg-box__btn {
  z-index: 3;
}

.pg-box__bottom {
  z-index: 3;
}

/* ── GRID FADE UP ── */
.section-portfolio.will-animate .portfolio__grid-wrap {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.4s ease-out 0.2s, transform 1.4s ease-out 0.2s;
}

.section-portfolio.anim-visible .portfolio__grid-wrap {
  opacity: 1;
  transform: translateY(0);
}
