@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.sag-section,
.sag-grid,
.sag-grid * {
  box-sizing: border-box;
}

.sag-section {
  font-family: 'Inter', sans-serif;
}

.sag-grid {
  --sag-border: #ddd7cf;
  --sag-text: #1f2430;
  --sag-muted: #667085;
  --sag-soft: #ffffff;
  --sag-btn-bg: #f3f1ed;
  --sag-accent: #d8c4a0;
  --sag-white: #ffffff;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  align-items: stretch;
}

.sag-grid__item {
  min-width: 0;
}

.sag-grid__item--hidden {
  display: none;
}

.sag-card {
  height: 100%;
  background: var(--sag-white);
  border: 1px solid var(--sag-border);
  border-radius: 22px;
  padding: 32px;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  color: var(--sag-text);
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.sag-card__header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.sag-card__logo {
  width: 74px;
  height: 74px;
  min-width: 74px;
  border-radius: 18px;
  background: var(--sag-soft);
  border: 1px solid #ece7df;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

.sag-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #fff;
}

.sag-card__initials {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #22252f;
}

.sag-card__title-wrap {
  min-width: 0;
  flex: 1;
}

.sag-card__title {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 1.5rem + 0.6vw, 2.25rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sag-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: var(--sag-muted);
  font-size: 1rem;
  line-height: 1.4;
}

.sag-card__meta-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sag-card__meta-item::before,
.sag-btn__icon,
.sag-btn__icon::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  flex: 0 0 18px;
}

.sag-card__meta-item--location::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.sag-card__meta-item--employees::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

.sag-card__description-wrap {
  margin-bottom: 20px;
}

.sag-card__description {
  margin: 0;
  color: var(--sag-muted);
  font-size: 1rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  max-height: calc(1.7em * 4);
}

.sag-card__contact {
  margin: 0 0 24px;
  color: #50586a;
  font-size: 1rem;
  line-height: 1.5;
}

.sag-card__contact-label {
  font-weight: 400;
}

.sag-card__actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sag-btn,
.sag-more-btn {
  min-height: 48px;
  border: 1px solid var(--sag-border);
  border-radius: 12px;
  background: var(--sag-btn-bg);
  color: var(--sag-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 600;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.sag-btn:hover,
.sag-btn:focus-visible,
.sag-more-btn:hover,
.sag-more-btn:focus-visible {
  transform: translateY(-1px);
  border-color: #cab28a;
  background: #f5f0e6;
  outline: none;
}

.sag-btn--primary,
.sag-more-btn {
  border-color: var(--sag-accent);
}

.sag-btn__icon--calendar::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231f2430' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
}

.sag-btn__icon--external::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231f2430' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E");
}

.sag-section__footer {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.sag-more-btn {
  cursor: pointer;
  min-width: 150px;
}

@media (max-width: 1200px) {
  .sag-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .sag-card {
    padding: 28px;
  }
}

@media (max-width: 767px) {
  .sag-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .sag-card {
    min-height: auto;
    padding: 22px;
    border-radius: 18px;
  }

  .sag-card__header {
    gap: 16px;
    margin-bottom: 18px;
  }

  .sag-card__logo {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 16px;
    padding: 8px;
  }

  .sag-card__title {
    font-size: 1.55rem;
  }

  .sag-card__meta,
  .sag-card__description,
  .sag-card__contact,
  .sag-btn,
  .sag-more-btn {
    font-size: 0.95rem;
  }

  .sag-card__actions {
    grid-template-columns: 1fr;
  }

  .sag-section__footer {
    margin-top: 20px;
  }

  .sag-more-btn {
    width: 100%;
  }
}
