/* ============================================================
   CSS 10.04 — absolute in real life: badges, close buttons, captions
   ============================================================
   All three use the same recipe from example 03:
     the box             → position: relative;   (the frame)
     the thing on top    → position: absolute;   + top / right / bottom / left
   ============================================================ */

/* 1. NEW ribbon on a card */
.course-card {
  position: relative;               /* frame for the ribbon */
}

.ribbon {
  position: absolute;
  top: -10px;                       /* a little ABOVE the card edge  */
  right: 12px;
}
/* Try it: change the ribbon to  top: 12px; left: 12px;  → it moves to the
   top-left, inside the card. (Delete  right: 12px;  too.) */


/* 2. × close button in a notice */
.alert {
  position: relative;               /* frame for the × */
  padding-right: 40px;              /* extra right padding so text never runs under the × */
}

.close-btn {
  position: absolute;
  top: 6px;
  right: 8px;
}


/* 3. Caption on top of a picture */
.photo {
  position: relative;               /* frame for the caption */
}

.caption {
  position: absolute;
  left: 0;
  right: 0;                         /* left 0 + right 0 = full width */
  bottom: 0;
}
/* Try it: change the caption to  top: 0;  instead of  bottom: 0;
   → it moves to the top of the picture. */


/* ------------------------------------------------------------
   Only to make the three demos look nice — not part of this lesson
   ------------------------------------------------------------ */
.course-card,
.alert,
.photo {
  margin: 24px 0;                   /* space between the three demos */
}

.course-card {
  width: 220px;
  padding: 20px 16px 16px;
  border: 1px solid #E4E4E4;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.ribbon {
  background-color: #E54B4F;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 999px;
}

.alert {
  width: 260px;
  padding-top: 14px;
  padding-bottom: 14px;
  padding-left: 16px;
  background-color: #FFF6E0;
  border-left: 5px solid #FFAF04;
  border-radius: 8px;
}

.close-btn {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #525252;
}

.photo {
  width: 260px;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  background: url("../assets/campus.svg") center / cover;   /* lesson 07 */
}

.caption {
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.55);
  color: #FFFFFF;
  font-size: 14px;
}
