/* ============================================================
   rexvionex.org — Documentation Style CSS
   Colors: forest green primary, clean white content, sage accents
   ============================================================ */

:root {
  --color-primary:      #2d6a4f;
  --color-primary-dark: #1b4332;
  --color-primary-light:#52b788;
  --color-accent:       #d8f3dc;
  --color-accent-mid:   #b7e4c7;
  --color-text:         #1c2b22;
  --color-text-muted:   #5a7066;
  --color-bg:           #f8faf8;
  --color-surface:      #ffffff;
  --color-border:       #d1e8d6;
  --color-border-dark:  #95c9a4;
  --color-code-bg:      #f0f7f2;
  --color-warning-bg:   #fff8e6;
  --color-warning-border:#e6c840;

  --font-sans:  'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:  'Cascadia Code', 'Fira Code', 'Courier New', monospace;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 2px 8px rgba(0,0,0,.10);

  --sidebar-w:  240px;
  --header-h:   60px;
  --max-content:720px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--color-primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.4em; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-primary-dark);
  height: var(--header-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.site-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-header__logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.site-header__logo-icon { display: flex; align-items: center; }
.site-header__logo-text { white-space: nowrap; }
.site-header__logo:hover { color: var(--color-accent-mid); }

/* Desktop nav */
.site-nav { margin-left: auto; }
.site-nav__list {
  display: flex;
  list-style: none;
  padding: 0;
  gap: .15rem;
}
.site-nav__link {
  display: block;
  padding: .4rem .75rem;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: .875rem;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.site-nav__link[aria-current="page"] {
  font-weight: 600;
}

/* Hamburger */
.site-header__menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  margin-left: auto;
}
.site-header__menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* ── Layout ── */
.layout {
  display: flex;
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.25rem;
  gap: 2rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}
.sidebar-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.sidebar-nav__heading {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: .75rem 1rem .4rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-accent);
}
.sidebar-nav__list {
  list-style: none;
  padding: .4rem 0;
}
.sidebar-nav__list li a {
  display: block;
  padding: .45rem 1rem;
  font-size: .875rem;
  color: var(--color-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}
.sidebar-nav__list li a:hover {
  background: var(--color-accent);
  border-left-color: var(--color-primary-light);
}
.sidebar-nav__list li a[aria-current="page"] {
  background: var(--color-accent);
  border-left-color: var(--color-primary);
  font-weight: 600;
  color: var(--color-primary-dark);
}

/* ── Main content ── */
.main-content {
  flex: 1;
  min-width: 0;
  max-width: var(--max-content);
}

/* ── Page header ── */
.page-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--color-border);
}
.page-header__label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-accent);
  padding: .2rem .65rem;
  border-radius: 2rem;
  margin-bottom: .6rem;
}
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-primary-dark);
  margin-bottom: .5rem;
}
.page-header__lead {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* ── Typography ── */
h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 2rem 0 .75rem;
  padding-left: .75rem;
  border-left: 4px solid var(--color-primary);
}
h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 1.5rem 0 .5rem;
}
p { margin-bottom: .9rem; }

/* ── Table of contents ── */
.toc {
  background: var(--color-accent);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.toc__title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  margin-bottom: .6rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.2em;
}
.toc li {
  margin-bottom: .25rem;
}
.toc a {
  font-size: .875rem;
  text-decoration: none;
  color: var(--color-primary);
}
.toc a:hover { text-decoration: underline; }

/* ── Content sections ── */
.doc-section {
  margin-bottom: 2.5rem;
}
.doc-section:last-child { margin-bottom: 0; }

/* ── Info boxes ── */
.info-box {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: .9rem;
  display: flex;
  gap: .75rem;
}
.info-box--note {
  background: #e8f4fd;
  border-left: 4px solid #3b82f6;
  color: #1e3a5f;
}
.info-box--tip {
  background: var(--color-accent);
  border-left: 4px solid var(--color-primary);
  color: var(--color-primary-dark);
}
.info-box--warning {
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning-border);
  color: #7c5a00;
}
.info-box__icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }

/* ── Steps list ── */
.steps-list {
  list-style: none;
  padding: 0;
  counter-reset: steps;
  margin: 1rem 0 1.5rem;
}
.steps-list > li {
  counter-increment: steps;
  display: flex;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--color-border);
}
.steps-list > li:last-child { border-bottom: none; }
.steps-list > li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .1rem;
}

/* ── Definition list ── */
.def-list dt {
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-top: 1rem;
}
.def-list dd {
  margin-left: 0;
  color: var(--color-text);
  font-size: .95rem;
  border-left: 3px solid var(--color-border-dark);
  padding-left: .85rem;
  margin-top: .2rem;
}

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: box-shadow .2s, border-color .2s;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}
.card__icon { font-size: 1.75rem; margin-bottom: .5rem; }
.card__title { font-size: .95rem; font-weight: 700; color: var(--color-primary-dark); margin-bottom: .35rem; }
.card__body { font-size: .85rem; color: var(--color-text-muted); }

