/* docs.grawlr.com — palette / nav patterns aligned with dashboard.css */

:root {
  --primary-purple: #5a6985;
  --primary-pink: #455983;
  --accent-violet: #bccce4;
  --light-bg: #f8faff;
  --lighter-bg: #c1d1d4;
  --text-dark: #111827;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --hover-bg: #c1d1d4;
  --card-header-bg: #edf0f0;
  --ink: #0f172a;
  --ink-soft: #1e293b;
  --paper: #fcfdff;
  --topbar-h: 56px;
  --sidebar-w: 280px;
  --toc-w: 200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 1rem);
}

body {
  margin: 0;
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 12% -10%, rgba(188, 204, 228, 0.22), transparent 60%),
    radial-gradient(900px 420px at 88% 0%, rgba(208, 248, 234, 0.14), transparent 55%),
    var(--paper);
  background-attachment: fixed;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary-pink);
  text-decoration: none;
}

a:hover {
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 3000;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Top bar */
.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--topbar-h);
  background: rgba(248, 250, 255, 0.82);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.docs-topbar-inner {
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  flex-shrink: 0;
}

.docs-brand img {
  height: 20px;
  width: auto;
}

.docs-brand-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1a2744;
  border-left: 1px solid var(--border-color);
  padding-left: 0.55rem;
}

.docs-top-tabs {
  display: none;
  align-items: center;
  gap: 0.15rem;
}

@media (min-width: 768px) {
  .docs-top-tabs {
    display: flex;
  }
}

.docs-top-tabs a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  padding: 0.55rem 0.85rem;
  border-bottom: 2px solid transparent;
}

.docs-top-tabs a.is-active,
.docs-top-tabs a:hover {
  color: var(--ink);
  border-bottom-color: var(--primary-purple);
}

.docs-top-tabs a.docs-ext i {
  font-size: 0.65rem;
  opacity: 0.55;
  margin-left: 0.15rem;
  vertical-align: 0.05em;
}

.docs-top-tabs a.docs-ext:hover i {
  opacity: 0.85;
}

.docs-search-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  min-width: 12rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.docs-search-btn:hover,
.docs-search-btn:focus-visible {
  border-color: var(--primary-purple);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(90, 105, 133, 0.12);
  outline: none;
}

.docs-search-btn span {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-search-btn kbd {
  display: none;
  font-size: 0.7rem;
  background: var(--card-header-bg);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
  color: var(--ink-soft);
  margin-left: auto;
}

@media (min-width: 992px) {
  .docs-search-btn {
    min-width: 16rem;
  }

  .docs-search-btn kbd {
    display: inline;
  }
}

.docs-menu-toggle {
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Shell */
.docs-shell {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - var(--topbar-h));
}

@media (min-width: 992px) {
  .docs-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
}

@media (min-width: 1200px) {
  .docs-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  }
}

/* Sidebar — quieter docs nav (no dashboard chevrons) */
.docs-sidebar {
  border-right: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: fixed;
  inset: var(--topbar-h) auto 0 0;
  width: min(88vw, var(--sidebar-w));
  transform: translateX(-105%);
  transition: transform 0.25s var(--ease);
  z-index: 900;
  overflow-y: auto;
}

.docs-sidebar.is-open {
  transform: translateX(0);
  box-shadow: 8px 0 24px rgba(17, 24, 39, 0.08);
}

@media (min-width: 992px) {
  .docs-sidebar {
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    transform: none;
    width: auto;
    box-shadow: none;
  }
}

.docs-sidebar-inner {
  padding: 1rem 0 2rem;
}

.docs-nav-section {
  margin-bottom: 1.1rem;
}

.docs-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0 1.5rem;
  margin: 0 0 0.25rem;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 1.25rem 0.62rem 1.35rem;
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.docs-nav-link i {
  width: 1.15rem;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: #6b7280;
}

.docs-nav-link:hover {
  background: rgba(193, 209, 212, 0.45);
  color: var(--text-dark);
}

.docs-nav-link:hover i {
  color: var(--primary-pink);
}

.docs-nav-link.is-active {
  background: rgba(188, 204, 228, 0.4);
  border-left-color: var(--primary-purple);
  color: var(--primary-pink);
  font-weight: 600;
}

.docs-nav-link.is-active i {
  color: var(--primary-pink);
}

/* Main */
.docs-main {
  padding: 1.75rem 1.25rem 3.5rem;
  max-width: 820px;
  width: 100%;
  justify-self: center;
}

@media (min-width: 992px) {
  .docs-main {
    padding: 2rem 2.25rem 4rem;
  }
}

.docs-breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.docs-breadcrumb a {
  color: var(--ink-soft);
}

.docs-article.is-ready {
  animation: docs-enter 0.32s var(--ease) both;
}

@keyframes docs-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.docs-article h1 {
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
  color: var(--ink);
}

