/* ============================================================
   SECTION — VJERA (Kompanije nam vjeruju)
   ============================================================
   bg: #f6f6f6
   padding-top: 130px, bottom: TBD
   cards: 250×250px, radius 20px, fan layout full-width
   ============================================================ */

:root {
  --vjera-bg: #ffffff;

  /* Card colors */
  --card-1: #7d7170;
  --card-2: #f59220;
  --card-3: #cc35cc;
  --card-4: #1b8f8f;
  --card-5: #2d8030;
  --card-6: #2b4cc8;
  --card-7: #d42020;

  /* Card dimensions */
  --card-w: 250px;
  --card-h: 250px;
  --card-radius: 20px;
}


/* ── SECTION WRAPPER ── */
.section-vjera {
  background: var(--vjera-bg);
  padding-top: 90px;
  padding-bottom: 120px;
  position: relative;
  width: 100%;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}


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

.vjera__heading .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: #111111;
}

.vjera__heading .h2-dutch {
  font-family: var(--font-dutch);
  font-size: var(--fs-h2-dutch);
  font-weight: 400;
  font-style: italic;
  letter-spacing: var(--ls-default);
  color: #111111;
}


/* ── PARAGRAPH ── */
.vjera__sub {
  font-family: var(--font-mont);
  font-size: calc(var(--fs-p) * 0.96);
  font-weight: var(--fw-regular);
  line-height: var(--lh-p);
  letter-spacing: var(--ls-default);
  color: #555555;
  max-width: var(--max-content);
  opacity: 0.9;
}


/* ── CARDS CONTAINER ──
   Own 1420px centering — no gutter — so left:0 = left edge of 1420px.
   Height calculated from rotated card bottoms + bubble room.
*/
.vjera__cards {
  position: relative;
  width: 100%;
  max-width: var(--max-content);
  margin: 70px auto 0;
  height: 474px;
}

/* ── CARD SLOT ── */
.card-slot {
  position: absolute;
  width: var(--card-w);
  height: var(--card-h);
}

/* Precise positions — left = visual post-rotation left edge within 1420px
                       top  = calculated so bottom points match spec         */
.card-slot--1 { left: 60px;   top: 124px; z-index: 1; }
.card-slot--2 { left: 234px;  top: 90px;  z-index: 2; }
.card-slot--3 { left: 408px;  top: 115px; z-index: 3; }
.card-slot--4 { left: 583px;  top: 70px;  z-index: 4; }
.card-slot--5 { left: 757px;  top: 107px; z-index: 5; }
.card-slot--6 { left: 931px;  top: 128px; z-index: 6; }
.card-slot--7 { left: 1105px; top: 118px; z-index: 7; }


/* ── CARD ── */
.card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 20px;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.card-slot--1 .card { background: var(--card-1); transform: rotate(-5.48deg); }
.card-slot--2 .card { background: var(--card-2); transform: rotate(-2.44deg); }
.card-slot--3 .card { background: var(--card-3); transform: rotate(-1deg);   }
.card-slot--4 .card { background: var(--card-4); transform: rotate(2.1deg);  }
.card-slot--5 .card { background: var(--card-5); transform: rotate(0deg);    }
.card-slot--6 .card { background: var(--card-6); transform: rotate(3deg);    }
.card-slot--7 .card { background: var(--card-7); transform: rotate(8.7deg);  }


/* ── CARD IMAGE ──
   Covers full card. Rotation matches card via parent.
*/
.card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ── SPEECH BUBBLE ──
   Upright (not rotated). Positioned relative to .card-slot.
   Black pill with white text and a triangle tail.
*/
.card__bubble {
  position: absolute;
  background: #111111;
  color: #ffffff;
  font-family: var(--font-mont);
  font-size: calc(var(--fs-p) * 0.81); /* -10% of previous -10% */
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-default);
  padding: 10px 16px;   /* +3px top/bottom */
  border-radius: 15px;
  white-space: nowrap;
  line-height: 1;
  z-index: 10;
}

.card__bubble::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
}

/* ── BUBBLE TOP (notch points down toward card) ── */
.card__bubble--top {
  bottom: calc(100% + 32px);
  left: 50%;
  transform: translateX(-50%);
}

.card__bubble--top::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  /* Rounded notch via box-shadow trick */
  width: 10px;
  height: 8px;
  background: #111111;
  border-radius: 0 0 5px 5px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* ── BUBBLE BOTTOM (notch points up toward card) ── */
.card__bubble--bottom {
  top: calc(100% + 32px);
  left: 50%;
  transform: translateX(-50%);
}

.card__bubble--bottom::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 8px;
  background: #111111;
  border-radius: 5px 5px 0 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* ── BUBBLE OVERRIDES ── */
.card__bubble {
  font-size: calc(var(--fs-p) * 0.77);
  padding: 9px 15px;
  border-radius: 10px;
  border: none;
}

.card__bubble--top    { bottom: calc(100% + 28px); }
.card__bubble--bottom { top:    calc(100% + 28px); }

/* Notch — rounded square rotated 45° */
.card__bubble--top::after,
.card__bubble--bottom::after {
  content: '';
  position: absolute;
  width: 11px;
  height: 11px;
  background: #111111;
  border-radius: 3px;
  left: 50%;
  clip-path: none;
}

.card__bubble--top::after {
  top: auto;
  bottom: -5.5px;
  transform: translateX(-50%) rotate(45deg);
}

.card__bubble--bottom::after {
  bottom: auto;
  top: -5.5px;
  transform: translateX(-50%) rotate(45deg);
}


/* ============================================================
   SECTION 2 ANIMATIONS
   Heading + sub: fade in (fast)
   Cards: fade up (slower, staggered)
   Triggered by JS adding .anim-visible to .section-vjera
   ============================================================ */

/* Initial hidden states */
.section-vjera.will-animate .vjera__heading,
.section-vjera.will-animate .vjera__sub {
  opacity: 0;
  transition: opacity 1s ease-out;
}

.card-slot {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.6s ease-out, transform 1.6s ease-out;
}

/* Triggered states */
.section-vjera.anim-visible .vjera__heading {
  opacity: 1;
}

.section-vjera.anim-visible .vjera__sub {
  opacity: 1;
  transition-delay: 0.12s;
}

/* Cards stagger left → right */
.section-vjera.anim-visible .card-slot--1 { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
.section-vjera.anim-visible .card-slot--2 { opacity: 1; transform: translateY(0); transition-delay: 0.22s; }
.section-vjera.anim-visible .card-slot--3 { opacity: 1; transform: translateY(0); transition-delay: 0.29s; }
.section-vjera.anim-visible .card-slot--4 { opacity: 1; transform: translateY(0); transition-delay: 0.36s; }
.section-vjera.anim-visible .card-slot--5 { opacity: 1; transform: translateY(0); transition-delay: 0.43s; }
.section-vjera.anim-visible .card-slot--6 { opacity: 1; transform: translateY(0); transition-delay: 0.50s; }
.section-vjera.anim-visible .card-slot--7 { opacity: 1; transform: translateY(0); transition-delay: 0.57s; }


/* ── CARD HOVER OVERLAY + ARROW ── */

/* Dark overlay */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  border-radius: 20px;
}

/* Centered 40×40 white box with ↗ arrow */
.card::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M17 7H7M17 7V17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
}

/* ── TESTING: centre heading and sub ── */
.vjera__heading {
  text-align: center;
}

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