/* =============================================
   KB Template: protocol_basic — v1.0
   Skonsolidowane style szablonu protocol_basic.
   Zawiera: WCAG focus, dark mode formularze/SVG,
   linki w treści artykułu.
   ============================================= */

/* =============================================
   #entry-content.prose code (wspólne z _head.html.erb)
   ============================================= */

#entry-content.prose code {
  font-family: 'Courier New', monospace;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  display: block;
  border-left: 4px solid #6366f1;
  background-color: #161616;
  padding: 16px 20px;
  font-size: 0.875rem;
  color: #fff;
  border-radius: 9px;
  max-width: 100%;
  font-weight: normal;
}

/* `code` w zdaniu (akapit, lista, tabela) to adres albo nazwa pola - zostaje w linii tekstu.
   Blokiem jest tylko kod stojący samodzielnie (<pre><code>, <code> z edytora HTML). */
#entry-content.prose :is(p, li, td, th, h1, h2, h3, h4, a, strong, em) > code {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
  border-left: 0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  line-height: inherit;
  background-color: #f3f4f6;
  color: #111827;
}
#entry-content.prose :is(p, li, td, th, h1, h2, h3, h4, a, strong, em) > code::before,
#entry-content.prose :is(p, li, td, th, h1, h2, h3, h4, a, strong, em) > code::after {
  content: none;
}
.dark #entry-content.prose :is(p, li, td, th, h1, h2, h3, h4, a, strong, em) > code {
  background-color: #374151;
  color: #f3f4f6;
}

@media print {
  .kb-widget-tab,
  .kb-widget-overlay,
  .kb-widget-panel {
    display: none !important;
  }
}

/* =============================================
   Focus management (WCAG 2.4.7)
   ============================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="combobox"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 2px;
}

.dark a:focus-visible,
.dark button:focus-visible,
.dark input:focus-visible,
.dark textarea:focus-visible,
.dark select:focus-visible {
  outline-color: #60a5fa;
}

/* =============================================
   Dark mode — formularze (@tailwindcss/forms)
   ============================================= */

.dark textarea,
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="search"],
.dark select {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #f3f4f6;
}

.dark textarea::placeholder,
.dark input::placeholder {
  color: #6b7280;
}

/* =============================================
   Dark mode — SVG z currentColor
   ============================================= */

.dark svg { color: #e5e7eb; }
.dark svg[stroke="currentColor"] { stroke: #e5e7eb !important; }
.dark .stroke-gray-900 { stroke: #e5e7eb !important; }

/* =============================================
   Linki w treści — reset prose
   Styl z get_content (border-dashed) ma priorytet
   ============================================= */

#entry-content a {
  color: inherit !important;
  text-decoration: none !important;
  font-weight: inherit !important;
}

#entry-content a:hover {
  color: #1d4ed8 !important;
}
