@font-face {
  font-family: "Lora";
  src: url("fonts/Lora.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("fonts/NunitoSans.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --forest: #0b4436;
  --cream: #fcf7e5;
  --paper: #fffdf5;
  --gold: #c7a34d;
  --ink: #263d34;
  font-family: "Nunito Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 18px;
  line-height: 1.6;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--forest); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--forest); outline-offset: 5px; }

.skip-link {
  position: absolute;
  top: 0;
  left: 1rem;
  padding: 0.6rem 1rem;
  background: var(--paper);
  transform: translateY(-120%);
  z-index: 1;
}
.skip-link:focus { transform: translateY(0); }

.masthead {
  background: var(--cream);
  border-bottom: 3px solid var(--gold);
}
.masthead-inner, .shelves, .footer-inner {
  width: min(1120px, calc(100% - 80px));
  margin-inline: auto;
}
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-block: 2.8rem;
}
.badge { width: 220px; height: auto; flex-shrink: 0; }
.welcome { max-width: 37rem; }
h1, h2, h3 {
  font-family: "Lora", Georgia, serif;
  color: var(--forest);
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.12; margin: 0 0 1.1rem; }
.welcome p { font-size: 1.2rem; max-width: 29rem; margin: 0; }
.shelves { padding-block: 3.3rem 4rem; }
.shelf + .shelf { margin-top: 4.5rem; }
h2 { font-size: 1.85rem; line-height: 1.25; margin: 0 0 2rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--gold); }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3.3rem 2.8rem; }
.book { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.cover-space {
  width: 100%;
  height: 360px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  margin-bottom: 1.35rem;
}
.book-cover {
  display: block;
  height: auto;
  width: auto;
  max-height: 100%;
  max-width: 100%;
  box-shadow: 3px 5px 9px #263d3426;
}
h3 { font-size: 1.25rem; line-height: 1.35; margin: 0 0 0.6rem; }
.book p { margin: 0 0 1.1rem; }
.amazon-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: auto;
  padding: 0.5rem 1rem;
  border: 1px solid var(--forest);
  border-radius: 4px;
  font-weight: 750;
  text-decoration: none;
  background: var(--cream);
}
.amazon-link:hover { color: var(--paper); background: var(--forest); }
.footer { background: var(--cream); border-top: 1px solid var(--gold); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; padding-block: 1.7rem; }
.footer p { margin: 0; }
.footer a { display: inline-flex; align-items: center; min-height: 48px; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masthead-inner { gap: 1.5rem; }
  .badge { width: 170px; }
  .cover-space { height: 330px; }
}

@media (max-width: 580px) {
  .masthead-inner, .shelves, .footer-inner { width: calc(100% - 40px); }
  .masthead-inner { flex-direction: column; text-align: center; padding-block: 1.6rem 2rem; gap: 1.2rem; }
  .badge { width: 154px; }
  h1 { font-size: 2.15rem; }
  .welcome p { font-size: 1rem; }
  .shelves { padding-block: 2.2rem 3rem; }
  h2 { font-size: 1.6rem; margin-bottom: 1.6rem; }
  .book-grid { grid-template-columns: minmax(0, 1fr); gap: 2.7rem; }
  .cover-space { height: 360px; justify-content: center; }
  h3 { font-size: 1.3rem; }
  .shelf + .shelf { margin-top: 3rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}
