/* KATALYSIA Research Public – Shared Stylesheet */
/* Design abgestimmt auf katalysia.com: Weiß, Bordeaux #8B1A1A, Charcoal #3A3A3A */

:root {
  --primary:       #3a3a3a;   /* Charcoal – wie aktiver Nav-Button */
  --primary-light: #555555;
  --accent:        #8b1a1a;   /* Bordeaux/Dunkelrot – wie Überschriften katalysia.com */
  --accent-light:  #a82424;
  --bg:            #ffffff;
  --bg-light:      #f7f7f7;
  --card-bg:       #ffffff;
  --text:          #2d2d2d;
  --text-light:    #888888;
  --border:        #e0e0e0;
  --nav-inactive:  #ebebeb;
  --prompt-bg:     #f5f0f0;
  --tag-bg:        #ebebeb;
  --tag-text:      #3a3a3a;
  --disclaimer-bg: #fafafa;
  --disclaimer-text: #999999;
}

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

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text);
  line-height: 1.7;
}

/* ── Header (weiß, wie katalysia.com) ── */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 1.4rem 2.5rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-header-text { flex: 1; }

.site-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
  margin-bottom: 0.15rem;
}
.site-header p {
  font-size: 0.82rem;
  color: var(--text-light);
  letter-spacing: 0.02em;
}
.site-header a { color: var(--accent); text-decoration: none; }
.site-header a:hover { text-decoration: underline; }

/* Logo – natürliche Farben, kein Filter */
.site-logo {
  flex-shrink: 0;
  height: 72px;
  width: auto;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }

/* Roter Akzent-Streifen unter dem Header */
.header-accent-bar {
  height: 3px;
  background: var(--accent);
  width: 100%;
}

/* ── Container ── */
.container { max-width: 980px; margin: 0 auto; padding: 2.2rem 1.5rem; }

/* ── Intro-Text ── */
.intro-text {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
  line-height: 1.7;
}

/* ── Section label ── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light);
  margin-bottom: 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ── Topic cards ── */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.topic-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 2px;
  padding: 1.4rem 1.5rem 1.2rem;
  transition: box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.topic-card:hover {
  box-shadow: 0 4px 18px rgba(139,26,26,0.1);
  transform: translateY(-2px);
}
.topic-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topic-card p { font-size: 0.87rem; color: var(--text-light); margin-bottom: 0.8rem; }

