/* CMS-specific overrides (compiled Tailwind lives in app.css) */

/* Logo: object-contain is not in the synced Tailwind build - keep aspect ratio */
.be-logo-img,
.be-logo-wrap img,
.be-cert-img {
  object-fit: contain;
}

/* Zertifizierungen (BBH, Agenda) - einheitliches Layout & Ausrichtung */
.be-cert-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}

.be-cert-card__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 7.5rem;
  padding: 1rem 1.25rem;
  line-height: 0;
  flex-shrink: 0;
}

.be-cert-card__visual .be-cert-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 4.75rem;
}

.be-cert-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.be-cert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  hyphens: none;
  line-height: 1.25;
  text-align: center;
  letter-spacing: 0.06em;
}

.be-cert-card-title {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  line-height: 1.3;
  max-width: 100%;
}

@media (max-width: 639px) {
  .be-cert-card__body {
    align-items: center;
    text-align: center;
  }

  .be-cert-badge {
    align-self: center;
  }

  .be-cert-card__link {
    align-self: center;
  }
}

@media (min-width: 640px) {
  .be-cert-card {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  .be-cert-card__visual {
    width: 11.5rem;
    height: 7.5rem;
  }

  .be-cert-card__body {
    align-self: center;
  }
}

/* Footer: kompakte Zertifizierungen */
.be-cert-pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.be-cert-pill {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(250, 245, 235, 0.2);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.be-cert-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(250, 245, 235, 0.35);
}

.be-cert-pill:focus-visible {
  outline: 4px dashed #f59e0b;
  outline-offset: 2px;
}

.be-cert-pill__logo {
  flex: 0 0 5.75rem;
  width: 5.75rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
}

.be-cert-pill__logo .be-cert-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 2.75rem;
}

.be-cert-pill__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
}

.be-cert-pill__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  color: #faf5eb;
}

.be-cert-pill__linkline {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(250, 245, 235, 0.78);
}

.be-cert-pill:hover .be-cert-pill__linkline {
  color: #faf5eb;
}

html.be-high-contrast .be-cert-card {
  background: #000 !important;
  background-image: none !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}

html.be-high-contrast .be-cert-card__visual,
html.be-high-contrast .be-cert-pill__logo {
  background: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
}

html.be-high-contrast .be-cert-card h4,
html.be-high-contrast .be-cert-card p,
html.be-high-contrast .be-cert-card .be-cert-badge,
html.be-high-contrast .be-cert-card [class*='rounded-full'] {
  color: #fff !important;
  border-color: #fff !important;
  background: #000 !important;
}

html.be-high-contrast .be-cert-card .be-cert-badge {
  color: #fca311 !important;
  background: #000 !important;
}

html.be-high-contrast .be-cert-card__link {
  background-color: #fca311 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
}

html.be-high-contrast .be-cert-pill {
  border: 2px solid #fff !important;
  background: #000 !important;
}

html.be-high-contrast .be-cert-pill__title,
html.be-high-contrast .be-cert-pill__linkline {
  color: #fff !important;
}

html.be-high-contrast .be-cert-pill:hover .be-cert-pill__linkline {
  color: #fca311 !important;
}

/* Mobile: kein horizontaler Overflow (site-weit) */
html {
  overflow-x: clip;
  max-width: 100%;
}

body#app-root-container {
  overflow-x: clip;
  max-width: 100%;
}

#app-root-container main,
#app-root-container header,
#app-root-container footer,
#app-root-container section {
  max-width: 100%;
}

#app-root-container .grid {
  min-width: 0;
}

#app-root-container .grid > * {
  min-width: 0;
}

/* Flex-Zeilen: Textspalte darf schrumpfen (Kontakt-Karten, Service-Karten) */
#app-root-container .be-flex-text {
  min-width: 0;
  flex: 1 1 0%;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

/* Überschriften: kein Buchstaben-Einzelumbruch (z. B. „…unge“ + „n“) */
#app-root-container .be-flex-text :is(h1, h2, h3, h4) {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
  text-wrap: balance;
}

/* Abschnitts-Überschriften: feste Zeilen („Schön, dass Sie da sind!“ / Kontakt-Titel) */
.be-title-line-keep {
  white-space: nowrap;
}

@media (max-width: 639px) {
  .be-section-heading {
    font-size: clamp(1.3125rem, 6vw, 1.875rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
}

#dienstleistungen .be-service-card-title {
  line-height: 1.2;
}

@media (max-width: 639px) {
  #dienstleistungen .be-service-card-title {
    font-size: 1.25rem;
    letter-spacing: -0.01em;
  }
}

