/* Global design tokens — Figma/Webflow variables */
/* Import this file once at the app entry point (index.css or index.js) */
/* All component CSS files can reference these variables freely */

:host {
  /* Colors */
  --text-color-primary: #252525;
  --text-color-secondary: #666666;
  --text-color-link1: #d5332a;
  --text-color-link2: #23327b;
  --text-color-white: #ffffff;
  --background-color-white: #ffffff;
  --background-color-gray-light: #f5f5f5;
  --background-color-red: #d5332a;
  --background-color-navy-dark: #16223b;
  --border-color-gray-light: #c4c4c4;
  --border-color-red: #d5332a;
  --border-color-brown: #847c79;
  --border-color-navy: #23327b;

  /* Typography — Families */
  --font-family-body-primary: 'Lato', sans-serif;
  --font-family-body-secondary: 'Merriweather', serif;
  --font-family-heading: 'Playfair Display', serif;

  /* Typography — Sizes */
  --text-size-tiny: 11px;
  --text-size-small: 12px;
  --text-size-normal: 14px;
  --text-size-large: 19px;
  --heading-style-h4: 25px;
  --heading-style-h6: 15px;

  /* Typography — Weights */
  --font-weight-regular: 400;
  --font-weight-xbold: 800;

  /* Typography — Line heights */
  --line-height-tiny: 16px;
  --line-height-small: 18px;
  --line-height-normal: 21px;
  --line-height-large: 40px;
  --line-height-h4: 39px;

  /* Typography — Letter spacing */
  --letter-spacing-medium: 2px;

  /* Spacing */
  --space-tiny: 2px;
  --space-xxxsmall: 4px;
  --space-xxsmall: 8px;
  --space-xsmall: 16px;
  --space-small: 20px;
  --space-medium: 24px;
  --space-large: 32px;
  --padding-section-large: 96px;
  --padding-global: 144px;

  /* Container widths */
  --container-large: 1440px;
  --container-medium: 960px;
  --container-xxsmall: 273px;
}

/* Responsive token overrides */
@media (max-width: 767px) {
  :host {
    --padding-global: 16px;
    --padding-section-large: 48px;
  }
}

/* SearchPage component styles */

/* Layout Classes */
.search-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-family-body-primary);
}

.padding-global {
  padding-left: var(--padding-global);
  padding-right: var(--padding-global);
}

.container-large {
  max-width: var(--container-large);
  width: 100%;
  margin: 0 auto;
}

.container-medium {
  max-width: var(--container-medium);
  width: 100%;
  margin: 0 auto;
}

.padding-section-large {
  padding-top: var(--padding-section-large);
  padding-bottom: var(--padding-section-large);
}

.search-grid-component {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-small);
  align-items: flex-start;
  width: 100%;
}

/* Sidebar / Facets */
.search-facets {
  display: flex;
  flex-direction: column;
  gap: var(--space-large);
  padding: var(--space-medium);
  background-color: var(--background-color-gray-light);
  max-width: var(--container-xxsmall);
  min-width: 200px;
  flex: 1 0 0;
}

.search-facets-title {
  font-family: var(--font-family-body-secondary);
  font-size: var(--text-size-large);
  font-weight: var(--font-weight-xbold);
  line-height: var(--line-height-large);
  color: var(--text-color-primary);
  margin: 0;
}

.search-facets-search {
  width: 100%;
}

.search-facets-section-title {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-small);
  font-weight: var(--font-weight-xbold);
  line-height: var(--line-height-small);
  color: var(--text-color-primary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-medium);
  margin: 0 0 var(--space-xxsmall) 0;
}

.search-facets-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xsmall);
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-facets-item {
  display: flex;
  align-items: center;
  width: 100%;
}

.search-facets-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-small);
  line-height: var(--line-height-small);
  color: var(--text-color-primary);
  text-align: left;
}

.search-facets-button.is-active {
  font-weight: var(--font-weight-xbold);
  color: var(--text-color-link2);
}

/* Main Content Area */
.search-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-medium);
  flex: 1 0 0;
  min-width: 0;
  width: 100%;
}

.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xsmall);
}

