/* ================================================
   SajhiloStay HMS — Queries (search + answer pages)
   Loaded only on /queries/, so the marketing pages
   stay as light as they were.
   ================================================ */

/* ── HERO SEARCH ── */
.q-hero { padding-bottom: 46px; }
.q-hero p { margin-bottom: 30px; }

.q-searchbox {
  position: relative; display: flex; align-items: center; gap: 8px;
  max-width: 680px; margin: 0 auto; background: var(--white);
  border-radius: var(--radius-full); padding: 7px 7px 7px 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.28); transition: box-shadow .22s ease;
}
.q-searchbox:focus-within { box-shadow: 0 0 0 4px rgba(14,165,233,.35), 0 18px 40px rgba(0,0,0,.3); }
.q-searchbox-icon { color: var(--text-light); font-size: 1rem; flex-shrink: 0; }
.q-searchbox input[type="search"] {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-size: 1rem; color: var(--text); padding: 12px 4px;
}
.q-searchbox input[type="search"]::-webkit-search-cancel-button { display: none; }
.q-searchbox input::placeholder { color: var(--text-light); }
.q-clear {
  width: 30px; height: 30px; border-radius: 50%; color: var(--text-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.q-clear:hover { background: var(--light); color: var(--text); }
.q-go {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff;
  font-weight: 700; font-size: .92rem; padding: 12px 26px; border-radius: var(--radius-full);
  flex-shrink: 0; transition: filter .2s;
}
.q-go:hover { filter: brightness(1.08); }
.q-noscript { font-size: .8rem; margin-top: 14px; }

.q-spinner {
  position: absolute; right: 112px; top: 50%; width: 16px; height: 16px;
  margin-top: -8px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: q-spin .7s linear infinite;
}
@keyframes q-spin { to { transform: rotate(360deg); } }

/* ── TYPEAHEAD ── */
.q-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 60;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); overflow: hidden; text-align: left; max-height: 62vh; overflow-y: auto;
}
.q-suggest-item { display: block; padding: 13px 18px; border-bottom: 1px solid var(--border); transition: background .15s; }
.q-suggest-item:last-child { border-bottom: none; }
.q-suggest-item:hover { background: var(--light); }
.q-suggest-title { display: block; font-weight: 700; font-size: .9rem; color: var(--text); line-height: 1.4; }
.q-suggest-cat { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--accent-dark); margin-top: 4px; }
.q-suggest-snip { display: block; font-size: .8rem; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

/* ── CATEGORY BAR ── */
.q-catbar { background: var(--light); border-bottom: 1px solid var(--border); padding: 18px 0; }
.q-cats { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.q-cat {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 9px 17px; font-size: .84rem; font-weight: 600; color: var(--text-muted); transition: all .18s;
}
.q-cat i { color: var(--accent); transition: color .18s; }
.q-cat:hover { border-color: var(--accent); color: var(--text); }
.q-cat.active { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(14,165,233,.3); }
.q-cat.active i { color: #fff; }

/* ── RESULTS ── */
.q-section { padding: 52px 0 80px; }
.q-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.q-results-head p { font-size: .95rem; color: var(--text-muted); }
.q-results-head strong { color: var(--text); font-size: 1.05rem; }
.q-results-head em { color: var(--accent-dark); font-style: normal; font-weight: 600; }
.q-share-search {
  display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700;
  color: var(--accent-dark); border: 1.5px solid var(--border); border-radius: var(--radius-full);
  padding: 8px 16px; transition: all .18s;
}
.q-share-search:hover { border-color: var(--accent); background: rgba(14,165,233,.07); }
.q-share-search.is-copied { border-color: var(--green); color: var(--green); }

.q-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.q-card {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.q-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(14,165,233,.4); }
.q-card-link { display: flex; flex-direction: column; flex: 1; }
.q-card-shot { aspect-ratio: 16 / 9; background: var(--light); overflow: hidden; }
.q-card-shot img { width: 100%; height: 100%; object-fit: cover; }
.q-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.q-chip {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: rgba(14,165,233,.1); color: var(--accent-dark); font-size: .68rem; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; padding: 5px 12px; border-radius: var(--radius-full); margin-bottom: 12px;
}
.q-card-title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 9px; }
.q-card-snip { font-size: .85rem; color: var(--text-muted); line-height: 1.65; }
.q-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 22px; border-top: 1px solid var(--border); background: var(--light); }
.q-meta { font-size: .75rem; color: var(--text-light); display: inline-flex; align-items: center; gap: 6px; }
.q-copy { display: inline-flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 700; color: var(--accent-dark); transition: color .18s; }
.q-copy:hover { color: var(--accent); }
.q-copy.is-copied { color: var(--green); }
mark { background: rgba(245,158,11,.28); color: inherit; padding: 0 2px; border-radius: 3px; }

/* ── PAGINATION ── */
.q-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 44px; }
.q-pagination a { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 700; color: var(--accent-dark); border: 1.5px solid var(--border); border-radius: var(--radius-full); padding: 10px 20px; transition: all .18s; }
.q-pagination a:hover { border-color: var(--accent); background: rgba(14,165,233,.07); }
.q-page-count { font-size: .82rem; color: var(--text-muted); }

