/* ==========================================================================
   LiD Blog Questions – Clean, professional, bilingual (RTL/LTR per section)
   ========================================================================== */

/* ── Question card ──────────────────────────────────────────────────────── */
.lid-q {
  border: 1px solid var(--border, #ddd);
  border-radius: 10px;
  margin: 1.4rem 0;
  overflow: hidden;
  background: var(--surface-1, #fff);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* ── Card header: number + correct answer ───────────────────────────────── */
.lid-q-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem .9rem;
  background: var(--surface-2, #f5f5f2);
  border-bottom: 1px solid var(--border, #ddd);
  gap: .5rem;
  flex-wrap: wrap;
}

.lid-q-num {
  font-weight: 700;
  font-size: .88rem;
  color: var(--text-secondary, #555);
  letter-spacing: .02em;
}

.lid-q-sol {
  font-size: .78rem;
  font-weight: 700;
  padding: .22rem .65rem;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  white-space: nowrap;
}

/* ── Image (coat-of-arms question) ──────────────────────────────────────── */
.lid-q-img-wrap {
  margin: 0;
  padding: .6rem .9rem;
  background: #fafafa;
  border-bottom: 1px solid var(--border, #ddd);
  text-align: center;
}

.lid-q-img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

/* ── Language section ───────────────────────────────────────────────────── */
.lid-q-sec {
  padding: .65rem .9rem .75rem;
  border-bottom: 1px solid var(--border, #ddd);
}

.lid-q-sec:last-child {
  border-bottom: none;
}

/* Language accent strip */
.lid-q-de { border-left: 3px solid #fbbf24; }
.lid-q-en { border-left: 3px solid #3b82f6; }
.lid-q-fa { border-right: 3px solid #22c55e; border-left: none; }

/* Force LTR for German and English sections, even inside RTL page */
.lid-q-de,
.lid-q-en {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

/* Force RTL for Persian section, even inside LTR page */
.lid-q-fa {
  direction: rtl;
  text-align: right;
  unicode-bidi: isolate;
  font-family: Vazirmatn, var(--font-body, sans-serif);
}

/* ── Language label ──────────────────────────────────────────────────────── */
.lid-q-lang {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary, #666);
  margin-bottom: .38rem;
}

/* ── Question text ───────────────────────────────────────────────────────── */
.lid-q-txt {
  margin: 0 0 .55rem;
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.58;
  color: var(--text-primary, #1a1a1a);
}

/* ── Options list ────────────────────────────────────────────────────────── */
.lid-opts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .28rem;
}

.lid-opt {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .38rem .55rem;
  border-radius: 6px;
  background: var(--surface-2, #f7f7f5);
  font-size: .88rem;
  line-height: 1.45;
  color: var(--text-primary, #1a1a1a);
  position: relative;
  border: 1px solid transparent;

  /* inherit dir from parent section */
  direction: inherit;
  text-align: inherit;
}

.lid-opt-fa {
  /* RTL option: key goes on right side naturally */
}

/* Correct answer highlight */
.lid-opt--correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  font-weight: 600;
}

/* Option letter label */
.lid-opt-key {
  flex-shrink: 0;
  min-width: 1.8rem;
  font-weight: 700;
  font-size: .83rem;
  color: #888;
}

.lid-opt--correct .lid-opt-key {
  color: #16a34a;
}

.lid-opt-val {
  flex: 1;
}

/* Checkmark */
.lid-opt-check {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  margin-left: auto;
}

/* RTL: checkmark on the left */
.lid-q-fa .lid-opt-check {
  margin-left: 0;
  margin-right: auto;
}

/* ── State section heading ───────────────────────────────────────────────── */
h2.lid-state-header,
.lid-state-header {
  margin: 2rem 0 .8rem;
  padding: .65rem .9rem;
  background: var(--surface-2, #f5f5f2);
  border-radius: 8px;
  border-left: 4px solid #f97316;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
}

/* RTL page: flip the accent border */
.blog-dir-rtl h2.lid-state-header,
.blog-dir-rtl .lid-state-header {
  border-left: none;
  border-right: 4px solid #f97316;
}

/* ── General section intro ───────────────────────────────────────────────── */
.lid-section-intro {
  margin: 1.2rem 0 .6rem;
  padding: .7rem 1rem;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  font-size: .92rem;
  color: #1e40af;
  font-weight: 500;
}

.blog-dir-rtl .lid-section-intro {
  border-left: none;
  border-right: 4px solid #3b82f6;
  text-align: right;
}

/* ── Table of contents ───────────────────────────────────────────────────── */
.lid-toc {
  background: var(--surface-2, #f7f7f5);
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: .9rem 1.1rem;
  margin: 1.2rem 0;
  font-size: .88rem;
}

.lid-toc h3 {
  margin: 0 0 .5rem;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-secondary, #555);
}

.lid-toc ol {
  margin: 0;
  padding-inline-start: 1.4rem;
}

.lid-toc li {
  margin: .2rem 0;
}

.lid-toc a {
  color: var(--color-primary, #2c5530);
  text-decoration: none;
}

.lid-toc a:hover {
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .lid-q-hd { padding: .45rem .7rem; }
  .lid-q-sec { padding: .55rem .7rem .65rem; }
  .lid-q-txt { font-size: .88rem; }
  .lid-opt   { font-size: .84rem; }
  .lid-q-img-wrap { padding: .5rem; }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  .lid-q { page-break-inside: avoid; box-shadow: none; }
  .lid-opt--correct { background: #d1fae5 !important; }
}
