/* Heart & Humor Ebooks — matches demo grid */

.hhe-ebooks-wrap {
  --hhe-color-bg: #faf6f3;
  --hhe-color-section: #f3ebe6;
  --hhe-color-main: #9c3d4a;
  --hhe-color-border: #e5ddd6;
  --hhe-cols: 4;
  --hhe-radius: 12px;
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--hhe-color-main);
}

.hhe-section-header {
  margin-bottom: 1.75rem;
}

.hhe-section-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--hhe-color-main);
}

.hhe-section-desc {
  margin: 0;
  max-width: 34rem;
  opacity: 0.8;
  line-height: 1.6;
}

.hhe-ebook-grid {
  display: grid;
  grid-template-columns: repeat(var(--hhe-cols), 1fr);
  gap: 1.25rem;
}

.hhe-ebook-card {
  background: var(--hhe-color-bg);
  border: 1px solid var(--hhe-color-border);
  border-radius: var(--hhe-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.hhe-ebook-card:hover {
  transform: translateY(-2px);
  border-color: var(--hhe-color-main);
}

.hhe-ebook-card--collection,
.hhe-ebook-card--view-all {
  border-color: var(--hhe-color-main);
}

.hhe-ebook-cover--view-all:not(.hhe-ebook-cover--has-image) {
  background: var(--hhe-color-main);
  opacity: 0.9;
}

.hhe-ebook-cover {
  height: 130px;
  background: var(--hhe-color-main);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.75rem;
  background-size: cover;
  background-position: center;
  position: relative;
}

.hhe-ebook-cover--has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
}

.hhe-ebook-format,
.hhe-ebook-badge {
  position: relative;
  z-index: 1;
}

.hhe-ebook-format {
  background: var(--hhe-color-bg);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--hhe-color-main);
  border: 1px solid var(--hhe-color-border);
}

.hhe-ebook-badge--premium {
  background: var(--hhe-color-main);
  color: var(--hhe-color-bg);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.hhe-ebook-body {
  padding: 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hhe-ebook-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  line-height: 1.25;
  color: var(--hhe-color-main);
}

.hhe-ebook-desc {
  font-size: 0.88rem;
  opacity: 0.8;
  margin: 0 0 1rem;
  flex: 1;
  line-height: 1.5;
}

.hhe-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--hhe-color-main);
  border: 1px solid var(--hhe-color-border);
  background: var(--hhe-color-bg);
  transition: border-color 0.2s, background 0.2s;
  width: fit-content;
}

.hhe-btn:hover {
  border-color: var(--hhe-color-main);
  color: var(--hhe-color-main);
  opacity: 1;
}

.hhe-btn--primary {
  background: var(--hhe-color-main);
  color: var(--hhe-color-bg) !important;
  border-color: var(--hhe-color-main);
}

.hhe-btn--primary:hover {
  opacity: 0.9;
  color: var(--hhe-color-bg) !important;
}

.hhe-no-ebooks {
  opacity: 0.8;
}

/* Inline --hhe-cols on the wrapper wins over variable-only rules; override grid directly. */
@media (max-width: 900px) {
  .hhe-ebook-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .hhe-ebook-grid {
    grid-template-columns: 1fr;
  }

  .hhe-section-title {
    font-size: 1.85rem;
  }
}
