/* ═══════════════════════════════════════════════════════════
   fellos Documentation — Shared Stylesheet
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --terracotta: #c4725a;
  --terracotta-light: #d4896f;
  --terracotta-dark: #b5654d;
  --sage: #8a9a7b;
  --sage-light: #a3b394;
  --warm-sand: #d4a574;
  --clay: #b8806a;
  --charcoal: #3d3630;
  --warm-gray: #6b635b;
  --light-gray: #9a928a;
  --cream: #f5f0e8;
  --cream-dark: #ede6db;
  --deep-brown: #4a3f35;
  --warm-white: #fffcf8;
  --border-color: #ede6db;
  --radius: 0.75rem;
  --sidebar-width: 260px;
  --header-height: 60px;
  --font-sans: 'Work Sans', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--terracotta); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--terracotta-dark); text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--charcoal);
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border-color); }
h3 { font-size: 1.15rem; margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }
li > ul, li > ol { margin-top: 0.35rem; margin-bottom: 0; }

strong { font-weight: 600; }

code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--cream-dark);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

blockquote {
  border-left: 4px solid var(--terracotta);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--warm-white);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--warm-gray);
  font-style: italic;
}

hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 2rem 0;
}

/* ── Page Layout ─────────────────────────────────────────── */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height);
}

/* ── Header ──────────────────────────────────────────────── */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--deep-brown);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
  gap: 1rem;
}

.docs-header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--cream);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.docs-header__logo:hover { color: var(--cream); text-decoration: none; }

.docs-header__logo svg { height: 32px; width: auto; }
.docs-header__logo span { opacity: 0.7; font-weight: 400; margin-left: 0.25rem; }

.docs-header__search {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
}

.docs-header__search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
}
.docs-header__search input::placeholder { color: rgba(245,240,232,0.5); }
.docs-header__search input:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
}
.docs-header__search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(245,240,232,0.5);
  pointer-events: none;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--warm-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}
.search-results.active { display: block; }
.search-results__empty {
  padding: 1rem;
  color: var(--light-gray);
  text-align: center;
  font-size: 0.875rem;
}
.search-results__item {
  display: block;
  padding: 0.65rem 1rem;
  color: var(--charcoal);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.1s;
  text-decoration: none;
}
.search-results__item:last-child { border-bottom: none; }
.search-results__item:hover, .search-results__item.focused {
  background: var(--cream);
  text-decoration: none;
}
.search-results__item-title {
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.search-results__item-section {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.search-results__item-section--members { background: #e8ddd4; color: var(--terracotta-dark); }
.search-results__item-section--org-admins { background: #dde5d8; color: #5c6e50; }
.search-results__item-section--site-admin { background: #e8ddd0; color: #9a7a55; }
.search-results__item-match {
  font-size: 0.8rem;
  color: var(--light-gray);
  margin-top: 0.15rem;
}

/* Section Switcher */
.docs-header__section-switcher {
  position: relative;
  flex-shrink: 0;
}
.docs-header__section-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--cream);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s;
}
.docs-header__section-btn:hover { background: rgba(255,255,255,0.18); }

.section-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--warm-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 200px;
  display: none;
  z-index: 200;
}
.section-dropdown.active { display: block; }
.section-dropdown a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--charcoal);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.1s;
}
.section-dropdown a:last-child { border-bottom: none; }
.section-dropdown a:hover { background: var(--cream); text-decoration: none; }
.section-dropdown a.active-section { font-weight: 600; color: var(--terracotta); }

/* Mobile menu toggle */
.docs-header__mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.docs-sidebar {
  width: var(--sidebar-width);
  background: var(--warm-white);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 1.25rem 0;
  z-index: 50;
  transition: transform 0.25s ease;
}

.docs-sidebar__section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--light-gray);
  padding: 1rem 1.25rem 0.4rem;
}
.docs-sidebar__section-label:first-child { padding-top: 0; }

.docs-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.25rem;
  color: var(--warm-gray);
  font-size: 0.875rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.docs-sidebar a:hover {
  color: var(--charcoal);
  background: var(--cream);
  text-decoration: none;
}
.docs-sidebar a.active {
  color: var(--terracotta);
  font-weight: 500;
  border-left-color: var(--terracotta);
  background: rgba(196,114,90,0.06);
}

/* Section color accents for active sidebar */
.docs-sidebar--org-admins a.active {
  color: #5c6e50;
  border-left-color: var(--sage);
  background: rgba(138,154,123,0.08);
}
.docs-sidebar--site-admin a.active {
  color: #9a7a55;
  border-left-color: var(--warm-sand);
  background: rgba(212,165,116,0.08);
}

/* ── Main Content ────────────────────────────────────────── */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.docs-content {
  max-width: 820px;
  padding: 2rem 2.5rem 4rem;
  margin: 0 auto;
}

/* ── Breadcrumbs ─────────────────────────────────────────── */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--light-gray);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.docs-breadcrumb a { color: var(--light-gray); }
.docs-breadcrumb a:hover { color: var(--terracotta); }
.docs-breadcrumb__sep { color: var(--border-color); }
.docs-breadcrumb__current { color: var(--charcoal); font-weight: 500; }

