/*
Theme Name: Gemeinschaftspraxis Dettenhausen
Theme URI: https://www.gemeinschaftspraxis-dettenhausen.de
Author: Gemeinschaftspraxis Dr. van Gerpen & Dr. Klause
Author URI: https://www.gemeinschaftspraxis-dettenhausen.de
Description: Custom WordPress theme for Gemeinschaftspraxis Dr. van Gerpen & Dr. Klause in Dettenhausen. GDPR-compliant, SEO-optimized, fully responsive medical practice theme with announcement modal, cookie consent, and accessibility features.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gemeinschaftspraxis
Tags: custom-menu, custom-logo, featured-images, accessibility-ready, translation-ready
*/

/* =============================================
   Gemeinschaftspraxis Dettenhausen – Redesign
   Modern, Accessible, GDPR-Compliant
   ============================================= */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors — matched to live website (blue + gold) with warm-modern tuning */
  --color-primary: #2a559d;
  --color-primary-dark: #1d3d72;
  --color-primary-light: #3a6fc4;
  --color-accent: #f2c200;
  --color-accent-dark: #d9a800;
  --color-accent-light: #ffd633;
  --color-emergency: #c0392b;
  --color-emergency-light: #e74c3c;
  --color-text: #232a35;
  --color-text-light: #5a6575;
  --color-bg: #ffffff;
  --color-bg-warm: #faf8f4;
  --color-bg-blue: #eef3fa;
  --color-bg-accent: #fff9e6;
  --color-border: #e3e8f0;
  --color-border-light: #eff2f7;

  /* Typography — GDPR-konform, keine externen Verbindungen */
  --font-heading: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Layout — warm, human-scaled */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(42,85,157,0.06), 0 1px 2px rgba(42,85,157,0.04);
  --shadow-md: 0 6px 24px rgba(42,85,157,0.08), 0 2px 6px rgba(42,85,157,0.05);
  --shadow-lg: 0 16px 48px rgba(42,85,157,0.1), 0 4px 14px rgba(42,85,157,0.06);
  --shadow-xl: 0 28px 70px rgba(42,85,157,0.13);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  --header-height: 80px;
}

/*
 * Optional: Self-hosted custom fonts (GDPR-konform).
 * Download Playfair Display + Source Sans 3 WOFF2 files from
 * https://gwfh.mranftl.com/ and place them in the /fonts/ directory.
 * Then uncomment the @font-face rules below:
 *
 * @font-face {
 *   font-family: 'Playfair Display';
 *   src: url('fonts/playfair-display-v37-latin-regular.woff2') format('woff2');
 *   font-weight: 400; font-style: normal; font-display: swap;
 * }
 * @font-face {
 *   font-family: 'Playfair Display';
 *   src: url('fonts/playfair-display-v37-latin-600.woff2') format('woff2');
 *   font-weight: 600; font-style: normal; font-display: swap;
 * }
 * @font-face {
 *   font-family: 'Playfair Display';
 *   src: url('fonts/playfair-display-v37-latin-700.woff2') format('woff2');
 *   font-weight: 700; font-style: normal; font-display: swap;
 * }
 * @font-face {
 *   font-family: 'Source Sans 3';
 *   src: url('fonts/source-sans-3-v15-latin-regular.woff2') format('woff2');
 *   font-weight: 400; font-style: normal; font-display: swap;
 * }
 * @font-face {
 *   font-family: 'Source Sans 3';
 *   src: url('fonts/source-sans-3-v15-latin-600.woff2') format('woff2');
 *   font-weight: 600; font-style: normal; font-display: swap;
 * }
 * @font-face {
 *   font-family: 'Source Sans 3';
 *   src: url('fonts/source-sans-3-v15-latin-700.woff2') format('woff2');
 *   font-weight: 700; font-style: normal; font-display: swap;
 * }
 *
 * Then update the custom properties above:
 * --font-heading: 'Playfair Display', Georgia, serif;
 * --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
 */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.72;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover, a:focus-visible { color: var(--color-accent-dark); }

/* Heading defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--color-primary);
}

/* ---------- Focus Styles (Accessibility) ---------- */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Skip to Content ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  color: #fff;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  height: var(--header-height);
  transition: box-shadow var(--transition);
}
.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 24px;
}

