/* ============================================================
   CSS 10.03 — position: absolute: pin it inside a parent
   ============================================================
   The recipe (remember it!):
     .parent { position: relative; }               ← the "frame"
     .child  { position: absolute; top: 0; right: 0; }   ← pinned to the frame's corner

   Without a positioned parent, the child pins itself to the whole PAGE instead.
   ============================================================ */

.abs-parent {
  position: relative;               /* ← THE FRAME. Remove this and the children fly to the page corners! */
  height: 220px;
}

.abs-child {
  position: absolute;               /* pinned inside .abs-parent */
}

.tl { top: 0;    left: 0; }
.tr { top: 0;    right: 0; }
.bl { bottom: 0; left: 0; }
.br { bottom: 0; right: 0; }

/* Centring an absolute box: move its top-left corner to the middle (50%),
   then pull it back by half its own size with transform. */
.mid {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
/* Try it: delete  position: relative;  from .abs-parent → the corner boxes
   jump to the corners of the WHOLE page. That is the most common
   absolute-position mistake! Put it back afterwards. */


/* ------------------------------------------------------------
   Only to make the boxes visible — not part of this lesson
   ------------------------------------------------------------ */
.abs-parent {
  max-width: 700px;
  background-color: #F4F5F7;
  border: 2px dashed #525252;
  border-radius: 10px;
}

.abs-child {
  background-color: #2D62EF;
  color: #FFFFFF;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: Consolas, Menlo, monospace;
  font-size: 13px;
}

.mid {
  background-color: #1F9D55;
}
