:root {
  --wdocs-ink: #24170E;
  --wdocs-text-2: #6B5B4E;
  --wdocs-bg: #FBF6EF;
  --wdocs-card: #FFFFFF;
  --wdocs-border: #E9DFD1;
  --wdocs-accent: #E8631C;
  --wdocs-accent-dark: #C74E10;
  --wdocs-sidebar-w: 280px;
  --wdocs-toc-w: 220px;
  --wdocs-ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wdocs-bg);
  color: var(--wdocs-ink);
  font-family: Archivo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--wdocs-accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-weight: 800; letter-spacing: -.02em; margin: 0; }

/* Shell: sidebar fija + columna de contenido */
.wdocs-shell { display: flex; min-height: 100vh; align-items: flex-start; }

.wdocs-sidebar {
  width: var(--wdocs-sidebar-w); flex: 0 0 auto; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; background: var(--wdocs-card); border-right: 1px solid var(--wdocs-border);
  padding: 24px 18px; display: flex; flex-direction: column; gap: 18px;
}
.wdocs-sidebar-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 4px 6px 8px; text-decoration: none; }
.wdocs-sidebar-logo-img { height: 30px; width: auto; }
.wdocs-sidebar-logo-texto { font-size: 15px; font-weight: 800; color: var(--wdocs-ink); }
.wdocs-sidebar-search input {
  width: 100%; padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--wdocs-border);
  background: var(--wdocs-bg); font-size: 14px; font-family: Archivo, sans-serif; color: var(--wdocs-ink);
}
.wdocs-sidebar-search input:focus { outline: none; border-color: var(--wdocs-accent); }

.wdocs-sidebar-tree { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wdocs-tree-seccion-titulo {
  margin: 14px 6px 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #A89A8C;
}
.wdocs-tree-seccion-titulo:first-child { margin-top: 2px; }
.wdocs-tree-plana { list-style: none; margin: 0 0 4px; padding: 0; }
.wdocs-tree-plana li { padding: 2px 0; }
.wdocs-tree-plana a {
  display: block; padding: 7px 10px; border-radius: 7px; font-size: 14px; color: var(--wdocs-text-2);
}
.wdocs-tree-plana a:hover { background: var(--wdocs-bg); color: var(--wdocs-ink); text-decoration: none; }
.wdocs-tree-plana a.is-active { color: var(--wdocs-accent-dark); font-weight: 700; }

.wdocs-tree-grupo { display: flex; flex-direction: column; }
.wdocs-tree-actor { border-bottom: 1px solid var(--wdocs-border); }
.wdocs-tree-actor:last-child { border-bottom: none; }
.wdocs-tree-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: none; border: none; padding: 9px 6px; font-family: Archivo, sans-serif;
  font-size: 14px; font-weight: 500; color: var(--wdocs-ink); cursor: pointer; border-radius: 8px;
}
.wdocs-tree-toggle:hover { background: var(--wdocs-bg); }
.wdocs-tree-chevron {
  width: 8px; height: 14px; flex-shrink: 0; color: var(--wdocs-text-2);
  transition: transform 175ms ease;
}
.wdocs-tree-actor.is-open > .wdocs-tree-toggle .wdocs-tree-chevron { transform: rotate(90deg); }
.wdocs-tree-docs {
  list-style: none; margin: 0; padding: 0 6px 0 16px; height: 0; overflow: hidden;
  transition: height 200ms ease;
}
.wdocs-tree-actor.is-open .wdocs-tree-docs { padding-bottom: 6px; }
.wdocs-tree-docs li { padding: 1px 0; }
.wdocs-tree-docs a {
  display: block; padding: 6px 10px; border-radius: 7px; font-size: 14px; color: var(--wdocs-text-2);
}
.wdocs-tree-docs a:hover { background: var(--wdocs-bg); color: var(--wdocs-ink); text-decoration: none; }
.wdocs-tree-docs a.is-active { color: var(--wdocs-accent-dark); font-weight: 700; }
.wdocs-tree-empty { padding: 6px 10px; font-size: 13px; color: var(--wdocs-text-2); font-style: italic; }

.wdocs-sidebar-back { font-size: 13px; color: var(--wdocs-text-2); padding: 0 6px; }

.wdocs-sidebar-burger {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 40; width: 42px; height: 42px;
  border-radius: 10px; border: 1px solid var(--wdocs-border); background: var(--wdocs-card);
  font-size: 18px; cursor: pointer;
}

.wdocs-content-col { flex: 1; min-width: 0; }
.wdocs-main { max-width: 860px; margin: 0 auto; padding: 48px 32px 80px; }

/* Breadcrumb / títulos genéricos */
.wdocs-breadcrumb { font-size: 14px; color: var(--wdocs-text-2); margin: 0 0 10px; }
.wdocs-home-titulo { font-size: clamp(32px, 4vw, 44px); margin-bottom: 28px; }

/* Home: listado tipo Notion ("Guide" + título + meta) */
.wdocs-guide-lista { display: flex; flex-direction: column; }
.wdocs-guide-item {
  display: flex; flex-direction: column; gap: 4px; padding: 22px 4px; color: var(--wdocs-ink);
  border-bottom: 1px solid var(--wdocs-border);
}
.wdocs-guide-item:first-child { border-top: 1px solid var(--wdocs-border); }
.wdocs-guide-item:hover { text-decoration: none; }
.wdocs-guide-item:hover .wdocs-guide-titulo { color: var(--wdocs-accent-dark); }
.wdocs-guide-etiqueta { font-size: 13px; font-weight: 700; color: var(--wdocs-accent); text-transform: uppercase; letter-spacing: .03em; }
.wdocs-guide-titulo { font-size: 22px; font-weight: 800; color: var(--wdocs-ink); transition: color 150ms var(--wdocs-ease); }
.wdocs-guide-meta { font-size: 13px; color: var(--wdocs-text-2); }