.search-results-count {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-small);
  line-height: var(--line-height-small);
  color: var(--text-color-secondary);
}

/* Sort Dropdown */
.search-sort-container {
  position: relative;
  min-height: 44px;
  border-bottom: 1px solid var(--border-color-brown);
  width: var(--container-xxsmall);
  max-width: 100%;
}

/* Native select sits on top of the entire container, invisible but clickable.
   Owns all pointer events so chevron, label, and value are part of the hit area. */
.search-sort-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: var(--space-xxsmall) var(--space-small);
  border: none;
  background: transparent;
  color: transparent;
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  letter-spacing: 0.8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  z-index: 1;
}

.search-sort-select:focus {
  outline: none;
}

/* Windows/Chromium inherit color:transparent into the open dropdown, hiding option text. */
.search-sort-select option {
  color: var(--text-color-primary);
  background-color: var(--background-color-white);
}

/* Visible presentation layer — non-interactive so clicks pass to the select. */
.search-sort-display {
  display: flex;
  align-items: center;
  gap: var(--space-xxsmall);
  min-height: 44px;
  padding: var(--space-xxsmall) var(--space-small);
  pointer-events: none;
}

.search-sort-select:focus-visible + .search-sort-display {
  outline: 2px solid var(--text-color-link2);
  outline-offset: 2px;
}

.search-sort-label {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  letter-spacing: 0.8px;
  color: var(--text-color-secondary);
  white-space: nowrap;
}

.search-sort-value {
  flex: 1 0 0;
  min-width: 0;
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  letter-spacing: 0.8px;
  color: var(--text-color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-sort-chevron {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--text-color-primary);
}

/* Content Cards */
.search-results-list {
  display: flex;
  flex-direction: column;
}

.related-content-card {
  display: flex;
  gap: var(--space-small);
  align-items: flex-start;
  padding: var(--space-small) 0;
  border-bottom: 1px solid var(--border-color-gray-light);
  min-width: 100px;
}

/* Clickable card link */
a.related-content-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

a.related-content-card-link:hover {
  background-color: var(--background-color-gray-light);
}

a.related-content-card-link:hover .related-content-card-title {
  text-decoration: underline;
}

.related-content-card-image-wrapper {
  display: flex;
  flex: 1 0 0;
  max-width: 120px;
  min-width: 80px;
  align-items: flex-start;
}

.related-content-card-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.related-content-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxsmall);
  flex: 1 0 0;
  min-width: 216px;
}

.related-content-card-type {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-tiny);
  font-weight: var(--font-weight-xbold);
  line-height: var(--line-height-tiny);
  color: var(--text-color-link1);
  text-transform: uppercase;
  margin: 0;
}

.related-content-card-title {
  font-family: var(--font-family-heading);
  font-size: var(--heading-style-h4);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-h4);
  color: var(--text-color-primary);
  margin: 0;
}


.related-content-card-authors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xxsmall);
  align-items: center;
}

.button-tertiary {
  display: inline-flex;
  gap: var(--space-xxsmall);
  align-items: center;
  justify-content: center;
  padding: var(--space-tiny) var(--space-xxxsmall);
  background: none;
  border: none;
  cursor: pointer;
}

.button-tertiary-label {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-xbold);
  line-height: var(--line-height-normal);
  color: var(--text-color-link1);
  text-transform: uppercase;
  letter-spacing: 0;
}

.related-content-card-location {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-small);
  font-weight: var(--font-weight-xbold);
  line-height: var(--line-height-small);
  color: var(--text-color-secondary);
}

.related-content-card-description {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-small);
  color: var(--text-color-secondary);
  margin: 0;
}

/* Pagination */
.numbered-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-small) 0;
}

.pagination-items {
  display: flex;
  align-items: center;
}

.pagination-page-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: var(--space-xxxsmall);
  background-color: var(--background-color-white);
  border: 1px solid var(--border-color-red);
  border-left: none;
  cursor: pointer;
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-small);
  line-height: var(--line-height-small);
  color: var(--text-color-secondary);
}

