/* emilywinfieldmartin.com */

@font-face {
  font-family: "Quattrocento Sans";
  src: url(../fonts/quattrocento-sans-regular.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quattrocento Sans";
  src: url(../fonts/quattrocento-sans-italic.woff2) format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Quattrocento Sans";
  src: url(../fonts/quattrocento-sans-bold.woff2) format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quattrocento Sans";
  src: url(../fonts/quattrocento-sans-bolditalic.woff2) format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --text: #3e3e3e;
  --muted: #767676;
  --link: #8d6a19;
  --nav: #767676;
  --nav-active: #333;
  --rule: rgba(0, 0, 0, 0.13);
  --bar: #f7f7f7;
  --width: 960px;
}

/* ---------- base ---------- */

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 16px/1.5 "Quattrocento Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--link);
  text-decoration: none;
  transition: color 300ms ease;
}

p {
  margin: 0 0 24px;
}

/* links in running text get a light underline, so they don't rely on color alone */
.content p a:not(.button) {
  text-decoration: underline;
  text-decoration-color: rgba(141, 106, 25, 0.4);
  text-underline-offset: 3px;
}

.content p a:not(.button):hover {
  text-decoration-color: currentColor;
}

small {
  font-size: 13px;
}

.space-above {
  margin-top: 24px;
}

/* book titles: the title line with the publisher underneath */
h2 {
  margin: 24px 0;
  font: inherit;
}

h2 small {
  display: block;
  font-style: italic;
}

.muted {
  color: var(--muted);
}

.left {
  text-align: left;
}

hr {
  height: 1px;
  margin: 60px 0 20px;
  border: 0;
  background: var(--rule);
}

/* ---------- header & navigation ---------- */

.site-header {
  /* the whole header scrolls away except the nav bar:
     40 padding + 49 name + 16 margin + 16 star + 30 margin */
  position: sticky;
  top: -151px;
  z-index: 10;
  padding-top: 40px;
  background: #fff;
  text-align: center;
}

.logo {
  display: table; /* shrink-wraps the name like inline-block, without the line-height gap under it */
  margin: 0 auto 16px;
}

.logo img {
  display: block;
  width: auto;
  height: 49px;
}

.star {
  display: block;
  margin: 0 auto 30px;
}

.menu-toggle {
  display: none;
}

.site-nav {
  padding: 10px 0;
  background: #fff;
}

.site-header.stuck .site-nav {
  border-bottom: 2px solid var(--bar);
}

.site-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  display: inline-block;
  padding: 0 5px;
}

.site-nav a {
  display: block;
  padding: 5px 15px;
  color: var(--nav);
  font-size: 14px;
  line-height: 19px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--nav-active);
}

/* ---------- page content ---------- */

.content {
  max-width: var(--width);
  margin: 0 auto;
  padding: 20px 20px 40px;
  text-align: center;
  overflow-wrap: break-word;
}

.content > :last-child {
  margin-bottom: 0;
}

/* hand-lettered section titles on the portfolio page: headings that look like plain images */
h2.lettering {
  margin: 0;
}

h2.lettering img[src$=".svg"] {
  display: block;
  width: auto;
  margin: 15px 0;
}

/* hand-lettered page title (Girls & Cats) */
.gc-title {
  margin: 10px 0 0;
  line-height: 0;
}

/* for headings that search engines and screen readers need but the design doesn't show */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* a single picture */
.image {
  padding: 10px 0;
}

.image.framed img {
  padding: 2px;
  border: 1px solid var(--rule);
}

/* two side-by-side columns */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

/* embedded video */
.video {
  max-width: 501px;
  margin: 10px auto;
  aspect-ratio: 16 / 9;
}

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

/*
  Thumbnail grid. Set per gallery with inline custom properties:
    --cols   number of columns (required)
    --gap    space between thumbnails (default 22px)
    --ratio  thumbnail height as a fraction of its width (default 1 = square)
  Add .fit to show whole images instead of cropping, .bordered for a thin frame.
*/
.gallery {
  --gap: 22px;
  --ratio: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  margin: 20px 0;
  padding: calc(var(--gap) / 2);
}