/* ── EMPTY STATE ── */
.q-empty { text-align: center; padding: 60px 20px; border: 1.5px dashed var(--border); border-radius: var(--radius-lg); background: var(--light); }
.q-empty > i { font-size: 2.2rem; color: var(--text-light); margin-bottom: 18px; }
.q-empty h3 { font-family: var(--font-display); font-size: 1.25rem; color: var(--text); margin-bottom: 10px; }
.q-empty p { font-size: .92rem; color: var(--text-muted); max-width: 520px; margin: 0 auto 24px; }
.q-empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── POPULAR ── */
.q-popular { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 32px; }
.q-popular-head { font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--text); margin-bottom: 16px; }
.q-popular-head i { color: var(--yellow); margin-right: 8px; }
.q-popular-list { display: flex; flex-wrap: wrap; gap: 10px; }
.q-popular-list a { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 9px 17px; font-size: .84rem; font-weight: 600; color: var(--text-muted); transition: all .18s; }
.q-popular-list a:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ── DETAIL PAGE ── */
.q-detail-hero { text-align: left; padding: 120px 0 52px; }
.q-detail-hero h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.3; max-width: 900px; }
.q-detail-hero p { margin: 0; max-width: 780px; }
.q-crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: rgba(255,255,255,.55); margin-bottom: 18px; }
.q-crumbs a { color: rgba(255,255,255,.72); }
.q-crumbs a:hover { color: #7dd3fc; }
.q-crumbs i { font-size: .6rem; opacity: .5; }

.q-detail-body { padding: 56px 0 80px; }
.q-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.q-cover { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border); margin-bottom: 30px; }