.button-no-interaction {
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-page-item:first-child {
  border-left: 1px solid var(--border-color-red);
}

.pagination-page-item.is-active {
  background-color: var(--background-color-red);
  color: var(--text-color-white);
}

.pagination-page-item:hover:not(.is-active) {
  background-color: var(--background-color-gray-light);
}

.button-outline-small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxsmall);
  height: 44px;
  padding: var(--space-xxsmall) var(--space-xsmall);
  border: 1px solid var(--border-color-red);
  background-color: var(--background-color-white);
  cursor: pointer;
}

.button-outline-small:hover {
  background-color: var(--background-color-gray-light);
}

.button-outline-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-outline-small-label {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-xbold);
  line-height: var(--line-height-normal);
  color: var(--text-color-link1);
  text-align: center;
}

/* Search Input */
.search-input-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxsmall);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-icon {
  position: absolute;
  left: var(--space-xsmall);
  color: var(--text-color-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-xsmall);
  padding-left: 44px;
  border: 1px solid var(--border-color-gray-light);
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  line-height: var(--line-height-normal);
  color: var(--text-color-primary);
  background-color: var(--background-color-white);
}

.search-input:focus {
  outline: 2px solid var(--border-color-red);
  outline-offset: -2px;
}

.search-input::placeholder {
  color: var(--text-color-secondary);
}

/* Search Input Clear Button */
.search-input-clear {
  display: none;
  position: absolute;
  right: 0;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-color-primary);
}

.search-input-clear:hover {
  color: var(--text-color-link1);
}

.search-input-clear svg {
  width: 24px;
  height: 24px;
}

/* Tags */
.search-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xxsmall);
}

.search-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xxxsmall);
  padding: var(--space-xxxsmall) var(--space-xxsmall);
  background-color: var(--background-color-gray-light);
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-small);
  line-height: var(--line-height-small);
  color: var(--text-color-primary);
}

.search-tag-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-color-secondary);
  font-size: 14px;
  line-height: 1;
}

.search-tag-close:hover {
  color: var(--text-color-link1);
}

/* Loading and Error States */
.search-loading,
.search-error,
.search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  text-align: center;
  gap: var(--space-xsmall);
}

.search-loading {
  color: var(--text-color-secondary);
}

.search-error {
  color: var(--text-color-link1);
}

.search-no-results {
  color: var(--text-color-secondary);
}

/* Mobile Refine Button - Hidden on desktop */
.refine-mobile-button {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxsmall);
  width: 100%;
  min-height: 44px;
  padding: var(--space-xxsmall) var(--space-small);
  border: 2px solid var(--border-color-navy);
  background-color: transparent;
  cursor: pointer;
  font-family: var(--font-family-body-primary);
}

.refine-mobile-button:hover {
  background-color: rgba(35, 50, 123, 0.05);
}

.refine-mobile-button-icon {
  display: none; /* Hide icon per design */
}

.refine-mobile-button-label {
  font-family: var(--font-family-body-primary);
  font-size: 16px;
  font-weight: var(--font-weight-xbold);
  line-height: 25px;
  color: var(--text-color-link2);
  text-align: center;
}

/* Refine Modal - Fullscreen Drawer */
.refine-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  overflow: hidden;
}

/* Refine Modal - Fullscreen Drawer */
.refine-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background-color: var(--background-color-gray-light);
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
}

.refine-modal.is-closing {
  animation: slideDown 0.25s ease-in forwards;
}

.refine-modal-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-medium);
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xsmall);
  padding-bottom: 100px; /* Space for footer */
}

/* Modal Header */
.refine-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: var(--space-xsmall);
}

.refine-modal-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-color-primary);
}

.refine-modal-title {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-xbold);
  line-height: 30px;
  color: var(--text-color-primary);
}

.refine-modal-reset {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-family-body-primary);
  font-size: 13px;
  font-weight: var(--font-weight-xbold);
  line-height: 20px;
  color: var(--text-color-link1);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.refine-modal-reset:hover {
  text-decoration: underline;
}

/* Modal Sections */
.refine-modal-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxsmall);
  width: 100%;
}

.refine-modal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xsmall);
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.refine-modal-section-title {
  flex: 1;
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-xbold);
  line-height: 30px;
  color: var(--text-color-primary);
  text-align: left;
}

