/* Selbsthilfegruppen Austausch — lesbare Marke, symmetrisches Layout */

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --sha-font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sha-primary: #006fb4;
  --sha-primary-dark: #004d80;
  --sha-primary-light: #e3f2fc;
  --sha-accent: #89bd24;
  --sha-accent-dark: #6a9618;
  --sha-text: #1a2f45;
  --sha-text-muted: #4a6278;
  --sha-bg: #f4f9fd;
  --sha-surface: #ffffff;
  --sha-border: #c5d9eb;
  --sha-radius: 16px;
  --sha-radius-sm: 10px;
  --sha-shadow: 0 4px 24px rgba(0, 79, 140, 0.07);
  --sha-max: 1200px;
  --sha-content: 760px;
  --sha-logo-header: 200px;
  --sha-logo-footer: 140px;
  --sha-logo-login:  min(420px, 85vw);
}

html.sha-theme--autismus,
body.sha-theme--autismus {
  --sha-primary: #2e86c1;
  --sha-primary-dark: #1a5f8f;
  --sha-primary-light: #e3f0fa;
  --sha-accent: #5ba3d9;
  --sha-accent-dark: #3d85b8;
  /* Hochformat-Logo: mehr Höhe und Breite für lesbare Schrift */
  --sha-logo-header: 260px;
  --sha-logo-header-max-width: min(480px, 94vw);
  --sha-logo-footer: 200px;
  --sha-logo-login: min(480px, 92vw);
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sha-font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--sha-text-muted);
  background:
    linear-gradient(180deg, #e8f4fc 0%, var(--sha-bg) 220px, var(--sha-bg) 100%);
  -webkit-font-smoothing: antialiased;
}

.sha-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--sha-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus-visible {
  color: var(--sha-primary-dark);
}

h1, h2, h3,
.layout-content h1,
.layout-content h2,
.layout-content h3 {
  color: var(--sha-text);
  font-weight: 700;
  line-height: 1.25;
}

.layout-content h1 {
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  text-align: center;
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--sha-accent);
}

.layout-content h1 + .sha-hero,
.layout-content > .sha-hero:first-child {
  margin-top: 0;
}

.sha-hero--compact {
  padding: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}

.sha-hero--compact h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  border: none;
  padding: 0;
  margin: 0 0 0.5rem;
}

/* Rechtstexte (Impressum, Datenschutz) */
.sha-legal {
  text-align: left;
  max-width: 42rem;
  margin: 0 auto;
}

.sha-legal .sha-lead {
  font-size: 1.05rem;
  color: var(--sha-text);
  background: var(--sha-primary-light);
  padding: 1rem 1.15rem;
  border-radius: var(--sha-radius-sm);
  border-left: 4px solid var(--sha-primary);
  margin-bottom: 1.5rem;
}

.sha-legal h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
  color: var(--sha-primary-dark);
  padding-top: 0.5rem;
  border-top: 1px solid var(--sha-border);
}

.sha-legal h2:first-of-type {
  border-top: none;
  margin-top: 0;
}

.sha-legal h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--sha-text);
}

.sha-legal p,
.sha-legal li {
  color: var(--sha-text-muted);
}

.sha-legal ul,
.sha-legal ol {
  padding-left: 1.25rem;
}

.sha-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.sha-table th,
.sha-table td {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--sha-border);
  text-align: left;
}

.sha-table th {
  background: var(--sha-primary-light);
  color: var(--sha-primary-dark);
  font-weight: 600;
  width: 30%;
}

.sha-highlight {
  background: var(--sha-primary-light);
  border-left: 4px solid var(--sha-accent);
  border-radius: var(--sha-radius-sm);
  padding: 1.15rem 1.35rem;
  margin: 1.75rem auto;
  max-width: var(--sha-content);
}

.sha-highlight h2,
.sha-highlight h3 {
  margin-top: 0;
  font-size: 1.15rem;
  color: var(--sha-primary-dark);
}

.sha-highlight p:last-child,
.sha-highlight ul:last-child {
  margin-bottom: 0;
}

.sha-steps {
  counter-reset: sha-step;
  list-style: none;
  padding-left: 0;
  max-width: 42rem;
  margin: 1rem auto 1.5rem;
}

.sha-steps li {
  position: relative;
  padding: 0.75rem 0 0.75rem 2.75rem;
  border-bottom: 1px solid var(--sha-border);
}

