/* Fieldset container */
#rk-search-form {
  display: flex;
  flex-direction: column;
  row-gap: 20px;
  width: 60%;
}

.rk-fieldset {
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  position: relative;
  transition: border-color 0.3s ease;
  background: #fff;
}

.rk-fieldset:focus-within {
  box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}

/* Input wrapper */
.rk-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.rk-input-wrapper input {
  width: 100%;
  padding: 6px 4px 6px 0;
  font-size: 1rem;
  border: none;
  background: transparent;
  outline: none;
  color: #233963;
}

/* Legend base */
.rk-input-wrapper legend {
  position: absolute;
  top: 50%;
  left: 0;
  font-size: 1rem;
  font-weight: 200;
  color: #233963;
  transform: translateY(-50%);
  pointer-events: none;
  transition: all 0.2s ease;
  background: #fff;
  padding: 0 0.5rem;
}

/* Bump size + color when input focused */
.rk-fieldset:focus-within legend {
  font-size: 1.5rem;
  color: #233963;
}

/* Floating effect when input is focused or has text */
.rk-input-wrapper input:focus + legend,
.rk-input-wrapper input:not(:placeholder-shown) + legend {
  top: -15px;
  font-size: 1.2rem;
  font-weight: 300;
  color: #1E2E4C;
  border-radius: 20px;
  padding: 0 6px;
  overflow: hidden;
}

/* Filter Group Layout */
.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Filter Buttons Container */
.rk-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Individual Filter Button */
.rk-filter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.85rem;
  background: #f1f5f9;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.rk-filter-btn input {
  display: none;
}

.rk-filter-btn span {
  transition: all 0.2s ease;
  color: #333;
}

/* Hover effect */
.rk-filter-btn:hover {
  background-color: #e2e8f0;
  border-color: #0073aa;
}

/* Checked state style */
.rk-filter-btn input:checked + span {
  background-color: #0073aa;
  color: #fff;
  border-radius: 4px;
  padding: 4px 10px;
}

/* Card Container */
#rk-search-results {
  display: flex !important;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 20px;
  justify-content: flex-start;
}

/* Individual Card Link */
.rksf-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;
  max-width: 48%;
  border: 1px solid #e1e7ec;
  border-radius: 12px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Image Container */
.rksf-card-img {
  flex-shrink: 0;
  width: 160px;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid #eee;
}

.rksf-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Text Content */
.rksf-card-content {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.rk-card-title {
  font-weight: bold;
  color: #1e2e4c;
  margin: 0 0 6px 0;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22ch;
}

.rk-card-excerpt {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40ch;
}

/* Responsive - Stack Cards on Small Screens */
@media screen and (max-width: 768px) {
  .rksf-card {
    flex-direction: column;
    max-width: 100%;
  }

  .rksf-card-img {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .rksf-card-content {
    padding: 14px;
  }

  .rk-card-title,
  .rk-card-excerpt {
    white-space: normal;
  }
}