/* Badge */
.badge {
  display: inline-block;
  background: var(--nav-inactive);
  color: var(--primary);
  font-size: 0.7rem;
  padding: 0.18rem 0.65rem;
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Artefakt-Vorschau in Karten */
.artifact-preview {
  margin-top: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}
.artifact-preview-item {
  font-size: 0.79rem;
  color: var(--text-light);
  padding: 0.18rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact-preview-item::before {
  content: '→ ';
  color: var(--accent);
  font-weight: 700;
}

/* Disclaimer auf Karten */
.card-disclaimer {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
  font-size: 0.7rem;
  color: var(--disclaimer-text);
  line-height: 1.5;
  font-style: italic;
}

/* ── Artefakt-Liste ── */
.artifact-list { list-style: none; margin-top: 0.8rem; }
.artifact-list li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 2px 2px 0;
  margin-bottom: 0.7rem;
  transition: border-left-color 0.15s, background 0.15s;
}
.artifact-list li:hover { background: var(--bg-light); }
.artifact-list li a {
  display: block;
  padding: 1rem 1.3rem;
  text-decoration: none;
  color: var(--text);
}
.artifact-list .artifact-title {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.91rem;
}
.artifact-list .artifact-date {
  font-size: 0.77rem;
  color: var(--text-light);
  margin-top: 0.2rem;
  display: block;
}

/* ── Prompt-Box auf Artefakt-Seiten ── */
.prompt-box {
  background: var(--prompt-bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 3px 3px 0;
  padding: 1.1rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.88rem;
}
.prompt-box .label {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.45rem;
}
.prompt-box .prompt-text {
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.model-tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 0.2rem 0.65rem;
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ── Content-Bereich ── */
.content h2 {
  font-size: 1.1rem;
  color: var(--accent);
  margin: 2rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.content h3 {
  font-size: 0.95rem;
  color: var(--primary);
  margin: 1.3rem 0 0.45rem;
  font-weight: 700;
}
.content p { margin-bottom: 0.95rem; font-size: 0.91rem; }
.content ul, .content ol { margin: 0.7rem 0 1.1rem 1.5rem; }
.content li { margin-bottom: 0.35rem; font-size: 0.91rem; }
.content strong { color: var(--primary); }

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.4rem;
  font-size: 0.86rem;
}
.content th {
  background: var(--primary);
  color: white;
  padding: 0.55rem 0.95rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.content td {
  padding: 0.55rem 0.95rem;
  border-bottom: 1px solid var(--border);
}
.content tr:nth-child(even) { background: var(--bg-light); }

/* ── Seiten-Disclaimer ── */
.page-disclaimer {
  padding: 0.9rem 1.1rem;
  background: var(--disclaimer-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-light);
  border-radius: 0 2px 2px 0;
  font-size: 0.77rem;
  color: var(--disclaimer-text);
  font-style: italic;
  line-height: 1.6;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 1.6rem 2rem;
  font-size: 0.77rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  background: #ffffff;
  letter-spacing: 0.02em;
}
.site-footer a { color: var(--accent); text-decoration: none; }

/* ── Sticky Navigation Bar ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 2.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.site-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover { color: #ffffff; }
.site-nav-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.site-nav-home {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.site-nav-sep {
  color: rgba(255,255,255,0.35);
  font-size: 0.7rem;
}
.site-nav-crumb {
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
}
.site-nav-crumb.active {
  color: rgba(255,255,255,0.95);
  font-weight: 600;
}

/* ── PDF Overlay Viewer ── */
.pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(20,20,20,0.8);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s;
}
.pdf-overlay.visible { opacity: 1; }

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}
.pdf-toolbar-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 1rem;
}
.pdf-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background 0.15s, border-color 0.15s;
}
.pdf-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}
.pdf-btn-accent {
  background: var(--accent);
  border-color: var(--accent);
}
.pdf-btn-accent:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}
.pdf-viewer-frame {
  flex: 1;
  border: none;
  width: 100%;
  background: #525659;
}

/* ── Download icon next to PDF links ── */
.pdf-download-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-left: 0.4rem;
  border-radius: 2px;
  color: var(--accent);
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.pdf-download-inline:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Auth-Overlay ── */
body.auth-locked > *:not(#auth-overlay) {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  transition: opacity 0.4s;
}
#auth-overlay.auth-fade-out { opacity: 0; }

.auth-box {
  background: white;
  border-radius: 3px;
  padding: 2.5rem 2rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  border-top: 4px solid var(--accent);
}
.auth-logo { font-size: 2rem; margin-bottom: 0.8rem; }
.auth-box h2 {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.auth-box p {
  font-size: 0.84rem;
  color: var(--text-light);
  margin-bottom: 1.4rem;
  line-height: 1.6;
}

.auth-input-row { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; }
.auth-input-row input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.auth-input-row input:focus { border-color: var(--accent); }
.auth-input-row button {
  padding: 0.65rem 1.1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s;
}
.auth-input-row button:hover { background: var(--accent-light); }

.auth-error { color: var(--accent); font-size: 0.82rem; margin-bottom: 0.6rem; }
.auth-hint { font-size: 0.75rem; color: var(--text-light); margin-top: 1rem !important; margin-bottom: 0 !important; }

.auth-box a, .auth-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.auth-box a:hover, .auth-link:hover {
  border-bottom-color: var(--accent);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.auth-shake { animation: shake 0.4s ease; }

/* ── Key Takeaways ── */
.key-takeaways {
  background: linear-gradient(135deg, #fdf6f6 0%, #f7f7f7 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 3px 3px 0;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.8rem;
}
.key-takeaways-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.key-takeaways ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.key-takeaways li {
  font-size: 0.87rem;
  color: var(--text);
  padding: 0.3rem 0;
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.55;
}
.key-takeaways li::before {
  content: '▸';
  color: var(--accent);
  font-weight: 700;
  position: absolute;
  left: 0;
}

/* ── Dienstleistungsbereich-Karten (Branchen-Index) ── */
.dl-bereich {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 2px;
  padding: 1.5rem 1.6rem 1.3rem;
  margin-bottom: 1.5rem;
}
.dl-bereich h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.dl-bereich > p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* Inhaltsebenen innerhalb eines Dienstleistungsbereichs */
.content-tier {
  margin-bottom: 0.9rem;
}
.content-tier-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}
.content-tier ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.content-tier li {
  margin-bottom: 0.35rem;
}
.content-tier li a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 2px 2px 0;
  text-decoration: none;
  color: var(--text);
  font-size: 0.87rem;
  transition: background 0.15s, border-left-color 0.15s;
}
.content-tier li a:hover {
  background: #f0e8e8;
  border-left-color: var(--accent-light);
}
.content-tier .tier-icon {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--accent);
}
.content-tier .tier-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: auto;
  white-space: nowrap;
}

