/* Getting Up Without Holding On: shared styles for every language version of the page.
   Colours and type follow the book cover (docs/look-and-feel.md). Always light; no dark mode. */

@font-face {
  font-family: "Libertinus Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/libertinus-serif-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Libertinus Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/libertinus-serif-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Libertinus Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/libertinus-serif-bold.woff2") format("woff2");
}

:root {
  --paper: #f4efe4;
  --blue: #40649e;
  --coral: #f5a88e;
  --ink: #0f0f0f;

  --serif: "Libertinus Serif", Georgia, "Times New Roman", serif;
  --gutter: 16px;
  --measure: 38rem;
  --page: 64rem;
  --woman-height: 18rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem; /* 18px */
  line-height: 1.6;
  font-kerning: normal;
}

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

a {
  color: inherit;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h2 {
  color: var(--blue);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

p {
  margin: 0 0 1rem;
}

cite {
  font-style: italic;
}

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Banner: the A+ banner rebuilt (publishing/cover/aplus-banner-970x600.png) */

.banner {
  padding-block: clamp(4rem, 14vw, 9rem) clamp(3rem, 10vw, 7rem);
}

.banner__text {
  width: fit-content;
  max-width: 100%;
}

.banner__title {
  color: var(--blue);
  /* scales with the screen so "Without Holding On" stays on one line down to 320px */
  font-size: clamp(1.75rem, 10vw - 0.25rem, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.005em;
}

.banner__title span {
  display: block;
}

.banner__subtitle {
  margin: 0;
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.9rem);
  font-style: italic;
  line-height: 1.3;
}

/* the coral rule, in the same proportion to the title as on the banner */
.banner__title::after {
  content: "";
  display: block;
  width: 58%;
  height: clamp(4px, 0.45vw, 6px);
  margin-block: 0.28em;
  background: var(--coral);
}

/* Blurb */

/* full page width, so that it reads as part of the banner */
.blurb {
  padding-bottom: 3rem;
  font-size: 1.25rem;
}

.blurb__buy {
  margin-top: 1.5rem;
  text-align: center;
}

/* Figure beside a list */

.feature {
  display: grid;
  gap: 1.5rem;
  padding-block: 2.5rem;
}

.feature__figure {
  justify-self: center;
}

.feature__figure img {
  width: auto;
  height: var(--woman-height);
}

/* the man is 82% of the woman's height, as on the cover */
.feature__figure--man img {
  height: calc(var(--woman-height) * 0.82);
}

.feature__text {
  max-width: var(--measure);
}

.feature ul {
  margin: 0;
  padding-left: 1.25em;
}

.feature li {
  margin-bottom: 0.6rem;
}

.feature li::marker {
  color: var(--ink);
}

@media (min-width: 720px) {
  :root {
    --woman-height: 24rem;
  }

  .feature {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(2.5rem, 6vw, 5rem);
    padding-block: 3.5rem;
  }

  .feature--reverse {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .feature--reverse .feature__figure {
    order: 2;
  }

  .feature__text {
    justify-self: start;
  }

  .feature--reverse .feature__text {
    justify-self: end;
  }
}

/* Sample exercise plate: multiply blends the white ground into the cream */

.plate {
  padding-block: 2.5rem 4rem;
}

.plate figure {
  margin: 0 auto;
  max-width: 52rem;
}

.plate img {
  width: 100%;
  mix-blend-mode: multiply;
}

.plate figcaption {
  max-width: var(--measure);
  margin: 0.75rem auto 0;
  font-style: italic;
  text-align: center;
}

/* Reader quote (reserved; the HTML is commented out until there is a real quote) */

.quote {
  padding-block: 1rem 4rem;
}

.quote figure {
  margin: 0 auto;
  max-width: var(--measure);
}

.quote blockquote {
  margin: 0;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  font-style: italic;
  line-height: 1.35;
}

.quote figcaption::before {
  content: "\2014\00a0";
}

/* Closing band: blue under a coral ground rule, as on the cover's lower half */

.band {
  background: var(--blue);
  border-top: 5px solid var(--coral);
  color: var(--paper);
  padding-block: 3rem 2rem;
}

.band__inner {
  display: grid;
  gap: 2rem;
}

.band__cover {
  justify-self: center;
  width: min(15rem, 70%);
}

.band__text {
  max-width: var(--measure);
}

/* Coral on blue is only 3.1:1: used only here, bold and at least 24px at every width */
.band__author {
  margin-bottom: 1.25rem;
  color: var(--coral);
  font-size: 1.75rem; /* 28px */
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.25;
  text-transform: uppercase;
}

.band__heading {
  margin-top: 2rem;
  color: var(--paper);
  font-size: 1.5rem;
}

.band__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.band__copyright {
  margin: 2.5rem 0 0;
  font-size: 1rem;
}

@media (min-width: 720px) {
  .band {
    padding-block: 4rem 2.5rem;
  }

  .band__inner {
    grid-template-columns: minmax(10rem, 17rem) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 6vw, 5rem);
    align-items: start;
  }

  .band__cover {
    width: 100%;
  }
}

/* a thin ink outline so that the cover's blue band does not merge into the page's */
.band__cover img {
  outline: 1px solid var(--ink);
}

/* Buttons: coral with ink text (ink on coral is about 9.9:1) */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.5rem 1.5rem;
  border: 0;
  border-radius: 0;
  background: var(--coral);
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.button:focus-visible {
  outline: 3px solid var(--paper);
  outline-offset: 3px;
}

/* coral against cream is only 1.7:1, so a button on cream gets a blue border */
.button--on-paper {
  border: 2px solid var(--blue);
}

.button--on-paper:focus-visible {
  outline-color: var(--blue);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