.header-logo img {
  height: 48px;
  width: auto;
}

/* Main Nav */
.main-nav { display: flex; align-items: center; }

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.main-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--color-bg-blue);
  color: var(--color-primary);
}
.main-nav .current-menu-item > a,
.main-nav .current-page-ancestor > a,
.main-nav a.active {
  color: var(--color-primary);
  background: var(--color-bg-blue);
}
.main-nav .nav-emergency a,
.main-nav .menu-item-notfall > a {
  background: var(--color-emergency);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 8px 18px;
}
.main-nav .nav-emergency a:hover,
.main-nav .nav-emergency a:focus-visible,
.main-nav .menu-item-notfall > a:hover,
.main-nav .menu-item-notfall > a:focus-visible {
  background: var(--color-emergency-light);
  color: #fff;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
  border-radius: var(--radius-sm);
}
.menu-toggle:focus-visible {
  outline: 3px solid var(--color-accent);
}
.menu-toggle svg { width: 28px; height: 28px; }

.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  padding: 100px 0 140px;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29,58,107,0.9) 0%, rgba(20,42,79,0.78) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 700px;
}
.hero-content h1 {
  color: #fff;
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
}
.hero-content .subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  opacity: 0.92;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ---------- Info Cards (Home) ---------- */
.section--cards-overlap {
  padding-top: 0;
  padding-bottom: 80px;
  position: relative;
  z-index: 2;
  background: transparent;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: -100px;
}

.info-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--color-primary);
  transition: transform var(--transition), box-shadow var(--transition);
}
.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}
.info-card h3 {
  margin-bottom: 16px;
  color: var(--color-primary);
  font-size: 1.2rem;
}
.info-card p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.7;
}
.info-card.accent-card {
  border-top-color: var(--color-accent);
}
.info-card.emergency-card {
  border-top-color: var(--color-emergency);
}

/* ---------- Office Hours Table ---------- */
.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.hours-table th,
.hours-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}
.hours-table th {
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hours-table td:first-child {
  font-weight: 600;
  color: var(--color-text);
}
.hours-table tr:last-child td { border-bottom: none; }

/* ---------- Sections ---------- */
.section {
  padding: 80px 0;
}
.section--warm { background: var(--color-bg-warm); }
.section--blue { background: var(--color-bg-blue); }
.section--accent { background: var(--color-bg-accent); }
.section--dark {
  background: var(--color-primary-dark);
  color: #fff;
}
.section--dark h2,
.section--dark h3 { color: #fff; }

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}
.section-header h2 { margin-bottom: 12px; }
.section-header p {
  color: var(--color-text-light);
  font-size: 1.05rem;
}
.section-header .accent-line {
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: 16px auto 0;
}

/* ---------- Eyebrow Label ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: 14px;
}
.eyebrow--light { color: var(--color-accent-light); }

/* ---------- Aktuelles & Urlaub ---------- */
.news-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.news-main h2 { margin-bottom: 28px; }
.news-item {
  padding: 22px 0;
  border-top: 1px solid var(--color-border);
}
.news-item:first-of-type { border-top: none; padding-top: 0; }
.news-item h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
  color: var(--color-primary);
}
.news-item p { color: var(--color-text-light); }
.news-aside {
  background: var(--color-bg-accent);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  border-left: 4px solid var(--color-accent);
}
.news-aside h3 { font-size: 1.05rem; margin-bottom: 12px; }
.news-aside p { margin-bottom: 12px; }
.news-aside p:last-child { margin-bottom: 0; }

