/*
  Erika Page White static migration prototype.
  Source identity: white page, purple accent, left content column, right portrait rail.
*/

:root {
  --accent: #87048f;
  --accent-bright: #af06ba;
  --ink: #474747;
  --muted: #6f6f6f;
  --line: #e4dbe6;
  --soft: #faf7fb;
  --focus: rgba(135, 4, 143, 0.32);
  --measure: 623px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  background: #fff;
  color: var(--ink);
  font-family: Verdana, Geneva, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  min-height: 100%;
  text-rendering: optimizeLegibility;
}

body::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #fff 38%);
  bottom: 0;
  content: "";
  left: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  z-index: -2;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-bright);
}

a:focus-visible,
button:focus-visible {
  border-radius: 0.2rem;
  box-shadow: 0 0 0 0.22rem var(--focus);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img {
  border: 0;
  height: auto;
  max-width: 100%;
}

picture {
  display: contents;
}

h1,
h2,
h3 {
  color: #202020;
  font-weight: 900;
  line-height: 1.08;
  margin: 0 0 1rem;
}

h1 {
  font-size: 1.9rem;
}

h2 {
  font-size: 1.7rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1rem;
}

.skip-link {
  background: #fff;
  border: 2px solid var(--accent);
  color: var(--accent);
  left: 1rem;
  padding: 0.65rem 0.9rem;
  position: fixed;
  top: 1rem;
  transform: translateY(-150%);
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-wrap {
  margin: 0 auto;
  max-width: 960px;
  padding: 1.8rem 0 2.5rem;
}

.site-header {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-bottom: 2.55rem;
  max-width: 623px;
}

.wordmark {
  display: inline-flex;
  line-height: 0;
}

.wordmark img {
  height: auto;
  max-width: min(443px, 100%);
}

.primary-nav ul {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  color: #000;
  display: inline-block;
  font-size: 1.25rem;
  line-height: 1.2;
  padding: 0.1rem 0;
  text-decoration: none;
}

.primary-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
}

.primary-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.page-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: 623px 315px;
}

.content-column {
  max-width: var(--measure);
}

.content-column.justify-source {
  text-align: justify;
}

.portrait-rail {
  align-self: start;
  display: grid;
  gap: 0;
  justify-items: start;
  margin-top: -10.6rem;
  overflow: visible;
}

.portrait {
  display: block;
  margin-left: -25px;
  max-width: none;
  object-fit: contain;
  object-position: top right;
  width: 390px;
}

.rail-info {
  font-size: 0.88rem;
  justify-self: end;
  margin-left: auto;
  margin-top: 1.55rem;
  max-width: 315px;
  text-align: right;
  width: 315px;
}

.rail-info h2,
.rail-info h3 {
  color: #1f1f1f;
  font-size: 1.45rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.rail-info p + h2,
.rail-info p + h3 {
  margin-top: 1rem;
}

.article-body > :last-child,
.content-column > :last-child {
  margin-bottom: 0;
}

.article-body strong {
  color: #222;
}

.content-image {
  border: 5px solid #000;
  margin: 0.35rem 1rem 0.75rem 0;
}

.content-image.right {
  float: right;
  margin-left: 1rem;
  margin-right: 0;
}

.content-image.left {
  float: left;
}

.content-image.no-border {
  border: 0;
  float: none;
  margin: 0 0 1rem;
}

.full-content-image,
.image-stack img {
  display: block;
  height: auto;
  max-width: 100%;
}

.image-stack {
  display: grid;
  gap: 1rem;
}

.image-pair {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1rem;
}

.article-section {
  border-top: 1px solid var(--line);
  margin-top: 1.8rem;
  padding-top: 1.55rem;
}

.news-list {
  display: grid;
  gap: 2rem;
}

.news-item {
  border-top: 1px solid var(--line);
  padding-top: 1.55rem;
}

.news-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.news-item h2 {
  margin-bottom: 0.45rem;
}

.video-frame {
  aspect-ratio: 4 / 3;
  margin: 1rem 0;
  max-width: 420px;
}

.video-frame iframe {
  border: 0;
  height: 100%;
  width: 100%;
}

.gallery-grid {
  align-items: start;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

.gallery-button {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: block;
  line-height: 0;
  padding: 0;
}

.gallery-button picture {
  display: block;
}

.gallery-button img {
  aspect-ratio: 5 / 6;
  background: transparent;
  display: block;
  height: auto;
  object-fit: contain;
  width: 100%;
}

.gallery-button:hover img,
.gallery-button:focus-visible img {
  opacity: 0.84;
}

.gallery-dialog {
  background: transparent;
  border: 0;
  max-width: min(960px, calc(100vw - 2rem));
  padding: 0;
}

.gallery-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.dialog-inner {
  background: #fff;
  display: grid;
  min-width: min(84vw, 720px);
  place-items: center;
  padding: 0.85rem;
  position: relative;
}

.dialog-inner img {
  max-height: calc(100vh - 7rem);
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.dialog-caption {
  color: #222;
  font-weight: 700;
  margin: 0.65rem 0 0;
}

.dialog-nav {
  background: rgba(255, 255, 255, 0.88);
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 2.6rem;
  height: 3.4rem;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.6rem;
}

.dialog-prev {
  left: 0.35rem;
}

.dialog-next {
  right: 0.35rem;
}

.dialog-close {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  justify-self: end;
  margin-top: 0.75rem;
  padding: 0.45rem 0.75rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2.5rem;
  max-width: var(--measure);
  padding-top: 1rem;
}

.screen-reader-text {
  clip: rect(0 0 0 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

@media (max-width: 1059px) {
  .site-wrap {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .site-header {
    margin-bottom: 1.5rem;
    max-width: none;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .content-column {
    max-width: none;
    text-align: left;
  }

  .portrait-rail {
    grid-row: 1;
    justify-items: center;
    margin-top: 0;
  }

  .portrait {
    margin: 0 auto;
    width: min(78vw, 390px);
  }

  .rail-info {
    margin: 1rem auto 0;
    max-width: 315px;
    text-align: center;
    width: min(100%, 315px);
  }

  .content-image.left,
  .content-image.right {
    float: none;
    margin: 0 0 1rem;
    max-width: min(100%, 420px);
  }
}

@media (max-width: 520px) {
  body {
    font-size: 13.5px;
  }

  .site-wrap {
    padding-top: 1rem;
  }

  .primary-nav ul {
    gap: 0.25rem 0.95rem;
  }

  .primary-nav a {
    font-size: 1.05rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
