/*
 * Rails-rendered pages deliberately use a small, classless stylesheet. The
 * .site-page block keeps these rules away from the React tools under /digital.
 */

.site-page {
  box-sizing: border-box;
  width: min(100% - 2rem, 42rem);
  margin: 0 auto;
  padding: 3rem 0 4rem;
  color: #222;
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

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

.site-page > header {
  margin-bottom: 3rem;
}

.site-page h1,
.site-page h2,
.site-page h3,
.site-page h4,
.site-page h5,
.site-page h6 {
  font-family: "Playfair Display", serif;
  line-height: 1.25;
}

.site-page h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(2rem, 8vw, 3rem);
}

.site-page h2 {
  margin: 0;
  font-size: 1.25rem;
}

.site-page p {
  margin: 0.75rem 0;
}

.site-page a {
  color: #174ea6;
}

.site-page a:hover {
  text-decoration-thickness: 0.15em;
}

.site-page img {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-page figure {
  margin: 0 0 1rem;
}

.site-page > section > article {
  padding: 1.5rem 0;
  border-top: 1px solid #ccc;
}

.site-page > section > article:last-child {
  border-bottom: 1px solid #ccc;
}

.site-page article > header p {
  margin: 0 0 0.25rem;
}

.site-page article > footer {
  margin-top: 1rem;
}

.site-page nav {
  margin-bottom: 2rem;
}

.site-page .site-page__back-link {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  color: #625b54;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.site-page__back-link::before {
  content: "\2190";
  transition: transform 120ms ease;
}

.site-page .site-page__back-link:hover {
  color: #36322e;
  text-decoration: none;
}

.site-page__back-link:hover::before {
  transform: translateX(-0.15rem);
}

.site-page .site-page__back-link:focus-visible {
  border-radius: 0.1rem;
  outline: 3px solid #8b5e32;
  outline-offset: 0.3rem;
}

.site-page > article > header {
  margin-bottom: 2rem;
}

.site-page > article > section {
  margin: 2rem 0;
}

.site-page label {
  display: block;
}

.site-page input,
.site-page textarea {
  max-width: 100%;
  font: inherit;
}

.site-page textarea {
  width: 100%;
}

.site-page form small {
  display: block;
  margin-top: 0.25rem;
}

.site-page .admin-material-form__description {
  min-height: 12rem;
  background: #fff;
  color: #222;
}

.site-page trix-toolbar .trix-button-row {
  flex-wrap: wrap;
  justify-content: flex-start;
  column-gap: 1rem;
  overflow-x: visible;
}

.site-page trix-toolbar .trix-button-group,
.site-page trix-toolbar .trix-button-group:not(:first-child) {
  margin-left: 0;
}

.site-page trix-toolbar .trix-button-group-spacer {
  display: none;
}

.site-page button {
  font: inherit;
}

.site-page .admin-materials__new-link {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border: 1px solid currentcolor;
  border-radius: 0.2rem;
  font-weight: 650;
  text-decoration: none;
}

.site-page .admin-materials__new-link:hover {
  background: #eef4ff;
  text-decoration: none;
}

.site-page .admin-materials__new-link:focus-visible {
  outline: 3px solid #8b5e32;
  outline-offset: 0.2rem;
}

.site-page .admin-materials__preview {
  width: 12rem;
  max-height: 10rem;
  margin-top: 1rem;
  padding: 0.25rem;
  border: 1px solid #ddd;
  border-radius: 0.2rem;
  background: #fff;
  object-fit: contain;
  object-position: left center;
}

.site-page .admin-material-form__file-field {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  background: #fafafa;
}

.site-page .admin-material-form__file-field label {
  font-weight: 650;
}

.site-page .admin-material-form__file-field input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
}

