/* Kyudo Search — plugin styles (scoped under .kys) */
.kys {
  max-width: 720px;
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.6;
}

.kys #kys-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

/* Input field wrapper — hosts the in-field status badge without extra height */
.kys .kys-field {
  position: relative;
  flex: 1;
  display: flex;
}

.kys .kys-field-status {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  line-height: 1.4;
  color: #8a8a8a;
  background: rgba(255, 255, 255, 0.92);
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid #e6e2da;
  pointer-events: none;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kys #kys-input.kys-has-status {
  padding-right: 110px;
}

/* Content-type badge shown next to result titles */
.kys .kys-type {
  font-size: 0.68rem;
  font-weight: 600;
  color: #8a8a8a;
  border: 1px solid #e6e2da;
  border-radius: 999px;
  padding: 1px 7px;
  vertical-align: middle;
}

.kys #kys-input {
  flex: 1;
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid #e6e2da;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #2b2b2b;
}

.kys #kys-input:focus {
  border-color: var(--kys-btn-bg, #a0522d);
}

/* Button design is configurable via --kys-btn-* custom properties
   (set from the settings screen or shortcode attributes). */
.kys #kys-form button {
  padding: 12px 20px;
  font-size: 1rem;
  border: none;
  border-radius: var(--kys-btn-radius, 8px);
  background: var(--kys-btn-bg, #a0522d);
  color: var(--kys-btn-color, #fff);
  cursor: pointer;
}

.kys #kys-form button:hover {
  opacity: 0.9;
}

.kys .kys-status {
  font-size: 0.85rem;
  color: #8a8a8a;
  min-height: 1.4em;
  margin: 0 0 16px;
}

.kys .kys-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.kys .kys-card {
  background: #fff;
  border: 1px solid #e6e2da;
  border-radius: 10px;
  padding: 16px 20px;
}

.kys .kys-card a {
  font-weight: 600;
  font-size: 1.05rem;
  color: #a0522d;
  text-decoration: none;
}

.kys .kys-card a:hover {
  text-decoration: underline;
}

.kys .kys-summary {
  font-size: 0.9rem;
  color: #2b2b2b;
  margin: 6px 0 0;
}

/* "Show more results" */
.kys .kys-more {
  border: none;
  background: transparent;
  padding: 2px 0;
}

.kys .kys-more-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--kys-btn-bg, #a0522d);
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}

.kys .kys-more-btn:hover {
  text-decoration: underline;
}

/* ---------- Compact mode ([kyudo_search compact="true"]) ---------- */

/* Normal mode: the panel wrapper must not affect layout. */
.kys .kys-panel {
  display: contents;
}

.kys.kys-compact {
  display: block;
  position: relative;
  max-width: 480px;
}

.kys.kys-compact .kys-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e6e2da;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  padding: 4px 0;
}

.kys.kys-compact .kys-panel.kys-open {
  display: block;
}

/* results="inline": results expand below the form (no floating panel) */
.kys .kys-panel.kys-inline {
  display: block;
  position: static;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.kys.kys-compact #kys-input {
  padding: 8px 12px;
  font-size: 0.95rem;
}

.kys.kys-compact #kys-form button {
  padding: 8px 14px;
  font-size: 0.95rem;
}

.kys.kys-compact .kys-status {
  padding: 2px 14px;
  margin: 0;
}

.kys.kys-compact .kys-results {
  gap: 0;
  max-height: 320px;
  overflow-y: auto;
}

.kys.kys-compact .kys-card {
  border: none;
  border-top: 1px solid #f0ece4;
  border-radius: 0;
  padding: 10px 14px;
}

.kys.kys-compact .kys-card:first-child {
  border-top: none;
}

.kys.kys-compact .kys-card a {
  font-size: 0.95rem;
}

.kys.kys-compact .kys-summary {
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
