/* ==========================================================================
   guide.css — Home/Guide, the full user guide.
   Both languages are in the page; html.st-en (the EN switch in the top bar)
   shows the English and hides the Persian. Colours follow admin-theme.css.
   ========================================================================== */

.gdPage {
  --gd-card: #242a35;
  --gd-card-2: #2a303c;
  --gd-line: #39414f;
  --gd-ink: #e8ecf3;
  --gd-soft: #a9b3c2;
  --gd-accent: #3b82f6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 16px 4rem 16px;
  color: var(--gd-ink);
}

/* Language: Persian unless the EN switch is on. */
.gdEn,
html.st-en .gdFa {
  display: none !important;
}

html.st-en .gdEn {
  display: revert !important;
}

html.st-en span.gdEn {
  display: inline !important;
}

.gdEn {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
}

/* ---------- Header ---------- */

.gdHero {
  padding: 1.6rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--gd-line);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0) 55%),
    var(--gd-card);
}

.gdHero h1 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 0.6rem 0;
  color: #f2f5fa;
}

.gdHero p {
  margin: 0;
  max-width: 62rem;
  color: #cdd5e1;
  line-height: 1.9;
}

/* ---------- Two columns: contents and the guide ---------- */

.gdLayout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* Contents on the reading side: right in Persian, left in English. */
.gdLayout {
  direction: rtl;
}

html.st-en .gdLayout {
  direction: ltr;
}

.gdToc {
  position: sticky;
  top: calc(var(--navH, 0px) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--gd-line);
  background: var(--gd-card);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.gdTocTitle {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gd-soft);
  padding: 0.2rem 0.5rem 0.5rem 0.5rem;
  border-bottom: 1px solid var(--gd-line);
  margin-bottom: 0.35rem;
}

.gdToc a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  color: var(--gd-ink);
  font-size: 0.88rem;
  text-decoration: none;
}

.gdToc a:hover {
  background: var(--gd-card-2);
  color: #fff;
}

.gdToc a .bi {
  color: var(--gd-accent);
}

/* ---------- Sections and entries ---------- */

.gdSection {
  margin-bottom: 2.25rem;
  scroll-margin-top: calc(var(--navH, 0px) + 1rem);
}

.gdSection > h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.8rem 0;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--gd-line);
  color: #f2f5fa;
}

.gdSection > h2 .bi {
  color: var(--gd-accent);
}

.gdIntro {
  color: #cdd5e1;
  line-height: 1.9;
  margin: 0 0 1rem 0;
}

.gdList,
.gdSteps {
  margin: 0;
  padding-inline-start: 1.3rem;
  line-height: 1.9;
}

.gdList li + li {
  margin-top: 0.35rem;
}

.gdEntry {
  position: relative;
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--gd-line);
  background: var(--gd-card);
  scroll-margin-top: calc(var(--navH, 0px) + 1rem);
}

.gdEntry h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.4rem 0;
  color: #f2f5fa;
}

.gdEntry p {
  margin: 0 0 0.5rem 0;
  color: #cdd5e1;
  line-height: 1.85;
}

.gdSteps {
  color: var(--gd-ink);
  font-size: 0.92rem;
}

/* The section a help dialog's link lands on is lit up for a moment. */
.gdEntry:target {
  border-color: var(--gd-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  animation: gdFlash 1.6s ease-out;
}

@keyframes gdFlash {
  0% { background: rgba(59, 130, 246, 0.25); }
  100% { background: var(--gd-card); }
}

.gdOpen {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--gd-line);
  background: var(--gd-card-2);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.gdOpen:hover {
  border-color: var(--gd-accent);
  color: #fff;
}

/* ---------- A typical day: numbered steps in a row ---------- */

.gdFlow {
  list-style: none;
  counter-reset: gd;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

html.st-en .gdFlow.gdEn {
  display: grid !important;
}

.gdFlow li {
  counter-increment: gd;
  position: relative;
  padding: 2.4rem 0.9rem 0.9rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--gd-line);
  background: var(--gd-card);
  font-size: 0.88rem;
  line-height: 1.75;
  color: #cdd5e1;
}

.gdFlow li strong {
  display: block;
  color: #f2f5fa;
  margin-bottom: 0.2rem;
}

.gdFlow li::before {
  content: counter(gd);
  position: absolute;
  top: 0.75rem;
  inset-inline-start: 0.9rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--gd-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gdTop {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gd-soft);
  text-decoration: none;
  font-size: 0.85rem;
}

.gdTop:hover {
  color: #fff;
}

/* ---------- Narrow screens: contents become a wrapping row above the guide ---------- */

@media only screen and (max-width: 900px) {
  .gdLayout {
    grid-template-columns: 1fr;
  }

  .gdToc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }

  .gdTocTitle {
    width: 100%;
  }

  .gdToc a {
    font-size: 0.8rem;
    background: var(--gd-card-2);
  }

  .gdHero h1 {
    font-size: 1.25rem;
  }
}
