/* ================================================
   EKW Services Cards Widget — Frontend Styles
   نسخه ۱.۰ | RTL | Elementor Widget
================================================ */

.ekw-wrapper {
  direction: rtl;
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  max-width: 100%;
}

.ekw-wrapper,
.ekw-wrapper *,
.ekw-wrapper *::before,
.ekw-wrapper *::after {
  box-sizing: border-box;
}

/* ---- Grid ---- */
.ekw-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  max-width: 100%;
}

/* ---- Card ---- */
.ekw-card {
  background: #ffffff;
  border: 1.5px solid #e8eef6;
  border-radius: 14px;
  padding: 32px 22px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  height: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.ekw-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(30, 120, 210, 0.12);
  border-color: #b8d4f5;
}

/* ---- Icon ---- */
.ekw-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #eef4fd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
  font-size: 28px;
  color: #1e78d2;
  transition: background 0.25s ease;
}

.ekw-card:hover .ekw-icon-wrap {
  background: #dce9fb;
}

/* Elementor SVG icons */
.ekw-icon-wrap svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* ---- Card Body ---- */
.ekw-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  width: 100%;
}

/* ---- Title ---- */
.ekw-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a3c6e;
  margin-bottom: 10px;
  line-height: 1.6;
}

/* ---- Divider ---- */
.ekw-divider {
  width: 36px;
  height: 2.5px;
  background: #1e78d2;
  border-radius: 2px;
  margin: 0 auto 14px;
  flex-shrink: 0;
}

/* ---- Description ---- */
.ekw-desc {
  font-size: 13px;
  font-weight: 400;
  color: #5a7599;
  line-height: 1.85;
  flex: 1;
  margin-bottom: 20px;
}

/* ---- Link (styled as a button) ---- */
.ekw-link {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background-color: #1e78d2;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 26px;
  border-radius: 8px;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: auto;
}

.ekw-link:hover {
  background-color: #1055a8;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(30, 120, 210, 0.25);
}

/* ================================================
   RESPONSIVE (default — overridden per-widget
   by inline <style> from widget.php for columns)
================================================ */

@media (max-width: 1024px) {
  .ekw-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet / large phone: icon + text side by side */
@media (max-width: 767px) {
  .ekw-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ekw-card {
    flex-direction: row;
    flex-wrap: wrap;
    text-align: right;
    align-items: flex-start;
    gap: 14px 16px;
    padding: 20px 18px;
  }

  .ekw-icon-wrap {
    width: 56px;
    height: 56px;
    font-size: 22px;
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .ekw-icon-wrap svg {
    width: 22px;
    height: 22px;
  }

  .ekw-card-body {
    align-items: flex-start;
    /* Prevents long titles/descriptions from forcing the row to overflow
       horizontally — flex items default to min-width:auto otherwise. */
    min-width: 0;
    flex-basis: 0;
  }

  .ekw-title {
    font-size: 15px;
  }

  .ekw-desc {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .ekw-divider {
    margin: 0 0 10px 0;
  }

  .ekw-link {
    width: 100%;
    text-align: center;
  }
}

/* Small phones: switch back to a centered, stacked card so the icon,
   title, description and button don't feel cramped on narrow screens. */
@media (max-width: 480px) {
  .ekw-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    padding: 26px 18px 22px;
  }

  .ekw-icon-wrap {
    width: 60px;
    height: 60px;
    font-size: 24px;
    margin-bottom: 16px;
  }

  .ekw-icon-wrap svg {
    width: 24px;
    height: 24px;
  }

  .ekw-card-body {
    align-items: center;
    flex-basis: auto;
  }

  .ekw-divider {
    margin: 0 auto 12px;
  }

  .ekw-link {
    max-width: 220px;
  }
}