.refine-modal-chevron {
  color: var(--text-color-primary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.refine-modal-chevron.is-expanded {
  transform: rotate(180deg);
}

.refine-modal-section-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Radio Items */
.refine-modal-radio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xsmall);
  min-height: 44px;
  padding: 12px var(--space-xxsmall);
  border-bottom: 1px solid var(--border-color-gray-light);
  cursor: pointer;
}

.refine-modal-radio-label {
  flex: 1;
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-small);
  color: var(--text-color-primary);
}

.refine-modal-radio-label.is-active {
  font-weight: var(--font-weight-xbold);
  color: var(--text-color-link2);
}

.refine-modal-radio {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color-brown);
  border-radius: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
}

.refine-modal-radio.is-selected {
  border: 1px solid var(--border-color-brown);
}

.refine-modal-radio-dot {
  width: 10px;
  height: 10px;
  background-color: var(--text-color-link2);
  border-radius: 50%;
}

/* Modal Footer */
.refine-modal-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-medium) var(--space-xsmall);
  background-color: var(--background-color-gray-light);
  box-shadow: 0 -8px 19px rgba(130, 130, 130, 0.2);
  z-index: 1001;
}

.refine-modal-apply {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxsmall);
  width: 100%;
  min-height: 44px;
  padding: var(--space-xxsmall) var(--space-xxsmall);
  border: none;
  background-color: #16223b;
  cursor: pointer;
  font-family: var(--font-family-body-primary);
  font-size: 13px;
  font-weight: var(--font-weight-xbold);
  line-height: 20px;
  color: var(--text-color-white);
  text-align: center;
}

.refine-modal-apply:hover {
  background-color: #1a2a4a;
}

/* Visually hidden for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .search-grid-component {
    flex-direction: column;
  }

  .search-facets {
    max-width: 100%;
    min-width: 100%;
  }

  /* Show mobile refine button, hide desktop sidebar */
  .refine-mobile-button {
    display: flex;
  }

  .search-facets {
    display: none;
  }

  /* Hide desktop sort dropdown on mobile */
  .search-sort-container {
    display: none;
  }

  .search-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Mobile Search Input - bottom border only */
  .search-input-wrapper {
    border-bottom: 1px solid var(--border-color-brown);
  }

  .search-input {
    border: none;
    border-radius: 0;
    padding: var(--space-xxsmall) var(--space-small);
    padding-left: 40px;
    padding-right: 40px;
    min-height: 44px;
  }

  .search-input:focus {
    outline: none;
    border-bottom-color: var(--text-color-link2);
  }

  .search-input-icon {
    left: 0;
  }

  /* Show clear button on mobile */
  .search-input-clear {
    display: flex;
  }

  .related-content-card {
    flex-direction: column;
  }

  .related-content-card-image-wrapper {
    max-width: 100%;
    min-width: 100%;
  }

  .related-content-card-content {
    min-width: 100%;
  }

  /* Adjust card title size on mobile */
  .related-content-card-title {
    font-size: 20px;
    line-height: 28px;
  }
}

/* ========================================
   Authors Layout (collection="authors")
   ======================================== */

/* Mobile search — hidden on desktop, shown on mobile */
.authors-mobile-search {
  display: none;
  margin-bottom: var(--space-medium);
}

/* Authors Grid — 4 columns on desktop */
.authors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-large) var(--space-medium);
}

/* Author Card */
.author-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-xxsmall);
}

a.author-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.author-card-link:hover .author-card-name {
  color: var(--text-color-link1);
}

a.author-card-link:hover .author-card-image {
  transform: scale(1.1);
}

.author-card-image-wrapper {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
}

.author-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.author-card-image-placeholder {
  background-color: var(--background-color-gray-light);
}

.author-card-name {
  font-family: var(--font-family-heading);
  font-size: var(--heading-style-h6);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--text-color-primary);
  margin: 0;
  padding-top: var(--space-xxsmall);
}

