/**
 * SAPERION API Documentation — Static site styles
 * Hyland brand-inspired theme.
 *
 * Brand colors:
 *   Navy (primary):   #1a1f4d
 *   Hyland yellow:    #FFC72C
 *   Hyland teal:      #00B189
 *   Hyland purple:    #5847C7
 *   Hyland orange:    #FF5C39
 */

/* ========================================
   CSS custom properties — Light theme
   ======================================== */
:root {
  --hyland-navy: #1a1f4d;
  --hyland-navy-dark: #14183d;
  --hyland-yellow: #ffc72c;
  --hyland-teal: #00b189;
  --hyland-purple: #5847c7;
  --hyland-orange: #ff5c39;

  --color-primary: var(--hyland-navy);
  --color-link: var(--hyland-navy);
  --color-link-hover: var(--hyland-purple);

  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-text: #1c1e21;
  --color-text-muted: #525860;
  --color-heading: var(--hyland-navy);

  --color-border: #e3e5ee;
  --color-emphasis-100: #f5f6f8;
  --color-emphasis-200: #ebedf0;
  --color-emphasis-300: #dadde1;

  --sidebar-bg: #f4f5fb;
  --sidebar-border: #e3e5ee;
  --sidebar-item-hover: #e8eaf3;
  --sidebar-item-active-bg: #e3e5ee;
  --sidebar-item-active-color: #1a1f4d;

  --navbar-bg: var(--hyland-navy);
  --navbar-height: 60px;
  --footer-bg: #191f5e;
  --footer-color: #ffffff;

  --card-shadow: 0 1px 3px rgba(26, 31, 77, 0.06);
  --card-shadow-hover: 0 8px 24px rgba(26, 31, 77, 0.15);
  --card-border: 1px solid #e3e5ee;
  --card-border-hover: 1px solid var(--hyland-navy);

  --font-base:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  --font-monospace:
    'JetBrains Mono', 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono',
    'Courier New', monospace;
}

/* ========================================
   CSS custom properties — Dark theme
   ======================================== */
[data-theme='dark'] {
  --color-bg: #0f1232;
  --color-surface: #161a42;
  --color-text: #ebedf0;
  --color-text-muted: #b6bce3;
  --color-heading: #ffffff;

  --color-border: #232a64;
  --color-emphasis-100: #161a42;
  --color-emphasis-200: rgba(255, 255, 255, 0.05);
  --color-emphasis-300: rgba(255, 255, 255, 0.08);

  --color-link: var(--hyland-yellow);
  --color-link-hover: #ffd54a;

  --sidebar-bg: #161a42;
  --sidebar-border: #232a64;
  --sidebar-item-hover: #1f2553;
  --sidebar-item-active-bg: #232a64;
  --sidebar-item-active-color: #ffffff;

  --navbar-bg: #0a0d24;
  --footer-bg: #0a0d24;

  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 8px 24px rgba(255, 199, 44, 0.15);
  --card-border: 1px solid #232a64;
  --card-border-hover: 1px solid var(--hyland-yellow);
}

/* ========================================
   Base
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  font-weight: 700;
  margin-top: 0;
}

code {
  background-color: var(--color-emphasis-200);
  border: 1px solid var(--color-emphasis-300);
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  font-family: var(--font-monospace);
  font-size: 0.875em;
}

/* ========================================
   Layout shell
   ======================================== */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--color-bg);
}

/* ========================================
   Navbar — dark navy
   ======================================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 1.5rem;
  background-color: var(--navbar-bg);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

.navbar__brand:hover {
  color: #ffffff;
  text-decoration: none;
}

.navbar__logo {
  height: 32px;
  display: flex;
  align-items: center;
}

.navbar__logo img {
  height: 100%;
  width: auto;
  display: block;
}

.navbar__title {
  color: #ffffff;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.navbar__items {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar__toggle {
  display: none;
  background: transparent;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
}

.navbar__toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.theme-toggle {
  background: transparent;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .theme-toggle__sun {
  display: none;
}

.theme-toggle .theme-toggle__moon {
  display: block;
}

[data-theme='dark'] .theme-toggle .theme-toggle__sun {
  display: block;
}

[data-theme='dark'] .theme-toggle .theme-toggle__moon {
  display: none;
}

/* ========================================
   Version switcher in the navbar
   ======================================== */
.navbar__version {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffffff;
  font-size: 0.8125rem;
  line-height: 1;
}

.navbar__version-label {
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.navbar__version-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(255, 255, 255, 0.06);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  height: 30px;
  padding: 0 1.75rem 0 0.625rem;
  min-width: 80px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.navbar__version-select:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.navbar__version-select:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}

.navbar__version-select option {
  color: #1c1e21;
  background-color: #ffffff;
}

@media (max-width: 600px) {
  .navbar__version-label {
    display: none;
  }
}

/* ========================================
   Sidebar — pale lavender
   ======================================== */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

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

.sidebar__menu li + li {
  margin-top: 0.125rem;
}