/* Rich text written in the admin editor. */
.q-body { font-size: 1rem; color: var(--text); line-height: 1.8; }
.q-body > *:first-child { margin-top: 0; }
.q-body h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--primary); margin: 34px 0 12px; }
.q-body h3 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; color: var(--primary); margin: 28px 0 10px; }
.q-body h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 22px 0 8px; }
.q-body p { margin-bottom: 16px; color: var(--text-muted); }
.q-body strong { color: var(--text); }
.q-body a { color: var(--accent-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.q-body a:hover { color: var(--accent); }
.q-body ul, .q-body ol { margin: 0 0 18px 22px; color: var(--text-muted); }
.q-body ul { list-style: disc; }
.q-body ol { list-style: decimal; }
.q-body li { margin-bottom: 8px; padding-left: 4px; }
.q-body blockquote { border-left: 4px solid var(--accent); background: var(--light); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 22px; margin: 22px 0; font-style: italic; color: var(--text-muted); }
.q-body code { background: var(--light); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; font-size: .88em; }
.q-body pre { background: var(--dark); color: #e2e8f0; border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; margin: 20px 0; }
.q-body pre code { background: none; border: none; color: inherit; padding: 0; }
.q-body hr { border: none; border-top: 1px solid var(--border); margin: 30px 0; }
.q-body img { border-radius: var(--radius); border: 1px solid var(--border); margin: 8px 0; }
.q-body figure { margin: 24px 0; }
.q-body figure.image img { width: 100%; }
.q-body figcaption { font-size: .8rem; color: var(--text-light); text-align: center; margin-top: 8px; }
.q-body .table, .q-body figure.table { overflow-x: auto; }
.q-body table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: .88rem; }
.q-body th, .q-body td { border: 1px solid var(--border); padding: 11px 14px; text-align: left; }
.q-body th { background: var(--light); font-weight: 700; color: var(--text); }
.q-body td { color: var(--text-muted); }

/* CKEditor writes its embeds as a padded wrapper with a 100% ratio; force the
   16:9 every video platform actually uses. */
.q-body figure.media { margin: 26px 0; }
.q-body figure.media div[data-oembed-url] { position: relative; }
.q-body figure.media div[data-oembed-url] > div { position: relative !important; padding-bottom: 56.25% !important; height: 0 !important; border-radius: var(--radius); overflow: hidden; }
.q-body figure.media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── ATTACHED MEDIA ── */
.q-media { margin-top: 38px; display: grid; gap: 28px; }
.q-media-item { margin: 0; }
.q-media-item img, .q-media-item video { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border); background: #000; display: block; }
.q-media-item img { background: var(--light); }
.q-frame { position: relative; padding-bottom: 56.25%; height: 0; border-radius: var(--radius-md); overflow: hidden; background: #000; box-shadow: var(--shadow-md); }
.q-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.q-media-item figcaption { font-size: .82rem; color: var(--text-light); margin-top: 10px; text-align: center; }
.q-media-link { display: inline-flex; align-items: center; gap: 10px; background: var(--light); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; font-size: .88rem; font-weight: 600; color: var(--accent-dark); word-break: break-all; }
.q-media-link:hover { border-color: var(--accent); }

/* ── TAGS ── */
.q-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.q-tag { background: var(--light); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 6px 14px; font-size: .78rem; font-weight: 600; color: var(--text-muted); transition: all .18s; }
.q-tag:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ── SHARE ── */
.q-share { margin-top: 40px; padding: 26px; background: var(--light); border: 1px solid var(--border); border-radius: var(--radius-md); }
.q-share-label { font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--text); margin-bottom: 16px; }
.q-share-label i { color: var(--accent); margin-right: 8px; }
.q-share-row { display: flex; flex-wrap: wrap; gap: 9px; }
.q-share-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 10px 18px; font-size: .82rem; font-weight: 700; color: var(--text-muted); transition: all .18s; }
.q-share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.q-share-copy { color: var(--accent-dark); }
.q-share-copy.is-copied { background: var(--green); border-color: var(--green); color: #fff; }
.q-share-btn.wa:hover { background: #25d366; border-color: #25d366; color: #fff; }
.q-share-btn.fb:hover { background: #1877f2; border-color: #1877f2; color: #fff; }
.q-share-btn.tw:hover { background: #000; border-color: #000; color: #fff; }
.q-share-btn.vb:hover { background: #7360f2; border-color: #7360f2; color: #fff; }
.q-share-btn.em:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.q-share-url { width: 100%; margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; font-size: .82rem; color: var(--text-muted); background: var(--white); }

/* ── STILL STUCK ── */
.q-still { margin-top: 34px; padding: 26px; border: 1.5px dashed var(--accent); border-radius: var(--radius-md); background: rgba(14,165,233,.05); }
.q-still p { font-size: .92rem; color: var(--text); margin-bottom: 18px; }
.q-still-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── SIDEBAR ── */
.q-detail-side { position: sticky; top: 96px; display: grid; gap: 20px; }
.q-side-search label { display: block; font-size: .8rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.q-side-search-field { position: relative; display: flex; align-items: center; }
.q-side-search-field i { position: absolute; left: 15px; color: var(--text-light); font-size: .85rem; }
.q-side-search input { width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-full); padding: 12px 16px 12px 40px; font-size: .88rem; background: var(--white); transition: border-color .2s; }
.q-side-search input:focus { outline: none; border-color: var(--accent); }
.q-side-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; }
.q-side-head { font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--text); margin-bottom: 14px; }
.q-side-list li { border-bottom: 1px solid var(--border); }
.q-side-list li:last-child { border-bottom: none; }
.q-side-list a { display: block; padding: 11px 0; font-size: .86rem; color: var(--text-muted); line-height: 1.5; transition: color .18s; }
.q-side-list a:hover { color: var(--accent-dark); }
.q-side-cta { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); border-color: transparent; color: #fff; }
.q-side-cta .q-side-head { color: #fff; }
.q-side-cta p { font-size: .85rem; color: rgba(255,255,255,.72); line-height: 1.7; margin-bottom: 18px; }
.q-side-cta .btn { margin-bottom: 10px; }
.q-side-cta .btn-outline { border-color: rgba(255,255,255,.4); color: #fff; }
.q-side-cta .btn-outline:hover { background: #fff; color: var(--primary-dark); border-color: #fff; }
.q-side-cta .btn-full { display: flex; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .q-grid { grid-template-columns: repeat(2, 1fr); }
  .q-detail-grid { grid-template-columns: 1fr; gap: 40px; }
  .q-detail-side { position: static; }
}
@media (max-width: 768px) {
  .q-grid { grid-template-columns: 1fr; }
  .q-section { padding: 36px 0 64px; }
  .q-searchbox { padding: 6px 6px 6px 14px; flex-wrap: nowrap; }
  .q-go { padding: 11px 18px; font-size: .85rem; }
  .q-spinner { display: none; }
  .q-detail-hero { padding: 110px 0 44px; }
  .q-results-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .q-card:hover, .q-share-btn:hover { transform: none; }
  .q-spinner { animation: none; }
}