/* Tipo pills (usados en taxonomy-actor.php / taxonomy-tipo_documento.php) */
.wdocs-archivo { padding-bottom: 40px; }
.wdocs-archivo h1 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 10px; }
.wdocs-archivo-desc { color: var(--wdocs-text-2); margin-bottom: 20px; }
.wdocs-tipos-filtro { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 28px; }
.wdocs-tipo-pill {
  display: inline-block; padding: 9px 18px; border-radius: 99px; border: 1.5px solid var(--wdocs-border);
  background: var(--wdocs-card); color: var(--wdocs-ink); font-size: 14px; font-weight: 600;
}
.wdocs-tipo-pill:hover { border-color: var(--wdocs-accent); text-decoration: none; }
.wdocs-tipo-pill.is-active { background: var(--wdocs-accent); border-color: var(--wdocs-accent); color: #fff; }

.wdocs-lista-documentos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wdocs-lista-documentos a {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 16px;
  background: var(--wdocs-card); border: 1px solid var(--wdocs-border); color: var(--wdocs-ink);
}
.wdocs-lista-documentos a:hover { border-color: var(--wdocs-accent); text-decoration: none; }
.wdocs-doc-titulo { font-weight: 700; font-size: 16px; }
.wdocs-doc-fecha { font-size: 13px; color: var(--wdocs-text-2); }
.wdocs-vacio { color: var(--wdocs-text-2); padding: 24px 0; }
.wdocs-404 h1 { margin-bottom: 14px; }

/* Documento individual: contenido + TOC derecho (estilo Meta "En esta página") */
.wdocs-single-layout { display: flex; gap: 48px; align-items: flex-start; }
.wdocs-single-doc { flex: 1; min-width: 0; }
.wdocs-single-doc h1 { font-size: clamp(26px, 3.6vw, 38px); margin: 8px 0 6px; }
.wdocs-vigencia { font-size: 14px; color: var(--wdocs-text-2); margin: 0 0 28px; }
.wdocs-single-contenido { font-size: 16px; line-height: 1.7; }
.wdocs-single-contenido h2 { font-size: 22px; margin: 32px 0 12px; scroll-margin-top: 24px; }
.wdocs-single-contenido h3 { font-size: 18px; margin: 24px 0 10px; scroll-margin-top: 24px; }
.wdocs-single-contenido p { margin: 0 0 16px; }
.wdocs-single-contenido ul, .wdocs-single-contenido ol { margin: 0 0 16px; padding-left: 22px; }

.wdocs-toc { width: var(--wdocs-toc-w); flex: 0 0 auto; position: sticky; top: 48px; }
.wdocs-toc-titulo { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--wdocs-text-2); margin-bottom: 12px; }
.wdocs-toc-lista { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--wdocs-border); display: flex; flex-direction: column; }
.wdocs-toc-lista li { margin: 0; }
.wdocs-toc-lista a { display: block; padding: 6px 0 6px 14px; font-size: 13.5px; color: var(--wdocs-text-2); margin-left: -2px; border-left: 2px solid transparent; }
.wdocs-toc-lista li.wdocs-toc-sub a { padding-left: 26px; }
.wdocs-toc-lista a:hover { color: var(--wdocs-ink); text-decoration: none; }
.wdocs-toc-lista a.is-active { color: var(--wdocs-accent-dark); border-left-color: var(--wdocs-accent); font-weight: 700; }

/* Footer */
.wdocs-footer { background: var(--wdocs-ink); color: #EBDCCB; padding: 48px 32px 26px; }
.wdocs-footer a { color: #EBDCCB; }
.wdocs-footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 36px 32px; }
.wdocs-footer-col-cta { max-width: 400px; }
.wdocs-footer-logo { height: 28px; width: auto; margin-bottom: 16px; }
.wdocs-footer-col-cta p { font-size: 15px; line-height: 1.5; color: #C9B8A4; margin-bottom: 18px; }
.wdocs-footer-cta { display: inline-block; background: var(--wdocs-accent); color: #fff !important; padding: 10px 20px; border-radius: 99px; font-size: 14px; font-weight: 700; }
.wdocs-footer-titulo { font-size: 15px; font-weight: 800; margin-bottom: 12px; color: #fff; }
.wdocs-footer-contacto { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.wdocs-footer-legal { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.wdocs-footer-bottom { max-width: 1200px; margin: 44px auto 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-top: 24px; }
.wdocs-footer-bottom .wdocs-footer-copy:last-child { text-align: right; }
.wdocs-footer-redes-bottom { display: flex; align-items: center; justify-content: center; gap: 14px; }
.wdocs-footer-redes-bottom a, .wdocs-footer-red-proximamente { display: flex; color: #EBDCCB; }
.wdocs-footer-red-proximamente { opacity: .4; cursor: default; }
.wdocs-footer-copy { font-size: 13px; color: #EBDCCB; }
@media (max-width: 640px) {
    .wdocs-footer-bottom { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 14px; }
    .wdocs-footer-bottom .wdocs-footer-copy:last-child { text-align: center; }
}

/* Responsive */
@media (max-width: 980px) {
  .wdocs-toc { display: none; }
}

@media (max-width: 860px) {
  .wdocs-sidebar-burger { display: flex; align-items: center; justify-content: center; }
  .wdocs-sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%);
    transition: transform 220ms var(--wdocs-ease); box-shadow: 0 0 0 1px var(--wdocs-border);
  }
  .wdocs-sidebar.is-open { transform: translateX(0); }
  .wdocs-main { padding: 84px 20px 60px; }
  .wdocs-single-layout { flex-direction: column; }
}
