/* Base */
html {
  box-sizing: border-box;
  background: #fff;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  font-size: 100%;
  line-height: 1.5;
  overflow-x: hidden;
}

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

body {
  margin: 0;
  min-width: 0;
  background: #fff;
  color: #000;
}

body.zoom-open {
  overflow: hidden;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: #000;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

button,
a {
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid #000;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-shell {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}

/* Homepage */
.home-header {
  max-width: 48rem;
  padding-block: 3rem 0;
}

.home-header h1 {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 0.95;
}

.home-header h2 {
  margin: 1.25rem 0 0;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
}

.home-header p {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  font-size: 1.0625rem;
}

.editorial-space {
  min-height: 22.5rem;
  padding-block: 2rem;
}

.editorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  min-height: 18.5rem;
}

.products-list {
  padding-block: 1rem 5rem;
}

.products-list hr {
  height: 1px;
  margin: 4rem 0;
  border: 0;
  background: #000;
}

.product-entry__title {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
}

.product-entry__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.8fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.product-entry__layout--without-image {
  grid-template-columns: minmax(0, 38rem);
}

.product-entry__figure {
  margin: 0;
}

.product-entry__figure a {
  display: block;
}

.product-entry__figure img {
  width: 100%;
  height: auto;
  border: 1px solid #000;
  object-fit: contain;
}

.product-entry__description {
  max-width: 34rem;
  margin: 0;
  font-size: 1.0625rem;
}

/* Product pages */
.product-header {
  padding-block: 2rem 1.5rem;
}

.back-nav {
  margin-bottom: 1.25rem;
}

.product-header h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 1;
}

.product-main {
  padding-bottom: 5rem;
}

.gallery {
  border-top: 1px solid #000;
  padding-top: 1.5rem;
}

.gallery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem;
  gap: 1.5rem;
  align-items: start;
}

.active-media {
  display: grid;
  min-height: min(62vw, 42rem);
  border: 1px solid #000;
  place-items: center;
  background: #fff;
  overflow: hidden;
}

.active-media > img,
.active-media > video,
.media-zoom-button,
.media-zoom-button img {
  width: 100%;
  height: 100%;
  max-height: 42rem;
  object-fit: contain;
}

.media-zoom-button {
  display: block;
  padding: 0;
  border: 0;
  background: #fff;
  color: #000;
  cursor: zoom-in;
}

.thumbnail-list {
  display: grid;
  gap: 0.75rem;
}

.thumbnail-button {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0.2rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: #fff;
  color: #000;
  cursor: pointer;
  place-items: center;
}

.thumbnail-button.is-active {
  border-color: #000;
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumbnail-video-label {
  position: absolute;
  inset: auto 0.2rem 0.2rem;
  border-top: 1px solid #000;
  background: #fff;
  font: inherit;
  font-size: 0.8125rem;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.product-error {
  margin-block: 2rem;
  border: 1px solid #000;
  padding: 1rem;
}

.product-description {
  width: min(100%, 44rem);
  margin: 5rem auto 0;
  text-align: center;
}

.product-description p {
  margin: 0 0 1.25rem;
}

.order-link {
  display: inline-block;
  margin-block: 0.25rem 1.25rem;
  font-size: 1.125rem;
}

.order-details {
  font-size: 0.9375rem;
}

.site-footer {
  border-top: 1px solid #000;
  padding-block: 1.5rem 3rem;
  font-size: 0.675rem;
}

/* Image zoom dialog */
.zoom-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow: auto;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.98);
}

.zoom-dialog {
  display: grid;
  min-height: calc(100vh - 2rem);
  min-height: calc(100dvh - 2rem);
  grid-template-rows: auto 1fr;
}

.zoom-close {
  justify-self: end;
  margin: 0 0 1rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.zoom-image {
  align-self: start;
  justify-self: center;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

/* Responsive layout */
@media (max-width: 44rem) {
  .site-shell {
    width: min(100% - 1.25rem, 72rem);
  }

  .home-header {
    padding-top: 2rem;
  }

  .editorial-space {
    min-height: 16rem;
  }

  .editorial-grid {
    grid-template-columns: 1fr;
    min-height: 12rem;
  }

  .product-entry__layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .products-list hr {
    margin-block: 3rem;
  }

  .gallery-layout {
    grid-template-columns: 1fr;
  }

  .active-media {
    min-height: 65vw;
  }

  .thumbnail-list {
    grid-template-columns: repeat(5, minmax(3.25rem, 1fr));
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.2rem 0.2rem 0.6rem;
  }

  .thumbnail-button {
    min-width: 3.25rem;
  }

  .product-description {
    margin-top: 3rem;
    text-align: left;
  }

  .zoom-image {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Print */
@media print {
  @page {
    margin: 1.5cm;
  }

  body {
    font-size: 11pt;
  }

  .site-shell {
    width: 100%;
  }

  .editorial-space,
  .thumbnail-list,
  .back-nav,
  .zoom-overlay,
  .site-footer {
    display: none !important;
  }

  .gallery-layout,
  .product-entry__layout {
    display: block;
  }

  .active-media {
    min-height: 0;
    border: 0;
  }

  .product-description {
    margin-top: 2rem;
  }

  a {
    color: #000;
  }
}