.sha-steps li:last-child {
  border-bottom: none;
}

.sha-steps li::before {
  counter-increment: sha-step;
  content: counter(sha-step);
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 1.85rem;
  height: 1.85rem;
  line-height: 1.85rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: var(--sha-primary);
  border-radius: 50%;
}

.layout-content h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
}

/* —— Marke: Volllogo (groß, gut lesbar) —— */
.sha-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 0;
}

.sha-brand:hover {
  opacity: 0.94;
}

.sha-brand__img {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.sha-brand__img--header {
  height: var(--sha-logo-header);
  max-width: var(--sha-logo-header-max-width, min(var(--sha-logo-header), 42vw));
}

.sha-footer .sha-brand {
  background: #fff;
  padding: 0.65rem 0.75rem;
  border-radius: var(--sha-radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sha-brand__img--footer {
  height: var(--sha-logo-footer);
  width: auto;
  max-width: none;
  margin: 0 auto;
}

.sha-brand__img--login {
  height: var(--sha-logo-login);
  width: auto;
  max-width: 100%;
  margin: 0 auto 1.25rem;
}

/* —— Header —— */
.sha-header {
  flex-shrink: 0;
  background: var(--sha-surface);
  box-shadow: var(--sha-shadow);
  position: sticky;
  top: 0;
  z-index: 200;
}

.sha-header__bar {
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--sha-primary) 0%,
    var(--sha-accent) 50%,
    var(--sha-primary) 100%
  );
}

body.sha-theme--autismus .sha-header__bar {
  background: linear-gradient(90deg, var(--sha-primary-dark), var(--sha-accent), var(--sha-primary-dark));
}

body.sha-theme--autismus .sha-header__inner {
  grid-template-columns: minmax(260px, 1.2fr) auto minmax(180px, 1fr);
}

body.sha-theme--autismus .sha-header__col--brand {
  min-width: 0;
}

.sha-header__inner {
  max-width: var(--sha-max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem 1rem;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  gap: 1rem 1.5rem;
}

.sha-header__col--brand {
  justify-self: start;
  min-width: 0;
}

.sha-header__col--nav {
  justify-self: center;
}

.sha-header__col--actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sha-header__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem 0.65rem;
}

.sha-header__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sha-text-muted);
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: var(--sha-radius-sm);
}

.sha-header__link:hover {
  color: var(--sha-primary);
  background: var(--sha-primary-light);
}

.sha-header__btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
}

.sha-header__btn--primary {
  background: var(--sha-primary);
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(0, 79, 140, 0.22);
  font-weight: 700;
}

.sha-header__btn--primary:hover {
  background: var(--sha-primary-dark);
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(0, 79, 140, 0.28);
}

.sha-header__btn--ghost {
  border: 1px solid var(--sha-border);
  color: var(--sha-text) !important;
}

.sha-nav .menu,
.sha-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
}

.sha-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--sha-text);
  text-decoration: none;
  border-radius: var(--sha-radius-sm);
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.sha-nav a:hover,
.sha-nav .menu-item--active-trail > a,
.sha-nav a.is-active {
  background: transparent;
  color: var(--sha-primary);
  border-bottom-color: var(--sha-primary);
}

.sha-nav a:hover {
  background: color-mix(in srgb, var(--sha-primary-light) 55%, transparent);
  border-bottom-color: color-mix(in srgb, var(--sha-primary) 45%, transparent);
}

.sha-nav-toggle {
  display: none;
}

/* —— Main —— */
.sha-main {
  flex: 1;
}

.sha-main__inner {
  max-width: var(--sha-max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.sha-main__breadcrumb {
  text-align: center;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

.sha-main__breadcrumb ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.layout-content {
  max-width: var(--sha-content);
  margin: 0 auto;
  background: var(--sha-surface);
  border-radius: var(--sha-radius);
  box-shadow: var(--sha-shadow);
  padding: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--sha-border);
  position: relative;
}

.layout-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--sha-accent);
  border-radius: 0 0 4px 4px;
}

