/* Uptime Notes — docs-style publication CSS */

:root {
  --blue: #155ec4;
  --blue-dark: #0d4393;
  --blue-light: #eaf2fd;
  --ink: #1c2530;
  --ink-soft: #4b5563;
  --line: #dde3ea;
  --bg: #ffffff;
  --bg-sunken: #f6f8fb;
  --code-bg: #f1f4f9;
  --code-ink: #27303d;
  --tip-bg: #eafbf3;
  --tip-border: #159a6b;
  --note-bg: #eef4fd;
  --note-border: #155ec4;
  --warn-bg: #fff6e8;
  --warn-border: #c77d12;
  --radius: 6px;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; height: auto; }

/* ---------- Top bar ---------- */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 1.5rem;
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}

.brand .mark {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  align-items: center;
  justify-content: center;
}

.brand:hover { text-decoration: none; }

.top-nav {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  font-size: 0.92rem;
}

.top-nav a { color: var(--ink-soft); font-weight: 500; }
.top-nav a:hover { color: var(--blue); text-decoration: none; }
.top-nav a.current { color: var(--blue); }

.top-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  color: #8a94a3;
  font-size: 0.85rem;
  background: var(--bg-sunken);
  min-width: 170px;
}

.top-search kbd {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.3rem;
  background: #fff;
  color: #9aa4b2;
}

/* ---------- Docs layout ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 230px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 1.75rem 1.25rem 2rem 1.5rem;
  border-right: 1px solid var(--line);
  font-size: 0.9rem;
}

.nav-group { margin-bottom: 1.5rem; }

.nav-group-title {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a94a3;
  margin-bottom: 0.5rem;
}

.docs-nav ul { list-style: none; margin: 0; padding: 0; }

.docs-nav li { margin: 0.1rem 0; }

.docs-nav a {
  display: block;
  color: var(--ink-soft);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
}

.docs-nav a:hover { background: var(--bg-sunken); text-decoration: none; }

.docs-nav a.active {
  color: var(--blue);
  font-weight: 600;
  background: var(--blue-light);
  border-left-color: var(--blue);
}

/* ---------- Main content ---------- */

.docs-main {
  padding: 0 2.5rem 4rem;
  min-width: 0;
}

.breadcrumbs {
  font-size: 0.82rem;
  color: #8a94a3;
  margin: 1.75rem 0 0.75rem;
}

.breadcrumbs a { color: #8a94a3; }
.breadcrumbs a:hover { color: var(--blue); }

article.doc .tag-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

article.doc h1 {
  font-size: 2.1rem;
  line-height: 1.25;
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}

.byline {
  color: #8a94a3;
  font-size: 0.88rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.byline a { color: var(--ink-soft); font-weight: 600; }
.byline a:hover { color: var(--blue); }

article.doc h2 {
  font-size: 1.45rem;
  margin: 2.5rem 0 1rem;
  padding-top: 0.25rem;
  letter-spacing: -0.005em;
  scroll-margin-top: 75px;
}

article.doc h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.75rem;
  scroll-margin-top: 75px;
}

article.doc p { margin: 0 0 1.1rem; color: var(--ink); }

article.doc ul, article.doc ol {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
}

article.doc li { margin-bottom: 0.4rem; }

article.doc .prereqs {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1rem 1.6rem;
}

article.doc .prereqs p.prereqs-label {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

figure.doc-figure { margin: 1.75rem 0; }

figure.doc-figure figcaption {
  font-size: 0.82rem;
  color: #8a94a3;
  margin-top: 0.5rem;
}

/* ---------- Code blocks ---------- */

article.doc code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

article.doc pre {
  font-family: var(--mono);
  background: #1d2430;
  color: #e4e9f1;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1.1rem 0 1.4rem;
}

article.doc pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 1em;
}

.code-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #8a94a3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.1rem 0 -0.9rem;
}

/* ---------- Tables ---------- */

article.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 1.6rem;
  font-size: 0.92rem;
}