#kontakt a[href^='tel:'],
#kontakt a[href^='mailto:'] {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Lange <option>-Texte erweitern auf Mobilgeräten oft die Seitenbreite */
#contact-form,
#contact-form select,
#contact-form input,
#contact-form textarea {
  max-width: 100%;
  min-width: 0;
}

#app-root-container .prose {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}

/* Header: Marke + Unterzeile nicht breiter als Viewport */
#main-header .flex.h-20 > .flex.items-center.gap-3 {
  min-width: 0;
  flex: 1 1 auto;
}

#header-brand-logo {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 767px) {
  #header-brand-logo .be-brand-subtitle {
    white-space: normal;
  }

  #access-panel-title {
    min-width: 0;
    flex: 1 1 0%;
    white-space: normal;
    line-height: 1.35;
  }

  /* Barrierefreiheit-Panel: auf dem Smartphone scrollbar, damit alle Optionen erreichbar sind */
  #accessibility-panel.be-access-panel:not(.hidden) {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 5rem - env(safe-area-inset-top, 0px));
    overflow: hidden;
    padding-bottom: 0;
  }

  body:has(#admin-bar) #accessibility-panel.be-access-panel:not(.hidden) {
    max-height: calc(100dvh - 7rem - env(safe-area-inset-top, 0px));
  }

  #accessibility-panel .be-access-panel__inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    width: 100%;
  }

  #accessibility-panel .be-access-panel__header {
    flex-shrink: 0;
  }

  #accessibility-panel .be-access-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
}

.be-hero-heading,
.be-hero-heading span {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

@media (max-width: 639px) {
  .be-hero-heading {
    font-size: clamp(1.75rem, 8.5vw, 2.25rem);
    line-height: 1.15;
  }

  .be-hero-badge {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    line-height: 1.35;
  }
}

/* Single-page: anchor targets clear sticky header (h-20) */
#top,
#dienstleistungen,
#ueber-mich,
#kontakt {
  scroll-margin-top: 5.5rem;
}

[x-cloak] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only:focus,
.sr-only:focus-visible,
.focus\:not-sr-only:focus {
  position: absolute;
  width: auto;
  height: auto;
  padding: 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slideDown {
  animation: slideDown 0.25s ease-out forwards;
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scaleUp {
  animation: scaleUp 0.2s ease-out forwards;
}

html {
  scroll-behavior: smooth;
}

*:focus-visible {
  outline: 4px dashed #f59e0b !important;
  outline-offset: 4px !important;
}

#app-root-container.be-dyslexia-font {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.05em;
  word-spacing: 0.16em;
}

/* High contrast - overrides Tailwind text/bg utilities for WCAG readability */
html.be-high-contrast body,
html.be-high-contrast #app-root-container {
  background-color: #000 !important;
  color: #fff !important;
}

html.be-high-contrast #main-header,
html.be-high-contrast #accessibility-panel,
html.be-high-contrast #mobile-navigation-menu {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

html.be-high-contrast #main-header {
  border-bottom-width: 4px !important;
}

html.be-high-contrast #app-root-container section,
html.be-high-contrast #app-root-container footer {
  background: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
}

/* Tailwind gradients must be removed - background-color alone leaves the cream gradient visible */
html.be-high-contrast #app-root-container [class*='gradient'],
html.be-high-contrast #app-root-container [class*='from-'],
html.be-high-contrast #app-root-container [class*='via-'],
html.be-high-contrast #app-root-container [class*='to-'] {
  background: #000 !important;
  background-image: none !important;
}

html.be-high-contrast #app-root-container .prose,
html.be-high-contrast #app-root-container .prose :where(p, li, strong, em) {
  color: #fff !important;
}

html.be-high-contrast #top [role='listitem'] span {
  color: #fff !important;
}

html.be-high-contrast #top .rounded-full {
  background-color: #fca311 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
}

html.be-high-contrast #hero-cta-services {
  background-color: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

/* Dark text utilities → white (substring match - arbitrary Tailwind classes contain brackets) */
html.be-high-contrast #app-root-container :is(
  [class*='1A1A1A'],
  [class*='1A2436'],
  [class*='4A5568'],
  [class*='text-stone-'],
  [class*='text-slate-5'],
  [class*='text-slate-6'],
  [class*='text-slate-7'],
  [class*='text-slate-8'],
  [class*='text-zinc-2'],
  [class*='text-zinc-3']
) {
  color: #fff !important;
}

