/* One search page (Web/Search.aspx, Nov 2026): the filters with the results under them. Loaded after css/kv-search.css,
   which has the form, card and results styles; this file adds the age boxes, the mother tongue checklist, the
   conditional fields, the folded-away form on phones and the results block. */

/* conditional fields (caste after a religion, city after a state) */
.kvs-field[hidden] { display: none; }

/* main row: 3 columns on a computer, 2 on a tablet, 1 on a phone */
.kvs-grid.kvs-grid--main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 991px) { .kvs-grid.kvs-grid--main { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .kvs-grid.kvs-grid--main { grid-template-columns: minmax(0, 1fr); } }

/* ---------- age: two number boxes, From and To (Dec 2026, MAT-29) ---------- */
.kvs-agebox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kvs-agebox-in { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; color: var(--kv-muted); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.kvs-agenum { flex: 1 1 auto; width: 100%; min-width: 0; height: 40px; padding: 0 10px; box-sizing: border-box; border: 1px solid var(--kv-line); border-radius: 10px; background: var(--kv-card); color: var(--kv-ink); font-size: 14px; }
.kvs-agenum:hover { border-color: #cfd3da; }
.kvs-agenum:focus { outline: 0; border-color: var(--kv-accent); box-shadow: 0 0 0 3px rgba(198, 40, 40, .12); }

/* the Filters button above the results (phones and tablets only; the results header box is gone) */
.kvs-filterbar { margin: 0 0 12px; }

/* ---------- mother tongue: checklist in a <details> ---------- */
.kvs-multi { position: relative; min-width: 0; }
.kvs-multi > summary { display: flex; align-items: center; list-style: none; cursor: pointer; height: 40px; padding: 0 30px 0 12px !important; box-sizing: border-box;
  border: 1px solid var(--kv-line); border-radius: 10px; background: var(--kv-card); color: var(--kv-ink); font-size: 14px; min-width: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.kvs-multi > summary::-webkit-details-marker { display: none; }
.kvs-multi > summary::marker { content: ""; }
.kvs-multi > summary:hover { border-color: #cfd3da; }
.kvs-multi[open] > summary { border-color: var(--kv-accent); box-shadow: 0 0 0 3px rgba(198, 40, 40, .12); }
.kvs-multi-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kvs-multi-panel { margin-top: 6px; max-height: 248px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px; border: 1px solid var(--kv-line); border-radius: 10px; background: var(--kv-card);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.kvs-chk { display: flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; padding: 4px 8px; border-radius: 8px; font-weight: 500; font-size: 13.5px; color: var(--kv-text); cursor: pointer; min-width: 0; }
.kvs-chk:hover { background: var(--kv-accent-soft); }
.kvs-chk input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--kv-accent); }
.kvs-chk span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575px) { .kvs-multi-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 280px; } }

/* "Showing profiles living outside India" (old NRI links only) */
.kvs-note { margin: -6px 0 14px; color: var(--kv-muted); font-size: 12.5px; }
.kvs-note a { color: var(--kv-accent); font-weight: 600; }

/* ---------- filters fold away on phones and tablets once there are results ---------- */
@media (max-width: 991px) { .kvs-card.kvs-collapsed { display: none; } }
@media (min-width: 992px) { #kvsEdit, .kvs-filterbar { display: none; } }

/* ---------- results under the form ---------- */
.kvs-results { max-width: 100%; padding: 4px 0 36px; }
.kvs-results #resultTable { width: 100%; border-collapse: collapse; border-spacing: 0; table-layout: fixed; }
.kvs-empty { margin: 4px 0 0; padding: 18px 16px; background: var(--kv-card); border: 1px solid var(--kv-line); border-radius: var(--kv-radius); color: #cc0000; font-size: 14px; font-weight: 600; }

/* phone: nothing may push the page sideways */
@media (max-width: 575px) {
  .kvs-wrap, .kvs-results { overflow-x: hidden; }
}

/* ---------- results layout (Dec 2026, MAT-28 item 3) ----------
   Before a search: the form on top, as before. After a search: on a computer (992px and up) the filters are a sticky left
   sidebar that scrolls on its own and the results fill the right; on phones and tablets the form folds away behind the
   "Filters" button in the results header (see the script in Search.aspx). */
.kvs-results { min-width: 0; }
@media (min-width: 992px) {
  .kvs-wrap.kvs-wrap--results { max-width: 1240px; padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
  .kvs-layout--results { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
  .kvs-layout--results > .kvs-card { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; padding: 16px 16px 0; border-radius: 14px; }
  .kvs-layout--results .kvs-grid, .kvs-layout--results .kvs-grid.kvs-grid--main, .kvs-layout--results .kvs-grid--more { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .kvs-layout--results .kvs-row--top { flex-direction: column; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; }
  .kvs-layout--results .kvs-actions { position: sticky; bottom: 0; margin: 16px -16px 0; padding: 12px 16px; background: var(--kv-card); border-radius: 0 0 14px 14px; z-index: 5; }
  .kvs-layout--results .kvs-results { padding-top: 0; }
}
