/* Catalog components share the variables declared in dark-theme.css. */
body.mp-theme #gallery1.mp-categories,
body.mp-theme #gallery1.mp-works {
  box-sizing: border-box;
  width: 100%;
  overflow: visible;
  padding-bottom: 20px;
  color: var(--mp-ink);
  font-family: var(--mp-font-sans);
}

body.mp-theme #gallery1.mp-categories .mp-categories__grid {
  display: grid;
  grid-template-columns: repeat(3, 186px);
  gap: 18px 22px;
  padding-bottom: 20px;
}

body.mp-theme #gallery1.mp-categories .mp-categories__card {
  box-sizing: border-box;
  position: relative;
  float: none;
  width: 186px;
  height: 269px;
  margin: 0;
  border-radius: 8px;
  background: var(--mp-surface);
  box-shadow: inset 0 0 0 1px var(--mp-line);
}

body.mp-theme #gallery1.mp-categories .mp-categories__link {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 148px;
  height: 190px;
  max-height: none;
  margin: 18px auto 0;
  overflow: visible;
  border: 0;
  color: var(--mp-ink);
  text-decoration: none;
}

body.mp-theme #gallery1.mp-categories .mp-categories__link::after,
body.mp-theme #gallery1.mp-works .mp-works__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
}

body.mp-theme #gallery1.mp-categories .mp-categories__link img {
  display: block;
  width: auto;
  height: auto;
  max-width: 142px;
  max-height: 190px;
  object-fit: contain;
}

body.mp-theme #gallery1.mp-categories .mp-categories__caption {
  position: absolute;
  bottom: 18px;
  left: 18px;
  width: 158px;
  color: var(--mp-ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  pointer-events: none;
}

body.mp-theme #gallery1.mp-categories .mp-categories__card:hover,
body.mp-theme #gallery1.mp-works .mp-works__card:hover {
  box-shadow: inset 0 0 0 1px var(--mp-accent);
}

body.mp-theme #gallery1.mp-categories .mp-categories__card:focus-within,
body.mp-theme #gallery1.mp-works .mp-works__card:focus-within {
  outline: 2px solid var(--mp-accent);
  outline-offset: -2px;
}

body.mp-theme #gallery1.mp-categories .mp-categories__link:focus-visible,
body.mp-theme #gallery1.mp-works .mp-works__link:focus-visible {
  outline: none;
}

body.mp-theme #gallery1.mp-categories .mp-categories__intro {
  max-width: 602px;
  margin: 6px 0 0;
  padding: 24px 0 16px;
  border-top: 1px solid var(--mp-line);
  color: var(--mp-ink);
  font-family: var(--mp-font-serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.45;
}

body.mp-theme #gallery1.mp-works .mp-works__heading,
body.mp-theme #mod2.mp-work .mp-work__title,
body.mp-theme #mp-photos.mp-photos h2.mp-photos__title {
  margin: 0 0 24px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--mp-line);
  color: var(--mp-ink);
  font-family: var(--mp-font-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body.mp-theme #gallery1.mp-works .mp-works__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 22px;
}

body.mp-theme #gallery1.mp-works .mp-works__card {
  box-sizing: border-box;
  position: relative;
  float: none;
  display: flex;
  flex-direction: column;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 269px;
  margin: 0;
  border-radius: 8px;
  background: var(--mp-surface);
  box-shadow: inset 0 0 0 1px var(--mp-line);
}

body.mp-theme #gallery1.mp-works .mp-works__link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 202px;
  width: calc(100% - 36px);
  height: 202px;
  max-height: none;
  margin: 18px auto 0;
  overflow: visible;
  border: 0;
  color: var(--mp-ink);
  text-decoration: none;
}

body.mp-theme #gallery1.mp-works .mp-works__link img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 202px;
  object-fit: contain;
}

body.mp-theme #gallery1.mp-works .mp-works__caption {
  position: static;
  display: block;
  width: auto;
  margin: 14px 18px 18px;
  color: var(--mp-ink);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  pointer-events: none;
}

body.mp-theme #gallery1.mp-works .mp-works__divider {
  height: 0;
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--mp-line);
}

