/* Search Box Form */
.tsacf-search-box {
  line-height: 1;
  position: relative;
  padding: 0;
  box-sizing: border-box;
}

.tsacf-search-box::after {
  content: '';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='%237259ef' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.7109 18.2891L15.2734 13.8516C16.4766 12.3984 17.1875 10.5469 17.1875 8.59375C17.1875 3.85156 13.3359 0 8.59375 0C3.85156 0 0 3.85156 0 8.59375C0 13.3359 3.85156 17.1875 8.59375 17.1875C10.5469 17.1875 12.3984 16.4766 13.8516 15.2734L18.2891 19.7109C18.4844 19.9062 18.7422 20 19 20C19.2578 20 19.5156 19.9062 19.7109 19.7109C20.0977 19.3242 20.0977 18.6758 19.7109 18.2891ZM8.59375 15.3125C4.88281 15.3125 1.875 12.3047 1.875 8.59375C1.875 4.88281 4.88281 1.875 8.59375 1.875C12.3047 1.875 15.3125 4.88281 15.3125 8.59375C15.3125 12.3047 12.3047 15.3125 8.59375 15.3125Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.tsacf-search-input {
  width: 100%;
  padding: 1rem 3.5rem 1rem 1.5rem;
  font-size: 1rem;
  line-height: 1.44444444;
  border: 1px solid #D5DCEF;
  border-radius: 0;
  background: #FFF;
  color: #221F54;
  font-family: "niveau-grotesk", system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tsacf-search-input:focus {
  border-color: #7259ef;
  box-shadow: 0 0 0 1px #7259ef;
}

.tsacf-search-input::placeholder {
  color: #535383;
  opacity: 0.7;
}

/* Root Layout */
.tsacf-results,
.tsacf-search-results {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 2rem;
}

/* Section Headings */
.tsacf-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #002b54;
  margin-bottom: 1rem;
  border-left: 4px solid #0073aa;
  padding-left: 0.75rem;
  text-transform: capitalize;
}

/* Grid of cards */
.tsacf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
  gap: 1.5rem;
}

/* Card */
.tsacf-hit {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease forwards;
  opacity: 0;
}

.tsacf-hit:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.08);
}

/* Thumbnail */
.tsacf-hit-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

/* Body */
.tsacf-hit-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Title */
.tsacf-hit-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.tsacf-hit-title a {
  font-weight: 600;
  color: #00548f;
  text-decoration: none;
}

.tsacf-hit-title a:hover {
  color: #002b54;
  text-decoration: underline;
}

/* Excerpt */
.tsacf-hit-excerpt {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
}

/* No results */
.tsacf-noresults {
  text-align: center;
  padding: 2rem;
  color: #666;
  font-size: 1rem;
}

/* Filter count */
.tsacf-filter-count {
  text-align: center;
  padding: 1rem;
  color: #555;
  font-size: 0.95rem;
  background: #f0f8ff;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* Fix layout for blog page when filtering */
.recent-resource-group.more-posts .more-post-item,
.more-posts .more-post-item,
.flexible-content-module-container--recent_resources .more-post-item {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 1.5rem !important;
  grid-column: auto !important;
}

.recent-resource-group.more-posts .more-post-item[style*="display: none"],
.more-posts .more-post-item[style*="display: none"],
.flexible-content-module-container--recent_resources .more-post-item[style*="display: none"] {
  display: none !important;
}

/* Loading State */
.tsacf-results.loading::after {
  content: 'Searching...';
  text-align: center;
  display: block;
  color: #777;
  font-style: italic;
  padding: 1rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
