/* Fonts: all subset to Latin, WOFF2. Variable fonts declare their weight range. */

@font-face {
  font-family: "Lora";
  src: url("Lora-VariableFont_wght.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("Lora-Italic-VariableFont_wght.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Young Serif";
  src: url("youngserif.bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Fallbacks: Georgia adjusted to Lora / Young Serif metrics, so a late font
   swap barely moves the text. Values computed with Capsize (createFontStack). */
@font-face {
  font-family: "Lora Fallback";
  src: local("Georgia");
  ascent-override: 95.8281%;
  descent-override: 26.1003%;
  line-gap-override: 0%;
  size-adjust: 104.9796%;
}

@font-face {
  font-family: "Young Serif Fallback";
  src: local("Georgia Bold"), local("Georgia-Bold");
  font-weight: 700;
  ascent-override: 107.4067%;
  descent-override: 31.76%;
  line-gap-override: 0%;
  size-adjust: 86.5868%;
}

/* Palette: change colors here only. */
:root {
  --color-bg: #fef5ea;
  --color-text: #262c2c;
  --color-line: #466060; /* hr, borders, other solid lines */
  --color-button: #576e6e;
  --color-button-hover: var(--color-link);
  --color-on-button: #fef5ea; /* button text: page background color */
  --color-callout-bg: #b4bbb6; /* differentiated background */
  --color-link: #2f4a4a;
}

html {
  font-size: 200%; /* double the browser default (usually 16px -> 32px) */
}

/* Phones: scale back so lines aren't too short for justified text. */
@media (max-width: 600px) {
  html {
    font-size: 125%; /* usually 20px */
  }
}

body {
  font-family: "Lora", "Lora Fallback", Georgia, serif;
  background: var(--color-bg);
  color: var(--color-text);
}

/* :where() keeps specificity at zero, so .button and other rules still win. */
:where(a:link, a:visited) {
  color: var(--color-link);
}

hr {
  border: none;
  border-top: 1px solid var(--color-line);
}

main section {
  margin-bottom: 3rem;
}

/* Justify prose, but not short footer lines. */
p:not(footer p) {
  text-align: justify;
  hyphens: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Young Serif", "Young Serif Fallback", Georgia, serif;
  font-weight: 700; /* only weight available; avoids faux bold */
}

main {
  max-width: 40rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

header h1 {
  text-align: center;
  font-size: 4rem; /* double the default 2em */
}

/* Phones: "Beautiful" at 4rem is wider than a small screen. */
@media (max-width: 600px) {
  header h1 {
    font-size: 3rem;
    width: min-content; /* as wide as the longest word: one word per line */
    margin-inline: auto; /* keep the narrowed box centered */
  }
}

.gallery {
  display: flex;
  gap: 10px;
  margin-block: 2rem;
}

/* Each gallery item is a link to the large image, wrapping its thumbnail. */
.gallery > a {
  flex: 1;
  min-width: 0;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
}

.button {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 33.333%;
  min-width: fit-content;
  aspect-ratio: 3 / 1;
  margin: 1rem auto;
  padding-inline: 1em;
  border-radius: 0.5rem;
  background: var(--color-button);
  color: var(--color-on-button);
  text-decoration: none;
}

.button:hover {
  background: var(--color-button-hover);
}

.button > * {
  margin: 0;
}

footer {
  text-align: center;
}

.centered {
  text-align: center;
}

/* Heading link back home: looks like the plain heading. */
header h1 a {
  color: inherit;
  text-decoration: none;
}

/* Terms page: set the submission rules apart from the surrounding text. */
section#submission-rules {
  margin-block: 1rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: 0.5rem;
  background: var(--color-callout-bg);
}

/* Fine print under the main join button: same shrinkage as <small>. */
div#opt-in {
  font-size: smaller;
}
