/* Native React layout corrections. This file only styles existing elements. */

/* Homepage footer: explicit placement for all React-rendered children. */
footer#contact {
  min-height: 220px;
  padding: 48px 7vw 34px;
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(260px, 1.25fr) minmax(250px, auto);
  grid-template-areas:
    "brand title links"
    "brand body links"
    "copyright copyright links";
  column-gap: clamp(34px, 5vw, 84px);
  row-gap: 10px;
  align-items: start;
  background-position: center;
  background-size: cover;
}

footer#contact > .logo {
  grid-area: brand;
  align-self: start;
  justify-self: start;
  margin: 0;
  text-align: left;
}

footer#contact > p {
  grid-area: title;
  margin: 2px 0 0;
  max-width: 520px;
  color: var(--ivory);
  font-size: 16px;
  line-height: 1.55;
}

footer#contact > span {
  grid-area: body;
  display: block;
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

footer#contact > div {
  grid-area: links;
  min-width: 250px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 22px;
}

footer#contact > div button,
footer#contact > div a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  color: var(--ivory);
  font: 600 12px/1.3 Manrope, sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

footer#contact > div button:hover,
footer#contact > div a:hover,
footer#contact > div button:focus-visible,
footer#contact > div a:focus-visible {
  color: var(--saffron);
  outline: none;
}

footer#contact > small {
  grid-area: copyright;
  align-self: end;
  margin-top: 18px;
  color: var(--muted);
}

/* Compact catalogue proportions. Prevent a single item becoming a wide banner. */
.work-section .book-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 640px)) !important;
  justify-content: start;
  align-items: start;
  gap: 26px;
}

.work-section .book-card {
  width: min(100%, 640px) !important;
  max-width: 640px !important;
  min-height: 360px !important;
  grid-template-columns: 215px minmax(0, 1fr) !important;
  align-items: stretch;
  overflow: hidden;
}

.work-section .book-card > img,
.work-section .book-card > .book-cover-fallback {
  width: 100%;
  height: 360px !important;
  min-height: 360px !important;
  max-height: 360px !important;
  object-fit: cover;
  object-position: center 18%;
}

.work-section .book-card > div:last-child {
  min-height: 360px !important;
  padding: 23px 24px !important;
}

.work-section .book-card h3 {
  margin: 4px 0 9px;
  font-size: clamp(25px, 2vw, 31px);
}

.work-section .book-card > div:last-child > p:not(.eyebrow) {
  -webkit-line-clamp: 5 !important;
  line-clamp: 5 !important;
}

.work-section .book-card .keyword-chips {
  max-height: 54px;
  margin: 12px 0 14px;
}

.work-section .book-card .keyword-chips span:nth-child(n + 6) {
  display: none;
}

.work-section .play-event-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 420px)) !important;
  justify-content: start;
  align-items: stretch;
  gap: 24px;
}

.work-section .play-event-card {
  width: min(100%, 420px);
  max-width: 420px;
  min-height: 340px;
  padding: 28px !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.work-section .play-event-card > p:not(.eyebrow) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
}

.work-section .play-event-card .button {
  margin-top: auto;
}

@media (max-width: 860px) {
  footer#contact {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "title"
      "body"
      "links"
      "copyright";
    gap: 12px;
    padding: 42px 24px 30px;
  }

  footer#contact > div {
    min-width: 0;
    margin-top: 8px;
    justify-content: flex-start;
  }

  footer#contact > small {
    margin-top: 16px;
  }
}

@media (max-width: 700px), (pointer: coarse) and (max-width: 1200px) {
  .work-section .book-grid,
  .work-section .play-event-grid {
    grid-template-columns: 1fr !important;
  }

  .work-section .book-card {
    width: min(100%, 430px) !important;
    max-width: 430px !important;
    grid-template-columns: 1fr !important;
  }

  .work-section .book-card > img,
  .work-section .book-card > .book-cover-fallback {
    height: min(76vw, 330px) !important;
    min-height: 250px !important;
    max-height: 330px !important;
  }

  .work-section .book-card > div:last-child {
    min-height: 0 !important;
    padding: 21px 19px 20px !important;
  }

  .work-section .book-card .button,
  .work-section .play-event-card .button {
    width: 100%;
    justify-content: center;
  }

  .work-section .play-event-card {
    width: min(100%, 430px);
    max-width: 430px;
    min-height: 0;
    padding: 23px 20px !important;
  }
}
