/* ============================================================
   CSS 04.08 — % : a part of the PARENT
   ============================================================
   width: 50%;  → half the width of the PARENT element
                  (the element it sits in — here the dashed box).
   ✔ Good for: widths of layout parts.
   ============================================================ */

.pct-25  { width: 25%; }
.pct-50  { width: 50%; }
.pct-75  { width: 75%; }
.pct-100 { width: 100%; }
/* Try it: make the browser window narrow → the green bars shrink.
   (Open 07-px.html side by side: the px bars do not.)
   Try it: give .parent  width: 400px;  → now 50% is always 200px,
   because the PARENT no longer changes. */

/* ------------------------------------------------------------
   Only to make the bars visible — not part of this lesson
   ------------------------------------------------------------ */
.bar {
  background-color: #2D62EF;
  color: #FFFFFF;
  padding: 6px 0;                  /* no side padding: it would make the 100% bar wider than its parent (see 06-box-sizing) */
  text-indent: 10px;                /* moves the text in, without adding width */
  margin: 8px 0;
  border-radius: 6px;
  font-family: Consolas, Menlo, monospace;
  font-size: 14px;
}

.bar {
  background-color: #1F9D55;        /* green bars for % */
}

.parent {
  border: 2px dashed #9A9A9A;
  padding: 0 8px;
}