/* ---------- PatMed App ---------- */
.section--patmed {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
}
.patmed-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}
.patmed-content h2 { color: #fff; margin-bottom: 18px; }
.patmed-content > p { color: rgba(255,255,255,0.88); margin-bottom: 20px; max-width: 60ch; }
.patmed-features {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}
.patmed-features li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 14px;
  color: rgba(255,255,255,0.92);
}
.patmed-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(242,194,0,0.2);
}
.patmed-stores {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background var(--transition);
}
.store-badge:hover { background: rgba(255,255,255,0.22); color: #fff; }
.patmed-visual {
  display: flex;
  justify-content: center;
}
.patmed-phone {
  width: 200px;
  height: 400px;
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05));
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.patmed-phone::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.3);
}
.patmed-phone-label {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

/* ---------- Service Card link + note ---------- */
.service-card-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
}
.service-card:hover .service-card-link { color: var(--color-accent-dark); }
.services-note {
  text-align: center;
  margin-top: 36px;
  padding: 20px;
  font-size: 1.02rem;
  color: var(--color-text-light);
}
.services-note a { font-weight: 600; }

/* ---------- Apparative Diagnostik ---------- */
.diagnostik-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: center;
}
.diagnostik-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 420px;
}
.diagnostik-content h2 { margin-bottom: 24px; }
.diagnostik-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.diagnostik-list li {
  position: relative;
  padding-left: 34px;
  font-size: 1.05rem;
  color: var(--color-text);
}
.diagnostik-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--color-bg-accent);
  border: 2px solid var(--color-accent);
}
.diagnostik-list li::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 7px;
  width: 6px;
  height: 11px;
  border: solid var(--color-accent-dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Contact Form ---------- */
.contact-form-wrap {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.contact-form-intro { margin-bottom: 32px; }
.contact-form-intro h2 { margin-bottom: 12px; }
.contact-form-intro p { color: var(--color-text-light); margin-bottom: 8px; }

@media (max-width: 640px) {
  .contact-form-wrap { padding: 28px 20px; }
}

/* ---------- Page Hero (Subpages) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  padding: 100px 0 60px;
  color: #fff;
  text-align: center;
}
.page-hero h1 {
  color: #fff;
  margin-bottom: 12px;
}
.page-hero p {
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 0.88rem;
}
.breadcrumb a { color: rgba(255,255,255,0.7); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .separator { color: rgba(255,255,255,0.4); }
.breadcrumb .current { color: #fff; font-weight: 600; }

/* ---------- Service Cards ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.service-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
.service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
  color: inherit;
}
.service-card .icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-bg-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: var(--color-primary);
}
.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}
.service-card p {
  color: var(--color-text-light);
  font-size: 0.93rem;
}

/* ---------- Team Section ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.team-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
}
.team-card-image {
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
}
.team-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.team-card:hover .team-card-image img {
  transform: scale(1.03);
}
.team-card-body {
  padding: 28px;
}
.team-card-body h3 {
  color: var(--color-primary);
  margin-bottom: 4px;
}
.team-card-body .role {
  color: var(--color-accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.team-card-body ul {
  list-style: none;
  padding: 0;
}
.team-card-body li {
  font-size: 0.92rem;
  color: var(--color-text-light);
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
}
.team-card-body li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

/* ---------- Team Members (Staff) ---------- */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.staff-card {
  text-align: center;
  background: var(--color-bg-warm);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  border: 1px solid var(--color-border-light);
}
.staff-card .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.staff-card h4 { font-size: 1rem; margin-bottom: 4px; }
.staff-card p { font-size: 0.85rem; color: var(--color-text-light); }

/* ---------- Contact Info Block ---------- */
.contact-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.95rem;
}
.contact-item .ci-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-primary);
}
.contact-item a {
  font-weight: 600;
}

/* ---------- Map Embed (OpenStreetMap – GDPR-konform, kein CDN) ---------- */
.map-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  height: 400px;
  position: relative;
  background: var(--color-bg-blue);
  z-index: 0;
  border: 1px solid var(--color-border);
}
.map-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-text);
}
.form-group .required { color: var(--color-emergency); }

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(42,85,157,0.15);
  outline: none;
}
.form-textarea { resize: vertical; min-height: 120px; }
select.form-input,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%23555'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 40px;
  cursor: pointer;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

/* ---------- Form Tabs ---------- */
.form-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 32px;
}
.form-tab {
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-light);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.form-tab:hover {
  color: var(--color-primary);
}
.form-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.form-tab:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: -3px;
  border-radius: var(--radius-sm);
}
.form-tab-panel { display: block; }
.form-tab-panel[hidden] { display: none; }

