/* theruthlessred.com — styled from the covers of
   "The Mischievous Adventures at Aspen Siesta" */

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/eb-garamond-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-italic-latin.woff2') format('woff2');
}
/* the cover's title and the back cover's headings are all set in a slanted chancery hand */
@font-face {
  font-family: 'Fondamento';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/fondamento-italic-latin.woff2') format('woff2');
}

:root {
  /* the cover's sea-green field and its darker shade */
  --teal: #5fa98e;
  --teal-deep: #2f6f5c;
  /* the pale, glowing wall behind the wardrobe on the front cover */
  --wall: #f2efcf;
  --ink: #23201c;
  /* the wardrobe's wood and Nora's red skirt */
  --wood: #8a5a34;
  --red: #a83232;

  --display: 'Fondamento', 'Palatino Linotype', Palatino, serif;
  --text: 'EB Garamond', Garamond, Georgia, serif;

  --measure: 34em;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --space: clamp(3rem, 8vw, 5.5rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h2 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
}
h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--teal-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--wall);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 68rem);
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  background: var(--teal);
  padding-block: 1rem 0.75rem;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
}
.wordmark {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--ink);
  text-decoration: none;
}
.site-nav ul {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.125rem;
  padding-block: 0.25rem;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-color: var(--wood);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* ---------- buttons ---------- */

.button {
  display: inline-block;
  background: var(--red);
  color: var(--wall);
  font-family: var(--text);
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
  padding: 0.6em 1.3em 0.65em;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.25);
}
.button:hover {
  background: #8f2626;
  color: var(--wall);
}

/* ---------- home hero: the book on its own teal cover ---------- */

.hero {
  background: var(--teal);
  padding-block: 1.25rem var(--space);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  grid-template-areas:
    'title title'
    'cover buy'
    'hook  hook';
  gap: 1.25rem 1.5rem;
  align-items: center;
}
.book-title {
  grid-area: title;
  font-size: clamp(2.1rem, 7.5vw, 4.4rem);
  line-height: 1.08;
  margin: 0;
}
.book-title span {
  display: block;
}
.hero-cover {
  grid-area: cover;
  position: relative;
  margin: 0;
}
/* the soft yellow glow that frames the illustration on the cover */
.hero-cover::before {
  content: '';
  position: absolute;
  inset: -18%;
  background: radial-gradient(closest-side, rgb(242 239 207 / 0.7), rgb(242 239 207 / 0));
}
.hero-cover img {
  position: relative;
  transform: rotate(-3deg);
  border-radius: 2px 5px 5px 2px;
  box-shadow:
    0 0.15rem 0.3rem rgb(20 55 45 / 0.25),
    0 1.2rem 2.5rem rgb(20 55 45 / 0.35);
  transition: transform 0.4s ease;
}
.hero-cover:hover img {
  transform: rotate(-1.5deg) translateY(-4px);
}
.hero-buy {
  grid-area: buy;
}
.hero-buy p {
  margin: 0 0 0.75rem;
}
.byline {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.4rem;
}
.audience {
  font-style: italic;
}
.hero-hook {
  grid-area: hook;
  max-width: var(--measure);
  margin: 0;
  font-size: 1.25rem;
}

@media (min-width: 48rem) {
  .hero {
    padding-top: var(--space);
  }
  .hero .wrap {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas:
      'cover title'
      'cover buy'
      'cover hook';
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(2rem, 6vw, 5rem);
  }
  .hero-cover {
    align-self: start;
  }
  .book-title {
    align-self: end;
  }
  .hero-buy {
    align-self: start;
  }
  .hero-hook {
    align-self: start;
  }
}

/* ---------- reading sections ---------- */

.section {
  padding-block: var(--space);
}
.section--teal {
  background: var(--teal);
}
.prose {
  max-width: var(--measure);
}
/* a page-width container whose text keeps a reading measure, aligned with the page heading */
.wrap.prose {
  max-width: none;
}
.wrap.prose > * {
  max-width: var(--measure);
}

/* about-this-book: text with the painting tilted beside it, as on the back cover */
.with-art {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 48rem) {
  .with-art {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2rem, 6vw, 5rem);
  }
}
.tilted {
  margin: 0;
}
.tilted img {
  transform: rotate(2.5deg);
  box-shadow: 0 0.8rem 1.8rem rgb(20 55 45 / 0.3);
}
.tilted--left {
  max-width: 22rem;
  justify-self: center;
}
.tilted--left img {
  transform: rotate(-2.5deg);
}
.tilted figcaption {
  margin-top: 1.25rem;
  font-style: italic;
  font-size: 1rem;
}

/* the trio */
.cast {
  display: grid;
  gap: 1.5rem 2rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .cast {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.cast li {
  border-top: 2px solid var(--ink);
  padding-top: 0.75rem;
}
.cast-name {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-size: 2.2rem;
  line-height: 1.1;
}
.cast-role {
  font-style: italic;
}
.cast-note {
  margin-top: 2rem;
  max-width: var(--measure);
}

/* book details */
.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 2rem;
  margin: 0;
  max-width: 36rem;
}
.details dt {
  font-weight: 600;
}
.details dd {
  margin: 0;
}

/* closing call to buy */
.buy-band {
  text-align: center;
}
.buy-band p {
  margin-inline: auto;
  max-width: var(--measure);
}

/* ---------- inner pages ---------- */

.page-head {
  background: var(--teal);
  padding-block: clamp(2rem, 6vw, 4rem);
}
.page-head h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  margin: 0;
}
.page-head p {
  max-width: var(--measure);
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
}

/* ---------- contact form ---------- */

.contact-form {
  display: grid;
  gap: 1.1rem;
  margin-top: 2rem;
  max-width: 32rem;
}
.field {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}
.field label {
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1.125rem;
  color: var(--ink);
  background: #fffdf3;
  border: 2px solid var(--teal-deep);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
}
.field textarea {
  min-height: 9rem;
  resize: vertical;
}
.field .button {
  justify-self: start;
  border: 0;
  cursor: pointer;
}
.form-note {
  margin: 0;
  font-size: 1rem;
  font-style: italic;
}
/* hidden from people; bots that fill every field reveal themselves */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--teal-deep);
  color: var(--wall);
  padding-block: 2.5rem;
  font-size: 1rem;
}
.site-footer p {
  margin: 0 0 0.35rem;
}
.site-footer a {
  color: var(--wall);
}
.site-footer :focus-visible {
  outline-color: var(--wall);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .hero-cover:hover img {
    transform: rotate(-3deg);
  }
}