article.doc table caption {
  text-align: left;
  font-size: 0.82rem;
  color: #8a94a3;
  margin-bottom: 0.4rem;
}

article.doc th, article.doc td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

article.doc th {
  background: var(--bg-sunken);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

table.pricing tbody tr:nth-child(odd) { background: var(--bg-sunken); }

table.pricing td.price, table.pricing th.price { white-space: nowrap; }

table.pricing .cta a {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
}

table.pricing .cta a:hover { background: var(--blue-dark); text-decoration: none; }

/* ---------- Admonitions ---------- */

.admonition {
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem 1rem;
  margin: 1.3rem 0 1.6rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
}

.admonition-heading {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.admonition p:last-child { margin-bottom: 0; }

.admonition-tip { background: var(--tip-bg); border-left-color: var(--tip-border); }
.admonition-tip .admonition-heading { color: var(--tip-border); }

.admonition-note { background: var(--note-bg); border-left-color: var(--note-border); }
.admonition-note .admonition-heading { color: var(--note-border); }

.admonition-warning { background: var(--warn-bg); border-left-color: var(--warn-border); }
.admonition-warning .admonition-heading { color: var(--warn-border); }

/* ---------- Ad boxes ---------- */

.ad-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sunken);
  border: 1px dashed #c3cbd6;
  border-radius: var(--radius);
  color: #aab2bf;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.6rem 0;
}

.ad-box::before { content: "Advertisement"; }

#ad-inline-1, #ad-inline-2 { min-height: 250px; }

#ad-toc { min-height: 250px; margin: 1.5rem 0 0; }

/* ---------- TOC rail ---------- */

.toc {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 1.75rem 1.5rem 2rem 1.25rem;
  border-left: 1px solid var(--line);
  font-size: 0.85rem;
}

.toc-title {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a94a3;
  margin-bottom: 0.75rem;
}

.toc ul { list-style: none; margin: 0; padding: 0; }

.toc li { margin-bottom: 0.45rem; }

.toc a {
  color: var(--ink-soft);
  display: block;
  border-left: 2px solid var(--line);
  padding-left: 0.65rem;
}

.toc a:hover { color: var(--blue); text-decoration: none; border-left-color: var(--blue); }

/* ---------- Related / footer-in-doc ---------- */

.related-docs {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.related-docs h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a94a3;
  margin: 0 0 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.related-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.related-card .kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  margin-bottom: 0.3rem;
}

.related-card a { color: var(--ink); font-weight: 600; }
.related-card a:hover { color: var(--blue); }

/* ---------- Home page ---------- */

.home-hero {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin: 1.75rem 0 2.5rem;
  border: 1px solid var(--line);
}

.home-hero img { width: 100%; max-height: 320px; object-fit: cover; }

.home-hero .hero-caption {
  padding: 1.1rem 1.4rem;
  background: var(--bg-sunken);
}

.home-hero h1 { margin: 0 0 0.4rem; font-size: 1.7rem; }
.home-hero p { margin: 0; color: var(--ink-soft); }

.post-list { list-style: none; margin: 0; padding: 0; }

.post-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}

.post-card img { border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; }

.post-card .cat-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  background: var(--blue-light);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.post-card h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--blue); }

.post-card .excerpt { margin: 0 0 0.4rem; color: var(--ink-soft); font-size: 0.95rem; }

.post-card .meta { font-size: 0.8rem; color: #8a94a3; }

.section-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a94a3;
  margin: 2.25rem 0 0.25rem;
}

/* ---------- Site footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  color: #8a94a3;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer nav a { color: #8a94a3; margin-left: 1.1rem; }
.site-footer nav a:first-child { margin-left: 0; }
.site-footer nav a:hover { color: var(--blue); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .docs-layout { grid-template-columns: 220px 1fr; }
  .toc { display: none; }
}

@media (max-width: 800px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .post-card { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}

/* Pubber: a filled ad container drops its placeholder styling */
.pb-filled{background:none !important;border:0 !important;min-height:0 !important;height:auto !important}
.pb-filled::before,.pb-filled::after{content:none !important;display:none !important}
