/* MedSearch — Static Site Styles */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --blue-dark: #2563eb;
  --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb;
  --gray-300: #d1d5db; --gray-400: #9ca3af; --gray-500: #6b7280;
  --gray-600: #4b5563; --gray-700: #374151; --gray-800: #1f2937;
  --gray-900: #111827; --gray-950: #030712;
  --bg: var(--gray-50); --bg-secondary: #fff;
  --text: var(--gray-900); --text-secondary: var(--gray-500); --text-muted: var(--gray-400);
  --border: var(--gray-200); --card-bg: #fff;
  --radius: 0.5rem; --container: 80rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) { --bg: var(--gray-950); --bg-secondary: var(--gray-900); --text: var(--gray-100); --text-secondary: var(--gray-400); --text-muted: var(--gray-600); --border: var(--gray-800); --card-bg: var(--gray-900); --blue-light: rgba(59,130,246,0.1); }
  html:not([data-theme="light"]) .header { background: rgba(3,7,18,0.85); }
  html:not([data-theme="light"]) .rel-item:hover { background: var(--gray-800); }
  html:not([data-theme="light"]) .chip:hover, html:not([data-theme="light"]) .show-more-btn:hover, html:not([data-theme="light"]) .header-nav a:hover { background: var(--gray-800); }
}

html[data-theme="dark"] { --bg: var(--gray-950); --bg-secondary: var(--gray-900); --text: var(--gray-100); --text-secondary: var(--gray-400); --text-muted: var(--gray-600); --border: var(--gray-800); --card-bg: var(--gray-900); --blue-light: rgba(59,130,246,0.1); }
html[data-theme="dark"] .header { background: rgba(3,7,18,0.85); }
html[data-theme="dark"] .rel-item:hover, html[data-theme="dark"] .chip:hover, html[data-theme="dark"] .show-more-btn:hover, html[data-theme="dark"] .header-nav a:hover { background: var(--gray-800); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 1rem; line-height: 1.6; color: var(--text); background: var(--bg); min-height: 100dvh; display: flex; flex-direction: column; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(59,130,246,0.2); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.i18n-nl,.i18n-fr,.i18n-de { display: none; }
html[lang="nl"] .i18n-en { display: none; } html[lang="nl"] .i18n-nl { display: inline; }
html[lang="fr"] .i18n-en { display: none; } html[lang="fr"] .i18n-fr { display: inline; }
html[lang="de"] .i18n-en { display: none; } html[lang="de"] .i18n-de { display: inline; }

.fallback { opacity: 0.65; font-style: italic; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; height: 4rem; gap: 0.75rem; }
.logo { display: flex; align-items: center; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.25rem; }
.logo:hover { text-decoration: none; }
.logo-search { color: var(--blue); }
.header-subtitle { font-size: 0.8125rem; color: var(--text-muted); font-weight: 400; display: none; }
@media (min-width: 768px) { .header-subtitle { display: inline; } }
.header-nav { flex: 1; display: flex; gap: 0.5rem; }
.header-nav a { padding: 0.375rem 0.75rem; border-radius: var(--radius); font-size: 0.875rem; color: var(--text-secondary); transition: color 0.15s, background 0.15s; }
.header-nav a:hover { color: var(--text); background: var(--gray-100); text-decoration: none; }

.theme-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.375rem; cursor: pointer; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; transition: color 0.15s, border-color 0.15s; }
.theme-btn:hover { color: var(--text); border-color: var(--gray-400); }
.theme-btn svg { width: 1.125rem; height: 1.125rem; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .icon-sun { display: none; }
  html:not([data-theme="light"]) .icon-moon { display: block; }
}

#lang-select { padding: 0.375rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg); color: var(--text); font-size: 0.875rem; cursor: pointer; }
#lang-select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }

.footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--bg-secondary); padding: 2rem 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 1.5rem; font-size: 0.875rem; color: var(--text-muted); text-align: center; }
@media (min-width: 640px) { .footer-inner { justify-content: space-between; text-align: left; } }
.footer-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; justify-content: center; }
@media (min-width: 640px) { .footer-left { justify-content: flex-start; } }
.footer-inner a { color: var(--blue); }
.footer-inner a:hover { text-decoration: underline; }
.sam-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.125rem 0.625rem; border-radius: 9999px; background: var(--blue-light); color: var(--blue-dark); font-size: 0.75rem; font-weight: 500; text-decoration: none; transition: background 0.15s; }
.sam-badge:hover { background: rgba(59,130,246,0.15); text-decoration: none; }

main { flex: 1; }
.page-content { padding: 1.5rem 0; }
.main-col { background: var(--card-bg); border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--border); }


.detail-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .detail-grid { grid-template-columns: 2fr 1fr; } }
.main-col { display: flex; flex-direction: column; gap: 2rem; }

