/* ═══════════════════════════════════════════════════════════════════════════
   KUMAVISION Corporate Design – DocFX modern template overrides
   Accent: #21438B (KUMAblau)
   
   This file is loaded automatically by the modern template as it resides
   in the template's public/ directory.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Color scheme ─────────────────────────────────────────────────────── */
:root {
  --bs-primary:       #21438B;
  --bs-primary-rgb:   33, 67, 139;
  --bs-link-color:    #21438B;
  --bs-link-hover-color: #192f63;
}

:root[data-bs-theme="light"] {
  --bs-primary:       #21438B;
  --bs-link-color:    #21438B;
  --bs-link-hover-color: #192f63;
}

:root[data-bs-theme="dark"] {
  --bs-primary:       #5b8ad4;
  --bs-link-color:    #5b8ad4;
  --bs-link-hover-color: #8db3ea;
}

/* Links */
a {
  color: var(--bs-link-color);
}
a:hover {
  color: var(--bs-link-hover-color);
}

/* Active TOC items & filter highlights */
.toc .nav-link.active,
.toc .nav-link:hover {
  color: #21438B !important;
  border-color: #21438B !important;
}

/* Breadcrumb active */
.breadcrumb-item.active {
  color: #21438B;
}

/* Buttons / action items */
.btn-primary,
.pagination .active .page-link {
  background-color: #21438B;
  border-color: #21438B;
}
.btn-primary:hover {
  background-color: #192f63;
  border-color: #192f63;
}

/* Navbar bottom border – match DocFX footer style (border-top utility) */
header nav.navbar {
  border-bottom: var(--bs-border-width, 1px) solid var(--bs-border-color, #dee2e6);
}

/* Logo – scale to fit navbar height */
.navbar-brand img {
  height: 2.5rem;
  width: auto;
  object-fit: contain;
}

/* ── 2. Responsive images ────────────────────────────────────────────────── */
article img,
.content img {
  max-width: 100%;
  height: auto;
}

/* ── 3. Hide prev/next navigation ────────────────────────────────────────── */
.prev-next-buttons,
.next-article,
.prev-article,
nav[aria-label="Paginator"],
.pagination-container {
  display: none !important;
}

/* ── 4. Custom footer (social icons – integrates with DocFX native footer) ── */
/* DocFX footer is: <footer class="border-top text-secondary"> with flex layout.
   We only style the appended .kvs-social div, keeping native theme colors. */

body > footer .kvs-social {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body > footer .kvs-social a {
  display: inline-flex;
  align-items: center;
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
  transition: color 0.2s;
}

body > footer .kvs-social a:hover {
  color: var(--bs-body-color, #212529);
}

body > footer .kvs-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── 5. Print styles ─────────────────────────────────────────────────────── */
@media print {
  h1, h2, h3, h4, h5, h6 {
    color: #21438B !important;
  }

  header, .sidebar, .toc-container,
  .kvs-social,
  .contribution-panel {
    display: none !important;
  }

  article img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Hide video iframes in PDF output */
  iframe {
    display: none !important;
  }

  /* Show print-only video link placeholders (generated by main.js) */
  .video-print-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.75em;
    margin: 1em 0;
    padding: 0.75em 1.25em;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    page-break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .video-print-link.video-youtube {
    background: #FF0000 !important;
    color: #fff !important;
  }

  .video-print-link.video-vimeo {
    background: #1AB7EA !important;
    color: #fff !important;
  }

  .video-print-link.video-generic {
    background: #555 !important;
    color: #fff !important;
  }

  .video-print-link svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    fill: #fff;
  }

  .video-print-link .video-print-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
  }

  .video-print-link .video-print-label {
    font-size: 0.95em;
    font-weight: 600;
  }

  .video-print-link .video-print-url {
    font-size: 0.75em;
    font-weight: 400;
    opacity: 0.85;
    word-break: break-all;
  }

  /* Prevent wide tables from being cut off */
  table {
    table-layout: fixed;
    width: 100%;
  }

  table td,
  table th {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* <details>/<summary> blocks (base + .faq variant) are forced open for
     print/PDF output via JS (see main.js expandAllDetails()) since CSS
     overrides (display/content-visibility) are not reliably able to expand
     a closed <details>'s content during headless Chromium PDF generation.
     The expand/collapse chevron is meaningless on paper once expanded -
     hide it, and drop the pointer cursor hint on the summary. */
  article details summary::after,
  .content details summary::after {
    display: none !important;
  }

  article details summary,
  .content details summary {
    cursor: default;
  }
}

/* Hide video print links on screen */
.video-print-link {
  display: none;
}

/* ── 6. Action Bar (PDF + Marketplace) ────────────────────────────────────── */
/* Flex row below h1: PDF link left, Marketplace link right. */
.kvs-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 0.75rem;
}

.kvs-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--bs-body-secondary-color, #6c757d) !important;
  background: none;
  border: none;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: none !important;
  transition: color 0.2s;
}

