/* Main section styling */
.section {
  margin: clamp(48px, 8vw, 64px) auto;
  max-width: 1200px;
  padding: 0 clamp(16px, 4vw, 32px);
}

.section h2 {
  font-size: clamp(1.75rem, 4vw, 2rem);
  margin-bottom: clamp(16px, 3vw, 24px);
  text-align: center;
  font-weight: 700;
  line-height: 1.2;
}

.section p {
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  margin-bottom: clamp(24px, 4vw, 32px);
  line-height: 1.6;
  text-align: center;
  color: var(--text-muted);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Card container with responsive grid */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, calc(100vw - 32px)), 1fr));
  gap: clamp(16px, 3vw, 50px);
  justify-items: center;
  margin-bottom: clamp(32px, 6vw, 48px);
  width: 100%;
}

/* Individual card styling */
.card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: min(320px, calc(100vw - 32px));
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: clamp(16px, 3vw, 24px);
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.card:hover::before {
  transform: scaleX(1);
}

/* Card image styling */
.card__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: clamp(160px, 25vw, 200px);
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: clamp(12px, 2vw, 16px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.card:hover .card__image {
  transform: scale(1.05);
}

/* Card text styling */
.card__name {
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  font-weight: 600;
  margin-bottom: clamp(6px, 1vw, 8px);
  text-align: center;
  word-wrap: break-word;
  overflow: visible;
  white-space: normal;
  line-height: 1.3;
  color: var(--text);
}

.card__role {
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  color: var(--text-muted);
  text-align: center;
  word-wrap: break-word;
  overflow: visible;
  white-space: normal;
  line-height: 1.4;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Departemen page specific adjustments */
body main {
  padding-top: clamp(64px, 10vw, 80px);
  min-height: calc(100vh - 64px);
}

/* Tablet responsive adjustments */
@media (max-width: 768px) {
  .section {
    margin: clamp(32px, 6vw, 48px) auto;
  }

  .card-container {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, calc(100vw - 100px)), 1fr));
    gap: clamp(16px, 3vw, 20px);
  }

  .card {
    max-width: min(280px, calc(100vw - 32px));
    min-height: 200px;
    padding: clamp(16px, 3vw, 20px);
  }

  .card__image {
    max-height: clamp(140px, 20vw, 170px);
  }

  body main {
    padding-top: 56px;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 550px) {
  .section {
    margin: clamp(24px, 5vw, 32px) auto;
    padding: 0 20px; /* Tetap berikan margin */
  }

  .card-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 4px; /* Extra padding untuk card container */
  }

  .card {
    max-width: min(100%, calc(100vw - 100px)); /* Lebih kecil untuk avoid overflow */
    min-height: 200px;
    padding: 16px;
    border-radius: 8px;
    margin: 0 auto; /* Center the card */
  }

  .card__image {
    max-height: 140px;
    border-radius: 6px;
  }

  body main {
    padding-top: 52px;
  }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .card-container {
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 1fr));
    gap: 16px;
  }

  .card {
    min-height: 280px;
    max-width: min(250px, calc(100vw - 32px));
  }

  .card__image {
    max-height: 110px;
  }
}

/* Large desktop adjustments */
@media (min-width: 1400px) {
  .card-container {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 50px;
  }

  .card {
    max-width: 350px;
    min-height: 420px;
    padding: 28px;
  }

  .card__image {
    max-height: 220px;
  }
}