.docs-purpose {
  margin: 0 0 1.35rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--primary-purple);
  background: linear-gradient(90deg, rgba(188, 204, 228, 0.28), rgba(252, 253, 255, 0.4));
  border-radius: 0 10px 10px 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.docs-article h2,
.docs-article h3 {
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}

.docs-article h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-top: 0;
  color: var(--ink);
}

.docs-article h2:first-of-type {
  margin-top: 1.5rem;
}

.docs-article h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.docs-article p,
.docs-article ul,
.docs-article ol {
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.docs-article li {
  color: var(--ink-soft);
}

.docs-article ul,
.docs-article ol {
  padding-left: 1.25rem;
}

.docs-article li + li {
  margin-top: 0.35rem;
}

.docs-article code {
  font-size: 0.86em;
  background: var(--card-header-bg);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

.docs-article pre {
  background: #111827;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.docs-article pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.docs-article img {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
  margin: 0.5rem 0 1.25rem;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

.docs-article blockquote {
  margin: 0 0 1.25rem;
  padding: 0.95rem 1.1rem;
  border-left: 3px solid var(--primary-purple);
  background: linear-gradient(90deg, rgba(188, 204, 228, 0.35), rgba(237, 240, 240, 0.9));
  border-radius: 0 10px 10px 0;
  color: var(--ink-soft);
}

.docs-article blockquote p:last-child {
  margin-bottom: 0;
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
}

.docs-table-wrap {
  overflow-x: auto;
  margin: 0 0 1.35rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
}

.docs-table-wrap table {
  margin: 0;
}

.docs-table-wrap th,
.docs-table-wrap td {
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  text-align: left;
}

.docs-table-wrap tr:last-child td {
  border-bottom: none;
}

.docs-table-wrap th {
  background: var(--card-header-bg);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.docs-article th,
.docs-article td {
  border: 1px solid var(--border-color);
  padding: 0.55rem 0.7rem;
  text-align: left;
}

.docs-article th {
  background: var(--card-header-bg);
  font-weight: 600;
}

.docs-loading {
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.docs-skeleton {
  display: grid;
  gap: 0.75rem;
  padding: 0.25rem 0 1rem;
}

.docs-skeleton-line {
  height: 0.85rem;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8ecef 0%, #f4f6f8 45%, #e8ecef 100%);
  background-size: 200% 100%;
  animation: docs-shimmer 1.2s ease-in-out infinite;
}

.docs-skeleton-title {
  height: 1.75rem;
  width: 55%;
  margin-bottom: 0.35rem;
}

.docs-skeleton-short {
  width: 68%;
}

@keyframes docs-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Pager */
.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.docs-pager a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
  min-width: 42%;
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s var(--ease);
}

.docs-pager a:hover,
.docs-pager a:focus-visible {
  border-color: var(--primary-purple);
  background: rgba(188, 204, 228, 0.28);
  box-shadow: 0 10px 24px rgba(69, 89, 131, 0.14);
  transform: translateY(-2px);
  color: var(--ink);
  outline: none;
}

.docs-pager a span {
  font-size: 0.75rem;
  color: var(--ink-soft);
  transition: color 0.18s ease;
}

.docs-pager a:hover span,
.docs-pager a:focus-visible span {
  color: var(--primary-pink);
}

.docs-pager a strong {
  font-weight: 600;
}

.docs-pager a.is-next {
  margin-left: auto;
  text-align: right;
}

.docs-pager a:not(.is-next) span::before {
  content: "← ";
}

.docs-pager a.is-next span::after {
  content: " →";
}

/* TOC */
.docs-toc {
  position: sticky;
  top: calc(var(--topbar-h) + 1.25rem);
  align-self: start;
  padding: 1.5rem 1rem 2rem 0;
  max-height: calc(100vh - var(--topbar-h) - 2rem);
  overflow: auto;
}

.docs-toc.is-empty {
  visibility: hidden;
}

.docs-toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 0.65rem;
}

#docs-toc a {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 0.3rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.55rem;
  margin-left: -0.1rem;
}

#docs-toc a[data-level="h3"] {
  padding-left: 1.1rem;
  font-size: 0.78rem;
}

#docs-toc a:hover,
#docs-toc a.is-active {
  color: var(--primary-purple);
  border-left-color: var(--primary-purple);
}

/* Search modal */
.docs-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14vh 1rem 1rem;
}

.docs-search-modal[hidden] {
  display: none !important;
}

.docs-search-dialog {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.docs-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.docs-search-bar > i {
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex-shrink: 0;
}

#docs-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.25rem 0;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
  outline: none;
}

#docs-search-input::placeholder {
  color: #9ca3af;
}

.docs-search-esc {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.docs-search-esc kbd,
.docs-search-footer kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--card-header-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  min-width: 1.4rem;
  text-align: center;
}