.sidebar__link {
  display: block;
  padding: 0.625rem 0.875rem;
  color: var(--hyland-navy);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

[data-theme='dark'] .sidebar__link {
  color: #ebedf0;
}

.sidebar__link:hover {
  background-color: var(--sidebar-item-hover);
  color: var(--hyland-navy);
  text-decoration: none;
}

[data-theme='dark'] .sidebar__link:hover {
  color: #ffffff;
}

.sidebar__link--active {
  background-color: var(--sidebar-item-active-bg);
  color: var(--sidebar-item-active-color);
  font-weight: 600;
}

[data-theme='dark'] .sidebar__link--active {
  color: #ffffff;
}

/* ========================================
   Home page (rendered inside a doc-style layout)
   ======================================== */
.hyland-home {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
}

.hyland-home__hero {
  padding: 1rem 0 2.5rem;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 2.5rem;
}

.hyland-home__title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--hyland-navy);
}

[data-theme='dark'] .hyland-home__title {
  color: #ffffff;
}

.hyland-home__subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 760px;
}

.hyland-home__cards {
  margin-top: 1rem;
}

.hyland-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.hyland-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem;
  background: var(--color-surface);
  border: var(--card-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.hyland-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border: var(--card-border-hover);
  text-decoration: none;
  color: inherit;
}

.hyland-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  margin-bottom: 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hyland-navy);
  background: rgba(26, 31, 77, 0.08);
  border-radius: 4px;
  width: fit-content;
}

[data-theme='dark'] .hyland-card__badge {
  color: var(--hyland-yellow);
  background: rgba(255, 199, 44, 0.12);
}

.hyland-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.625rem;
  color: var(--hyland-navy);
}

[data-theme='dark'] .hyland-card__title {
  color: #ffffff;
}

.hyland-card__description {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
  flex: 1;
}

.hyland-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--hyland-navy);
}

[data-theme='dark'] .hyland-card__link {
  color: var(--hyland-yellow);
}

.hyland-card__link::after {
  content: '→';
  transition: transform 0.2s ease;
  font-size: 1.125rem;
}

.hyland-card:hover .hyland-card__link::after {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .hyland-home__title {
    font-size: 2.25rem;
  }

  .hyland-home__subtitle {
    font-size: 1.0625rem;
  }
}

/* ========================================
   API page (full-height iframe)
   ----------------------------------------
   Fix the article block at exactly one viewport-minus-navbar tall, so the
   iframe fills the visible area on initial load and the footer sits at the
   natural bottom of the document (a small scroll away — never pinned to
   the screen). Mirrors the layout used in the Docusaurus repo.
   ======================================== */
.api-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--navbar-height));
}

.breadcrumbs {
  padding: 0.625rem 1.25rem;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--hyland-navy);
}

[data-theme='dark'] .breadcrumbs a:hover {
  color: var(--hyland-yellow);
}

.breadcrumbs__sep {
  margin: 0 0.5rem;
  color: var(--color-text-muted);
  opacity: 0.6;
}

.breadcrumbs__current {
  color: var(--hyland-navy);
  background-color: var(--sidebar-item-active-bg);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

[data-theme='dark'] .breadcrumbs__current {
  color: #ffffff;
  background-color: var(--sidebar-item-active-bg);
}

.api-frame__wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  background: #ffffff;
  min-height: 0;
}

.api-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

.api-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 1rem;
  background: #ffffff;
}

/* ========================================
   Footer — Hyland support-style centered footer
   ======================================== */
.footer {
  background-color: var(--footer-bg);
  color: var(--footer-color);
  padding: 1.75rem 1.5rem;
  text-align: center;
  overflow-x: hidden;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

/* The HTML lists the legal links first and the copyright/trademark block
   second. The Hyland support-footer layout wants them rendered the other
   way around (copyright on top, links underneath), so we use flex `order`
   on the two siblings instead of duplicating the HTML. */
.footer__bottom {
  order: 1;
  width: 100%;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0;
}

.footer-copyright {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0;
  margin-bottom: 0.28rem;
}

.footer-trademark {
  display: inline-block;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin: 4px;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: nowrap;
  width: max-content;
}

@media (max-width: 1100px) {
  .footer-trademark {
    white-space: normal;
    width: auto;
    max-width: 720px;
    font-size: 0.6875rem;
  }
}

.footer__links {
  order: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links li {
  display: inline-flex;
  align-items: center;
}

.footer__link {
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  padding: 0 0.2rem;
  transition: color 0.15s ease;
  letter-spacing: 0;
  line-height: 1.6;
  white-space: nowrap;
}

.footer__link:hover {
  color: var(--hyland-yellow);
  text-decoration: underline;
}

.footer__sep {
  font-size: 0.75rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

@media (max-width: 768px) {
  .footer {
    padding: 1.25rem 1rem;
  }

  .footer-trademark {
    font-size: 0.6875rem;
  }

  .footer__link {
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
  }
}

/* ========================================
   Responsive — collapsible sidebar on small viewports
   ======================================== */
@media (max-width: 996px) {
  .navbar__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 80;
  }

  .sidebar-backdrop--open {
    display: block;
  }
}
