/* ============================================================
   CSS 13.10 — Flexbox or Grid? When to use which
   ============================================================
   FLEXBOX = ONE direction (a row OR a column)
     ✔ navbars, button groups, a card's inside, centring one thing,
       a row of items whose sizes come from their content

   GRID = TWO directions (rows AND columns together)
     ✔ page layouts (header / sidebar / main / footer),
       galleries, dashboards, card grids that must line up in columns

   They work TOGETHER: a grid page layout, with flexbox inside the navbar.
   ============================================================ */

.flex-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flex-cards .box {
  flex: 1 1 200px;                  /* the 2 cards in the last row grow wider */
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* every card exactly 1/3 */
  gap: 10px;
}

/* ------------------------------------------------------------
   Only to make the boxes visible — not part of this lesson
   ------------------------------------------------------------ */
.box {
  background-color: #2D62EF;
  color: #FFFFFF;
  font-weight: bold;
  padding: 14px;
  border-radius: 6px;
}

.container {
  background-color: #F4F5F7;
  border: 2px dashed #9A9A9A;
  padding: 8px;
  margin-bottom: 16px;
  max-width: 900px;
}


/* ============================================================
   Lesson 13 — Quick summary
   ============================================================
   ON THE CONTAINER                           ON AN ITEM
   display: grid                              grid-column: span 2
   grid-template-columns: 200px 1fr           grid-row: span 2
   grid-template-columns: repeat(3, 1fr)      grid-column: 2 / 4   (lines)
   grid-template-columns:                     grid-column: 1 / -1  (full width)
     repeat(auto-fit, minmax(160px, 1fr))     grid-area: header
   grid-template-rows: 60px 120px
   grid-template-areas: "header header" …
   gap: 20px 10px
   place-items: center

   fr = a part of the free space.   Flexbox = 1 direction, Grid = 2.

   Practice tasks:
     1. Make a 4-column fee table layout with  repeat(4, 1fr)  and a 12px gap.
     2. Make a photo grid where the first photo is 2 columns wide and 2 rows tall.
     3. Build a page with grid-template-areas: header, main, a sidebar on the
        RIGHT, and a footer.

   Then open 11-playground-grid.html and click the buttons to try it all.
   ============================================================ */
