/**
 * css/style.css
 * LearnDash Course Grid — responsive layout
 * Version: 1.1.3
 */

.custom-ld-grid {
  display: grid;
  gap: 20px;
  width: 100%;
}

@media (max-width: 768px) {
  .custom-ld-card-image { height: 150px; }
}

.custom-ld-card-link {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
}

.custom-ld-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-width: 1px;
  border-style: solid;
  border-color: #000000; /* overridable via settings inline CSS */
  background: #fff;
  max-width: 100%; /* Prevent width overflow */
}

.custom-ld-card-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.custom-ld-card-content {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.custom-ld-course-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.custom-ld-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}
.custom-ld-info-item { display: flex; align-items: center; }
.custom-ld-info-item .dashicons { margin-right: 5px; font-size: 16px; }

.custom-ld-progress-bar-container { margin-bottom: 10px; }
.custom-ld-progress-bar-bg,
.custom-ld-progress-bar-fill { height: 8px; }
.custom-ld-progress-bar-bg {
  position: relative;
  background-color: #eee;
  border-radius: 4px;
  overflow: hidden;
}
.custom-ld-progress-bar-fill {
  width: 0;
  background-color: #4caf50;
  transition: width 0.3s ease;
}
.custom-ld-progress-label {
  display: block;
  text-align: right;
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.custom-ld-last-activity {
  font-size: 12px;
  color: #999;
  text-align: right;
}

.custom-ld-badge { position: absolute; top: 10px; right: 10px; padding: 5px 10px; color: #fff; font-weight: 700; font-size: 12px; border-radius: 3px; }
.custom-ld-badge.status-locked       { background-color: gray; }
.custom-ld-badge.status-not-started  { background-color: orange; }
.custom-ld-badge.status-in-progress  { background-color: blue; }
.custom-ld-badge.status-completed    { background-color: green; }

.custom-ld-button-wrap {
  margin-top: 12px;
  text-align: inherit;
  flex-shrink: 0; /* Prevent button from shrinking and breaking layout */
}

.custom-ld-button {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  background: #1e73be;
  color: #fff;
  max-width: 100%; /* Ensure button fits within card */
  box-sizing: border-box; /* Include padding in width calculation */
}
.custom-ld-button:hover { opacity: 0.9; }

.custom-ld-grid.center-content .custom-ld-card-content { text-align: center; }
.custom-ld-grid.center-content .custom-ld-info-row { justify-content: center; }