/* Ribbonwood Press
   Palette drawn from the logo: wordmark green, gilt, bark and leaf on the logo's own paper. */

:root {
  --paper: #FCFBF7;      /* the logo's background */
  --ink: #1F2A21;        /* body text: green-black */
  --green: #1E3A22;      /* wordmark green: headings, links */
  --cloth: #1B3420;      /* book-cloth green for the closing band */
  --gilt: #DAA744;       /* gold leaf, used on the green cloth */
  --gilt-deep: #B8862B;  /* gold on paper (ornament only, never text) */
  --gilt-pale: #EAD49C;  /* small gilt text on cloth */
  --bark: #7A4B1C;       /* trunk brown: lead lines */
  --leaf: #4E7242;       /* leaf green: hover states */
  --rule: #7A8B76;       /* form field borders */
  --muted: #55604F;      /* hints on paper */

  --serif: "Old Standard TT", "Iowan Old Style", Baskerville, Georgia, serif;
  --measure: 36rem;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
}

@media (min-width: 40rem) {
  body { font-size: 1.1875rem; }
}

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

a {
  color: var(--green);
  text-decoration-line: underline;
  text-decoration-color: var(--gilt-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--leaf); text-decoration-color: currentColor; }

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  justify-content: flex-end;
  padding: 1.25rem clamp(1rem, 4vw, 3rem) 0;
}

.site-nav ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.0625rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.25rem 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--leaf); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--gilt-deep); }

/* ---------- Title (logo) ---------- */

.masthead {
  text-align: center;
  padding: 0.5rem 1rem 0;
}

.masthead h1,
.masthead .logo-link { margin: 0; display: block; line-height: 0; }

.masthead img {
  display: block;
  margin: 0 auto;
  width: min(400px, 74vw);
}

.masthead--small img { width: 190px; }

.tagline {
  margin: 0.75rem 0 0;
  font-style: italic;
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
  line-height: 1.3;
  color: var(--green);
}

.fleuron {
  display: block;
  width: 160px;
  height: 32px;
  margin: 2.75rem auto;
  color: var(--gilt-deep);
}

/* ---------- Reading column ---------- */

main { flex: 1 0 auto; }

.prose {
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding: 0 1rem;
}

.prose section + section { margin-top: 4.5rem; }

h1, h2 {
  font-weight: 400;
  color: var(--green);
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}

h2,
.page-title {
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.625rem);
  margin: 0 0 0.75rem;
}

.page-title { margin-top: 2.25rem; }

.prose .lead {
  margin: 0 0 2rem;
  text-align: center;
  font-style: italic;
  font-size: 1.3125rem;
  line-height: 1.45;
  color: var(--bark);
  text-wrap: balance;
}

.prose p { margin: 0; hyphens: auto; -webkit-hyphens: auto; }
.prose p + p { text-indent: 1.5em; }
.prose .lead + p { text-indent: 0; }

/* ---------- The plate: open book photograph with the quotation ---------- */

/* Same width as the text column. The quote sits in the lit, empty stretch
   of wall above the book; --q-top is the vertical centre of that space.
   Type is sized in container units (cqw) so it scales with the photo. */
.plate {
  --q-top: 55%;
  --q-width: 90%;
  container-type: inline-size;
  position: relative;
  width: calc(100% - 2rem);
  max-width: var(--measure);
  margin: 4.5rem auto 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #C9A868;
}

.plate-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}

.plate-quote {
  position: absolute;
  left: 50%;
  top: var(--q-top);
  transform: translate(-50%, -50%);
  width: var(--q-width);
  margin: 0;
  text-align: center;
}

/* soft lamplight behind the words, so the vines never fight the text */
.plate-quote::before {
  content: "";
  position: absolute;
  inset: -28% -10%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(250, 236, 198, 0.78), rgba(250, 236, 198, 0.5) 60%, rgba(250, 236, 198, 0));
}

.plate-quote blockquote { margin: 0; }

.plate-quote blockquote p {
  margin: 0;
  font-style: italic;
  font-size: max(1.25rem, 4.4cqw);
  line-height: 1.18;
  color: var(--green);
  text-wrap: balance;
}

.plate-quote figcaption {
  margin-top: 0.7em;
  font-size: max(0.875rem, 2.6cqw);
  line-height: 1.4;
  color: #4A2C10;
}

.plate-quote cite { display: block; font-style: italic; }

/* tablet and up: show the whole photograph, uncropped */
@media (min-width: 600px) {
  .plate { aspect-ratio: 1997 / 1520; --q-top: 56%; --q-width: 64%; }
}

/* ---------- Footer: book-cloth green ---------- */

.site-footer {
  margin-top: 4.5rem;
  padding: 2rem 1rem;
  background-color: var(--cloth);
  /* faint cloth weave */
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 3px);
}

.colophon {
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
  color: #CBBF9E;
}

/* ---------- Contact form ---------- */

.form {
  max-width: 34rem;
  margin: 2.5rem auto 0;
}

.field { margin-bottom: 1.5rem; }

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 1.0625rem;
  color: var(--green);
}

.field .hint {
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--muted);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.7rem 0.8rem;
}

.field textarea { min-height: 11rem; resize: vertical; }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  border-color: var(--green);
}

.button {
  display: inline-block;
  font: inherit;
  font-size: 1.125rem;
  line-height: 1.2;
  padding: 0.9rem 2rem;
  border: 0;
  border-radius: 2px;
  background: var(--cloth);
  color: var(--paper);
  /* gilt inner rule, echoing the binding */
  box-shadow: inset 0 0 0 4px var(--cloth), inset 0 0 0 5px var(--gilt);
  cursor: pointer;
  text-decoration: none;
}
.button:hover { background: #28492D; box-shadow: inset 0 0 0 4px #28492D, inset 0 0 0 5px var(--gilt); color: var(--paper); }


.centre { text-align: center; }
.centre .lead + p { margin-top: 0.5rem; }

@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color 120ms ease, box-shadow 120ms ease; }
}

@media print {
  .site-header, .skip-link { display: none; }
  .site-footer { background: none; }
  .colophon { color: var(--ink); }
}
