.ppg-grid {
  display: grid;
  gap: 22px;
  align-items: start;
}
.ppg-grid.ppg-columns-1 { grid-template-columns: minmax(0, 1fr); }
.ppg-grid.ppg-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ppg-grid.ppg-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ppg-grid.ppg-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ppg-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #F5F1E8;
  border: 1px solid rgba(43,43,43,.14);
  padding: 18px;
  color: #2B2B2B;
}
.ppg-title {
  margin: 0 0 13px;
  color: #324B5A;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.18rem, 1.65vw, 1.5rem);
  line-height: 1.16;
}
.ppg-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
  overflow: hidden;
}
.ppg-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ppg-content {
  min-width: 0;
}

/* Details stays compact until needed. */
.ppg-details-wrap {
  margin: 0 0 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(43,43,43,.14);
}
.ppg-details-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6B4E3D;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.ppg-details-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.05em;
  font-size: 1.05em;
  line-height: 1;
}
.ppg-details {
  padding: 9px 0 1px;
  font-size: .92rem;
  line-height: 1.42;
}
.ppg-details ul {
  margin: 0;
  padding-left: 1.15rem;
}
.ppg-details li + li { margin-top: 3px; }
.ppg-details > :last-child { margin-bottom: 0; }

/* Professor's Notes is deliberately inset from the rest of the card. */
.ppg-notes {
  margin: 0 0 14px 10px;
  padding-left: 12px;
  border-left: 2px solid rgba(50,75,90,.35);
}
.ppg-section-label {
  margin-bottom: 4px;
  color: #324B5A;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ppg-take {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: .96rem;
  line-height: 1.48;
}
.ppg-take > :first-child { margin-top: 0; }
.ppg-take > :last-child { margin-bottom: 0; }

.ppg-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 2px 0 0;
}
.ppg-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid #324B5A;
  color: #324B5A;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
}
.ppg-link:hover,
.ppg-link:focus {
  background: #324B5A;
  color: #F5F1E8;
}
.ppg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}
.ppg-tag {
  font-size: .72rem;
  border: 1px solid rgba(107,78,61,.28);
  color: #6B4E3D;
  padding: 3px 6px;
  line-height: 1.15;
}
.ppg-empty { opacity: .72; }

/* Professor Perk */
.ppg-perk {
  max-width: 310px;
  margin: 4px auto 16px;
  padding: 14px 16px;
  border: 2px dashed rgba(191,75,68,.38);
  border-radius: 8px;
  background: #FBF7F4;
  text-align: center;
}
.ppg-perk-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
}
.ppg-perk-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23BF4B44' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41 13.41 20.59a2 2 0 0 1-2.82 0L3.41 13.41a2 2 0 0 1 0-2.82l7.18-7.18A2 2 0 0 1 12 3h7a2 2 0 0 1 2 2v7a2 2 0 0 1-.41 1.41Z'/%3E%3Ccircle cx='16.5' cy='7.5' r='1.35'/%3E%3C/svg%3E");
}
.ppg-perk-label {
  color: #BF4B44;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ppg-perk-copy {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  align-items: baseline;
  color: #2B2B2B;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: .98rem;
  line-height: 1.4;
}
.ppg-promo-code {
  color: #324B5A;
  font-family: inherit;
  font-size: 1em;
  font-style: normal;
  font-weight: 800;
}
.ppg-perk-expiration {
  margin-top: 3px;
  color: rgba(43,43,43,.72);
  font-size: .84rem;
  line-height: 1.35;
  text-align: center;
}
.ppg-perk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.ppg-copy-code,
.ppg-perk-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 8px 12px;
  border: 1px solid #324B5A;
  border-radius: 2px;
  background: #fff;
  color: #324B5A;
  font: inherit;
  font-size: .83rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.ppg-copy-code {
  background: #324B5A;
  color: #F5F1E8;
}
.ppg-copy-code:hover,
.ppg-copy-code:focus {
  background: #263b47;
  color: #F5F1E8;
}
.ppg-perk-link:hover,
.ppg-perk-link:focus {
  background: #324B5A;
  color: #F5F1E8;
}
.ppg-copy-code.ppg-copied {
  border-color: #324B5A;
  background: #263b47;
  color: #F5F1E8;
}

@media (max-width: 1100px) {
  .ppg-grid.ppg-columns-3,
  .ppg-grid.ppg-columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ppg-grid.ppg-columns-2,
  .ppg-grid.ppg-columns-3,
  .ppg-grid.ppg-columns-4 { grid-template-columns: 1fr; }
  .ppg-card { padding: 16px; }
  .ppg-media { aspect-ratio: 4 / 3; }
}

/* Compact reference-price row beneath the product image. */
.ppg-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(43,43,43,.14);
}
.ppg-meta-row .ppg-details-wrap {
  margin: 0;
  padding: 0;
  border-bottom: 0;
  flex: 1 1 auto;
}
.ppg-meta-row .ppg-details-empty {
  min-width: 0;
}
.ppg-reference-price {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
  color: #2B2B2B;
  line-height: 1.1;
  text-align: right;
}
.ppg-reference-price-label {
  margin-right: 4px;
  opacity: .62;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: .84rem;
  font-style: italic;
  font-weight: 400;
}
.ppg-reference-price-value {
  color: #324B5A;
  font-size: .98rem;
  font-weight: 800;
}
.ppg-meta-row + .ppg-details {
  margin: -2px 0 12px;
  padding: 1px 0 9px;
  border-bottom: 1px solid rgba(43,43,43,.14);
}
