/* grimmgroup.eu. The decisions behind this file are in website/DESIGN.md. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/EBGaramond.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/EBGaramond-Italic.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

/* The house: a printed catalogue. Works override these three colours on their own pages. */
:root {
  --paper: #fbfaf7;
  --ink: #1e1b18;
  --accent: #8c6a4a;
  font-size: 18px;
}
@media (min-width: 48rem) { :root { font-size: 19px; } }
body.totv { --paper: #352f29; --ink: #ece4da; --accent: #cfa67d; }
body.sup { --paper: #f4ecd8; --ink: #2b2416; --accent: #7a3e10; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  /* Worked out here, not on :root, so they follow each work's colours. */
  --rule: color-mix(in srgb, var(--ink) 18%, transparent);
  --muted: color-mix(in srgb, var(--ink) 78%, var(--paper));
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-variant-numeric: oldstyle-nums proportional-nums;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--accent);
    text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: text-decoration-color 0.15s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.4rem 0.8rem; z-index: 1; }

.wrap { max-width: 64rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
@media (min-width: 48rem) { .wrap { padding-left: 2.5rem; padding-right: 2.5rem; } }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
                     padding-top: 1rem; padding-bottom: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand img { width: 2.6rem; height: 2.6rem; }
.brand span { font-size: 1.2rem; font-weight: 500; letter-spacing: 0.01em; }
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current="page"], .site-nav a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

.site-footer { border-top: 1px solid var(--rule); margin-top: 5rem; padding: 2rem 0 3rem; font-size: 0.85rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: baseline; } }
.site-footer p { margin: 0; }
.site-footer .links { display: flex; gap: 1.1rem; flex-wrap: wrap; }
@media (min-width: 48rem) { .site-footer .links { justify-content: flex-end; } }

/* Type */
h1, h2, h3 { font-weight: 500; line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.005em; }
h1 { font-size: 2.3rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
@media (min-width: 48rem) { h1 { font-size: 3.1rem; } h2 { font-size: 2.1rem; } h3 { font-size: 1.45rem; } }
p, ul, ol, dl { margin: 0 0 1em; }
.prose { max-width: 36rem; }
.lead { font-size: 1.2rem; max-width: 34rem; }
.label { font-variant-caps: all-small-caps; letter-spacing: 0.04em; color: var(--muted); }
.meta { color: var(--muted); }
em, cite { font-style: italic; }
blockquote { margin: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

main { padding-top: 3.5rem; }
@media (min-width: 48rem) { main { padding-top: 5rem; } }
section { margin-bottom: 4.5rem; }

/* Home: statement */
.statement h1 { max-width: 42rem; }
.statement .turn { display: block; }
.statement .lead p:last-child { margin-bottom: 0; }
#catalogue + .meta { margin-top: -0.4rem; margin-bottom: 1.4rem; }
.motto { font-size: 2rem; font-style: italic; font-weight: 500; line-height: 1.15; margin: 0 0 1.4rem; }

/* Home: the catalogue */
.catalogue { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.catalogue > li { display: grid; gap: 1rem 2rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 48rem) {
  .catalogue > li { grid-template-columns: 6rem 13rem 1fr; align-items: start; }
}
.catalogue .no { font-variant-caps: all-small-caps; letter-spacing: 0.06em; font-size: 1.15rem; }
/* Pictures share the book cover's 2:3 shape; a phone screenshot shows its top. */
.catalogue .pic { border: 1px solid var(--rule); max-width: 14rem; }
.catalogue .pic img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: top; }
.catalogue h3 { margin-bottom: 0.25rem; }
.catalogue .kind { margin-bottom: 0.8rem; }
.catalogue .more { margin: 0; }
.next { margin-top: 1.5rem; color: var(--muted); }

/* Facts list (company details, book details) */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1.5rem; }
.facts dt { font-variant-caps: all-small-caps; letter-spacing: 0.04em; color: var(--muted); }
.facts dd { margin: 0; }

/* Two columns: text and a picture */
.split { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 48rem) { .split { grid-template-columns: 1fr 1fr; gap: 3.5rem; } .split.narrow-pic { grid-template-columns: 3fr 2fr; } }
.split figure, figure { margin: 0; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

/* Tales of the Valley */
/* The old site's background art, darkened under a line from the book (it's too soft to show as a picture). */
.band { display: grid; margin: 0 0 4rem; }
.band > * { grid-area: 1 / 1; }
.band img { width: 100%; height: 22rem; object-fit: cover; object-position: center 30%; filter: brightness(0.38) saturate(0.85); }
/* position: the filtered picture is its own layer, which would otherwise paint over the quote. */
.band blockquote { position: relative; align-self: center; padding: 2rem 1.5rem; max-width: 34rem; }
@media (min-width: 48rem) { .band img { height: 26rem; } .band blockquote { padding: 3rem; } }
.band blockquote p { font-size: 1.6rem; font-style: italic; line-height: 1.25; margin-bottom: 0.5rem; }
@media (min-width: 48rem) { .band blockquote p { font-size: 2rem; } }
.band footer { color: var(--accent); }
.subnav { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: -1.5rem 0 3rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.subnav a { text-decoration: none; }
.subnav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); }
.button { display: inline-block; padding: 0.55rem 1.2rem; border: 1px solid var(--ink); text-decoration: none; }
.button:hover { background: var(--ink); color: var(--paper); }
.gallery { display: grid; gap: 1.25rem; }
@media (min-width: 48rem) { .gallery { grid-template-columns: 1fr 1fr; } .gallery .wide { grid-column: 1 / -1; } }

/* sup? */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 15rem)); gap: 1.25rem; }
.shots img { border: 1px solid var(--rule); }
.points { padding-left: 1.2rem; }
.points li { margin-bottom: 0.5rem; }

/* Legal pages */
.legal { max-width: 40rem; }
.legal h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.legal p { hyphens: auto; }
