/* D2R help guide theme (W5): puts the shared design system on the stock Frappe Wiki at /help, so it reads as the
   fourth D2R product instead of a different one. Tokens only (ds/tokens.css); no hex colours, no px font sizes.
   Wired in with the web_include_css hook in dbev_agency/hooks.py. The logo and the accent are never hard-coded here:
   they are read from Agency Settings by d2r-ops/seed_help.py (Wiki Settings.logo/dark_mode_logo, and --acc, set by
   the script in d2r-ops/help_theme/prepaint.js). See d2r-ops/help_theme/README.md for how the two scripts are wired. */
@import url("/assets/unwind_kam/ds/tokens.css");
@import url("/assets/unwind_kam/ds/components.css");

/* ------------------------------------------------------------------ page */
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: var(--fs-md); line-height: var(--lh); }
.content-view { background: var(--bg); min-height: 100vh; }
a { color: var(--acc-text); }
::selection { background: var(--acc-soft); }
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, .sidebar-group-item-title:focus-visible,
.sun-moon-container:focus-visible { outline: var(--focus-outline); outline-offset: 2px; border-radius: var(--r-sm); }

/* ------------------------------------------------------------------ navbar */
.wiki-navbar { background: var(--surface-solid); border-bottom: 1px solid var(--line); box-shadow: none; padding: 0 var(--gutter); }
.navbar-brand-container { background: transparent; }
.navbar-brand { color: var(--text) !important; }
.navbar-brand img { height: calc(22px * var(--ctl-scale)); max-width: none; }
.navbar-link, .navbar-nav .dropdown-item { color: var(--text-2); font-size: var(--fs-sm); }
.navbar-link:hover, .navbar-nav .dropdown-item:hover { color: var(--text); background: var(--hover); }
.dropdown-menu { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
.sun-moon-container { display: inline-flex; align-items: center; justify-content: center; width: var(--ctl-h-sm); height: var(--ctl-h-sm);
	border-radius: var(--r-pill); cursor: pointer; color: var(--text-2); }
.sun-moon-container:hover { background: var(--hover); color: var(--text); }
#navbar-dropdown-content .app-switcher { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
#navbar-dropdown-content .space-link { color: var(--text-2); }
#navbar-dropdown-content .space-link:hover { background: var(--hover); color: var(--text); }

/* ------------------------------------------------------------------ sidebar */
.doc-sidebar, .web-sidebar { background: var(--bg-2); border-right: 1px solid var(--line); }
.sidebar-group-title { font-size: var(--fs-xs); font-weight: var(--label-weight); letter-spacing: var(--label-tracking);
	text-transform: var(--label-transform); color: var(--text-3); }
.sidebar-group-item-title { color: var(--text-2); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.sidebar-item:hover .sidebar-group-item-title { color: var(--text); background: var(--hover); }
.sidebar-item-active .sidebar-group-item-title { color: var(--acc-text); font-weight: 600; background: var(--acc-soft); }
.sidebar-group .collapsible .icon { color: var(--text-3); }

/* ------------------------------------------------------------------ the back link (added by help_theme/wiki-page.js) */
.d2r-help-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 16px; font-size: var(--fs-sm); font-weight: 600;
	color: var(--acc-text); text-decoration: none; }
.d2r-help-back::before { content: "\2190"; } /* left arrow */
.d2r-help-back:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ page body typography */
.wiki-title { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.02em; color: var(--text); margin: 0 0 6px; }
.markdown h1, .from-markdown h1 { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
.markdown h2, .from-markdown h2 { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.01em; color: var(--text); margin-top: 1.6em; }
.markdown h3, .from-markdown h3 { font-size: var(--fs-lg); font-weight: 600; color: var(--text); margin-top: 1.4em; }
.markdown h4, .markdown h5, .markdown h6, .from-markdown h4, .from-markdown h5, .from-markdown h6 { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.markdown p, .from-markdown p { color: var(--text-2); font-size: var(--fs-md); }
.markdown strong, .from-markdown strong { color: var(--text); }
.markdown a, .from-markdown a { color: var(--acc-text); text-decoration: underline; text-decoration-color: var(--acc-line); }
.markdown ul, .markdown ol, .from-markdown ul, .from-markdown ol { color: var(--text-2); font-size: var(--fs-md); }
.markdown blockquote, .from-markdown blockquote { border-left: 3px solid var(--line-3); padding-left: 14px; color: var(--text-3); }
.markdown hr, .from-markdown hr { border-color: var(--line); }

/* ------------------------------------------------------------------ code blocks */
.markdown code, .from-markdown code { font-family: var(--mono); font-size: var(--fs-sm); background: var(--surface-2);
	border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1px 6px; }
.markdown pre, .from-markdown pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
	padding: 14px 16px; }
.markdown pre code, .from-markdown pre code { background: transparent; border: none; padding: 0; }

/* ------------------------------------------------------------------ tables */
.markdown table, .from-markdown table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
.markdown th, .from-markdown th { background: var(--surface-2); color: var(--text); font-weight: 600; text-align: left;
	border-bottom: 1px solid var(--line-2); padding: 8px 12px; }
.markdown td, .from-markdown td { color: var(--text-2); border-bottom: 1px solid var(--line); padding: 8px 12px; }

/* ------------------------------------------------------------------ feedback + search widgets */
.wiki-page-meta { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; }
.feedback-btn { color: var(--acc-text); cursor: pointer; }
.user-contributions { color: var(--text-3); font-size: var(--fs-xs); }
.modal-content { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); color: var(--text); }
.modal-header, .modal-footer { border-color: var(--line); }
.form-control { background: var(--field-bg); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--r); min-height: var(--ctl-h); }
.form-control:focus { border-color: var(--acc-line); box-shadow: var(--focus-ring); background: var(--field-bg); color: var(--text); }
.search-dropdown-menu { background: var(--surface-solid); border: 1px solid var(--line); }
.search-icon { color: var(--text-3); }

