:root {
  --text: #555;
  --text-strong: #333;
  --line: #686868;
  --soft: #ececec;
  --soft-2: #f7f7f7;
  --paper: #fbfbfa;
  --card: #fff;
  --link: #4f4f4f;
  --link-hover: #111;
  --accent: #6f7a62;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--text);
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.45;
  margin: 0;
  padding: 34px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  background: var(--card);
  border: 1px solid #dedede;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 980px;
  padding: 28px 30px 18px;
}

.masthead {
  display: block;
}

.masthead h1 {
  color: var(--text-strong);
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 12px;
}

.rule {
  background: linear-gradient(90deg, #4f4f4f 0 42px, #8b9481 42px 92px, var(--line) 92px 100%);
  height: 12px;
  margin-bottom: 0;
  width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
  margin-top: 18px;
}

.sidebar {
  background: #e9ebe6;
  border-left: 7px solid #cfd4c7;
  min-height: 520px;
  padding: 28px 18px 20px;
}

.sidebar a {
  color: var(--text-strong);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 13px;
  padding: 3px 0;
}

.content {
  padding: 0;
}

.welcome {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
  text-align: right;
}

h2,
h3 {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.25;
  margin: 0;
}

h2 {
  background: var(--soft);
  border-left: 5px solid var(--accent);
  color: var(--text-strong);
  font-weight: 700;
  margin-bottom: 18px;
  padding: 7px 12px;
  text-align: center;
}

.books {
  display: grid;
  gap: 26px 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.book {
  display: flex;
  flex-direction: column;
  min-height: 332px;
}

.book h3 {
  align-items: center;
  background: #eef0eb;
  border-top: 0;
  display: flex;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 9px 10px;
  text-align: center;
}

.book-body {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 140px;
  padding: 16px 14px 10px;
  flex: 1;
}

.book p {
  font-size: 15px;
  margin: 0;
}

.book strong {
  color: var(--accent);
  font-weight: 400;
}

.cover {
  align-items: start;
  display: flex;
  justify-content: center;
}

.cover img {
  height: auto;
  max-height: 205px;
  object-fit: contain;
  width: auto;
}

.more {
  align-self: flex-start;
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px 14px;
  padding: 0;
}

.footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 10px;
}

.footer p {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

@media (max-width: 820px) {
  body {
    padding: 20px;
  }

  .page {
    padding: 22px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sidebar {
    min-height: 0;
    padding: 14px 14px 0;
  }

  .sidebar a {
    display: inline-block;
    margin: 0 14px 14px 0;
  }

  .content {
    padding-left: 0;
  }

  .welcome {
    margin-top: 14px;
    text-align: left;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
    padding: 14px;
  }

  .page {
    padding: 16px;
  }

  .masthead h1 {
    font-size: 25px;
  }

  .books {
    grid-template-columns: 1fr;
  }

  .book-body {
    grid-template-columns: minmax(0, 1fr) 128px;
  }

  .cover img {
    max-height: 190px;
  }
}

@media (max-width: 430px) {
  .book-body {
    grid-template-columns: 1fr;
  }

  .cover {
    justify-content: flex-start;
  }
}