.docs-search-results {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  max-height: min(420px, 52vh);
  overflow: auto;
  min-height: 0;
}

.docs-search-results:empty {
  display: none;
}

.docs-search-results li {
  margin: 0;
}

.docs-search-results li a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  color: var(--ink);
}

.docs-search-results li a:hover,
.docs-search-results li a.is-active {
  background: var(--lighter-bg);
  color: var(--primary-purple);
}

.docs-search-results .result-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.docs-search-results .result-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.docs-search-results .result-section {
  text-align: left;
  margin-top: 0;
}

.docs-search-results .result-snippet {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink-soft);
}

mark.docs-search-mark {
  background: #fef08c;
  color: inherit;
  padding: 0 0.12em;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.docs-article mark.docs-search-mark {
  background: #fde047;
}

.docs-search-empty,
.docs-search-none {
  margin: 0;
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.docs-search-empty i,
.docs-search-none i {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 0.55rem;
  opacity: 0.55;
}

.docs-search-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--card-header-bg);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.docs-search-footer span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.docs-search-footer kbd {
  padding: 0.1rem 0.32rem;
}

/* —— Learn magazine theme (deeper teal) —— */
body.area-learn {
  --primary-purple: #0d9488;
  --primary-pink: #0f766e;
  --accent-violet: #5eead4;
  --light-bg: #f0fafa;
  --lighter-bg: #ccfbf1;
  --hover-bg: #99f6e4;
  --card-header-bg: #e6f7f5;
  --paper: #f5fbfb;
  --ink: #0a1f1d;
  --ink-soft: #163532;
  --border-color: #c5ddd9;
  background:
    radial-gradient(1100px 460px at 10% -8%, rgba(13, 148, 136, 0.14), transparent 58%),
    radial-gradient(900px 400px at 92% 0%, rgba(45, 212, 191, 0.1), transparent 55%),
    var(--paper);
}

body.area-learn .docs-topbar {
  background: rgba(245, 251, 251, 0.9);
}

body.area-learn .docs-sidebar {
  background: rgba(255, 255, 255, 0.8);
}

body.area-learn .docs-nav-link.is-active {
  background: rgba(13, 148, 136, 0.12);
  border-left-color: var(--primary-purple);
  color: var(--primary-pink);
}

body.area-learn .docs-purpose {
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.12), rgba(245, 251, 251, 0.5));
  border-left-color: var(--primary-purple);
}

body.area-learn .docs-pager a:hover,
body.area-learn .docs-pager a:focus-visible {
  background: rgba(13, 148, 136, 0.1);
  border-color: var(--primary-purple);
  box-shadow: 0 10px 24px rgba(13, 148, 136, 0.12);
}

/* Story callouts — tall teal bar, no card chrome */
.learn-story {
  margin: 1.85rem 0 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border: none;
  border-left: 4px solid #0d9488;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.learn-story + .learn-story {
  margin-top: 1.5rem;
}

.learn-story-label {
  display: none;
}

.learn-story h4 {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.learn-story h4:first-of-type {
  margin-top: 0;
}

.learn-story p {
  margin: 0 0 0.4rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.65;
}

.learn-story p:last-child {
  margin-bottom: 0;
}

body.area-learn .docs-article > .learn-story:first-of-type {
  margin-top: 3.5rem;
  position: relative;
  padding-top: 0.35rem;
}

body.area-learn .docs-article > .learn-story:first-of-type::before {
  content: "Stories from businesses like yours";
  display: block;
  position: absolute;
  top: -2rem;
  left: 0;
  right: 0;
  padding-bottom: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f766e;
}

/* Learn sidebar: clearer section rhythm */
body.area-learn .docs-nav-section {
  margin-bottom: 1.35rem;
}

body.area-learn .docs-nav-label {
  color: #0f766e;
  opacity: 0.8;
}

body.area-learn .docs-main {
  max-width: 760px;
}

body.area-learn .docs-article {
  font-size: 1.02rem;
  line-height: 1.7;
}

body.area-learn .docs-article h1 {
  letter-spacing: -0.03em;
}

body.area-learn .docs-breadcrumb {
  margin-bottom: 1rem;
}

body.area-learn .docs-top-tabs a.is-active {
  border-bottom-color: #0d9488;
  color: #0f766e;
}

body.area-learn .docs-search-btn:hover,
body.area-learn .docs-search-btn:focus-visible {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
}

body.area-learn .docs-nav-link span {
  white-space: normal;
  line-height: 1.35;
}

body.area-learn .docs-nav-link {
  align-items: flex-start;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

body.area-learn .docs-nav-link i {
  margin-top: 0.15rem;
  color: #0f766e;
}

body.area-learn .docs-article h2 {
  margin-top: 1.85rem;
}

body.area-learn .docs-brand-label {
  color: #0a3d3a;
  border-left-color: #9bb8b4;
  font-weight: 700;
}
