/* =========================================================================
   HOSTL.eu Docs – Seiteninhalt
   Wird öffentlich UND im Editor verwendet, damit der Editor exakt so
   aussieht wie die veröffentlichte Seite.
   ========================================================================= */

.doc-content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--hostl-text);
  overflow-wrap: break-word;
}
.doc-content > * { margin-top: 0; }
.doc-content > * + * { margin-top: 16px; }
.doc-content p { margin-bottom: 0; }
.doc-content .doc-empty { min-height: 1em; }

.doc-content a:not(.doc-btn):not(.doc-card) {
  color: var(--hostl-primary-text);
  text-decoration: underline;
  text-decoration-color: var(--hostl-primary-soft-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color var(--hostl-transition);
}
.doc-content a:not(.doc-btn):not(.doc-card):hover { text-decoration-color: currentColor; color: var(--hostl-primary-text); }

.doc-content strong { color: var(--hostl-text-strong); font-weight: 600; }
.doc-content :not(pre) > code {
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: var(--hostl-radius-xs);
  background: var(--hostl-surface-2);
  border: 1px solid var(--hostl-border);
  color: var(--hostl-text-strong);
}

/* Textfarben */
.tc-primary { color: var(--hostl-primary-text); }
.tc-success { color: var(--hostl-success-text); }
.tc-warning { color: var(--hostl-warning-text); }
.tc-danger { color: var(--hostl-danger-text); }
.tc-purple { color: #b48ae6; }
.tc-teal { color: #2fd4bf; }
.tc-muted { color: var(--hostl-text-subtle); }

/* Überschriften */
.doc-content .doc-heading {
  position: relative;
  color: var(--hostl-text-strong);
  letter-spacing: -0.01em;
  line-height: 1.3;
  scroll-margin-top: 88px;
}
.doc-content h2.doc-heading { font-size: 24px; font-weight: 700; margin-top: 40px; }
.doc-content h3.doc-heading { font-size: 19px; font-weight: 600; margin-top: 32px; }
.doc-content h4.doc-heading { font-size: 16px; font-weight: 600; margin-top: 24px; }
.doc-content > .doc-heading:first-child { margin-top: 0; }
.doc-anchor {
  display: inline-flex;
  margin-left: 8px;
  font-size: 0.6em;
  vertical-align: middle;
  color: var(--hostl-text-faint) !important;
  text-decoration: none !important;
  opacity: 0;
  transition: opacity var(--hostl-transition);
}
.doc-heading:hover .doc-anchor, .doc-anchor:focus-visible { opacity: 1; }
.doc-anchor:hover { color: var(--hostl-primary-text) !important; }

/* Listen */
.doc-content ul, .doc-content ol { margin-bottom: 0; padding-left: 26px; }
.doc-content li + li { margin-top: 6px; }
.doc-content li::marker { color: var(--hostl-text-faint); }
.doc-content ol li::marker { color: var(--hostl-text-subtle); font-weight: 600; }
.doc-content .doc-checklist { list-style: none; padding-left: 2px; }
.doc-checklist li { display: flex; gap: 10px; align-items: baseline; }
.doc-checklist li i { color: var(--hostl-text-faint); }
.doc-checklist li.is-checked i { color: var(--hostl-primary-text); }
.doc-checklist li.is-checked span { color: var(--hostl-text-subtle); text-decoration: line-through; }

/* Zitat */
.doc-content blockquote {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--hostl-border-strong);
  color: var(--hostl-text-muted);
}

.doc-content hr { border: 0; border-top: 1px solid var(--hostl-border); margin: 32px 0; }

/* Hinweise */
.doc-hint {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--hostl-radius);
  border: 1px solid;
  font-size: 15px;
  line-height: 1.65;
}
.doc-hint-icon { margin-top: 4px; font-size: 16px; flex-shrink: 0; }
.doc-hint-body { min-width: 0; flex: 1; }
.doc-hint-title { font-weight: 600; color: var(--hostl-text-strong); margin-bottom: 2px; }
.doc-hint-info { background: var(--hostl-primary-soft); border-color: var(--hostl-primary-soft-strong); }
.doc-hint-info .doc-hint-icon { color: var(--hostl-primary-text); }
.doc-hint-success { background: var(--hostl-success-soft); border-color: var(--hostl-success-soft-strong); }
.doc-hint-success .doc-hint-icon { color: var(--hostl-success-text); }
.doc-hint-warning { background: var(--hostl-warning-soft); border-color: var(--hostl-warning-soft-strong); }
.doc-hint-warning .doc-hint-icon { color: var(--hostl-warning-text); }
.doc-hint-danger { background: var(--hostl-danger-soft); border-color: var(--hostl-danger-soft-strong); }
.doc-hint-danger .doc-hint-icon { color: var(--hostl-danger-text); }

/* Code */
.doc-code {
  border: 1px solid var(--hostl-border);
  border-radius: var(--hostl-radius);
  background: var(--hostl-surface-sunken);
  overflow: hidden;
}
.doc-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 14px;
  background: var(--hostl-surface);
  border-bottom: 1px solid var(--hostl-border);
  font-size: 12px;
}
.doc-code-title { color: var(--hostl-text-subtle); font-weight: 500; font-family: var(--hostl-font-mono); }
.doc-code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--hostl-radius-xs);
  background: transparent;
  color: var(--hostl-text-subtle);
  font-size: 12px;
  cursor: pointer;
}
.doc-code-copy:hover { background: var(--hostl-surface-2); color: var(--hostl-text-strong); }
.doc-code-copy.is-done { color: var(--hostl-success-text); }
.doc-code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
}
.doc-code code { color: #d6dbe4; }
.tk-comment { color: #6b7385; font-style: italic; }
.tk-string { color: #7fd1a3; }
.tk-keyword { color: #a990f5; }
.tk-literal { color: #f5a97f; }
.tk-number { color: #f5a97f; }
.tk-function { color: #8fa8f5; }
.tk-property { color: #8fc8f5; }
.tk-variable { color: #f5c150; }
.tk-meta { color: #f5c150; }
.tk-tag { color: #f5797f; }

/* Bilder */
.doc-figure { margin: 24px auto; text-align: center; }
.doc-figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--hostl-radius);
  cursor: zoom-in;
}
.doc-figure.has-border img { border: 1px solid var(--hostl-border); }
.doc-figure-small img { max-width: 50%; }
.doc-figure-normal img { max-width: 100%; }
.doc-figure-wide { margin-left: -40px; margin-right: -40px; }
.doc-figure-full { margin-left: -40px; margin-right: -40px; }
.doc-figure-full img { width: 100%; }
.doc-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--hostl-text-subtle); }

/* Tabellen */
.doc-table-wrap { overflow-x: auto; border: 1px solid var(--hostl-border); border-radius: var(--hostl-radius); }
.doc-content table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.doc-content th, .doc-content td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hostl-border); }
.doc-content th + th, .doc-content td + td { border-left: 1px solid var(--hostl-border); }
.doc-content th { background: var(--hostl-surface); color: var(--hostl-text-strong); font-weight: 600; }
.doc-content tbody tr:last-child td { border-bottom: 0; }

/* Tabs */
.doc-tabs { border: 1px solid var(--hostl-border); border-radius: var(--hostl-radius); overflow: hidden; }
.doc-tab-list { display: flex; gap: 2px; padding: 6px 6px 0; background: var(--hostl-surface); border-bottom: 1px solid var(--hostl-border); overflow-x: auto; }
.doc-tab {
  padding: 8px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--hostl-text-subtle);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.doc-tab:hover { color: var(--hostl-text-strong); }
.doc-tab.active { color: var(--hostl-primary-text); border-bottom-color: var(--hostl-primary); }
.doc-tab-panel { padding: 14px 16px; }

/* Aufklappbar */
.doc-expandable { border: 1px solid var(--hostl-border); border-radius: var(--hostl-radius); background: var(--hostl-surface); }
.doc-expandable summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--hostl-text-strong);
  list-style: none;
}
.doc-expandable summary::-webkit-details-marker { display: none; }
.doc-expandable summary i { font-size: 11px; color: var(--hostl-text-faint); transition: transform var(--hostl-transition); }
.doc-expandable[open] summary i { transform: rotate(90deg); }
.doc-expandable-body { padding: 0 16px 14px 37px; }

/* Buttons */
.doc-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--hostl-radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--hostl-transition), border-color var(--hostl-transition);
}
.doc-btn i { font-size: 11px; }
.doc-btn-primary { background: var(--hostl-primary); color: var(--hostl-on-primary) !important; }
.doc-btn-primary:hover { background: var(--hostl-primary-hover); }
.doc-btn-secondary { background: var(--hostl-surface); border-color: var(--hostl-border); color: var(--hostl-text) !important; }
.doc-btn-secondary:hover { border-color: var(--hostl-border-hover); background: var(--hostl-surface-hover); }

/* Karten */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.doc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--hostl-surface);
  border: 1px solid var(--hostl-border);
  border-radius: var(--hostl-radius);
  color: var(--hostl-text);
  text-decoration: none;
  transition: border-color var(--hostl-transition), background var(--hostl-transition);
}
.doc-card.is-link:hover { border-color: var(--hostl-primary); background: var(--hostl-surface-hover); }
.doc-card-icon {
  width: 36px; height: 36px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--hostl-radius-sm);
  background: var(--hostl-primary-soft); color: var(--hostl-primary-text);
  font-size: 16px;
}
.doc-card-title { font-weight: 600; color: var(--hostl-text-strong); font-size: 15px; line-height: 1.4; }
.doc-card-text { font-size: 13.5px; color: var(--hostl-text-subtle); line-height: 1.55; }
.doc-card-arrow { position: absolute; top: 18px; right: 18px; font-size: 12px; color: var(--hostl-text-faint); transition: transform var(--hostl-transition), color var(--hostl-transition); }
.doc-card.is-link:hover .doc-card-arrow { color: var(--hostl-primary-text); transform: translateX(2px); }
.doc-embed-link .doc-card-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 20px; }

/* Einbettungen */
.doc-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--hostl-radius); overflow: hidden; border: 1px solid var(--hostl-border); background: var(--hostl-surface); }
.doc-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 1023px) {
  .doc-figure-wide, .doc-figure-full { margin-left: 0; margin-right: 0; }
}
@media (max-width: 560px) {
  .doc-content { font-size: 15px; }
  .doc-figure-small img { max-width: 100%; }
}
