/* veryexpensivemaps.com */

:root {
  /* Optima ships on Apple devices; everyone else gets EB Garamond from /assets/fonts (bottom of this file) */
  --font: Optima, 'EB Garamond', Georgia, serif;
  --text: #696464;
  --bg: #fefaf6;
  --bg-image: url(img/background.webp);
  /* the background lags the page by this fraction of the scroll, as on evanapplegate.com; 0 turns it off */
  --parallax: 0.15;
  --field: #f9f9f8;
  --rule: #d0cbc1;
  --link: #6e5950;
  --link-hover: #8c7a73;
  --underline: #d1ccc1;
  --radius: 5px;
}
@media (max-width: 767px) {
  :root {
    --bg-image: url(img/background-1200.webp);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
[hidden] {
  display: none !important;
}
html {
  background-color: var(--bg);
}
body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font: 14px/1.3 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* evanapplegate.com's paper texture, on its own layer behind the page so it can drift */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg-image) top left / 100% auto repeat;
  image-rendering: pixelated;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body::before {
      animation: bg-parallax 1ms linear both;
      animation-timeline: scroll(root block);
    }
  }
}
/* 100% is the page height, so the layer ends up shifted by --parallax x scroll distance */
@keyframes bg-parallax {
  from {
    transform: translateY(calc(var(--parallax) * (100vh - 100%)));
  }
  to {
    transform: translateY(0);
  }
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
p,
h2 {
  margin: 0;
  font: inherit;
}
ul,
ol {
  margin: 14px 0;
  padding-left: 40px;
}
:is(ul, ol) :is(ul, ol) {
  margin: 0;
}
a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-decoration-color: var(--underline);
  text-underline-offset: calc(0.075em + 1px); /* 1px below Optima's own underline */
  transition: color 0.1s;
}
a:hover {
  color: var(--link-hover);
}

/* ---------- layout: a centred column, 3/4 of the window from 1024px up ----------
   Columns sit on thirds with 10px between them: a label third (text kept 25px clear of the next column)
   and two thirds of text. The 10px terms keep the original Dorik column edges to the pixel. */
.page {
  width: calc(75% - 2.5px);
  margin: 0 auto;
  padding-top: 40px;
}
.row {
  --third: calc((100% + 10px) / 3 - 10px);
  display: grid;
  grid-template-columns: var(--third) 1fr;
  column-gap: 10px;
}
.row.thirds {
  grid-template-columns: repeat(3, 1fr);
}
/* every column opens with a hairline rule */
.cell {
  display: flow-root; /* keeps the 14px under the last paragraph inside the cell */
  min-width: 0;
  margin-top: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.cell > :last-child {
  margin-bottom: 14px;
}
.label {
  padding-right: 25px;
}
.label h2 {
  font-style: italic;
  margin-bottom: 14px;
}
/* an episode's title, then its own Spotify and Apple Podcasts pages on the same line */
.ep-title {
  margin-bottom: 14px;
  font-style: italic;
}
.ep-title h2 {
  display: inline;
}
.ep-title a {
  white-space: nowrap; /* keeps "Apple Podcasts" on one line */
}

/* ---------- masthead ---------- */
.masthead-title {
  margin: 0;
}
.logo {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: var(--radius);
  object-fit: cover;
}
.listen {
  display: grid;
  grid-template-columns: repeat(3, 12.5vw);
  justify-content: center;
}
.listen a {
  display: block;
  margin: 7px 5px 0;
  padding: 10px 0 14px;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.listen img {
  width: 50px;
  margin: 0 auto;
}

/* ---------- episodes ---------- */
.cover:last-child {
  margin-bottom: 0; /* the image ends the row flush, as on the Dorik site */
}
.cover img {
  border-radius: var(--radius);
  transition: opacity 0.5s;
}
.cover:hover img {
  opacity: 0.5;
}
.pager {
  display: block;
  width: calc((100% + 10px) * 2 / 3 - 10px);
  margin: 0 auto;
  text-align: center;
}
.who {
  grid-template-columns: calc(var(--third) / 2 - 5px) calc(var(--third) / 2 - 5px) 1fr;
}
.who .label,
.how .label {
  padding-right: 0;
}
.who-pic {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius);
  filter: grayscale(44%);
}
.who p + p {
  margin-top: 14px;
}
/* audio player, as on evanapplegate.com (assets/audio-player.js builds it from the <audio controls>) */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  margin-top: 14px;
  padding: 10px 15px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background-color: var(--field);
}
.audio-player__toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 -6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  cursor: pointer;
  transition: color 0.1s;
}
.audio-player__toggle:hover {
  color: var(--link-hover);
}
.audio-player__toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.audio-player__pause,
.audio-player.is-playing .audio-player__play {
  display: none;
}
.audio-player.is-playing .audio-player__pause {
  display: block;
}
.audio-player__time {
  flex: none;
  min-width: 2.2em;
  text-align: center;
}
.audio-player__seek {
  --progress: 0%;
  flex: 1;
  min-width: 0;
  height: 20px;
  margin: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.audio-player__seek::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(to right, var(--link) var(--progress), var(--underline) var(--progress));
}
.audio-player__seek::-moz-range-track {
  height: 1px;
  background: var(--underline);
}
.audio-player__seek::-moz-range-progress {
  height: 1px;
  background: var(--link);
}
.audio-player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px;
  height: 9px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--link);
}
.audio-player__seek::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: var(--link);
}
.audio-player__toggle:focus-visible,
.audio-player__seek:focus-visible {
  outline: 1px solid var(--link);
  outline-offset: 3px;
}