/* ------------------------------------------------------------------ buttons */
.btn { font-family: var(--sans); font-size: var(--fs-sm); border-radius: var(--r); min-height: var(--ctl-h-sm); }
.btn-primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn-primary:hover { background: var(--acc); filter: brightness(1.08); }
.btn-secondary { background: var(--surface-2); border-color: var(--line-2); color: var(--text-2); }
.btn-secondary:hover { background: var(--hover); color: var(--text); }

/* ------------------------------------------------------------------ table of contents + prev/next */
.page-toc-title { color: var(--text-3); font-size: var(--fs-xs); text-transform: var(--label-transform); letter-spacing: var(--label-tracking); }
.page-toc a { color: var(--text-2); font-size: var(--fs-sm); }
.page-toc a:hover { color: var(--acc-text); }
.wiki-footer .btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.wiki-footer .btn:hover { color: var(--text); background: var(--hover); }

/* ------------------------------------------------------------------ hide edit affordances, for everyone (no setting
   exists for this; CSS is the only lever, confirmed against the rendered templates in apps/wiki) */
.sidebar-edit-mode-btn, .add-sidebar-group, .sidebar-view-mode-btn, .new-wiki-page,
.wiki-page-meta .dropdown, .admin-banner { display: none !important; }

/* ------------------------------------------------------------------ hide the wiki's own avatar menu, for everyone
   (same reasoning as the edit affordances above: no setting exists, CSS is the only lever). The wiki navbar's
   account menu links to the raw Frappe account page and to Logout, which break two rules the rest of D2R already
   follows: sign-out lives only on My account inside each app (ec74bc8), and the app switcher only shows Agency and
   Field Execution with the D2R mark (W3), not the framework's own /desk and /apps. #website-post-login is the <li>
   that holds both the avatar button and its dropdown (My Account, Logout, Contributions, My Drafts, Switch To Desk,
   Apps), so hiding it removes the button too once the menu behind it is gone. It is an id, not a class, so it does
   not touch the search dropdown (#search-container / .search-dropdown-menu) or the theme toggle (.sun-moon-container). */
#website-post-login { display: none !important; }