.entity-header { display: flex; flex-direction: column; gap: 0.5rem; }
.entity-header h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
@media (min-width: 640px) { .entity-header h1 { font-size: 1.875rem; } }
.entity-code { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--text-secondary); flex-wrap: wrap; }
.entity-code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; background: var(--bg); padding: 0.125rem 0.375rem; border-radius: 0.25rem; }

.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; white-space: nowrap; width: fit-content; }

.section { display: flex; flex-direction: column; gap: 1rem; }
.section-title { font-size: 1.125rem; font-weight: 600; }
.section-title .count { font-size: 0.875rem; font-weight: 400; color: var(--text-secondary); }

.info-list { display: flex; flex-direction: column; gap: 0.75rem; }
.info-row { display: flex; flex-direction: column; gap: 0.25rem; }
@media (min-width: 640px) { .info-row { flex-direction: row; align-items: flex-start; gap: 1rem; } .info-row dt { width: 10rem; flex-shrink: 0; } }
.info-row dt { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.info-row dd { font-size: 0.875rem; color: var(--text); }

.rel-list { display: flex; flex-direction: column; gap: 0.5rem; }
.rel-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: all 0.15s; }
.rel-item:hover { border-color: var(--gray-300); box-shadow: 0 1px 3px rgba(0,0,0,0.05); text-decoration: none; }
.rel-item-content { flex: 1; min-width: 0; }
.rel-item-name { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-item:hover .rel-item-name { color: var(--blue); }
.rel-item-subtitle { display: block; font-size: 0.875rem; color: var(--text-secondary); }
.rel-item-arrow { color: var(--text-muted); font-size: 1.25rem; flex-shrink: 0; transition: transform 0.15s; }
.rel-item:hover .rel-item-arrow { color: var(--text-secondary); transform: translateX(2px); }
.hidden-item { display: none; }
.show-more-btn { display: inline-flex; align-items: center; padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg); color: var(--text-secondary); font-size: 0.875rem; cursor: pointer; transition: background 0.15s, color 0.15s; align-self: flex-start; }
.show-more-btn:hover { background: var(--bg); color: var(--text); }

.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.summary-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.summary-card h3 { font-size: 1rem; font-weight: 500; margin-bottom: 1rem; }
.summary-rows { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; }
.summary-row { display: flex; justify-content: space-between; align-items: flex-start; }
.summary-label { color: var(--text-secondary); }
.summary-value { font-weight: 500; text-align: right; }
.link-text { display: block; color: var(--blue); }
.text-muted { color: var(--text-muted); font-size: 0.75rem; }

