/* sg-ask.css — the public Ask-a-Scholar intake surface (/ask, patterns/ask.php).
 * Enqueued (not inline) so it stays off the CSP inline-style ledger. One source,
 * both directions: logical properties only (margin/padding/inset-inline) so RTL is
 * automatic under [dir="rtl"]; type roles + colours come from the design tokens. */

.sg-ask { --sg-ask-ink:#0F1B22; color: var(--sg-ask-ink); }
.sg-ask *, .sg-ask *::before, .sg-ask *::after { box-sizing: border-box; }

/* ---- Hero ---- */
.sg-ask-hero {
	background: var(--sg-astral, #30708E);
	color: #F5ECDA;
	padding-block: 56px 44px;
	padding-inline: 24px;
}
.sg-ask-hero-inner { max-width: 880px; margin-inline: auto; }
.sg-ask-hero .crumb { font-family: var(--sg-font-ui, sans-serif); font-size: 13px; letter-spacing: 0.04em; margin: 0 0 20px; color: #FBF7EF; }
.sg-ask-hero .crumb a { color: #FBF7EF; text-decoration: none; }
.sg-ask-hero .crumb a:hover { text-decoration: underline; }
.sg-ask-hero .crumb .sep { margin-inline: 8px; }
.sg-ask-hero .eyebrow {
	font-family: var(--sg-font-ui, sans-serif); text-transform: uppercase;
	letter-spacing: 0.16em; font-size: 12px; margin: 0 0 12px; color: #FBF7EF;
}
.sg-ask-hero h1 {
	font-family: var(--sg-font-display, serif); font-weight: 400;
	font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0 0 14px;
}
.sg-ask-hero .lede { font-family: var(--sg-font-read, serif); font-size: 18px; line-height: 1.6; margin: 0; max-width: 60ch; color: #FBF7EF; }

/* ---- Main / compose ---- */
.sg-ask-main { background: #FBF7EF; padding-block: 48px 80px; padding-inline: 24px; }
.sg-ask-main-inner { max-width: 760px; margin-inline: auto; }
.sg-ask-compose {
	background: #FFFFFF; border: 1px solid #E5D3B3; border-radius: 2px;
	border-block-start: 3px solid #ECA608; /* gold top-rule — the house emphasis */
	padding: 32px;
}
.sg-ask-compose h2 { font-family: var(--sg-font-display, serif); font-weight: 400; font-size: 26px; margin: 0 0 6px; }
.sg-ask-compose .sub { font-family: var(--sg-font-read, serif); font-size: 16px; line-height: 1.6; color: #4A4034; margin: 0 0 24px; }

.sg-ask-fields { display: flex; flex-direction: column; gap: 20px; }
.sg-ask-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sg-ask-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sg-ask-fld label { font-family: var(--sg-font-ui, sans-serif); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: #2A2A2A; }
.sg-ask-fld .opt { font-weight: 400; color: #6A5F4F; }
.sg-ask-fld .req { font-weight: 400; color: var(--gold-ink, #8F6604); }
.sg-ask-fld input, .sg-ask-fld select, .sg-ask-fld textarea {
	font-family: var(--sg-font-read, serif); font-size: 16px; color: var(--sg-ask-ink);
	background: #FCFAF5; border: 1px solid #D9C9A8; border-radius: 2px;
	padding: 12px 14px; min-height: 44px; width: 100%;
}
.sg-ask-fld textarea { min-height: 132px; resize: vertical; line-height: 1.6; }
.sg-ask-fld input:focus, .sg-ask-fld select:focus, .sg-ask-fld textarea:focus {
	outline: 2px solid var(--sg-astral, #30708E); outline-offset: 1px; border-color: var(--sg-astral, #30708E);
}
.sg-ask-fld--consent { flex-direction: row; align-items: flex-start; gap: 10px; }
.sg-ask-fld--consent input { width: 20px; height: 20px; min-height: 0; margin-block-start: 2px; flex: 0 0 auto; }
.sg-ask-fld--consent label { font-family: var(--sg-font-read, serif); font-weight: 400; font-size: 14px; line-height: 1.5; color: #4A4034; }
/* Consent-first opt-ins: a quiet lead that separates the two optional choices from
   the question. margin:0 — the form is a flex column with its own 20px gap. */
.sg-ask-consent-lead { margin: 0; font-family: var(--sg-font-ui, sans-serif); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: #6A5F4F; }

/* ---- Dedup-on-submit: existing answers (retrieval only) ---- */
.sg-ask-existing {
	background: #F5ECDA; border: 1px solid #E5D3B3; border-radius: 2px; padding: 18px 20px;
}
.sg-ask-existing-head { font-family: var(--sg-font-ui, sans-serif); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: var(--gold-ink, #8F6604); margin: 0 0 12px; }
.sg-ask-existing-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sg-ask-existing-list li { padding-block-end: 12px; border-block-end: 1px solid #E5D3B3; }
.sg-ask-existing-list li:last-child { border-block-end: 0; padding-block-end: 0; }
.sg-ask-existing-list a { font-family: var(--sg-font-display, serif); font-size: 17px; color: var(--sg-astral, #30708E); text-decoration: none; }
.sg-ask-existing-list a:hover { text-decoration: underline; }
.sg-ask-existing-list .summary { font-family: var(--sg-font-read, serif); font-size: 14px; line-height: 1.5; color: #4A4034; margin: 4px 0 0; }
.sg-ask-resolve { margin-block-start: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--sg-font-ui, sans-serif); font-size: 14px; color: #2A2A2A; }
.sg-ask-resolve button {
	font-family: var(--sg-font-ui, sans-serif); font-size: 14px; min-height: 44px; padding: 8px 16px;
	border-radius: 2px; cursor: pointer; border: 1px solid var(--sg-astral, #30708E);
}
.sg-ask-resolved { background: var(--sg-astral, #30708E); color: #FFFFFF; }
.sg-ask-continue { background: #FFFFFF; color: var(--sg-astral, #30708E); }
.sg-ask-resolve button:focus-visible { outline: 2px solid var(--gold-ink, #8F6604); outline-offset: 2px; }

/* ---- Actions ---- */
.sg-ask-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-block-start: 4px; }
.sg-ask-actions .left { font-family: var(--sg-font-ui, sans-serif); font-size: 13px; color: #6A5F4F; max-width: 40ch; }
.sg-ask-actions .submit {
	font-family: var(--sg-font-ui, sans-serif); font-size: 15px; font-weight: 600;
	background: var(--sg-astral, #30708E); color: #FFFFFF; border: 0; border-radius: 2px;
	min-height: 48px; padding: 12px 26px; cursor: pointer;
}
.sg-ask-actions .submit:hover { background: #265A72; }
.sg-ask-actions .submit:focus-visible { outline: 2px solid var(--gold-ink, #8F6604); outline-offset: 2px; }

.sg-ask-note { max-width: 760px; margin: 24px auto 0; font-family: var(--sg-font-read, serif); font-size: 14px; line-height: 1.6; color: #6A5F4F; text-align: center; }
.sg-ask-note a { color: var(--gold-ink, #8F6604); }

/* ---- Honeypot (bot deterrent) ---- */
/* Off-screen (NOT display:none, so naive bots still fill it) and fully out of the
   a11y tree (the input is aria-hidden + tabindex -1 in markup). Logical offset →
   RTL-safe. No inline style, so the CSP inline-style ledger stays flat. */
.sg-ask-hp { position: absolute; inset-inline-start: -9999px; inline-size: 1px; block-size: 1px; overflow: hidden; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
	.sg-ask-row { grid-template-columns: 1fr; }
	.sg-ask-compose { padding: 22px 18px; }
	.sg-ask-actions { flex-direction: column; align-items: stretch; }
	.sg-ask-actions .submit { width: 100%; }
}

/* ── Search-first one-page Answer Service (2026-06-26) ─────────────────────────
   Search leads in the Astral hero; the living library + the ask <details> sit in
   the paper main. Logical CSS throughout (LTR == RTL). */
.sg-ask .sr-only{ position:absolute; inline-size:1px; block-size:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* search box — on the dark Astral hero */
.sg-ask-search{ display:flex; align-items:center; gap:10px; margin-block:22px 16px; background:#FBF7EF; border:1px solid rgba(251,247,239,.45); border-radius:2px; padding-inline:14px; max-inline-size:560px; }
.sg-ask-search-ico{ color:var(--sg-astral,#30708E); font-size:18px; line-height:1; }
.sg-ask-search input{ flex:1; min-inline-size:0; border:0; background:transparent; padding-block:14px; padding-inline:4px; font-family:var(--sg-font-ui,sans-serif); font-size:16px; color:#23211C; }
.sg-ask-search input:focus{ outline:none; }
.sg-ask-search:focus-within{ box-shadow:0 0 0 3px rgba(236,166,8,.55); }

/* topic chips */
.sg-ask-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.sg-ask-chip{ font-family:var(--sg-font-ui,sans-serif); font-size:13px; color:#FBF7EF; background:transparent; border:1px solid rgba(251,247,239,.5); border-radius:999px; padding-block:6px; padding-inline:14px; cursor:pointer; min-block-size:32px; }
.sg-ask-chip:hover,.sg-ask-chip:focus-visible{ background:rgba(251,247,239,.16); }

/* the living library (paper main) */
.sg-ask-results{ margin-block-end:28px; }
.sg-ask-results-head{ font-family:var(--sg-font-ui,sans-serif); font-size:12px; letter-spacing:.14em; text-transform:uppercase; color:var(--sg-astral,#30708E); font-weight:700; margin:0 0 12px; }
:root[lang="ar"] .sg-ask-results-head{ letter-spacing:0; }
.sg-ask-results-list{ list-style:none; margin:0; padding:0; }
.sg-ask-results-list li{ border-block-end:1px solid #E5D3B3; }
.sg-ask-results-list li:first-child{ border-block-start:1px solid #E5D3B3; }
.sg-ask-results-list a{ display:block; padding-block:13px; padding-inline:4px; font-family:var(--sg-font-read,serif); font-size:17px; color:#23211C; text-decoration:none; }
.sg-ask-results-list a:hover,.sg-ask-results-list a:focus-visible{ color:var(--sg-astral,#30708E); text-decoration:underline; text-underline-offset:3px; }

/* the bridge = the <summary> of the ask <details>; the card frame stays from .sg-ask-compose */
.sg-ask-compose{ padding:0; }
.sg-ask-bridge{ list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:16px; padding-block:18px; padding-inline:24px; font-family:var(--sg-font-ui,sans-serif); }
.sg-ask-bridge::-webkit-details-marker{ display:none; }
.sg-ask-bridge-q{ font-family:var(--sg-font-display,serif); font-size:19px; color:#23211C; }
.sg-ask-bridge-cta{ font-weight:700; color:var(--sg-astral,#30708E); white-space:nowrap; }
.sg-ask-bridge-cta .arrow{ margin-inline-start:6px; }
.sg-ask-bridge:hover .sg-ask-bridge-cta,.sg-ask-compose[open] .sg-ask-bridge-cta{ color:var(--sg-astral-700,#22506A); }
.sg-ask-compose-body{ padding-block:8px 32px; padding-inline:32px; border-block-start:1px solid #E5D3B3; }
.sg-ask-existing-head.is-error{ color:#9B2D20; }

@media (max-width:560px){
  .sg-ask-bridge{ flex-direction:column; align-items:flex-start; gap:6px; }
  .sg-ask-compose-body{ padding-inline:20px; }
}
