/* Emma & Ferdie: colours and fonts */
:root {
  --cream: #FAF3E3;
  --sand: #F1E6CC;
  --brown: #4A3422;
  --green: #5E7050;
  --white: #FFFFFF;
  --heading: "Young Serif", Georgia, serif;
  --body: "Lora", Georgia, serif;
  --pad: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

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

h1, h2, h3, h4 {
  font-family: var(--heading);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: 56px; }
h2 { font-size: 38px; }
h3 { font-size: 21px; }
h4 { font-size: 20px; }
p { margin: 0 0 1em; }

a { color: inherit; }
a:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: calc(1168px + 2 * var(--pad));
  margin: 0 auto;
  padding: 0 var(--pad);
}
#author p { max-width: 720px; }

section { padding: 88px 0; scroll-margin-top: 8px; }
.band-sand { background: var(--sand); }
.band-green { background: var(--green); color: var(--white); }

.intro { max-width: 720px; }
.fine { font-size: 15px; font-style: italic; margin-top: 1.5em; }

/* Header */
.site-header { padding: 22px 0; }
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
}
.brand {
  font-family: var(--heading);
  font-size: 24px;
  text-decoration: none;
}
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}
.menu a {
  display: inline-block;
  padding: 6px 0;
  text-decoration: none;
  font-size: 17px;
}
.menu a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Buttons */
.buttons { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.btn {
  display: inline-block;
  padding: 13px 28px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-family: var(--body);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: #4f5f43; border-color: #4f5f43; }
.btn-outline { background: transparent; color: var(--green); }
.btn-outline:hover { background: var(--green); color: var(--white); }
.btn-cream { background: var(--cream); border-color: var(--cream); color: var(--brown); }
.btn-cream:hover { background: var(--white); border-color: var(--white); }
.band-green a:focus-visible { outline-color: var(--cream); }

/* Hero */
.hero { padding: 40px 0 88px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
}
.eyebrow { font-style: italic; color: var(--green); margin-bottom: 0.6em; }
.hero-img { border-radius: 12px; }

/* Books */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin-top: 40px;
}
.book {
  background: var(--white);
  border-radius: 12px;
  padding: 18px 18px 24px;
  display: flex;
  flex-direction: column;
}
.book p { margin-bottom: 1.2em; }
.book .btn, .book .status { margin-top: auto; align-self: flex-start; }
.cover {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream);
  margin-bottom: 18px;
}
/* Title shows in the square until a cover picture is added */
.cover span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-family: var(--heading);
  font-size: 19px;
  line-height: 1.3;
}
.cover img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain; /* never crop the cover */
  background: var(--cream);
}
.status { font-style: italic; color: var(--green); margin: 0; }

/* For grown-ups */
.subhead { margin-top: 40px; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 28px;
}
.card p { margin: 0; }

/* Breathe with Ferdie */
.breathe-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}
.breathe-inner p { max-width: 620px; }
.qr {
  background: var(--cream);
  border-radius: 12px;
  padding: 20px;
  width: 240px;
  height: 240px;
}
.qr img { width: 200px; height: 200px; image-rendering: pixelated; }

/* Contact form */
#contact { padding-top: 0; }
.contact-card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  max-width: 640px;
}
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #8C7A63;
  border-radius: 8px;
  background: var(--white);
  color: var(--brown);
  font: inherit;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus-visible, .field textarea:focus-visible, button.btn:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 2px;
}
button.btn { cursor: pointer; }
.hidden-field { position: absolute; left: -9999px; }

/* Thank-you page */
.thanks { min-height: 60vh; }

/* Footer */
.site-footer { padding: 36px 0; font-size: 16px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
}
.footer-inner p { margin: 0; }

/* Tablet and phone */
@media (max-width: 860px) {
  .hero-inner, .breathe-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-img { order: -1; }
}
@media (max-width: 600px) {
  :root { --pad: 20px; }
  body { font-size: 17px; }
  h1 { font-size: 38px; }
  h2 { font-size: 30px; }
  section { padding: 60px 0; }
  .hero { padding: 16px 0 60px; }
  .site-header { padding: 16px 0; }
  .menu { gap: 2px 20px; }
  .menu a { font-size: 16px; padding: 8px 0; }
  .contact-card { padding: 24px 20px; }
}