/* ── Image figure ── */
.doc-figure {
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.doc-figure img { width: 100%; max-height: 380px; object-fit: cover; }
.doc-figure figcaption {
  background: var(--color-accent);
  font-size: .8rem;
  color: var(--color-text-muted);
  padding: .5rem .85rem;
  border-top: 1px solid var(--color-border);
}

/* ── Table ── */
.doc-table-wrap { overflow-x: auto; margin: 1.25rem 0 1.75rem; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.doc-table th {
  background: var(--color-primary-dark);
  color: #fff;
  text-align: left;
  padding: .6rem .85rem;
  font-weight: 600;
}
.doc-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--color-border);
}
.doc-table tr:nth-child(even) td { background: var(--color-accent); }
.doc-table tr:last-child td { border-bottom: none; }

/* ── FAQ (details/summary) ── */
.faq-list { list-style: none; padding: 0; margin: 1.25rem 0; }
.faq-list details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: .6rem;
  background: var(--color-surface);
  transition: box-shadow .2s;
}
.faq-list details[open] { box-shadow: var(--shadow-sm); }
.faq-list summary {
  padding: .9rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--color-primary);
  transition: transform .2s;
  flex-shrink: 0;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-answer {
  padding: 0 1.1rem 1rem;
  font-size: .9rem;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  padding-top: .75rem;
}

/* ── Breadcrumb ── */
.breadcrumb { margin-bottom: 1.25rem; }
.breadcrumb ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
  font-size: .8rem;
}
.breadcrumb__item { color: var(--color-text-muted); }
.breadcrumb__item a { color: var(--color-primary); text-decoration: none; }
.breadcrumb__item a:hover { text-decoration: underline; }
.breadcrumb__item + .breadcrumb__item::before {
  content: '›';
  margin-right: .25rem;
  color: var(--color-text-muted);
}
.breadcrumb__item--active { color: var(--color-text); font-weight: 500; }

/* ── Related content ── */
.related-content {
  background: var(--color-accent);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 2.5rem;
}
.related-content__title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  margin-bottom: .6rem;
  border: none;
  padding: 0;
}
.related-content__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.related-content__list li { font-size: .875rem; }
.related-content__desc { color: var(--color-text-muted); font-size: .82rem; }

/* ── Season badges ── */
.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .15rem .6rem;
  border-radius: 2rem;
  margin: .1rem;
}
.badge--spring { background: #dcfce7; color: #166534; }
.badge--summer { background: #fef9c3; color: #854d0e; }
.badge--autumn { background: #ffedd5; color: #9a3412; }
.badge--winter { background: #e0f2fe; color: #0c4a6e; }

/* ── Code / pre ── */
code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--color-code-bg);
  padding: .1em .35em;
  border-radius: var(--radius-sm);
  color: var(--color-primary-dark);
}

/* ── Hero (index) ── */
.hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 2rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.hero h1 {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: .75rem;
  color: #fff;
}
.hero__lead {
  font-size: 1rem;
  color: rgba(255,255,255,.85);
  max-width: 52ch;
  margin-bottom: 1.25rem;
}
.hero__tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero__tag {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.2);
  padding: .25rem .75rem;
  border-radius: 2rem;
  font-size: .8rem;
  text-decoration: none;
}
.hero__tag:hover { background: rgba(255,255,255,.25); color: #fff; }

/* ── Section index cards ── */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.index-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .15s, border-color .2s;
  display: block;
}
.index-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary-light);
}
.index-card__icon { font-size: 2rem; margin-bottom: .6rem; }
.index-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: .35rem;
  text-decoration: none;
}
.index-card__desc { font-size: .875rem; color: var(--color-text-muted); }

/* ── Footer ── */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.8);
  margin-top: auto;
}
.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.site-footer__brand {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .4rem;
}
.site-footer__desc { font-size: .85rem; line-height: 1.5; }
.site-footer__nav-heading {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.5);
  margin-bottom: .5rem;
}
.site-footer__nav {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.site-footer__nav a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .875rem;
}
.site-footer__nav a:hover { color: #fff; }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: .85rem 1.25rem;
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .layout { padding-top: 1rem; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .site-header__menu-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--color-primary-dark);
    padding: .75rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    z-index: 99;
  }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; gap: .1rem; }
  .site-nav__link { padding: .6rem .75rem; }
  .hero h1 { font-size: 1.45rem; }
  .index-grid { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
  .layout { padding: .75rem .9rem 2rem; }
}