/* ── Page Subtitle ───────────────────────────────────────── */
.docs-subtitle {
  color: var(--warm-gray);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* ── Prev / Next Navigation ──────────────────────────────── */
.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}
.docs-pager a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--warm-white);
  transition: all 0.15s;
  min-width: 0;
  max-width: 48%;
  text-decoration: none;
}
.docs-pager a:hover {
  border-color: var(--terracotta);
  background: rgba(196,114,90,0.03);
  text-decoration: none;
}
.docs-pager__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--light-gray);
}
.docs-pager__title {
  font-weight: 500;
  color: var(--terracotta);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-pager a.next { margin-left: auto; text-align: right; }

/* ── Footer ──────────────────────────────────────────────── */
.docs-footer {
  margin-left: var(--sidebar-width);
  background: var(--deep-brown);
  color: rgba(245,240,232,0.6);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
}
.docs-footer a { color: var(--cream); }

/* ── Landing Page ────────────────────────────────────────── */
.landing { padding-top: var(--header-height); }

.landing__hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}
.landing__hero h1 { font-size: 2.5rem; margin-bottom: 0.75rem; }
.landing__hero p { font-size: 1.1rem; color: var(--warm-gray); }

.landing__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 960px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
}

.landing__card {
  background: var(--warm-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--charcoal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.landing__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--terracotta-light);
  text-decoration: none;
}

.landing__card-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing__card-icon--members { background: rgba(196,114,90,0.12); color: var(--terracotta); }
.landing__card-icon--org-admins { background: rgba(138,154,123,0.12); color: var(--sage); }
.landing__card-icon--site-admin { background: rgba(212,165,116,0.12); color: var(--warm-sand); }

.landing__card h2 { font-size: 1.25rem; margin: 0; border: none; padding: 0; }
.landing__card p { color: var(--warm-gray); font-size: 0.9rem; margin: 0; }
.landing__card-cta {
  margin-top: auto;
  padding-top: 0.75rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.landing__footer {
  text-align: center;
  padding: 2rem;
  color: var(--light-gray);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
}

/* ── Content Helpers ─────────────────────────────────────── */
.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.callout--tip {
  background: rgba(138,154,123,0.1);
  border-left: 4px solid var(--sage);
}
.callout--note {
  background: rgba(212,165,116,0.1);
  border-left: 4px solid var(--warm-sand);
}
.callout--important {
  background: rgba(196,114,90,0.08);
  border-left: 4px solid var(--terracotta);
}
.callout__title {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}
.callout--tip .callout__title { color: #5c6e50; }
.callout--note .callout__title { color: #9a7a55; }
.callout--important .callout__title { color: var(--terracotta-dark); }

.steps { counter-reset: step-counter; list-style: none; padding-left: 0; }
.steps li {
  counter-increment: step-counter;
  padding-left: 2.5rem;
  position: relative;
  margin-bottom: 1rem;
}
.steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--terracotta);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Steps with section-specific colors */
.steps--sage li::before { background: var(--sage); }
.steps--sand li::before { background: var(--warm-sand); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.feature-card {
  background: var(--warm-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.feature-card h4 { margin-top: 0; font-size: 0.95rem; }
.feature-card p { font-size: 0.875rem; color: var(--warm-gray); margin: 0; }

/* Definition list style */
.def-list dt {
  font-weight: 600;
  margin-top: 1rem;
  color: var(--charcoal);
}
.def-list dd {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--border-color);
  color: var(--warm-gray);
  margin-bottom: 0.5rem;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--warm-gray);
}
tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
tbody tr:hover { background: rgba(245,240,232,0.5); }

/* ── SVG Illustrations ───────────────────────────────────── */
.svg-illustration {
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-dark);
}
.svg-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}
.svg-illustration__caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--light-gray);
  padding: 0.5rem;
  background: var(--warm-white);
  border-top: 1px solid var(--border-color);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .docs-content { padding: 1.5rem 1.5rem 3rem; }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .docs-header__search { display: none; }

  .docs-header__mobile-toggle { display: block; }

  .docs-sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  }
  .docs-sidebar.open { transform: translateX(0); }

  .docs-main { margin-left: 0; }
  .docs-footer { margin-left: 0; }

  .docs-content { padding: 1.25rem 1rem 3rem; }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .landing__cards { grid-template-columns: 1fr; max-width: 400px; }
  .landing__hero h1 { font-size: 1.75rem; }
  .landing__hero { padding: 2.5rem 1.5rem 1.5rem; }

  .docs-pager { flex-direction: column; }
  .docs-pager a { max-width: 100%; }
  .docs-pager a.next { text-align: left; }

  /* Mobile search - show in sidebar when open */
  .docs-sidebar .mobile-search {
    display: block;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.5rem;
  }
  .docs-sidebar .mobile-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    background: var(--cream);
  }
}

@media (min-width: 769px) {
  .docs-sidebar .mobile-search { display: none; }
}

/* ── Overlay for mobile sidebar ──────────────────────────── */
.docs-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 40;
}
.docs-overlay.active { display: block; }

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .docs-header, .docs-sidebar, .docs-pager, .docs-footer { display: none; }
  .docs-main { margin-left: 0; }
  .docs-content { max-width: 100%; padding: 0; }
  .docs-layout { padding-top: 0; }
}