html.be-high-contrast #app-root-container :is(
  [class*='8F6E3B'],
  [class*='text-amber-']
) {
  color: #fca311 !important;
}

html.be-high-contrast #app-root-container h1,
html.be-high-contrast #app-root-container h2,
html.be-high-contrast #app-root-container h3,
html.be-high-contrast #app-root-container h4 {
  color: #fca311 !important;
}

html.be-high-contrast #app-root-container a:not([class*='bg-']) {
  color: #fff !important;
}

html.be-high-contrast #app-root-container a:hover,
html.be-high-contrast #app-root-container button:hover {
  text-decoration: underline !important;
}

/* Light surfaces → black (Logo-Boxen der Zertifikate ausnehmen) */
html.be-high-contrast #app-root-container :where(
  [class*='bg-white'],
  [class*='FDFCF9'],
  [class*='FDFDFB'],
  [class*='FCFAF6'],
  [class*='F4F6F0'],
  [class*='F0F4F0'],
  [class*='FAF5EB'],
  [class*='FAF6EE'],
  [class*='bg-slate-50'],
  [class*='bg-stone-50'],
  [class*='bg-stone-100']
):not(.be-cert-pill__logo):not(.be-cert-card__visual) {
  background: #000 !important;
  background-image: none !important;
  border-color: #fff !important;
}

/* Primary actions → amber on black (not footer shell) */
html.be-high-contrast #app-root-container :is(
  a[class*='1A2436'],
  button[class*='1A2436']
) {
  background-color: #fca311 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
}

html.be-high-contrast #main-footer {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  border-top-width: 4px !important;
}

html.be-high-contrast #main-footer :is(
  [class*='text-white'],
  [class*='FAF5EB']
) {
  color: #fff !important;
}

html.be-high-contrast #header-call-btn,
html.be-high-contrast #header-email-btn {
  background-color: #000 !important;
  color: #fca311 !important;
  border: 2px solid #fff !important;
}

html.be-high-contrast #accessibility-panel .be-size-btn,
html.be-high-contrast #contrast-toggle-btn,
html.be-high-contrast [data-be-dyslexia-toggle] {
  background-color: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

html.be-high-contrast #accessibility-panel .be-size-btn[aria-pressed='true'],
html.be-high-contrast #contrast-toggle-btn[aria-pressed='true'],
html.be-high-contrast [data-be-dyslexia-toggle][aria-pressed='true'] {
  background-color: #fca311 !important;
  color: #000 !important;
  border-color: #fff !important;
}

html.be-high-contrast #accessibility-panel #close-access-panel-btn {
  background-color: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

html.be-high-contrast input,
html.be-high-contrast textarea,
html.be-high-contrast select {
  background-color: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

html.be-high-contrast input::placeholder,
html.be-high-contrast textarea::placeholder {
  color: #d4d4d8 !important;
}

/* Modals (AGB, Impressum, Datenschutz, Inbox) */
html.be-high-contrast #modal-card-body {
  background: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border: 4px solid #fff !important;
}

html.be-high-contrast #modal-card-body .be-modal-header,
html.be-high-contrast #modal-card-body .be-modal-footer,
html.be-high-contrast #modal-card-body .be-modal-body {
  background: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
}

html.be-high-contrast #modal-card-body .be-modal-header {
  border-bottom-width: 4px !important;
}

html.be-high-contrast #modal-card-body .be-modal-footer {
  border-top-width: 4px !important;
}

html.be-high-contrast #modal-title {
  color: #fca311 !important;
}

html.be-high-contrast #modal-subtitle {
  color: #fff !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}

html.be-high-contrast #modal-close-header-btn,
html.be-high-contrast #modal-close-footer-btn {
  background-color: #fca311 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
}

html.be-high-contrast #modal-close-header-btn:hover,
html.be-high-contrast #modal-close-footer-btn:hover {
  background-color: #fbbf24 !important;
}

html.be-high-contrast .be-legal-content,
html.be-high-contrast .be-legal-content.prose {
  color: #fff !important;
}

html.be-high-contrast .be-legal-content :where(h1, h2, h3, h4, h5, h6) {
  color: #fca311 !important;
  border-color: #fff !important;
}