/* ---------- contact form (Formspree) ---------- */
.contact {
  margin-top: 14px;
}
.cell > .contact:last-child {
  margin-bottom: 0;
}
.contact input,
.contact textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0 0 10px;
  padding: 10px 15px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--field);
  color: #171a21;
  font: 14px/1.15 var(--font);
}
.contact textarea {
  margin-bottom: 15px;
}
.contact button {
  width: 100%;
  height: 50px;
  padding: 0 30px;
  border: 0;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font: 18px var(--font);
  cursor: pointer;
}
.contact button[disabled] {
  opacity: 0.7;
  cursor: default;
}
.form-success,
.form-error {
  display: none;
  margin-top: 10px;
  padding: 10px 15px;
  border-radius: 3px;
  background: #fff;
  text-align: center;
}
.form-success {
  color: var(--text); /* the body text colour, not Dorik's green (owner's request) */
}
.form-error {
  color: #ff3a28;
}
.form-success[data-fs-active],
.form-error[data-fs-active] {
  display: block;
}
.field-error {
  display: none;
  margin: -6px 0 10px;
  color: #ff3a28;
  font-size: 12px;
}
.field-error[data-fs-active] {
  display: block;
}
.contact [aria-invalid='true'] {
  border-color: #ff3a28;
}

/* ---------- below 1024px: one column, 25px gutters ---------- */
@media (max-width: 1023px) {
  .page {
    width: auto;
    margin: 0 25px;
  }
  .row,
  .row.thirds,
  .who {
    display: block;
  }
  .label {
    padding-right: 0;
  }
  .listen {
    display: block;
  }
  .listen a {
    margin: 7px 0 0;
    border-top: 0; /* stacked, the logo and listen links read as one block: no rules between them */
  }
  article .cell + .cell {
    border-top: 0; /* one rule per episode, above its title */
  }
  .pager {
    width: auto;
  }
  .who-pic {
    margin: 10px 0 20px;
  }
  .contact {
    margin-top: 20px;
  }
}

/* EB Garamond (SIL Open Font License), weights 400-800, regular and italic.
   Only downloaded where Optima is missing (Windows, Android); browsers fetch just the subsets a page uses. */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-normal-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-normal-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-normal-greek-ext.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-normal-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-normal-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-italic-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-italic-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-italic-greek-ext.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-italic-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/eb-garamond-italic-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
