/* ============================================================
   CSS 15.08 — Everything together: a responsive page
   ============================================================
   Phone (default)                Laptop (900px and wider)
     "header"                       "header header"
     "main"                         "main   side"
     "side"                         "footer footer"
     "footer"
   Only grid-template-areas / columns change inside the media query.

   HOW TO TEST ON A "PHONE" WITHOUT A PHONE:
     Open the page in Chrome → press F12 → press Ctrl+Shift+M
     (the "device toolbar"). Choose a phone like "iPhone SE" at the top,
     or drag the edge to change the width. Watch the page change.

   ============================================================ */

/* Phone: one column */
.page {
  display: grid;
  grid-template-areas:
    "header"
    "main"
    "side"
    "footer";
  gap: 12px;
}

.p-header { grid-area: header; }
.p-main   { grid-area: main; }
.p-side   { grid-area: side; }
.p-footer { grid-area: footer; }

.p-photo {
  max-width: 100%;                  /* example 02 */
  height: auto;
}

.p-title {
  font-size: clamp(1.75rem, 5vw, 3rem);   /* example 07 */
}

.p-cards {
  display: grid;
  grid-template-columns: 1fr;       /* cards: 1 column on phones */
  gap: 10px;
}

/* Laptop: two columns, 3 cards in a row */
@media (min-width: 900px) {
  .page {
    grid-template-columns: 1fr 260px;
    grid-template-areas:
      "header header"
      "main   side"
      "footer footer";
  }

  .p-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* Try it: change 900px to 700px → the laptop layout starts earlier. */


/* ------------------------------------------------------------
   Only to make the parts visible — not part of this lesson
   ------------------------------------------------------------ */
.page { font-family: Arial, sans-serif; max-width: 1100px; }
.p-header, .p-footer { background-color: #0F1B3D; color: #FFFFFF; padding: 14px 18px; border-radius: 8px; font-weight: bold; }
.p-side { background-color: #FFF6E0; padding: 14px; border-radius: 8px; line-height: 1.8; }
.p-title { margin: 6px 0 12px; }
.p-photo { border-radius: 10px; }
.p-card { background-color: #EEF3FF; color: #2D62EF; font-weight: bold; padding: 20px; border-radius: 8px; text-align: center; }


/* ============================================================
   Lesson 15 — Quick summary
   ============================================================
   1. <meta name="viewport" content="width=device-width, initial-scale=1.0">
   2. Images: img { max-width: 100%; height: auto; }
   3. Mobile-first: phone CSS first, then  @media (min-width: 600px) { … }
   4. Change only what must change inside the media query
      (columns, direction, display: none / block).
   5. Fluid text: font-size: clamp(min, 5vw, max);
   6. Test with F12 → Ctrl+Shift+M (device toolbar).

   Practice tasks:
     1. Make a fee table section that is 1 column on phones and 2 from 600px.
     2. Hide a big decorative picture on phones with display: none.
     3. Make the footer links stack on phones and sit in a row from 600px.
   ============================================================ */