@media (max-width: 640px) {
  .form-tabs { flex-direction: column; gap: 0; border-bottom: none; }
  .form-tab {
    border-bottom: none;
    border-left: 3px solid transparent;
    text-align: left;
    padding: 12px 20px;
  }
  .form-tab.active { border-left-color: var(--color-primary); border-bottom-color: transparent; }
}

/* ---------- Medication Row ---------- */
.med-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}
.med-row .med-name { flex: 1; }
.med-row .med-size { flex: 0 0 160px; }

@media (max-width: 640px) {
  .med-row { flex-direction: column; align-items: stretch; gap: 0; }
  .med-row .med-size { flex: 1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-accent {
  background: var(--color-accent);
  color: var(--color-text);
}
.btn-accent:hover, .btn-accent:focus-visible {
  background: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover, .btn-outline:focus-visible {
  background: var(--color-primary);
  color: #fff;
}
.btn-white {
  background: #fff;
  color: var(--color-primary);
}
.btn-white:hover, .btn-white:focus-visible {
  background: var(--color-bg-blue);
  color: var(--color-primary-dark);
}
.btn-emergency {
  background: var(--color-emergency);
  color: #fff;
}
.btn-emergency:hover, .btn-emergency:focus-visible {
  background: var(--color-emergency-light);
  color: #fff;
}
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* ---------- Emergency Banner ---------- */
.emergency-banner {
  background: var(--color-emergency);
  color: #fff;
  padding: 32px 0;
  text-align: center;
}
.emergency-banner h3 { color: #fff; margin-bottom: 8px; }
.emergency-banner a { color: #fff; text-decoration: underline; }

.emergency-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  display: block;
  margin: 12px 0;
}

/* ---------- Leistungen Section Nav ---------- */
.leistungen-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.leistungen-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.leistungen-nav ul::-webkit-scrollbar { display: none; }
.leistungen-nav li { flex-shrink: 0; }
.leistungen-nav a {
  display: block;
  padding: 16px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-light);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.leistungen-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

/* ---------- Content Block ---------- */
.content-block {
  max-width: 800px;
  margin: 0 auto;
}
.content-block h2 {
  margin-bottom: 16px;
}
.content-block h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}
.content-block ul, .content-block ol {
  padding-left: 0;
  margin-bottom: 16px;
  list-style: none;
}
.content-block ul > li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
  line-height: 1.7;
}
.content-block ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(242,194,0,0.15);
}
.content-block ol {
  counter-reset: gp-counter;
  padding-left: 0;
}
.content-block ol > li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
  line-height: 1.7;
  counter-increment: gp-counter;
}
.content-block ol > li::before {
  content: counter(gp-counter);
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.85rem;
}

/* ---------- Info Box / Notice ---------- */
.info-box {
  background: var(--color-bg-accent);
  border-left: 4px solid var(--color-accent);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
}

/* ---------- Download Card ---------- */
.download-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}
.download-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}
.download-card .dl-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
}
.download-card .dl-info { flex: 1; }
.download-card .dl-info h4 { margin-bottom: 2px; color: var(--color-primary); }
.download-card .dl-info p { font-size: 0.85rem; color: var(--color-text-light); }
.download-card .dl-arrow {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--color-accent-dark);
  transition: transform var(--transition);
}
.download-card:hover .dl-arrow { transform: translateY(3px); }

