/* ============================================================
   CSS 12.03 — Cards with the button always at the bottom
   ============================================================
   Look for the lines marked  ★ FLEX .  Those are the lines that make
   the layout. Everything at the bottom is decoration (colours, padding,
   borders) from earlier lessons.

   .pinned           { display: flex; flex-direction: column; }
   .pinned .card-btn { margin-top: auto; }

   margin-top: auto → "take all the free space ABOVE me" → pushed to the bottom
   ============================================================ */

/* The row of cards (same as example 02) */
.card-row {
  display: flex;                    /* ★ FLEX                                      */
  flex-wrap: wrap;                  /* ★ FLEX: new rows on small screens           */
  gap: 16px;                        /* ★ FLEX                                      */
  max-width: 900px;                 /* not too wide, so the cards' text wraps to different lengths */
}

.course-card {
  flex: 1 1 220px;                  /* ★ FLEX: grow, shrink, start at 220px        */
}

/* The fix — only the bottom row has the class "pinned" */
.pinned {
  display: flex;                    /* ★ FLEX: the CARD itself becomes a flex container …  */
  flex-direction: column;           /* ★ FLEX: … stacking title, text, button top to bottom */
}

.pinned .card-btn {
  margin-top: auto;                 /* ★ FLEX: push the button to the bottom of the card   */
  align-self: flex-start;           /* (in the column) don't stretch the button full width */
}
/* Try it: remove  margin-top: auto;  → the bottom row looks like the top row again. */


/* ------------------------------------------------------------
   Only to make the cards look nice — not part of this lesson
   ------------------------------------------------------------ */
.course-card {
  padding: 18px;
  border: 1px solid #E4E4E4;
  border-radius: 12px;
  background-color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.course-card h3 { margin: 0 0 6px; font-size: 18px; }
.course-card p  { margin: 0; color: #525252; }

.card-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 14px;
  border: 2px solid #2D62EF;
  border-radius: 8px;
  color: #2D62EF;
  font-weight: 700;
  text-decoration: none;
}
