@font-face {
  font-family: 'Somar';
  src: url('assets/fonts/somar.ttf');
  font-display: swap;
}

@font-face {
  font-family: 'DroidArabic';
  src: url('assets/fonts/droid-sans.ttf');
  font-display: swap;
}

:root {
  --gold1: #c6a15b;
  --gold2: #8c6a29;
  --bg: #f9f7f2;
  --card: #fff;
  --text: #2e2410;
  --muted: #7b6b45;
  --border: #e4d6b8;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  direction: rtl;
  font-family: 'DroidArabic', sans-serif;
  background: linear-gradient(180deg, #fbfaf6 0%, var(--bg) 100%);
  color: var(--text);
}

body.source-nonmuslim .ask-cats-wrap {
  display: none;
}

body.source-nonmuslim .ask-modes {
  display: none !important;
}

body.source-nonmuslim #sourceContext {
  display: block !important;
}

.ask-header {
  background: linear-gradient(135deg, var(--gold2), var(--gold1));
  color: #fff;
  width: min(100% - 20px, 820px);
  margin: 4px auto 14px;
  padding: 34px 22px 28px;
  border-radius: 32px;
  box-shadow: var(--shadow);
  position: relative;
}

.ask-header {
  width: 100%;
  margin: 0 0 14px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
}

.ask-logo {
  display: none;
}

.ask-hero-shell {
  display: grid;
  gap: 18px;
}

.ask-hero-copy {
  text-align: center;
}

.ask-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: 'Somar';
  font-size: 13px;
}

.ask-header h1 {
  margin: 0 0 8px;
  font-family: 'Somar';
  font-size: 32px;
}

.ask-subtitle {
  max-width: 620px;
  margin: 0 auto;
  font-size: 15px;
  color: #fdf6e5;
  opacity: 0.95;
  line-height: 1.9;
}

.ask-hero-panel {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  text-align: center;
}

.ask-hero-kicker {
  margin: 0 0 8px;
  font-family: 'Somar';
  font-size: 18px;
}

.ask-hero-text {
  margin: 0;
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  line-height: 1.9;
}

.ask-modes {
  display: grid;
  gap: 12px;
  padding: 18px 20px 8px;
}

.ask-mode {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: right;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ask-mode:hover {
  transform: translateY(-2px);
}

.ask-mode i {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #f8edd3;
  color: var(--gold2);
  font-size: 18px;
}

.ask-mode strong {
  display: block;
  margin-bottom: 4px;
  font-family: 'Somar';
  font-size: 18px;
}

.ask-mode span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  font-family: 'Somar';
}

.ask-mode.active {
  border-color: var(--gold1);
  background: linear-gradient(180deg, #fffdf8, #faf4e6);
  box-shadow: 0 10px 24px rgba(140, 106, 41, 0.14);
}

.ask-mode.active i {
  background: linear-gradient(135deg, var(--gold1), var(--gold2));
  color: #fff;
}

.ask-mode-note {
  margin: 0 20px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.ask-cats-wrap {
  padding: 14px 20px 0;
}

.cats-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cats-head h2 {
  margin: 0;
  font-family: 'Somar';
  font-size: 22px;
}

.cats-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cats-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: 'Somar';
  font-size: 13px;
  line-height: 1.7;
}

.ask-cats {
  display: grid;
  gap: 8px;
}

.cats-label {
  color: var(--muted);
  font-size: 13px;
}

.cat-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--gold2) 50%),
    linear-gradient(135deg, var(--gold2) 50%, transparent 50%),
    linear-gradient(180deg, #fff, #fcf8ef);
  background-position:
    calc(18px) calc(50% - 3px),
    calc(12px) calc(50% - 3px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  padding-left: 34px;
  color: var(--text);
  font-family: 'DroidArabic', sans-serif;
  font-size: 15px;
  box-shadow: var(--shadow);
  outline: none;
}

.cat-select:focus {
  border-color: var(--gold1);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.18);
}

.ask-input {
  padding: 20px;
}

.input-box {
  display: flex;
  align-items: center;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.input-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  background: transparent;
}

.input-box button {
  background: linear-gradient(135deg, var(--gold1), var(--gold2));
  border: none;
  color: #fff;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 25px;
}

.ask-results {
  padding: 20px;
}

.placeholder {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin-top: 40px;
}

.answer-box {
  background: #fff;
  padding: 22px;
  border-radius: 14px;
  line-height: 2;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  font-size: 17px;
  color: #333;
  white-space: pre-line;
}

.answer-box h3 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 700;
  color: #5a4a2e;
}

.answer-box strong {
  color: #5a4a2e;
}

.answer-box ol,
.answer-box ul {
  padding-right: 1.4rem;
  margin: 0.5rem 0;
}

.answer-box hr {
  margin: 1.2rem 0;
  border: 0;
  border-top: 1px solid #ddd;
}

.suggested {
  margin-top: 1rem;
  padding: 10px 15px;
  background: #eff6ea;
  border-right: 5px solid #7aa25a;
  border-radius: 8px;
}

.question-header {
  background: #faf6e8;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.question-header .question-label {
  font-weight: 700;
  color: #5a4a2e;
  margin-bottom: 4px;
}

.question-header .question-text {
  font-size: 16px;
}

.book-author {
  margin-top: 1rem;
  padding: 10px 14px;
  background: #faf6e8;
  border-radius: 10px;
  font-size: 15px;
}

.suggested-question-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: right;
  cursor: pointer;
  font: inherit;
  color: #335022;
  font-weight: 600;
}

.suggested-question-link:hover {
  text-decoration: underline;
  color: #234012;
}

.muted {
  color: var(--muted);
}

@media (min-width: 768px) {
  .ask-hero-shell {
    gap: 22px;
  }

  .ask-header h1 {
    font-size: 34px;
  }

  .ask-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 800px;
    margin: 0 auto;
    padding-top: 22px;
  }

  .ask-mode-note,
  .ask-cats-wrap,
  .ask-input,
  .ask-results {
    max-width: 800px;
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .ask-modes,
  .ask-cats-wrap,
  .ask-input {
    padding-right: 16px;
    padding-left: 16px;
  }

  .ask-mode-note,
  .ask-results {
    margin-right: 16px;
    margin-left: 16px;
  }

  .cats-head {
    display: block;
  }

  .cats-head p {
    margin-top: 4px;
  }

  .ask-header {
    width: min(100% - 12px, 820px);
    padding: 28px 16px 22px;
    margin-bottom: 12px;
    border-radius: 28px;
  }

  .ask-header {
    width: 100%;
    margin: 0 0 12px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
  }

  .ask-hero-panel {
    padding: 16px;
    border-radius: 20px;
  }

  .ask-header h1 {
    font-size: 24px;
  }

  .ask-subtitle {
    font-size: 14px;
  }
}
