/* Makes element sizing include padding and borders. */

* {
  box-sizing: border-box;
}

/* Removes the browser's default page margin and sets the site's colors and font. */

body {
  margin: 0;
  color: rgb(74, 52, 40);
  background-color: rgb(250, 248, 243);
  font-family: Georgia, "Times New Roman", serif;
}

/* Prevents images from overflowing their containers. */

img {
  max-width: 100%;
  height: auto;
}

/* Centers the business name and navigation at the top of the page. */

header {
  padding: 28px 20px 20px;
  text-align: center;
}

/* Styles the business name. */

header h1 {
  margin: 0 0 12px;
  color: rgb(30, 77, 137);
  font-size: 44px;
}

/* Removes the navigation list's default spacing and uses Flexbox to place the links in one centered row. */
/* Applied display: flex to nav ul because its direct children--the four <li> elements--need to form a row. */
/* justify-content: center centers that entire row; gap: 30px creates consistent space between links */

nav ul {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Styles the navigation links. */

nav a {
  color: rgb(74, 52, 40);
  font-style: italic;
  text-decoration: none;
}

/* Makes the hero image span the page beneath the header. */
/* object-fit: cover lets the hero fill its assigned height without visibly stretching the photograph. */

#home img {
  display: block;
  width: 100%;
  height: 460px;
  object-fit: cover;
}


/* The <h2> and three card sections are direct children of #bagels. Flexbox tries to place all four on one row. flex-wrap allows items to move onto another row, while flex-basis: 100% makes the heading take the entire first row so the three cards appear beneath it. */

#bagels {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  width: 60%;
  max-width: 900px;
  margin: 40px auto 80px;
}

/* Makes the heading occupy its own row above the cards. */

#bagels > h2 {
  flex-basis: 100%;
  margin: 0%;
  text-align: center;
  font-size: 34px;
}

/* Gives each direct-child section an equal share of the row. */

#bagels > section {
  flex: 1;
  border: 1px solid rgb(218, 205, 190);
  background-color: rgb(255, 254, 251);
}

/* Gives all three card images the same dimensions. */

#bagels > section img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* Adds space around each card's name. */

#bagels h3 {
  margin: 12px 16px 8px;
  font-size: 20px;
}

/* Adds space around the card descriptions and prices. */

#bagels > section p {
  margin: 0 16px 12px;
}


/* Styles the final paragraph in each card as its price. */

#bagels > section p:last-child {
  color: rgb(30, 77, 137);
  font-weight: bold;
}


/* Centers the coffee section and adds space below it. */

#coffee {
  width: 60%;
  max-width: 700px;
  margin: 0 auto 80px;
  text-align: center;
}

#coffee h2 {
  margin: 0 0 28px;
  font-size: 34px;
}

#coffee p {
  margin: 0;
  line-height: 1.25;
}

/* Separates and centers the shop information at the bottom of the page. */

footer {
  padding: 28px 20px;
  border-top: 1px solid rgb(30, 77, 137);
  text-align: center;
}

footer address {
  font-style: normal;
}

footer p {
  margin: 14px 0;
}

footer a {
  color: rgb(74, 52, 40);
  text-decoration: none;
}