.kvs-action-link:hover {
  color: var(--bs-body-color, #212529) !important;
}

.kvs-action-link i {
  font-size: 1.1em;
  opacity: 0.7;
}

.kvs-action-link:hover i {
  opacity: 1;
}

@media print {
  .kvs-action-bar {
    display: none !important;
  }
}

/* ── 7. Language Switcher Dropdown (Navbar) ─────────────────────────────── */
/* Injected into form.icons (left of theme toggle). Uses Bootstrap dropdown,
   matching the DocFX theme switcher pattern exactly. */
@media print {
  .kvs-lang-dropdown {
    display: none !important;
  }
}

/* ── 8. Base formatting for <details>/<summary> blocks ───────────────────── */
/* Base styling for manually authored <details>/<summary> blocks (e.g. to flag
   obsolete procedures/events in generated API docs). Styled as a Bootstrap-
   like warning callout so it visually stands out from regular text. Other
   <details> variants (e.g. .faq below) build on top of these base rules and
   only override colors/icon. */

article details,
.content details {
  margin: 1rem 0;
  border: 1px solid var(--bs-warning-border-subtle, #ffecb5);
  background-color: var(--bs-warning-bg-subtle, #fff3cd);
  border-radius: var(--bs-border-radius, 0.375rem);
  padding: 0.5rem 1rem;
}

article details[open],
.content details[open] {
  padding-bottom: 0.75rem;
}

article details summary,
.content details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-weight: 600;
  color: var(--bs-warning-text-emphasis, #664d03);
}

article details summary::-webkit-details-marker,
.content details summary::-webkit-details-marker {
  display: none;
}

/* Warning icon */
article details summary::before,
.content details summary::before {
  content: "\26A0\FE0F";
  color: var(--bs-warning, #ffc107);
  font-size: 1.05em;
  flex-shrink: 0;
}

/* Expand/collapse chevron */
article details summary::after,
.content details summary::after {
  content: "\25B8";
  margin-left: auto;
  color: var(--bs-warning-text-emphasis, #664d03);
  transition: transform 0.2s ease;
}

article details[open] summary::after,
.content details[open] summary::after {
  transform: rotate(90deg);
}

article details > *:not(summary),
.content details > *:not(summary) {
  margin-top: 0.5rem;
  color: var(--bs-warning-text-emphasis, #664d03);
}

:root[data-bs-theme="dark"] article details,
:root[data-bs-theme="dark"] .content details {
  border-color: #664d03;
  background-color: rgba(255, 193, 7, 0.15);
}

:root[data-bs-theme="dark"] article details summary,
:root[data-bs-theme="dark"] .content details summary,
:root[data-bs-theme="dark"] article details > *:not(summary),
:root[data-bs-theme="dark"] .content details > *:not(summary),
:root[data-bs-theme="dark"] article details summary::after,
:root[data-bs-theme="dark"] .content details summary::after {
  color: #ffda6a;
}

/* ── 9. FAQ notices (<details class="faq">/<summary>) ────────────────────── */
/* FAQ entries. Builds on the base <details>/<summary> formatting from
   section 8 above and overrides colors to a Bootstrap-like success callout
   (green tones) with a "question circle" icon, so FAQs are visually distinct
   from the default (amber) <details> styling. */

article details.faq,
.content details.faq {
  border-color: var(--bs-success-border-subtle, #a3cfbb);
  background-color: var(--bs-success-bg-subtle, #d1e7dd);
}

article details.faq summary,
.content details.faq summary {
  color: var(--bs-success-text-emphasis, #0a3622);
}

/* Question circle icon (Bootstrap Icons) */
article details.faq summary::before,
.content details.faq summary::before {
  content: "\F505";
  font-family: "bootstrap-icons" !important;
  color: var(--bs-success, #198754);
  font-size: 1.05em;
  flex-shrink: 0;
}

article details.faq summary::after,
.content details.faq summary::after {
  color: var(--bs-success-text-emphasis, #0a3622);
}

article details.faq > *:not(summary),
.content details.faq > *:not(summary) {
  color: var(--bs-success-text-emphasis, #0a3622);
}

:root[data-bs-theme="dark"] article details.faq,
:root[data-bs-theme="dark"] .content details.faq {
  border-color: #0f5132;
  background-color: rgba(25, 135, 84, 0.15);
}

:root[data-bs-theme="dark"] article details.faq summary,
:root[data-bs-theme="dark"] .content details.faq summary,
:root[data-bs-theme="dark"] article details.faq > *:not(summary),
:root[data-bs-theme="dark"] .content details.faq > *:not(summary),
:root[data-bs-theme="dark"] article details.faq summary::after,
:root[data-bs-theme="dark"] .content details.faq summary::after {
  color: #75b798;
}

:root[data-bs-theme="dark"] article details.faq summary::before,
:root[data-bs-theme="dark"] .content details.faq summary::before {
  color: #75b798;
}