/* ---------- Two Column Layout ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.two-col--reverse { direction: rtl; }
.two-col--reverse > * { direction: ltr; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 64px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand img,
.footer-brand .footer-logo {
  height: 44px;
  width: auto;
  max-width: 300px;
  margin-bottom: 16px;
  display: block;
}
.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.8;
}
.footer-col h4 {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  font-weight: 700;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--color-accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  opacity: 0.7;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { color: rgba(255,255,255,0.7); }
.footer-legal a:hover { color: #fff; }

/* ---------- Cookie Consent (GDPR) ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  padding: 24px;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
.cookie-banner.visible {
  transform: translateY(0);
}
.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-text {
  flex: 1;
  min-width: 280px;
  font-size: 0.9rem;
  color: var(--color-text-light);
}
.cookie-text a { text-decoration: underline; }
.cookie-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.cookie-btn-accept {
  background: var(--color-primary);
  color: #fff;
}
.cookie-btn-accept:hover { background: var(--color-primary-dark); }
.cookie-btn-reject {
  background: var(--color-border);
  color: var(--color-text);
}
.cookie-btn-reject:hover { background: var(--color-border-light); }

/* ---------- Announcement Modal ---------- */
.announcement-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.announcement-overlay.visible {
  opacity: 1;
  visibility: visible;
}
.announcement-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease;
}
.announcement-overlay.visible .announcement-modal {
  transform: translateY(0) scale(1);
}
.announcement-modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.announcement-modal-header h2 {
  font-size: 1.4rem;
  color: var(--color-primary);
  margin: 0;
}
.announcement-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-bg-blue);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  transition: all var(--transition);
  font-size: 1.2rem;
  line-height: 1;
}
.announcement-close:hover {
  background: var(--color-border);
  color: var(--color-text);
}
.announcement-modal-body {
  padding: 20px 28px 28px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-light);
}
.announcement-modal-body p:last-child { margin-bottom: 0; }

.announcement-modal--info .announcement-modal-header h2 { color: var(--color-primary); }
.announcement-modal--warning .announcement-modal-header h2 { color: var(--color-accent-dark); }
.announcement-modal--urgent .announcement-modal-header h2 { color: var(--color-emergency); }

.announcement-modal--info { border-top: 5px solid var(--color-primary); }
.announcement-modal--warning { border-top: 5px solid var(--color-accent); }
.announcement-modal--urgent { border-top: 5px solid var(--color-emergency); }

/* ---------- WordPress Specific ---------- */
.wp-block-image img { border-radius: var(--radius-md); }
.alignwide { max-width: calc(var(--max-width) + 100px); margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100vw; margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }
.aligncenter { text-align: center; }
.wp-caption { max-width: 100%; }

/* Screen Reader Text (WP) */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  background: var(--color-primary);
  color: #fff;
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
  clip: auto;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  animation: fadeInUp 0.6s ease both;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent-dark); }
.text-emergency { color: var(--color-emergency); }
.text-muted { color: var(--color-text-light); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.gap-stack > * + * { margin-top: 16px; }

.info-callout {
  background: var(--color-bg-accent);
  border-left: 4px solid var(--color-accent);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  margin-top: 24px;
}

/* ---------- Form success/error ---------- */
.form-message {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-weight: 600;
}
.form-message--success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.form-message--error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .header-inner { padding: 0 16px; }
  .news-grid,
  .patmed-grid,
  .diagnostik-grid { grid-template-columns: 1fr; gap: 36px; }
  .diagnostik-media { order: 2; }
  .patmed-visual { order: -1; }
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 999;
    padding: 24px;
    overflow-y: auto;
  }
  .main-nav.open ul {
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }
  .main-nav.open a {
    padding: 14px 16px;
    font-size: 1.05rem;
    border-radius: var(--radius-sm);
  }
  .menu-toggle { display: block; }

  .info-cards {
    grid-template-columns: 1fr;
    margin-top: -60px;
  }
  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .team-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root { --header-height: 64px; }

  .hero { padding: 80px 0 100px; min-height: 400px; }
  .section { padding: 56px 0; }
  .section--cards-overlap { padding-top: 0; }
  .page-hero { padding: 80px 0 40px; }

  .header-logo img { height: 36px; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal { flex-direction: column; gap: 8px; }

  .staff-grid { grid-template-columns: 1fr 1fr; }

  .cookie-inner { flex-direction: column; }
  .cookie-actions { width: 100%; }
  .cookie-btn { flex: 1; text-align: center; }

  .announcement-modal { margin: 16px; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .cookie-banner, .menu-toggle, .map-wrapper, .announcement-overlay { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; text-decoration: underline; }
  .section { padding: 24px 0; }
  .hero, .page-hero { padding: 24px 0; background: none; color: #000; }
  .hero-content h1, .page-hero h1 { color: #000; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- High Contrast ---------- */
@media (forced-colors: active) {
  .btn, .cookie-btn { border: 2px solid ButtonText; }
  .info-card { border: 2px solid CanvasText; }
}
