
body {
  background-color: #f8f5f1;
  color: #3b2c2c;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-weight: 400;
}

h1, h2, h3 {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  letter-spacing: 0.01em;
}

.navbar-brand strong {
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.04em;
}

.btn.btn-primary,
.btn.btn-secondary,
.btn.btn-light {
  font-weight: 600;
}

.nav-link i,
.btn i {
  font-size: 0.95em;
}
/* Header: light style; brand stays visible */
.navbar .navbar-brand img { image-rendering: -webkit-optimize-contrast; }
.hero-section {
  background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
              url('/static/img/tractor-bg.jpg') center/cover no-repeat;
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}
.hero-section h1 {
  font-size: 2.5rem;
}
.search-bar input {
  border-radius: 25px;
  padding: 0.75rem 1.5rem;
  border: 1px solid #ddd;
}
.cta-section {
  background-color: #ffcc33; /* Corn yellow */
  padding: 2rem 0;
  text-align: center;
}
footer {
  background-color: #3b2c2c; /* Dirt brown */
  color: #eee;
  padding: 2rem 0;
}
footer a {
  color: #ffcc33;
  text-decoration: none;
}

/* Ensure book grid cards align and look consistent */
.book-cover {
  height: 200px;
  object-fit: cover;
}

/* Clamp long descriptions to 3 lines for uniform heights */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pinterest-style Masonry using CSS columns */
.masonry {
  column-gap: 1.5rem; /* match Bootstrap g-4 */
  column-count: 1;
}
@media (min-width: 576px) {
  .masonry { column-count: 2; }
}
@media (min-width: 992px) {
  .masonry { column-count: 3; }
}
@media (min-width: 1400px) {
  .masonry { column-count: 4; }
}
.masonry-item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 1.5rem; /* vertical gutter */
}

/* Slightly longer clamp for masonry to allow variation */
.line-clamp-6 {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* HTMX indicator visibility */
.htmx-indicator { display: none; }
.htmx-indicator.htmx-request { display: inline-block; }

/* Improve card visuals */
.card {
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

/* Keep cover images consistent without layout shifts */
.card-img-top {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background-color: #f3f3f3;
}

/* Show full cover (letterboxed) on hover */
.card:hover .card-img-top {
  object-fit: contain;
  background-color: #fff;
}

/* Mobile: show a toggle to view full cover without hover */
.cover-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  z-index: 2;
  padding: .25rem .5rem;
  line-height: 1;
}
@media (hover: none) and (pointer: coarse) {
  .cover-toggle { display: inline-flex; }
  .card:focus-within .card-img-top { object-fit: contain; background-color: #fff; }
}
