/* jamesbulman.com: one stylesheet for every page. A "Home" link above and
   below a single 1000px column of text, videos and the home page's banner. */

body {
  --side: clamp(1.5rem, 5vw, 2rem);
  --end: clamp(1.8rem, 1.8rem + ((1vw - 0.48rem) * 2.885), 3rem);
  margin: 0;
  padding: var(--end) 0;
  background: #fff;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.227), 1rem);
  line-height: 1.5;
}

header,
footer {
  padding: 0 var(--side);
}

header p,
footer p {
  margin: 0;
}

footer {
  margin-top: 1.5rem;
}

main {
  padding: 0 var(--side);
}

/* Every block sits in a 1000px column with a 1.5rem gap above it. */
main > *,
.columns > div > * {
  max-width: 1000px;
  margin: 1.5rem auto 0;
}

main > :first-child,
.columns > div > :first-child {
  margin-top: 0;
}

h1, h2 {
  color: #0693e3;
  font-weight: 400;
  line-height: 1.5;
}

h1 {
  font-size: clamp(1.378rem, 1.378rem + ((1vw - 0.2rem) * 1.585), 2.25rem);
}

h2 {
  font-size: clamp(1.75rem, 1.75rem + ((1vw - 0.48rem) * 0.24), 1.875rem);
}

/* "Home" links are black; links in the content are dark green. */
a {
  color: #000;
}

main a {
  color: #345c00;
}

a:hover {
  text-decoration: none;
}

a:focus {
  text-decoration: underline dashed;
}

a:active {
  color: #345c00;
  text-decoration: none;
}

/* A list's indent counts inside the column width. */
ul {
  box-sizing: border-box;
}

/* The home page's banner fills the column. */
.banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Videos fill their column and keep their proportions. */
.video iframe {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
}

.ratio-16-9 iframe {
  aspect-ratio: 16 / 9;
}

.ratio-4-3 iframe {
  aspect-ratio: 4 / 3;
}

figcaption {
  margin: 0.5em 0 1em;
}

/* Two columns side by side, one above the other on narrow screens. */
.columns {
  display: flex;
  gap: 1.5rem;
}

.columns > div {
  flex: 1;
  min-width: 0;
}

@media (max-width: 781px) {
  .columns {
    flex-wrap: wrap;
  }

  .columns > div {
    flex-basis: 100%;
  }
}
