/* ===== SERVICES ===== */

.services {
  background: var(--color-bg);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: clip; /* clips bg/pseudo but allows positioned children to overflow */
}


/* HEADER */
.services__header {
  margin-bottom: var(--space-xl);
  position: relative;
}

/* GRID */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: var(--space-xl);
  position: relative;
  /* Extra bottom row padding so illustrations can overflow downward */
  padding-bottom: 40px;
}

/* CARD BASE */
.services__card {
  background: transparent;
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  border: none;
  position: relative;
  overflow: visible; /* lets illustration bleed right beyond the card */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  cursor: default;
  display: flex;
  flex-direction: column;
}

/* Visual card surface — rounded, clipped to its own boundary */
.services__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(45, 90, 39, 0.045) 0%, transparent 50%),
    var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 61, 24, 0.08);
  border-top: 3px solid var(--color-primary);
  z-index: 0;
  transition: box-shadow 0.3s ease;
}

/* All card children sit above the pseudo-element surface */
.services__card > * {
  position: relative;
  z-index: 1;
}

.services__card:hover {
  transform: translateY(-5px);
}

.services__card:hover::before {
  box-shadow: 0 16px 48px rgba(30, 61, 24, 0.12);
}

/* DECORATIVE NUMBER */
.services__num {
  position: absolute;
  top: var(--space-md);
  right: var(--space-lg);
  font-family: var(--font-heading);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -3px;
  color: rgba(30, 61, 24, 0.06);
  user-select: none;
  pointer-events: none;
}

/* ICON */
.services__icon {
  width: 48px;
  height: 48px;
  background: rgba(45, 90, 39, 0.09);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  flex-shrink: 0;
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

.services__card:hover .services__icon:not(.services__icon--img) {
  background: rgba(45, 90, 39, 0.15);
  transform: scale(1.08) rotate(-4deg);
}

.services__card--featured .services__icon {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
}

.services__card--featured:hover .services__icon {
  background: rgba(255, 255, 255, 0.2);
}

/* ICON — image variant: large, flush left edge, no box */
.services__icon--img {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: 120px;
  background: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  display: block;
}

.services__icon--img img {
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: top left;
  display: block;
}

/* Cards with image icons — push content below icon */
.services__card--img-icon {
  padding-top: 100px;
}

/* Split layout: illustration on right, text on left */
.services__card--split {
  padding-right: 52%;
}

/* DECORATIVE CARD ILLUSTRATION — flush bottom, overflows right only */
.services__card-img {
  position: absolute;
  bottom: 0;
  right: -28px;
  width: 72%;
  pointer-events: none;
}

/* Override z-index:1 set by .services__card > * */
.services__card > .services__card-img {
  z-index: 0;
}

.services__card-img img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: bottom right;
}

/* SPLIT variant — illustration on right half, anchored bottom-right */
.services__card--split .services__card-img {
  top: 0;
  bottom: 0;
  right: 0;
  left: 50%;
  width: auto;
  overflow: hidden;
}

.services__card--split .services__card-img img {
  position: absolute;
  bottom: 0;
  left: -95%;
  height: 80%; /* ← OVDE menjaj visinu ilustracije u Orezivanje kartici */
  width: auto;
  max-width: none;
  object-fit: contain;
}

/* GREEN ACCENT BAR */
.services__accent {
  width: 40px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  margin-bottom: var(--space-md);
  flex-shrink: 0;
}

/* FEATURED CARD — full background image */
.services__card--featured {
  grid-column: span 2;
  display: block;
  background: var(--color-primary-dark);
  border: none;
  border-top: 3px solid var(--color-primary-light);
  padding: 0;
  min-height: 400px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.services__card--featured::before {
  content: none;
}

.services__card--featured:hover {
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.25);
}

/* Background image for featured card */
.services__featured-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.services__featured-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center right;
  transition: transform 0.7s ease;
}

.services__card--featured:hover .services__featured-bg img {
  transform: scale(1.04);
}

/* Gradient overlay: dark left for text, transparent right shows image */
.services__featured-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(15, 40, 12, 0.85) 0%,
    rgba(15, 40, 12, 0.55) 45%,
    rgba(15, 40, 12, 0.15) 100%
  );
  z-index: 1;
}

.services__card-content {
  position: relative;
  z-index: 2;
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 400px;
  max-width: 55%;
}

.services__card--featured .btn {
  white-space: nowrap;
  align-self: flex-start;
}

.services__card--featured .services__accent {
  background: var(--color-primary-light);
}

/* NAME */
.services__name {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.2;
  max-width: 100%;
}

.services__card--featured .services__name {
  color: var(--color-white);
  font-size: var(--text-3xl);
}

/* DESC */
.services__desc {
  font-size: var(--text-sm);
  color: var(--color-primary-dark);
  line-height: 1.75;
  font-weight: 700;
  flex: 1;
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.5);
}
@media (max-width: 768px) {
  .services__card-img {
    filter: blur(0.5px);
  }
}
.services__card--featured .services__desc {
  color: rgba(255, 255, 255, 0.7);
}

/* LINK */
.services__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: gap 0.2s;
  align-self: flex-start;
}

.services__card--featured .services__link {
  color: var(--color-primary-light);
}

.services__link:hover {
  gap: 10px;
}

/* CTA */
.services__cta {
  text-align: center;
}

.services__cta-btn {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 6px 24px rgba(45, 90, 39, 0.25);
}

.services__cta-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .services__grid {
    grid-template-columns: 1fr 1fr;
  }
  .services__card--featured {
    grid-column: span 2;
  }
  .services__card-content {
    max-width: 65%;
  }
  /* Kartice su šire na tabletu — smanji ilustraciju i overflow */
  .services__card-img {
    width: 55%;
    right: 0;
  }
  /* Split kartica — smanji padding da tekst ima više prostora */
  .services__card--split {
    padding-right: 44%;
  }
  .services__card--split .services__card-img {
    left: 56%;
  }
}

@media (max-width: 768px) {
  .services__grid {
    grid-template-columns: 1fr;
  }
  .services__card--featured {
    grid-column: span 1;
    min-height: 320px;
  }
  .services__card-content {
    max-width: 100%;
    min-height: 320px;
  }
  .services__featured-bg::after {
    background: rgba(15, 40, 12, 0.72);
  }
  /* Fiksuj overflow koji izlazi van viewport-a */
  .services__card-img {
    right: 0;
    width: 60%;
  }
  /* Reset split kartice — tekst dobija punu širinu */
  .services__card--split {
    padding-right: 32px;
  }
  .services__card--split .services__card-img {
    display: none;
  }
}

@media (max-width: 480px) {
  .services__card-img {
    width: 50%;
  }
  .services__card--img-icon {
    padding-top: 80px;
  }
  .services__icon--img {
    height: 90px;
  }
}