body.mp-theme #gallery1.mp-works .mp-works__intro {
  margin: 24px 0 0;
  color: var(--mp-muted);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

body.mp-theme #mod2.mp-work {
  box-sizing: border-box;
  width: 100%;
  border: 0;
  border-spacing: 0;
  color: var(--mp-ink);
  font-family: var(--mp-font-sans);
  font-size: 14px;
  line-height: 1.65;
}

body.mp-theme #mod2.mp-work > tbody,
body.mp-theme #mod2.mp-work > tbody > tr,
body.mp-theme #mod2.mp-work > tbody > tr > td:first-child {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  text-align: left;
}

body.mp-theme #mod2.mp-work #card.mp-work__card {
  box-sizing: border-box;
  width: 100% !important;
  padding: 0 !important;
  overflow: visible;
}

body.mp-theme #mod2.mp-work .mp-work__surface {
  box-sizing: border-box;
  float: none;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--mp-line);
  border-radius: 10px;
  background: var(--mp-surface);
}

body.mp-theme #mod2.mp-work .mp-work__visual,
body.mp-theme #mod2.mp-work .mp-work__visual > .br,
body.mp-theme #mod2.mp-work .mp-work__visual > .br > .bl {
  background: none;
}

body.mp-theme #mod2.mp-work .mp-work__visual > .br > .bl {
  padding: 22px;
}

body.mp-theme #mod2.mp-work .mp-work__image {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 0 20px;
}

body.mp-theme #mod2.mp-work .mp-work__image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

body.mp-theme #mod2.mp-work #card .mp-work__metadata {
  padding-top: 18px;
  border-top: 1px solid var(--mp-line);
  color: var(--mp-muted);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

body.mp-theme #mod2.mp-work .mp-work__order {
  box-sizing: border-box;
  margin: 22px 22px 0;
  padding: 20px;
  border: 1px solid var(--mp-line);
  border-radius: 8px;
  background: var(--mp-paper);
}

body.mp-theme #mod2.mp-work .mp-work__order-intro {
  height: auto;
  min-height: 0;
  margin: 0;
}

body.mp-theme #mod2.mp-work .mp-work__order-title {
  margin: 0 0 16px;
  padding: 0;
  color: var(--mp-ink);
  font-family: var(--mp-font-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.35;
}

body.mp-theme #mod2.mp-work .order_form_form {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  margin: 0;
}

body.mp-theme #mod2.mp-work .order_form_form label {
  width: auto;
  color: var(--mp-muted);
  font-size: 12px;
  line-height: 1.6;
}

body.mp-theme #mod2.mp-work .order_form_form .text_before,
body.mp-theme #mod2.mp-work .order_form_form select {
  grid-column: 1 / -1;
}

body.mp-theme #mod2.mp-work .order_form_form .text_before {
  font-size: 13px;
  font-weight: 400;
}

body.mp-theme #mod2.mp-work .order_form_form .form_block {
  display: contents;
  float: none;
  width: auto;
}

body.mp-theme #mod2.mp-work .order_form_form input,
body.mp-theme #mod2.mp-work .order_form_form select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  color: var(--mp-ink);
  background: var(--mp-surface);
  font-family: var(--mp-font-sans);
  font-size: 14px;
  line-height: 1.4;
}

body.mp-theme #mod2.mp-work .order_form_form input.button {
  grid-column: 2;
  width: 100%;
  margin-top: 4px;
  border-color: var(--mp-accent);
  color: var(--mp-ink);
  background: var(--mp-accent-wash);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

body.mp-theme #mod2.mp-work .order_form_form input.button:hover {
  background: var(--mp-surface);
}

body.mp-theme #mod2.mp-work #card .mp-work__description {
  margin: 24px 0 0;
  color: var(--mp-muted);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

body.mp-theme #mod2.mp-work .mp-work__description img {
  max-width: 100%;
  height: auto;
}

body.mp-theme #gallery.mp-albums {
  box-sizing: border-box;
  margin: 0;
  color: var(--mp-ink);
  font-family: var(--mp-font-sans);
}