.site-page .admin-material-form__file-field input[type="file"]::file-selector-button {
  margin-right: 0.5rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid #aaa;
  border-radius: 0.2rem;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.site-page .admin-material-form__file-field input[type="file"]::file-selector-button:hover {
  background: #eef4ff;
}

.site-page .admin-material-form__download {
  display: inline-block;
  margin-top: 0.65rem;
}

.site-page .admin-materials__paddle-debug {
  margin-top: 3rem;
  padding: 1rem;
  border: 1px dashed #999;
  border-radius: 0.25rem;
  background: #f7f7f7;
  color: #444;
}

.site-page .admin-materials__paddle-debug header {
  margin-bottom: 1rem;
}

.site-page .admin-materials__paddle-debug h2,
.site-page .admin-materials__paddle-debug h3,
.site-page .admin-materials__paddle-debug p {
  margin: 0;
}

.site-page .admin-materials__paddle-debug header p {
  font-size: 0.9rem;
}

.site-page .admin-materials__paddle-debug dl {
  margin: 0;
}

.site-page .admin-materials__paddle-debug dl > div {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 1rem;
  padding: 0.2rem 0;
}

.site-page .admin-materials__paddle-debug dt {
  font-weight: 650;
}

.site-page .admin-materials__paddle-debug dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.site-page .admin-materials__paddle-debug h3 {
  margin-top: 1rem;
  font-size: 1rem;
}

.site-page .admin-materials__paddle-debug ul {
  margin-top: 0;
}

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

.site-page .paddle-price__skeleton {
  display: inline-block;
  width: 4.5em;
  height: 0.8em;
  border-radius: 0.15em;
  background: linear-gradient(90deg, #ded6cc 25%, #f3ede5 50%, #ded6cc 75%);
  background-size: 200% 100%;
  vertical-align: -0.05em;
  animation: paddle-price-loading 1.4s ease-in-out infinite;
}

@keyframes paddle-price-loading {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

.catalog-body {
  margin: 0;
  background: #fffaf1;
}

.catalog-page {
  width: min(100% - 3rem, 70rem);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(5rem, 10vw, 8rem);
  color: #36322e;
}

.catalog-page__intro {
  max-width: 52rem;
  margin-bottom: clamp(4rem, 10vw, 7rem);
}

.catalog-page__eyebrow {
  margin: 0 0 0.75rem;
  color: #8b5e32;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.catalog-page h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.75rem, 8vw, 5rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.catalog-page__lede {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.catalog-page__nav {
  display: flex;
  gap: 1.5rem;
  margin: 2rem 0 0;
}

.catalog-page__nav a {
  color: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  text-underline-offset: 0.25em;
}

.catalog-section {
  scroll-margin-top: 2rem;
}

.catalog-section + .catalog-section {
  margin-top: clamp(4rem, 10vw, 7rem);
}

.catalog-section__header {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 28rem);
  align-items: end;
  margin-bottom: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #bfae98;
}

.catalog-section__header h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.catalog-section__header > p {
  margin: 0;
  color: #625b54;
}

.material-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-page .material-card {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.material-card article {
  height: 100%;
  overflow: hidden;
  border: 1px solid #d5c8b7;
  border-radius: 0.35rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(61 48 35 / 8%);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.material-card img {
  width: 100%;
  aspect-ratio: 1.06;
  object-fit: cover;
  border-bottom: 1px solid #e3d9cc;
  background: #fff;
}

.material-card__preview.material-card__preview--printable {
  aspect-ratio: 4;
  object-fit: contain;
}

.material-card__body {
  padding: 1.25rem;
}

.material-card__meta {
  margin: 0 0 0.5rem;
  color: #8b5e32;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.material-card h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.material-card__body > p:last-child {
  margin: 0.75rem 0 0;
  color: #625b54;
  font-size: 0.9rem;
  line-height: 1.55;
}

.material-card:hover article {
  border-color: #8b5e32;
  box-shadow: 0 0.35rem 1rem rgb(61 48 35 / 10%);
  transform: translateY(-2px);
}

.material-card:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.material-card:focus-visible {
  outline: 3px solid #8b5e32;
  outline-offset: 4px;
}

.catalog-section__empty {
  margin: 0;
  padding: 1.5rem 0;
  border-top: 1px solid #d5c8b7;
  border-bottom: 1px solid #d5c8b7;
}

.material-page {
  width: min(100% - 3rem, 70rem);
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(5rem, 10vw, 8rem);
  color: #36322e;
}

.material-page__nav {
  margin-bottom: clamp(3rem, 8vw, 5rem);
}

.material-detail__header {
  max-width: 52rem;
  margin-bottom: clamp(3rem, 8vw, 5rem);
}

.site-page .material-detail__header .catalog-page__eyebrow {
  margin-bottom: 0.75rem;
}

.material-detail__header .catalog-page__eyebrow small {
  font-size: inherit;
}

.material-detail__header h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.75rem, 8vw, 5rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.site-page .material-detail__summary {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  color: #625b54;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.material-detail__content {
  padding-top: 1.5rem;
  border-top: 1px solid #bfae98;
}

.material-detail__preview {
  max-width: 52rem;
  overflow: hidden;
  margin: 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #d5c8b7;
  border-radius: 0.35rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(61 48 35 / 8%);
}

.material-detail__preview img {
  width: 100%;
  max-height: 44rem;
  object-fit: contain;
}

.material-detail__preview + .material-detail__body {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.material-detail__body {
  max-width: 42rem;
}

.material-detail__description {
  margin: 0;
  color: #4d4842;
}

.material-detail__description > .trix-content > :first-child {
  margin-top: 0;
}

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

.material-detail__action {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d5c8b7;
}

.site-page .material-detail__action-link,
.site-page .material-detail__action-button {
  display: inline-block;
  padding: 0.7rem 1rem;
  border: 1px solid #6d492b;
  border-radius: 0.25rem;
  background: #6d492b;
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.site-page .material-detail__action-link:visited {
  color: #fff;
}

.site-page .material-detail__action-link:hover,
.site-page .material-detail__action-button:hover {
  background: #543820;
  color: #fff;
  text-decoration: none;
}

.site-page .material-detail__action-link:focus-visible,
.site-page .material-detail__action-button:focus-visible {
  outline: 3px solid #8b5e32;
  outline-offset: 3px;
}

.site-page .material-detail__action-button:disabled {
  border-color: #8c8279;
  background: #8c8279;
  cursor: wait;
}

.site-page .material-detail__action-error {
  margin-top: 0.75rem;
  color: #8f261c;
  font-size: 0.9rem;
}

.site-page .material-detail__purchase-terms {
  max-width: 32rem;
  margin: 0.75rem 0 0;
  color: #625b54;
  font-size: 0.85rem;
}

.material-detail__action [aria-disabled="true"] {
  color: #736b63;
  font-size: 0.9rem;
}

.purchase-page {
  max-width: 42rem;
}

.purchase-status {
  padding-top: 1.5rem;
  border-top: 1px solid #bfae98;
}

.legal-page {
  max-width: 42rem;
}

.legal-page > article > section {
  padding-top: 1.5rem;
  border-top: 1px solid #d5c8b7;
}

.site-footer {
  box-sizing: border-box;
  display: flex;
  width: min(100% - 3rem, 70rem);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid #bfae98;
  color: #625b54;
  font-family: "DM Sans", sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer a {
  color: inherit;
  text-underline-offset: 0.2em;
}

@media (max-width: 50rem) {
  .catalog-section__header {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

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

}

@media (max-width: 36rem) {
  .catalog-page,
  .material-page {
    width: min(100% - 2rem, 42rem);
  }

  .material-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    width: min(100% - 2rem, 42rem);
    flex-direction: column;
    gap: 0.75rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .material-card article {
    transition: none;
  }

  .site-page__back-link::before {
    transition: none;
  }

  .site-page .paddle-price__skeleton {
    animation: none;
  }
}

@media (max-width: 30rem) {
  .site-page {
    width: min(100% - 1.5rem, 42rem);
    padding-top: 2rem;
  }
}
