/* Tutorial filtering and display styles */
/* Custom styles that complement Bootstrap 5 */

.tutorial-index {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Tutorial grid - CSS Grid for responsive auto-fill layout */
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

/* Tutorial card hover effects */
.tutorial-card {
  transition: transform 0.3s, box-shadow 0.3s;
}

.tutorial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Muted Wes Anderson-inspired color palette */

/* Tutorial card title - dark grey instead of bright red */
.tutorial-card .card-title a {
  color: #3d3d3d;
}

.tutorial-card .card-title a:hover {
  color: #5a5a5a;
}

/* Shared metadata-badge colours used by tutorial cards (tutorials/index.html)
   and the tutorial pages (_layouts/tutorial.html). */
.badge-workflow   { background-color: #9a8297; color: #fff; }  /* dusty mauve  */
.badge-package    { background-color: #6b8a9a; color: #fff; }  /* slate blue   */
.badge-domain     { background-color: #5f9ea0; color: #fff; }  /* cadet blue   */
.badge-deprecated { background-color: #8b8b8b; color: #fff; }  /* muted grey   */

/* Metadata badge shape on tutorial pages. */
.tutorial-badges .tag {
  display: inline-block;
  padding: 4px 8px;
  margin-right: 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* BEAST version badge */
.tutorial-card .badge.bg-secondary {
  background-color: #8b8b8b !important;
}

/* Prerequisites badge */
.tutorial-card .badge.bg-light {
  border: 1px solid #ddd;
}

/* Filter and sort button active state override */
[data-filter].active,
[data-sort].active {
  background-color: #6b8a9a;
  color: white;
  border-color: #6b8a9a;
}

/* Filter buttons that would leave no results */
[data-filter].filter-dead {
  opacity: 0.4;
}

/* Search mode toggle */
.btn-check:checked + .btn-outline-secondary {
  background-color: #6b8a9a;
  border-color: #6b8a9a;
  color: white;
}

/* Keyword chips */
.keyword-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  transition: all 0.2s;
}

.keyword-chip:hover {
  background-color: #6b8a9a;
  border-color: #6b8a9a;
  color: white;
}

/* Pagefind search customization */
#pagefind-search {
  min-height: 45px;
}

#pagefind-search .pagefind-ui__search-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 6px;
}

/* Pagefind results styling */
.pagefind-ui__result {
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.pagefind-ui__result-link {
  color: #3d3d3d;
  font-weight: 600;
}

.pagefind-ui__result-link:hover {
  color: #6b8a9a;
}

/* Deprecated tutorial cards - greyed out */
.tutorial-card--legacy {
  opacity: 0.55;
  border-left: 3px solid #aaa;
}

.tutorial-card--legacy:hover {
  opacity: 0.75;
}

/* Compact filter controls */
.bg-light .form-label {
  font-size: 0.85rem;
}

.bg-light .btn-sm.rounded-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
}

/* Search-mode toggle: chip font size, bold, tighter than the chips. */
.bg-light .search-mode-toggle .btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  /* Stretched to the search input's height by the flex row, so centre the label. */
  display: flex;
  align-items: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .tutorial-grid {
    grid-template-columns: 1fr;
  }

  [data-filter] {
    width: 100%;
  }
}

/* Clear button inside the search boxes */
#tutorial-search,
#fulltext-search {
  padding-right: 1.75rem;
}

.btn-clear-search {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 0.25rem;
  border: 0;
  background: none;
  line-height: 1;
  font-size: 1.1rem;
  font-weight: 700;
  color: #6c757d;
}

.btn-clear-search:hover {
  color: #3d3d3d;
}
