/*
Theme Name: Biomed
Theme URI: https://biomedlabor.de
Author: Arbeitsgruppe Biomed · Hochschule München · Fak. 06
Author URI: https://biomedlabor.de
Description: Design System für die Arbeitsgruppe Biomed (BioMedLab), Hochschule München, Fakultät für angewandte Naturwissenschaften und Mechatronik. Enthält Header, Footer und die globalen Designtokens (IBM Plex, soothed palette, Kachelmotiv, Radien 2/4/8 px). Seiteninhalte werden über Custom-HTML-Blöcke mit Scope-Klasse .biomed-site gepflegt.
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: biomed
Tags: research, education, clean, minimal, custom-logo, custom-menu, wide-blocks, block-styles, full-width-template, translation-ready
*/

/* =========================================================================
   BIOMED — Globale Designtokens (scope: :root + .biomed-site)
   Die Tokens liegen auf :root, damit Header/Footer sie nutzen können.
   Content-Blöcke (Custom HTML) nutzen zusätzlich .biomed-site als Scope.
   ========================================================================= */
:root {
  --biomed-green: #5a9e7d;
  --biomed-blue:  #4a88a8;

  --green-50: #eef5f0; --green-100: #cfe3d6; --green-300: #8fbda0;
  --green-500: #5a9e7d; --green-700: #407a5f;
  --blue-50:  #eaf1f5; --blue-100:  #c8dae4; --blue-300:  #86abc0;
  --blue-500: #4a88a8; --blue-700:  #2f6a88;
  --grey-25:  #f6f8fa; --grey-50:   #edf1f5; --grey-100: #e1e7ed;
  --grey-200: #bac7d2; --grey-300:  #9aabba; --grey-400: #75899a;
  --grey-500: #57697a; --grey-600:  #3d4c5a; --grey-700: #28333d;
  --grey-800: #18202a;

  --bg: #ffffff;
  --fg-1: var(--grey-800); --fg-2: var(--grey-600); --fg-3: var(--grey-400);
  --border: var(--grey-100); --border-strong: var(--grey-200);

  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-1: 2px; --r-2: 4px; --r-3: 8px; --r-pill: 999px;
  --shadow-focus: 0 0 0 3px rgba(74,136,168,.28);
  --dur-fast: 120ms;
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* =========================================================================
   Base Reset / Body
   ========================================================================= */
* , *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg-1);
  background: var(--bg);
  font-weight: 400;
}
body.admin-bar .biomed-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .biomed-header { top: 46px; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--biomed-blue); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--blue-700); }

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-2);
}

/* Screen-reader helper */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute !important; word-wrap: normal !important;
}

/* =========================================================================
   HEADER — Sticky, Blur, Nav
   ========================================================================= */
.biomed-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.biomed-header__inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 28px;
}
.biomed-header__brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 16px; color: var(--fg-1);
  text-decoration: none;
}
.biomed-header__brand:hover { color: var(--fg-1); }
/* Logo — Seitenverhältnis wird immer beibehalten.
   Höhe/Breite hier anpassen, wenn das Logo größer oder kleiner dargestellt werden soll. */
.biomed-header__brand img {
	display: block;
	height: auto;              /* Höhe folgt dem Seitenverhältnis */
	width:  auto;              /* Breite folgt dem Seitenverhältnis */
	max-height: 48px;          /* ← zentraler Wert: Logo-Höhe hier steuern */
	max-width:  240px;         /* Sicherheitsgrenze für sehr breite Logos */
	object-fit: contain;       /* verhindert jegliches Stauchen */
}
/* Fallback, wenn (noch) kein Logo im Customizer gesetzt ist */
.biomed-header__brand-fallback {
	font-weight: 600; font-size: 16px; color: var(--fg-1); letter-spacing: -.01em;
}