/* Authors responsive: Tablet */
@media (max-width: 991px) {
  .authors-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Authors responsive: Mobile */
@media (max-width: 767px) {
  .authors-mobile-search {
    display: block;
  }

  .authors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-medium) var(--space-xsmall);
  }

  .author-card-name {
    font-size: var(--text-size-normal);
  }
}

/* ========================================
   Books Layout (collection="books")
   ======================================== */

.book-facets-section-title {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-xbold);
  line-height: 25px;
  color: var(--text-color-primary);
  margin: 0 0 var(--space-xxsmall) 0;
}

.book-facets-see-all {
  align-self: flex-start;
  margin-top: var(--space-xsmall);
  padding: var(--space-tiny) var(--space-xxxsmall);
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-xbold);
  line-height: var(--line-height-normal);
  color: var(--text-color-link1);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.book-facets-see-all:hover {
  text-decoration: underline;
}

/* Active filter chips above the grid */
.books-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-medium);
  min-height: 44px;
  width: 100%;
}

.books-active-filters-list {
  display: flex;
  flex: 1 0 0;
  min-width: 0;
  flex-wrap: wrap;
  gap: var(--space-xxsmall);
  align-items: center;
}

.books-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xsmall);
  padding: var(--space-xxsmall);
  background-color: var(--background-color-gray-light);
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  line-height: var(--line-height-normal);
  color: var(--text-color-primary);
  letter-spacing: 0.8px;
}

.books-filter-chip-label {
  white-space: nowrap;
}

.books-filter-chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-color-primary);
}

.books-filter-chip-close:hover {
  color: var(--text-color-link1);
}

.books-clear-filters {
  padding: var(--space-tiny) var(--space-xxxsmall);
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  line-height: var(--line-height-normal);
  color: var(--text-color-link1);
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.books-clear-filters:hover {
  text-decoration: underline;
}

/* Books Grid — 4 columns on desktop */
.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-large) var(--space-small);
  width: 100%;
}

/* Book Card */
.book-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxsmall);
  padding: 0 var(--space-xsmall);
  min-width: 0;
}

.book-card-image-link {
  display: block;
  width: 100%;
  overflow: hidden;
  text-decoration: none;
}

.book-card-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

a.book-card-image-link:hover .book-card-image {
  transform: scale(1.03);
}

.book-card-image-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: var(--background-color-gray-light);
}

.book-card-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xsmall);
  width: 100%;
}

.book-card-title {
  font-family: var(--font-family-heading);
  font-size: 20px;
  font-weight: var(--font-weight-regular);
  line-height: 34px;
  color: var(--text-color-primary);
  margin: 0;
}

.book-card-title-link {
  color: inherit;
  text-decoration: none;
}

.book-card-title-link:hover {
  text-decoration: underline;
}

.book-card-description {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--text-color-secondary);
  letter-spacing: 0.8px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-author {
  font-family: var(--font-family-body-primary);
  font-size: var(--text-size-normal);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--text-color-secondary);
  letter-spacing: 0.8px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxsmall);
  padding: var(--space-xxsmall) var(--space-small);
  border: 2px solid var(--border-color-red);
  background-color: transparent;
  cursor: pointer;
  text-decoration: none;
}

.book-card-button:hover {
  background-color: rgba(213, 51, 42, 0.08);
}

.book-card-button-label {
  font-family: var(--font-family-body-primary);
  font-size: 16px;
  font-weight: var(--font-weight-xbold);
  line-height: 25px;
  color: var(--text-color-link1);
  text-align: center;
}

/* Books mobile checkbox (in refine modal) */
.book-modal-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color-brown);
  background-color: transparent;
  flex-shrink: 0;
  box-sizing: border-box;
  color: var(--text-color-white);
}

.book-modal-checkbox.is-checked {
  background-color: var(--border-color-navy);
  border-color: var(--border-color-navy);
}

/* Books responsive: Tablet */
@media (max-width: 991px) {
  .books-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Books responsive: Mobile */
@media (max-width: 767px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-medium) var(--space-xsmall);
  }

  .book-card {
    padding: 0;
  }

  .book-card-title {
    font-size: 18px;
    line-height: 28px;
  }

  .books-active-filters {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xsmall);
  }
}

