/* gracegerwe.com */

:root {
  --bg: #ffffff;
  --ink: #000000;
  /* body text */
  --link: #4b0082;
  /* regal purple, links */
  --link-hover: #6d28d9;
  /* a lighter purple, when a link is hovered or clicked */
  --underline: #9d85bd;
}

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

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

main {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 5rem 1.5rem 5rem;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

h1 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
}

h1 a {
  color: inherit;
  text-decoration: none;
}

.icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icons a {
  display: inline-flex;
  align-items: center;
  color: var(--link);
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  transition: color 0.15s ease;
}

.icons a:hover {
  color: var(--link-hover);
}

section {
  margin-bottom: 1.75rem;
}

h2 {
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: 0 0 0.6rem;
}

ul {
  margin: 0;
  padding-left: 1.1rem;
  list-style-type: disc;
}

li {
  margin-bottom: 0.3rem;
  padding-left: 0.15rem;
}

li::marker {
  color: currentColor;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 2.5px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
  text-decoration-thickness: 2px;
}

footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.25rem;
}

/* the writing index */

.stories {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.stories li {
  margin-bottom: 1.1rem;
  padding-left: 0;
}

.stories a {
  text-decoration: none;
}

.story-title {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 2.5px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.stories a:hover .story-title {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
  text-decoration-thickness: 2px;
}

.story figure {
  margin: 0 0 1.3rem;
}

/* photographs the story puts side by side stay side by side */
.photo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1.3rem;
}

.photo-row figure {
  position: relative;
  min-width: 0;
  margin: 0;
}

/* The cell's shape comes from its own aspect ratio and the picture is laid
   over the whole of it, cropped to fill. A picture sized by a percentage
   height inside a cell sized by aspect ratio resolves against an indefinite
   height, which is what left a strip of white under the short ones. */
.photo-row figure img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

.photo-row-2 figure {
  flex: 0 1 calc(50% - 0.25rem);
  aspect-ratio: 1 / 1;
}

.photo-row-3 figure {
  flex: 0 1 calc(33.333% - 0.34rem);
  aspect-ratio: 4 / 5;
}

/* A screenshot (race results, a training log) is not a photograph: it gets
   the whole column and its own shape, because cropping would eat the text. */
.story figure.photo-full img {
  position: static;
  width: 100%;
  height: auto;
  object-fit: fill;
  margin: 0;
}

.back {
  display: block;
  margin: 0 0 1.2rem;
  font-size: 13px;
}

.story-date {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-top: 0.15rem;
}

/* a story page */

.story-heading {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.3rem;
}

.story-subtitle {
  font-style: italic;
  margin: 0.9rem 0 1.4rem;
}

.story p {
  margin: 0 0 1.15rem;
  line-height: 1.75;
}

.story h2 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin: 2.1rem 0 0.7rem;
}

.story h3 {
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 2.1rem 0 0.7rem;
}

.story ul,
.story ol {
  margin: 0 0 1.15rem;
  padding-left: 1.35rem;
}

.story li {
  margin-bottom: 0.45rem;
}

.story blockquote {
  margin: 0 0 1.15rem;
  padding-left: 1rem;
  border-left: 2px solid #ddd2ee;
  font-style: italic;
}

.story blockquote p {
  margin: 0;
}

.story img {
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0 1.3rem;
}

@media (max-width: 640px) {
  main {
    padding: 3rem 1.25rem 3.5rem;
  }

  header {
    margin-bottom: 1.75rem;
  }

  /* on a phone a row of three is too small, so it breaks into two and one */
  .photo-row-2 figure,
  .photo-row-3 figure {
    flex: 0 1 calc(50% - 0.25rem);
    aspect-ratio: 4 / 5;
  }
}
