/* Audrey Pilkington — look and feel.
   A tidied version of the 2013 design: picture banner with the name, serif
   menu under a soft shadow, a 900px column of work in three columns. */

/* Cabin, the text typeface the 2013 design asked for (SIL Open Font License,
   see fonts/OFL.txt). One file covers regular to bold. */
@font-face {
  font-family: "Cabin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/cabin-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Cabin";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/cabin-italic-latin.woff2") format("woff2");
}

:root {
  --text: #46433a;
  --ink: #2f373a;            /* menu and links */
  --menu-current: #d3d3d1;
  --shadow: 4px 4px 10px #aaa;
  --column: 900px;           /* width of the page column */
  --gutter: 15px;            /* space kept at the screen edges on small screens */
  --banner-height: 100px;
}

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

html {
  overflow-y: scroll;        /* keeps the page from shifting sideways between short and long pages */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: Cabin, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

p {
  margin: 1em 0 10px;
}

a {
  color: var(--ink);
  text-decoration: underline;
}
a:hover,
a:focus {
  color: rgba(76, 44, 36, 0.6);
}

strong {
  font-weight: 700;
}

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

/* Present for screen readers and search engines, not shown on the page */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 8px 15px;
  background: #fff;
}
.skip-link:focus {
  left: 0;
}


/* Banner
   ---------------------------------------------------------------------- */

/* Each banner picture is 2000 x 100 with the signature and name painted in,
   placed so that they line up with the left edge of the page column when the
   picture is centred. */
.banner {
  position: relative;
  height: var(--banner-height);
  overflow: hidden;
  background: var(--menu-current);
}
.banner-slide {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: auto var(--banner-height);
  opacity: 0;
  transition: opacity 2s linear;
}
.banner-slide.is-current {
  opacity: 1;
}


/* Menu
   ---------------------------------------------------------------------- */

.site-nav {
  background: url("/images/header/nav-shadow.png") repeat-x top;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  width: min(100% - 2 * var(--gutter), var(--column));
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 8px 15px;
  color: var(--ink);
  font-family: "Times New Roman", Times, serif;
  font-size: 120%;
  line-height: normal;
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  background: var(--menu-current) url("/images/header/nav-shadow.png") repeat-x top;
}
.site-nav a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}


/* Page column
   ---------------------------------------------------------------------- */

.site-content {
  width: min(100% - 2 * var(--gutter), var(--column));
  margin: 0 auto;
  padding-top: 46px;
}
.site-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Picture beside the text on the Biography and Exhibition pages */
.page-image {
  float: right;
  margin: 0 0 10px 1.5em;
  box-shadow: var(--shadow);
}


/* Selected work
   ---------------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 33%);
  margin: 0 0 1.5em;
}
.work {
  margin: 10px 0 0;
  text-align: center;
}
.work a {
  display: inline-block;
  max-width: 90%;
  vertical-align: top;
}
.work img {
  display: block;
  box-shadow: var(--shadow);
}
.work a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.work figcaption {
  margin-top: 6px;
  font-size: 80%;
  text-wrap: balance;        /* a caption that wraps splits into even lines */
}
.nowrap {
  white-space: nowrap;
}


/* Footer
   ---------------------------------------------------------------------- */

.site-footer {
  clear: both;
  padding: 20px 20px 120px;
  font-size: 80%;
  text-align: center;
}
.site-footer p {
  margin: 0;
}


/* Picture viewer (opened from the Selected Work page by js/site.js)
   ---------------------------------------------------------------------- */

html:has(.lightbox[open]) {
  overflow: hidden;
}
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 10px;
  border: 0;
  background: transparent;
  color: #666;
  overflow: auto;
}
.lightbox[open] {
  display: grid;
  place-items: center;
}
.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.8);
}
.lightbox-frame {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 10px;
  background: #fff;
}
.lightbox-stage {
  position: relative;
}
.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
  width: auto;
  height: auto;
  margin: 0 auto;
}

/* Left and right halves of the picture go back and forward */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  padding: 0 12px;
  border: 0;
  background: none;
  color: #fff;
  font: 400 44px/1 "Times New Roman", Times, serif;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.lightbox-prev {
  left: 0;
  text-align: left;
}
.lightbox-next {
  right: 0;
  text-align: right;
}
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  opacity: 1;
  outline: none;             /* the arrow appearing shows where the focus is */
}
@media (hover: none) {
  /* Touch screens have no hover, so the arrows stay faintly visible */
  .lightbox-prev,
  .lightbox-next {
    opacity: 0.75;
  }
}
.lightbox-prev[hidden],
.lightbox-next[hidden] {
  display: none;
}

/* Caption, "Image 3 of 35" and Close, under the picture. The width trick
   stops a long caption making the white frame wider than the picture. */
.lightbox-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1em;
  width: 0;
  min-width: 100%;
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}
.lightbox-caption {
  display: block;
  font-weight: 700;
}
.lightbox-count {
  display: block;
}
.lightbox-close {
  flex: none;
  padding: 2px 0 2px 8px;
  border: 0;
  background: none;
  color: #666;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: #111;
}


/* Smaller screens
   ---------------------------------------------------------------------- */

/* Narrower than the page column: instead of centring the banner, pin it so
   the signature and name stay at the left edge, and shrink it on phones so
   the whole name fits. (5.5 = the name's 550px offset in the picture, per
   100px of banner height.) */
@media (max-width: 929px) {
  :root {
    --banner-height: min(100px, 22vw);
  }
  .banner-slide {
    background-position: calc(var(--gutter) - 5.5 * var(--banner-height)) top;
  }
}

@media (max-width: 640px) {
  .site-nav a {
    padding: 8px 12px;
  }
  .site-content {
    padding-top: 24px;
  }
  .gallery {
    grid-template-columns: repeat(2, 50%);
  }
  .page-image {
    display: block;
    float: none;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner-slide {
    transition: none;
  }
}