.biomed-header__nav {
  display: flex; gap: 26px; flex: 1;
  justify-content: flex-end;    /* Nav-Items rechtsbündig */
  list-style: none; padding: 0; margin: 0;
}
.biomed-header__nav li { position: relative; }
.biomed-header__nav a {
  font-size: 14px; color: var(--fg-2); padding: 6px 2px; position: relative;
  text-decoration: none; transition: color var(--dur-fast) var(--ease-out);
}
.biomed-header__nav a:hover { color: var(--fg-1); }
.biomed-header__nav .current-menu-item > a,
.biomed-header__nav .current_page_item > a {
  color: var(--fg-1); font-weight: 500;
}
.biomed-header__nav .current-menu-item > a::after,
.biomed-header__nav .current_page_item > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -15px;
  height: 2px; background: var(--biomed-blue);
}
/* Dropdown-Untermenüs (Desktop) — Hover + Keyboard-Focus */
.biomed-header__nav .menu-item-has-children > a::after,
.biomed-header__nav .page_item_has_children > a::after {
  content: " ▾"; font-size: .75em; margin-left: 4px; color: var(--fg-3);
}
.biomed-header__nav .sub-menu {
  position: absolute; top: 100%; right: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-3);
  padding: 8px; margin: 8px 0 0; list-style: none;
  box-shadow: 0 8px 24px rgba(24,32,42,.10), 0 2px 4px rgba(24,32,42,.04);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-fast);
}
.biomed-header__nav li:hover > .sub-menu,
.biomed-header__nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
.biomed-header__nav .sub-menu a { display: block; padding: 8px 10px; border-radius: var(--r-2); }
.biomed-header__nav .sub-menu a:hover { background: var(--grey-25); }
.biomed-header__nav .sub-menu a::after { content: none; }  /* kein ▾ auf Sub-Items */

/* Mobile Toggle */
.biomed-header__toggle {
  display: none;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--r-2); padding: 8px 10px;
  color: var(--fg-1); font-family: var(--font-mono); font-size: 11px;
  cursor: pointer; letter-spacing: .06em; text-transform: uppercase;
  margin-left: auto;
}

@media (max-width: 900px) {
  .biomed-header__inner { gap: 16px; }
  .biomed-header__nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 12px 28px; margin: 0;
  }
  .biomed-header__nav.is-open { display: flex; }
  .biomed-header__nav a { padding: 12px 0; display: block; border-bottom: 1px solid var(--rule); }
  .biomed-header__nav li:last-child a { border-bottom: none; }
  .biomed-header__toggle { display: inline-flex; margin-left: auto; }

  /* Untermenüs auf Mobile: nicht schwebend, sondern eingerückt & sichtbar */
  .biomed-header__nav .sub-menu {
    position: static; opacity: 1; visibility: visible;
    background: transparent; border: none; border-radius: 0;
    padding: 0; margin: 0; box-shadow: none; min-width: 0;
  }
  .biomed-header__nav .sub-menu a {
    padding: 10px 0 10px 20px; border-bottom: 1px solid var(--rule);
    font-size: 14px; color: var(--fg-2);
  }
  .biomed-header__nav .menu-item-has-children > a::after,
  .biomed-header__nav .page_item_has_children > a::after {
    content: none;  /* kein ▾-Pfeil im mobilen Layout */
  }
}

/* =========================================================================
   MAIN CONTENT — erlaubt Full-Width-Blöcke der Custom-HTML-Inhalte
   ========================================================================= */
.biomed-main { min-height: 40vh; }
.biomed-page { max-width: 1240px; margin: 0 auto; padding: 48px 28px; }
.biomed-page.is-fullwidth { max-width: none; padding: 0; }

/* Stellt sicher, dass die .biomed-site-Blöcke im Content ausbrechen können */
.biomed-main .biomed-site { max-width: none; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.biomed-footer {
  background: var(--grey-800); color: var(--grey-200);
  padding: 60px 0 24px; margin-top: 60px;
}
.biomed-footer__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px;
}
.biomed-footer h5 {
  color: #fff; font-size: 12px; text-transform: uppercase;
  letter-spacing: .12em; margin: 0 0 14px; font-weight: 600;
}
.biomed-footer ul { list-style: none; padding: 0; margin: 0; }
.biomed-footer li { margin-bottom: 8px; font-size: 14px; }
.biomed-footer a { color: var(--grey-200); text-decoration: none; border: none; }
.biomed-footer a:hover { color: #fff; }

.biomed-footer__brand img {
  height: 34px; width: auto; filter: brightness(0) invert(1); margin-bottom: 14px;
}
.biomed-footer__brand p {
  font-size: 13px; color: var(--grey-300); margin: 0 0 10px; max-width: 36ch; line-height: 1.65;
}
.biomed-footer__address {
  font-family: var(--font-mono); font-size: 12px; color: var(--grey-300);
}
.biomed-footer__legal {
  grid-column: 1 / -1; border-top: 1px solid var(--grey-700);
  margin-top: 40px; padding-top: 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--grey-400);
}

@media (max-width: 900px) {
  .biomed-footer__inner { grid-template-columns: 1fr; }
  .biomed-footer__legal { flex-direction: column; }
}

/* =========================================================================
   Block-Editor Kompatibilität — alignfull / alignwide
   ========================================================================= */
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.alignwide { max-width: 1240px; margin-left: auto; margin-right: auto; }