body.mp-theme #gallery.mp-albums .mp-albums__grid,
body.mp-theme .mp-photos #gallery.mp-photos__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 22px;
}

body.mp-theme #gallery.mp-albums .mp-albums__card,
body.mp-theme .mp-photos #gallery.mp-photos__grid .mp-photos__card {
  box-sizing: border-box;
  float: none;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 18px;
  overflow: visible;
  border: 1px solid var(--mp-line);
  border-radius: 8px;
  background: var(--mp-surface);
}

body.mp-theme #gallery.mp-albums .mp-albums__table,
body.mp-theme #gallery.mp-albums .mp-albums__table tbody,
body.mp-theme #gallery.mp-albums .mp-albums__table tr,
body.mp-theme #gallery.mp-albums .mp-albums__table td {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  font-family: inherit;
}

body.mp-theme #gallery.mp-albums .mp-albums__title {
  margin: 0 0 16px;
  padding: 0;
  color: var(--mp-ink);
  font-family: var(--mp-font-serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

body.mp-theme #gallery.mp-albums .mp-albums__cover,
body.mp-theme #gallery.mp-albums .mp-albums__cover div {
  padding: 0;
  background: none;
}

body.mp-theme #gallery.mp-albums .mp-albums__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 180px;
  background: transparent;
}

body.mp-theme #gallery.mp-albums .mp-albums__link img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 180px;
  margin: 0;
  object-fit: contain;
}

body.mp-theme #gallery.mp-albums .mp-albums__table td.mp-albums__description {
  margin-top: 16px;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

body.mp-theme .mp-photos {
  color: var(--mp-ink);
  font-family: var(--mp-font-sans);
}

body.mp-theme .mp-photos .mp-photos__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -10px 0 8px;
  color: var(--mp-accent);
  font-size: 13px;
  line-height: 1.5;
  text-underline-offset: 4px;
}

body.mp-theme .mp-photos .mp-photos__intro {
  color: var(--mp-muted);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

body.mp-theme .mp-photos #gallery.mp-photos__grid {
  box-sizing: border-box;
  width: 100%;
  margin: 24px 0 0;
}

body.mp-theme .mp-photos #gallery.mp-photos__grid .mp-photos__frame {
  width: 100%;
  height: 180px;
  margin: 0;
  border: 0;
  border-spacing: 0;
  table-layout: fixed;
}

body.mp-theme .mp-photos .mp-photos__frame td {
  padding: 0;
  border: 0;
}

body.mp-theme .mp-photos .mp-photos__link,
body.mp-theme .mp-photos .mp-photos__link > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 180px;
}

body.mp-theme .mp-photos .mp-photos__link img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