/* ── Branchen-Cards auf Hauptseite (erweitert) ── */
.branche-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 2px;
  padding: 1.4rem 1.5rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: box-shadow 0.2s, transform 0.15s;
}
.branche-card:hover {
  box-shadow: 0 4px 18px rgba(139,26,26,0.1);
  transform: translateY(-2px);
}
.branche-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.branche-card > p {
  font-size: 0.87rem;
  color: var(--text-light);
  margin-bottom: 0.9rem;
}
.branche-card .key-takeaways {
  margin-bottom: 0.8rem;
  padding: 0.9rem 1.1rem;
}
.branche-card .key-takeaways li {
  font-size: 0.82rem;
}
.branche-card .badge { display: inline-block; }

/* ─────────────────────────────────────────────────────────────────
 *  Mobile / Responsive (≤ 720 px)
 * ─────────────────────────────────────────────────────────────────
 *  Goals:
 *  - vertical scroll always works (no accidental horizontal overflow)
 *  - tables become horizontally scrollable on small screens
 *  - paddings & font sizes shrink so content fits the viewport
 */

html, body {
  /* Defensive: never block the page from scrolling */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
}

/* Wrap wide tables so they scroll within their box instead of pushing the
 * page wider than the viewport. */
.content table,
.risk-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent very wide images / pre / code from breaking the layout */
img, iframe, embed, object {
  max-width: 100%;
}
pre, code {
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .container { padding: 1.4rem 1rem; }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.2rem 1rem;
    gap: 0.8rem;
  }
  .site-header h1 { font-size: 1.4rem; line-height: 1.25; }
  .site-header p { font-size: 0.85rem; }
  .site-logo { width: 90px; height: auto; }

  .breadcrumb {
    font-size: 0.7rem;
    word-break: break-word;
    white-space: normal;
  }

  /* Sticky-Nav: kompakter, horizontal scrollbar bei langen Pfaden */
  .site-nav {
    padding: 0.4rem 0.8rem;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
  }
  .site-nav-left { flex-wrap: nowrap; white-space: nowrap; }

  /* Branchen-Karten: einspaltig */
  .topics-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }

  /* Größere Klick-Flächen, sauberer Zeilenumbruch */
  h1 { font-size: 1.4rem !important; }
  h2 { font-size: 1.2rem !important; }
  h3 { font-size: 1.05rem !important; }

  /* Auth-Overlay: Box passt sich an */
  .auth-box {
    padding: 1.6rem 1.2rem;
    width: calc(100vw - 2rem);
  }

  /* PDF-Overlay-Toolbar kompakter, falls jemand den Desktop-Pfad doch
   * triggert (Tablet im Desktop-Modus etc.) */
  .pdf-toolbar { padding: 0.5rem 0.8rem; gap: 0.4rem; }
  .pdf-toolbar-title { font-size: 0.75rem; }
  .pdf-btn { padding: 0.35rem 0.6rem; font-size: 0.7rem; }


  /* Lange URLs in Quellenlisten brechen sauber um */
  .source-list a, .content a {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .container { padding: 1rem 0.85rem; }
  .site-header h1 { font-size: 1.2rem; }
  body { font-size: 15px; }
}