.gallery > * {
  display: block;
  overflow: hidden;
  aspect-ratio: calc(1 / var(--ratio));
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery.fit > * {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* whole images at their own proportions, no cropping */
.gallery.natural {
  align-items: center;
}

.gallery.natural > * {
  aspect-ratio: auto;
}

.gallery.natural img {
  height: auto;
}

.gallery.bordered img {
  padding: 1px;
  border: 1px solid var(--rule);
}

/* homepage feature: one big picture, a title, a line or two and a shop link */
.feature {
  max-width: 640px;
  margin: 0 auto;
}

.feature-image {
  display: block;
  max-width: 500px;
  margin: 10px auto 0;
}

.feature-image img {
  display: block;
  width: 100%;
}

.feature h2 {
  margin: 32px 0 16px;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* a bordered link that reads as a button (homepage feature, about page signup) */
.button {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--link);
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.button:hover {
  background: var(--link);
  color: #fff;
}

/* for button text whose capitalization matters (buyolympia.com) */
.button.keep-case {
  letter-spacing: 0.05em;
  text-transform: none;
  font-size: 15px;
}

.feature .gallery {
  margin-top: 36px;
}

/* 404 page */
.not-found {
  margin: 20px 0 24px;
  font-size: 22px;
  font-weight: 400;
}

/* ---------- footer ---------- */

.site-footer {
  min-height: 60px;
  padding: 20px;
  border-top: 2px solid var(--bar);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

/* ---------- lightbox (js/site.js) ---------- */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 100%;
  margin: 0;
  padding: 40px 70px;
}

.lightbox img {
  min-height: 0;
  max-height: 100%;
  object-fit: contain;
}

/* buy button under the image (thumbnail links with data-buy) */
.lightbox .buy {
  flex: none;
  padding: 10px 22px;
  border: 1px solid #fff;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.lightbox .buy:hover {
  background: #fff;
  color: var(--text);
}

.lightbox button {
  position: absolute;
  padding: 10px;
  border: 0;
  background: none;
  color: #fff;
  font: 40px/1 "Quattrocento Sans", sans-serif;
  cursor: pointer;
}

.lightbox button:focus:not(:focus-visible) {
  outline: none;
}

.lightbox button:hover {
  color: var(--nav);
}

.lightbox .close {
  top: 10px;
  right: 15px;
}

.lightbox .prev,
.lightbox .next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox .prev {
  left: 10px;
}

.lightbox .next {
  right: 10px;
}

/* ---------- smaller screens ---------- */

@media (max-width: 992px) {
  .content {
    max-width: 768px;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 15px;
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: 100%;
    height: 50px;
    padding: 10px 0;
    background: #fff;
    border-bottom: 2px solid var(--bar);
  }

  .logo {
    margin: 1px auto 0;
  }

  .logo img {
    width: auto;
    height: 26px;
  }

  .star {
    display: none;
  }

  .menu-toggle {
    position: absolute;
    top: 0;
    left: 5px;
    display: block;
    width: 50px;
    height: 48px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .menu-toggle span,
  .menu-toggle span::before,
  .menu-toggle span::after {
    position: absolute;
    left: 14px;
    width: 22px;
    height: 2px;
    background: var(--text);
    content: "";
    transition: all 300ms ease;
  }

  .menu-toggle span {
    top: 23px;
  }

  .menu-toggle span::before {
    top: -7px;
    left: 0;
  }

  .menu-toggle span::after {
    top: 7px;
    left: 0;
  }

  .nav-open .menu-toggle span {
    background: transparent;
  }

  .nav-open .menu-toggle span::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-open .menu-toggle span::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .site-nav {
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    height: calc(100vh - 50px);
    padding: 0;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 300ms ease, visibility 300ms;
  }

  .nav-open .site-nav {
    padding: 10px 0;
    visibility: visible;
    opacity: 1;
    /* links are usable the moment it opens, while it still fades in (and out) */
    transition: opacity 300ms ease, visibility 0s;
  }

  .site-header.stuck .site-nav {
    border-bottom: 0;
  }

  .site-nav li {
    display: block;
    padding: 0;
  }

  .site-nav a {
    padding: 10px 0;
    text-indent: 0.34em; /* balances the spacing after the last letter */
  }

  .content {
    margin-top: 55px;
  }

  .columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

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