body.mp-theme .mp-photos .mp-photos__caption {
  margin: 14px 0 0;
  color: var(--mp-muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body.mp-theme .mp-photos .mp-photos__pages {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
}

body.mp-theme .mp-photos .mp-photos__pages a {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  color: var(--mp-ink);
  font-size: 13px;
  text-decoration: none;
}

body.mp-theme .mp-photos .mp-photos__pages .s,
body.mp-theme .mp-photos .mp-photos__pages a:hover {
  border-color: var(--mp-accent);
  background: var(--mp-accent-wash);
}

body.mp-theme #mod2.mp-work .order_form_form input:focus-visible,
body.mp-theme #mod2.mp-work .order_form_form select:focus-visible,
body.mp-theme #mod2.mp-work .mp-work__image:focus-visible,
body.mp-theme #gallery.mp-albums .mp-albums__link:focus-visible,
body.mp-theme .mp-photos .mp-photos__link:focus-visible,
body.mp-theme .mp-photos .mp-photos__back:focus-visible,
body.mp-theme .mp-photos .mp-photos__pages a:focus-visible,
body.mp-theme .mp-photo-viewer .mp-photo-viewer__close:focus-visible {
  outline: 2px solid var(--mp-accent);
  outline-offset: 4px;
}

body.mp-theme #gallery1.mp-categories .mp-categories__clear,
body.mp-theme #gallery1.mp-works .mp-works__clear,
body.mp-theme #mod2.mp-work .mp-work__clear,
body.mp-theme #mod2.mp-work .mp-work__spacer,
body.mp-theme #mod2.mp-work .order_form_form .devider,
body.mp-theme #gallery.mp-albums .mp-albums__clear,
body.mp-theme .mp-photos .mp-photos__clear {
  display: none;
}

/* The photo layer is independent of the callback overlay and legacy #shade. */
body.mp-theme .mp-photo-shade {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgb(0 0 0 / 0.78);
}

body.mp-theme .mp-photo-viewer {
  box-sizing: border-box;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 301;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 12px;
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--mp-line);
  border-radius: 10px;
  color: var(--mp-ink);
  background: var(--mp-surface);
  box-shadow: 0 12px 60px rgb(0 0 0 / 0.4);
}

body.mp-theme .mp-photo-viewer .mp-photo-viewer__close {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  align-self: flex-end;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--mp-line);
  border-radius: 6px;
  color: var(--mp-ink);
  background: var(--mp-paper);
  font-family: var(--mp-font-sans);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

body.mp-theme .mp-photo-viewer .mp-photo-viewer__close:hover {
  border-color: var(--mp-accent);
  color: var(--mp-accent);
}

body.mp-theme .mp-photo-viewer .mp-photo-viewer__image {
  display: block;
  flex-shrink: 0;
  width: auto;
  height: auto;
  max-width: calc(100vw - 58px);
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  object-fit: contain;
}

@media (max-width: 959px) {
  body.mp-theme #gallery1.mp-categories .mp-categories__grid,
  body.mp-theme #gallery1.mp-works .mp-works__grid,
  body.mp-theme #gallery.mp-albums .mp-albums__grid,
  body.mp-theme .mp-photos #gallery.mp-photos__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__card {
    width: 100%;
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__link {
    width: calc(100% - 36px);
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__link img {
    max-width: 100%;
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__caption {
    width: calc(100% - 36px);
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__intro {
    max-width: none;
  }
}

@media (max-width: 479px) {
  body.mp-theme #gallery1.mp-categories .mp-categories__grid,
  body.mp-theme #gallery1.mp-works .mp-works__grid,
  body.mp-theme #gallery.mp-albums .mp-albums__grid,
  body.mp-theme .mp-photos #gallery.mp-photos__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__card {
    height: 318px;
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__link {
    height: 236px;
    margin-top: 20px;
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__link img {
    max-height: 236px;
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__caption {
    bottom: 20px;
    left: 20px;
    width: calc(100% - 40px);
    font-size: 14px;
  }

  body.mp-theme #gallery1.mp-categories .mp-categories__intro {
    font-size: 23px;
  }

  body.mp-theme #gallery1.mp-works .mp-works__heading,
  body.mp-theme #mod2.mp-work .mp-work__title,
  body.mp-theme #mp-photos.mp-photos h2.mp-photos__title {
    font-size: 25px;
  }

  body.mp-theme #gallery1.mp-works .mp-works__link {
    flex-basis: 236px;
    height: 236px;
  }

  body.mp-theme #gallery1.mp-works .mp-works__link img {
    max-height: 236px;
  }

  body.mp-theme #mod2.mp-work .mp-work__order {
    margin: 16px 16px 0;
    padding: 16px;
  }

  body.mp-theme #mod2.mp-work .mp-work__visual > .br > .bl {
    padding: 16px;
  }

  body.mp-theme #mod2.mp-work .order_form_form {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body.mp-theme #mod2.mp-work .order_form_form input.button {
    grid-column: 1;
    margin-top: 8px;
  }

  body.mp-theme #gallery.mp-albums .mp-albums__link,
  body.mp-theme .mp-photos #gallery.mp-photos__grid .mp-photos__frame,
  body.mp-theme .mp-photos .mp-photos__link,
  body.mp-theme .mp-photos .mp-photos__link > span {
    height: 236px;
  }

  body.mp-theme #gallery.mp-albums .mp-albums__link img,
  body.mp-theme .mp-photos .mp-photos__link img {
    max-height: 236px;
  }
}