html.be-high-contrast .be-legal-content :where(p, li, ol, ul, td, th, blockquote, strong, em, span) {
  color: #fff !important;
}

html.be-high-contrast .be-legal-content a {
  color: #fca311 !important;
  text-decoration: underline !important;
}

html.be-high-contrast #app-root-container article[class*='FAF8F5'] {
  background: #000 !important;
}

html.be-high-contrast #app-root-container article [class*='bg-white'][class*='rounded-2xl'] {
  background: #000 !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}

html.be-high-contrast .be-legal-content hr {
  border-color: #fff !important;
}

/* WhatsApp Business - Kontakt & Header */
.be-whatsapp-icon-wrap {
  background-color: #25d366;
  color: #fff;
}

.be-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background-color: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.be-whatsapp-btn:hover {
  background-color: #1da851;
  color: #fff;
}

.be-whatsapp-btn:focus-visible {
  outline: 4px dashed #f59e0b;
  outline-offset: 3px;
}

.be-whatsapp-btn--bar {
  width: 100%;
  min-height: 3rem;
  font-size: 1rem;
}

.be-whatsapp-btn--inline {
  width: fit-content;
  max-width: 100%;
}

.be-whatsapp-icon-btn {
  background-color: #25d366;
  color: #fff;
}

.be-whatsapp-icon-btn:hover {
  background-color: #1da851;
  color: #fff;
}

html.be-high-contrast .be-whatsapp-btn,
html.be-high-contrast .be-whatsapp-icon-btn,
html.be-high-contrast .be-whatsapp-icon-wrap {
  background-color: #fca311 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
}

/* Kontaktformular: Datenschutz-Checkbox (groß genug für Touch) */
.be-privacy-row {
  align-items: flex-start;
  gap: 0.75rem;
}

.be-privacy-checkbox {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  min-height: 1.5rem;
  margin-top: 0.15rem;
  border: 2px solid #d6d3d1;
  border-radius: 0.25rem;
  cursor: pointer;
  accent-color: #2d5a27;
}

.be-privacy-label {
  flex: 1;
  min-width: 0;
}

.be-privacy-error {
  margin-left: 2.25rem;
}

@media (max-width: 639px) {
  .be-privacy-checkbox {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    margin-top: 0.1rem;
  }

  .be-privacy-error {
    margin-left: 2.5rem;
  }
}

/* Absende-Button: Flex-Layout explizit (Tailwind-Klassen oft nicht im Build) */
.be-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.875rem 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.35;
  text-align: center;
  border: none;
  cursor: pointer;
}

.be-submit-btn:disabled {
  cursor: not-allowed;
}

.be-submit-btn .be-submit-icon,
.be-submit-btn .be-submit-loader {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
}

.be-submit-btn .be-submit-icon svg,
.be-submit-btn .be-submit-loader svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.be-submit-label {
  display: inline;
  text-align: center;
}

.be-submit-text-short {
  display: none;
}

@media (max-width: 639px) {
  .be-submit-btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  .be-submit-text-full {
    display: none;
  }

  .be-submit-text-short {
    display: inline;
  }
}

.be-submit-btn.is-loading .be-submit-text-short {
  display: none !important;
}

.be-submit-btn.is-loading .be-submit-text-full {
  display: inline !important;
}

/* hidden + inline-flex on same node: inline-flex wins in Tailwind - keep errors hidden until JS shows them */
#contact-form [id^="error-"].hidden,
.be-submit-loader.hidden {
  display: none !important;
}

/* Legal pages & modals: explicit typography (prose plugin not in Tailwind build) */
.be-legal-content {
  color: #44403c;
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  word-break: normal;
}

.be-legal-content h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a2436;
  border-bottom: 2px solid #eadfcb;
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.35;
}

.be-legal-content h2:first-child {
  margin-top: 0;
}

.be-legal-content h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1a2436;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.be-legal-content p {
  margin: 0 0 1rem;
}

.be-legal-content p:last-child {
  margin-bottom: 0;
}

.be-legal-content strong {
  font-weight: 700;
  color: #1a2436;
}

.be-legal-content a {
  color: #8f6e3b;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.be-legal-content a:hover {
  color: #1a2436;
}

.be-legal-content ul,
.be-legal-content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.be-legal-content li {
  margin-bottom: 0.35rem;
}

.be-legal-content li:last-child {
  margin-bottom: 0;
}

.be-legal-content hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid #e7e5e4;
}