.layout-content > p,
.layout-content > ul,
.layout-content > ol,
.layout-content > .sha-cards,
.layout-content > .sha-hero {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.layout-content > .sha-cards {
  max-width: var(--sha-content);
}

/* —— Login —— */
.sha-main--login .sha-main__inner {
  display: flex;
  justify-content: center;
}

.sha-login-shell {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.sha-login-shell__title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: var(--sha-text);
}

.sha-login-shell__lead {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.sha-login-shell__forms {
  text-align: left;
}

.sha-page-login .page-title {
  display: none;
}

.sha-sso-form {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--sha-border);
}

.sha-login-form input[type="text"],
.sha-login-form input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--sha-border);
  border-radius: var(--sha-radius-sm);
  font-family: var(--sha-font);
}

.sha-login-form input:focus {
  outline: none;
  border-color: var(--sha-primary);
  box-shadow: 0 0 0 3px rgba(0, 111, 180, 0.15);
}

.button,
input[type="submit"],
.form-submit,
.sha-btn-sso,
.sha-btn-local {
  width: 100%;
  padding: 0.75rem 1rem !important;
  font-family: var(--sha-font) !important;
  font-weight: 600 !important;
  border-radius: var(--sha-radius-sm) !important;
}

.sha-btn-sso,
.openid-connect-login-form input[type="submit"] {
  background: var(--sha-primary) !important;
  color: #fff !important;
  border: none !important;
}

.sha-btn-local {
  background: transparent !important;
  color: var(--sha-primary) !important;
  border: 2px solid var(--sha-primary) !important;
  margin-top: 0.5rem;
}

/* —— Footer —— */
.sha-footer {
  background: var(--sha-primary-dark);
  color: #c5d9eb;
  margin-top: auto;
}

.sha-footer__inner {
  max-width: var(--sha-max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.sha-footer__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.sha-footer__tagline {
  margin: 0;
  font-size: 0.85rem;
  max-width: 18rem;
}

.sha-footer .menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sha-footer .menu a {
  color: #b8d4f0;
  text-decoration: none;
  font-weight: 500;
}

.sha-footer .menu a:hover {
  color: #fff;
}

.sha-footer__links a {
  color: #b8d4f0;
  text-decoration: none;
}

.sha-footer__legal {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #dce8f4;
}

.sha-footer__links {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

/* —— Mobile —— */
@media (max-width: 900px) {
  :root {
    --sha-logo-header: 160px;
    --sha-logo-footer: 120px;
    --sha-logo-login: min(360px, 90vw);
  }

  body.sha-theme--autismus {
    --sha-logo-header: 210px;
    --sha-logo-header-max-width: min(380px, 90vw);
    --sha-logo-login: min(420px, 92vw);
  }

  .sha-header__inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    padding: 0.75rem 1rem;
  }

  .sha-brand__img--header {
    max-width: var(--sha-logo-header-max-width, min(160px, 55vw));
  }

  .sha-header__col--nav {
    grid-column: 1 / -1;
    display: none;
  }

  .sha-header.is-nav-open .sha-header__col--nav {
    display: block;
    border-top: 1px solid var(--sha-border);
    padding-top: 0.75rem;
  }

  .sha-nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--sha-border);
    background: #fff;
    border-radius: var(--sha-radius-sm);
    cursor: pointer;
  }

  .sha-nav-toggle__bar {
    height: 2px;
    background: var(--sha-text);
    border-radius: 1px;
  }

  .sha-header__actions {
    display: none;
  }

  .sha-header.is-nav-open .sha-header__actions {
    display: flex;
    justify-content: center;
    width: 100%;
    padding-top: 0.5rem;
  }

  .sha-footer__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --sha-logo-header: 130px;
  }

  body.sha-theme--autismus {
    --sha-logo-header: 180px;
    --sha-logo-header-max-width: 92vw;
  }

  .sha-brand__img--header {
    height: var(--sha-logo-header);
    max-width: var(--sha-logo-header-max-width, 70vw);
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--sha-primary);
  color: #fff;
  border-radius: var(--sha-radius-sm);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.sha-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.sha-card {
  background: var(--sha-bg);
  border: 1px solid var(--sha-border);
  border-radius: var(--sha-radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.sha-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sha-shadow);
}

.sha-card h2 {
  font-size: 1.15rem;
  margin-top: 0;
}

.sha-badge {
  display: inline-block;
  background: var(--sha-primary-light);
  color: var(--sha-primary-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

#block-sha-search-form-narrow {
  display: none;
}
