/* SeoGraph – front end: floating button, overlay, crawlable block, HTML sitemap. */

/* Floating button: every visual setting is a CSS variable (see FloatingButton::css_vars). */
.seograph-fab {
  --sgb-bg: #0b1226; --sgb-fg: #fff; --sgb-icon: #3b82f6; --sgb-border: #1e293b; --sgb-glow: #3b82f6;
  --sgb-scale: 1; --sgb-x: 22px; --sgb-y: 22px; --sgb-radius: 999px; --sgb-z: 99990;
  position: fixed; z-index: var(--sgb-z); display: inline-flex; align-items: center; gap: calc(8px * var(--sgb-scale));
  padding: calc(11px * var(--sgb-scale)) calc(18px * var(--sgb-scale)) calc(11px * var(--sgb-scale)) calc(16px * var(--sgb-scale));
  border: 1px solid var(--sgb-border); border-radius: 999px; cursor: pointer; background: var(--sgb-bg); color: var(--sgb-fg);
  font-family: "Vazirmatn", "IRANSansX", "IRANSans", Tahoma, sans-serif; font-size: calc(14px * var(--sgb-scale)); font-weight: 600; line-height: 1;
  box-shadow: 0 10px 26px -10px rgba(2, 6, 23, .55); transition: transform .2s ease, box-shadow .2s ease, opacity .25s ease;
}
.seograph-fab .sgb-icon { display: inline-flex; color: var(--sgb-icon); }
.seograph-fab .sgb-svg { width: calc(18px * var(--sgb-scale)); height: calc(18px * var(--sgb-scale)); }
.seograph-fab.sgb-glow { box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--sgb-glow) 70%, transparent), 0 0 22px -4px var(--sgb-glow); }
.seograph-fab.sgb-glow .sgb-icon { filter: drop-shadow(0 0 6px var(--sgb-glow)); }
.seograph-fab:hover { transform: translateY(-2px); }
.seograph-fab:focus-visible { outline: 2px solid var(--sgb-icon); outline-offset: 3px; }
.seograph-fab.sgb-shape-rounded { border-radius: var(--sgb-radius); }
.seograph-fab.sgb-shape-circle { border-radius: 50%; }
.seograph-fab.sgb-icon-only { padding: calc(13px * var(--sgb-scale)); }
.seograph-fab.sgb-icon-only .sgb-label { display: none; }
.sgb-pos-bottom-left { left: var(--sgb-x); bottom: var(--sgb-y); }
.sgb-pos-bottom-right { right: var(--sgb-x); bottom: var(--sgb-y); }
.sgb-pos-top-left { left: var(--sgb-x); top: var(--sgb-y); }
.sgb-pos-top-right { right: var(--sgb-x); top: var(--sgb-y); }
.sgb-pos-middle-left { left: var(--sgb-x); top: 50%; transform: translateY(-50%); }
.sgb-pos-middle-right { right: var(--sgb-x); top: 50%; transform: translateY(-50%); }
.sgb-pos-middle-left:hover, .sgb-pos-middle-right:hover { transform: translateY(calc(-50% - 2px)); }
.seograph-fab.sgb-pulse::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 0 var(--sgb-glow); animation: sgbPulse 2.4s ease-out 3; pointer-events: none; }
@keyframes sgbPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sgb-glow) 70%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.seograph-fab.sgb-wait-scroll { opacity: 0; pointer-events: none; }
.seograph-fab.sgb-wait-scroll.sgb-visible { opacity: 1; pointer-events: auto; }
@media (max-width: 640px) {
  .seograph-fab.sgb-mobile-icon { padding: calc(13px * var(--sgb-scale)); }
  .seograph-fab.sgb-mobile-icon .sgb-label { display: none; }
  .seograph-fab.sgb-mobile-hide { display: none; }
}
@media (prefers-reduced-motion: reduce) { .seograph-fab, .seograph-fab::after { transition: none; animation: none; } }

/* Overlay */
.seograph-overlay { position: fixed !important; inset: 0; z-index: 2147483000; opacity: 0; visibility: hidden; transform: scale(.985); transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s; }
.seograph-overlay.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s ease; }
html.seograph-lock, html.seograph-lock body { overflow: hidden !important; }
.seograph-embed { width: 100%; margin: 1.5em 0; border-radius: 16px; box-shadow: 0 10px 40px -12px rgba(2, 6, 23, .45); }

/* Crawlable block */
.seograph-block { margin: 2.2em 0 1em; padding: 18px 20px; border-radius: 16px; border: 1px solid rgba(100, 116, 139, .22); background: rgba(100, 116, 139, .05); font-size: 14px; line-height: 2; }
.seograph-block .sgx-title { margin: 0 0 6px; font-weight: 700; font-size: 15px; }
.seograph-block .sgx-path { margin: 0 0 10px; font-size: 13px; }
.seograph-block .sgx-sep { opacity: .45; margin: 0 6px; }
.seograph-block .sgx-seq { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.seograph-block .sgx-seq a { display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(100, 116, 139, .2); text-decoration: none; line-height: 1.8; }
.seograph-block .sgx-seq small { display: block; opacity: .6; font-size: 12px; }
.seograph-block .sgx-next { text-align: left; }
.seograph-block .sgx-sub { margin: 10px 0 2px; font-weight: 600; }
.seograph-block .sgx-related { margin: 0; padding-right: 18px; }
@media (max-width: 600px) { .seograph-block .sgx-seq { grid-template-columns: 1fr; } .seograph-block .sgx-next { text-align: right; } }

/* HTML sitemap */
.seograph-sitemap ul { list-style: none; margin: 0; padding-right: 18px; border-right: 1px dashed rgba(100, 116, 139, .3); }
.seograph-sitemap > ul { border: 0; padding: 0; }
.seograph-sitemap li { margin: 4px 0; line-height: 2; }
.seograph-sitemap .sgs-level-1 > li > a { font-weight: 700; }
/* Start-up error (shown instead of a silent failure) */
.seograph-error { position: absolute; inset: 0; margin: auto; width: min(420px, 90vw); height: fit-content; background: #0b1226; color: #e2e8f0; border: 1px solid rgba(148,163,184,.3); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 10px; font-family: inherit; direction: rtl; text-align: right; }
.seograph-error span { color: #fca5a5; font-size: 13px; direction: ltr; text-align: left; word-break: break-word; }
.seograph-error small { color: #94a3b8; line-height: 1.8; }
.seograph-error button { align-self: flex-start; background: #3b82f6; color: #fff; border: 0; border-radius: 10px; padding: 8px 16px; cursor: pointer; }
