/* Shelf: manila catalog cards, typed quotes */

.catalog {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  align-items: start;
  gap: 3.5rem clamp(1.25rem, 2.5vw, 2rem);
  max-width: 76rem;
  margin: 0;
  padding: 3.5rem 0 0;
  list-style: none;
}
.card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 14.5rem;
  padding: 0 1rem 1.1rem;
  border: 2px solid #4a1410;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 1.6rem, rgb(178 34 34 / 0.35) 1.6rem 1.7rem, transparent 1.7rem),
    repeating-linear-gradient(180deg, transparent 0 1.55rem, rgb(74 20 16 / 0.14) 1.55rem 1.62rem),
    #fbe8c4;
  box-shadow: 0 14px 24px -16px rgb(74 20 16 / 0.7);
  transform: rotate(var(--tilt, 0deg));
  font-family: var(--type);
  color: #3a100c;
}
.card:nth-child(odd) {
  --tilt: -1deg;
}
.card:nth-child(3n) {
  --tilt: 1.2deg;
}
.card-cover {
  justify-self: center;
  width: 58%;
  margin-top: -2.75rem;
  margin-bottom: 1rem;
  transition: transform 0.4s var(--ease-out);
}
.card-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 12px 20px -10px rgb(0 0 0 / 0.6);
}
.card:hover .card-cover {
  transform: translateY(-10px) rotate(-2deg);
}
.card h2 {
  font-family: var(--type);
  font-stretch: normal;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.3;
  color: #3a100c;
  letter-spacing: 0;
}
.card p {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  line-height: 1.35;
}

.shelf-lower {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  align-items: start;
  gap: 2.5rem clamp(2.5rem, 6vw, 6rem);
  max-width: 84rem;
  margin-top: clamp(4rem, 12vh, 7rem);
}
.plan {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1.25rem 1.2rem;
  box-shadow: 0 14px 24px -16px rgb(74 20 16 / 0.7);
  transform: rotate(1deg);
  border: 2px solid #4a1410;
  border-radius: 6px;
  background: #fff4dc;
  font-family: var(--type);
  color: #3a100c;
}
.plan h2 {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgb(74 20 16 / 0.3);
  font-family: var(--type);
  font-stretch: normal;
  font-weight: 700;
  font-size: 1.15rem;
  color: #3a100c;
  letter-spacing: 0;
}
.plan p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.quotes {
  display: grid;
  gap: 1.5rem;
}
.quote {
  margin: 0;
  min-height: 8.5em;
  font-family: var(--type);
  font-size: clamp(1.3rem, 1rem + 1.3vw, 2.15rem);
  line-height: 1.35;
  color: #3a100c;
}
.quote p {
  display: inline;
  margin: 0;
  max-width: none;
}
.quote p::before {
  content: "“";
}
.quote p::after {
  content: "”";
}
.quote p:empty::before,
.quote p:empty::after {
  content: none;
}
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.15em;
  vertical-align: -0.15em;
  background: var(--oxblood);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.quote footer {
  margin-top: 1rem;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--oxblood);
  min-height: 1.5em;
}
.quote-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
}
.quote-nav button {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 2px solid var(--oxblood);
  border-radius: 50%;
  background: transparent;
  color: var(--oxblood);
  font-family: var(--type);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.quote-nav button:hover {
  background: var(--oxblood);
  color: var(--manila);
}
.quote-count {
  min-width: 3.5rem;
  font-family: var(--type);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .shelf-lower {
    grid-template-columns: 1fr;
  }
  .quote {
    min-height: 11em;
  }
}
@media (prefers-reduced-motion: reduce) {
  .caret {
    animation: none;
  }
}