.hero { background: linear-gradient(to bottom, var(--blue-light), var(--bg)); padding: 2.5rem 0 1.5rem; }
@media (min-width: 640px) { .hero { padding: 3.5rem 0 2rem; } }
.hero-inner { text-align: center; max-width: 56rem; }
.hero h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.5rem; }
@media (min-width: 640px) { .hero h1 { font-size: 2.5rem; } }
@media (min-width: 1024px) { .hero h1 { font-size: 3rem; } }
.hero-subtitle { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.hero-examples { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.examples-label { font-size: 0.875rem; color: var(--text-secondary); }
.chip { display: inline-flex; align-items: center; padding: 0.375rem 0.75rem; border-radius: 9999px; background: var(--card-bg); border: 1px solid var(--border); color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; transition: all 0.15s; cursor: pointer; }
.chip:hover { background: var(--bg); border-color: var(--gray-300); color: var(--text); text-decoration: none; }
.hero-stats { display: flex; justify-content: center; gap: 3rem; max-width: 42rem; margin: 1rem auto 2rem; padding: 1rem 1rem 0; }
.stat { text-align: center; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 600; color: var(--blue); }
.stat-label { display: block; font-size: 0.875rem; color: var(--text-muted); }

/* Search bar */
.search-bar-wrap { display: flex; max-width: 56rem; margin: 0 auto 1.5rem; border-radius: 0.75rem; overflow: hidden; border: 2px solid var(--border); background: var(--card-bg); transition: border-color 0.15s; }
.search-bar-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.type-select { border: none; border-right: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 1.125rem 1rem; font-size: 1rem; font-weight: 500; cursor: pointer; width: auto; flex-shrink: 0; }
.type-select:focus { outline: none; }
.search-input-wrap { flex: 1; position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 1rem; width: 1.375rem; height: 1.375rem; color: var(--text-muted); pointer-events: none; }
#search-input { width: 100%; border: none; background: transparent; padding: 1.125rem 1.5rem 1.125rem 3rem; font-size: 1.25rem; color: var(--text); }
#search-input:focus { outline: none; }
#search-input::placeholder { color: var(--text-muted); }

/* Search results */
.search-results-section { max-width: 48rem; margin: 0 auto; padding: 0 1rem 2rem; }
.search-count { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.75rem; font-weight: 500; }
.search-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: 1rem; }

.result-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; border-radius: var(--radius); background: var(--card-bg); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: all 0.15s; margin-bottom: 0.5rem; }
.result-card:hover { border-color: var(--gray-300); box-shadow: 0 1px 4px rgba(0,0,0,0.06); text-decoration: none; }
.result-card:hover .result-name { color: var(--blue); }
.result-card:hover .result-arrow { color: var(--text-secondary); transform: translateX(2px); }
.result-left { display: flex; align-items: flex-start; gap: 0.75rem; flex: 1; min-width: 0; }
.result-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.result-name { font-weight: 500; font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-card mark { background: rgba(59,130,246,0.12); color: inherit; border-radius: 2px; padding: 0 1px; }
.result-meta { display: flex; gap: 0.5rem; align-items: center; }
.result-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; color: var(--text-muted); }
.result-details { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; font-size: 0.8125rem; color: var(--text-secondary); }
.result-sep { color: var(--text-muted); }
.result-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; flex-shrink: 0; }
.result-price { font-weight: 600; font-size: 0.875rem; color: var(--text); }
.result-reimb { font-size: 0.6875rem; padding: 0.0625rem 0.375rem; border-radius: 9999px; background: rgba(124,58,237,0.1); color: #7C3AED; font-weight: 500; }
.result-bt { color: #f59e0b; font-size: 0.75rem; }
.result-count { font-size: 0.75rem; color: var(--text-muted); }
.result-arrow { color: var(--text-muted); font-size: 1.25rem; flex-shrink: 0; transition: all 0.15s; }

@media (max-width: 639px) {
  .search-bar-wrap { flex-direction: column; }
  .type-select { border-right: none; border-bottom: 1px solid var(--border); min-width: auto; }
}

.verse-tree { margin-left: 1rem; border-left: 2px solid var(--border); padding-left: 1rem; }
.verse-item { margin: 0.5rem 0; font-size: 0.875rem; }
.verse-meta { display: inline-flex; gap: 0.375rem; margin-left: 0.5rem; }
.verse-tag { font-size: 0.7rem; padding: 0.0625rem 0.375rem; border-radius: 0.25rem; background: var(--bg); color: var(--text-secondary); }

.atc-hierarchy { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.875rem; }
.atc-level { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0; }
.atc-level-current { font-weight: 600; color: var(--text); }
.atc-indent { display: inline-block; width: 1.5rem; text-align: center; color: var(--text-muted); }

.black-triangle { color: #f59e0b; }
.warning-box { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius); padding: 0.75rem 1rem; font-size: 0.875rem; color: var(--text); display: flex; align-items: flex-start; gap: 0.5rem; }
.warning-box svg { flex-shrink: 0; width: 1.25rem; height: 1.25rem; color: #f59e0b; }

/* Block-level i18n for prose content */
div.i18n-nl, div.i18n-fr, div.i18n-de { display: none; }
html[lang="nl"] div.i18n-en { display: none; } html[lang="nl"] div.i18n-nl { display: block; }
html[lang="fr"] div.i18n-en { display: none; } html[lang="fr"] div.i18n-fr { display: block; }
html[lang="de"] div.i18n-en { display: none; } html[lang="de"] div.i18n-de { display: block; }

/* Help page */
.help-content { max-width: 52rem; margin: 0 auto; padding: 2rem 1rem; display: flex; flex-direction: column; gap: 2.5rem; }
.help-content h1 { font-size: 1.875rem; font-weight: 700; }
.help-tree { display: flex; flex-direction: column; gap: 0; }
.help-tree-node { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.5rem 0; font-size: 0.9375rem; line-height: 1.5; }
.help-tree-node .badge { margin-top: 0.125rem; flex-shrink: 0; }
.help-tree-branch { margin-left: 1rem; border-left: 2px solid var(--border); padding-left: 1rem; }
.badge-grid { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
@media (min-width: 640px) { .badge-grid { grid-template-columns: 1fr 1fr; } }
.badge-grid-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; padding: 0.375rem 0; }
.badge-grid-desc { color: var(--text-secondary); }
.help-defs { display: flex; flex-direction: column; gap: 1rem; }
.help-defs dt { font-size: 0.9375rem; }
.help-defs dd { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; margin-left: 0; }
.help-defs code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; background: var(--bg); padding: 0.125rem 0.375rem; border-radius: 0.25rem; }
.help-content ul { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.help-btn:hover { text-decoration: none; }

@media print { .header,.footer,.show-more-btn,#lang-select,.theme-btn,.help-btn { display: none !important; } .hidden-item { display: flex !important; } body { font-size: 10pt; } }
