/* IG-SAFE: gemeinsame Seitenstruktur und Bedienelemente */
.skip-link {
  position: absolute;
  z-index: 100;
  top: -5rem;
  left: 1rem;
  padding: .7rem 1rem;
  border: 2px solid var(--red);
  border-radius: .5rem;
  background: var(--paper);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 .25rem 1rem rgb(45 34 30 / 8%);
}
.header-top {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: min(calc(100% - 2 * var(--site-gutter)), var(--site-width));
  min-height: 140px;
  margin-inline: auto;
  transition: min-height .24s ease, padding .24s ease;
}
.header-brand {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: min(29rem, calc(100% - 38rem));
  transform: translate(-50%, -50%);
  text-align: center;
}
.header-brand a { display: block; }
.brand-logo {
  display: block;
  width: min(460px, 100%);
  height: 122px;
  max-height: 9rem;
  margin-inline: auto;
  border: 2px solid #b32632;
  border-radius: 12px;
  object-fit: contain;
  transition: width .24s ease, height .24s ease, max-height .24s ease;
}
.header-promo {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .4rem;
  width: 21.875rem;
}
.store-link { display: inline-flex; width: 7.5rem; align-items: center; justify-content: center; text-decoration: none; }
.store-badge { display: block; width: 7.5rem; height: auto; }
.apple-placeholder {
  display: inline-flex;
  width: 5.1rem;
  min-width: 5.1rem;
  height: 2.55rem;
  align-items: center;
  justify-content: center;
  border: 1px dashed #9d8f8d;
  border-radius: .6rem;
  font-size: 0;
  line-height: 0;
}
.header-actions {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  transform: translateY(-50%);
}
/* Gemeinsame Web-Kopfzeile: Logo mittig, Store-Hinweise darunter, Funktionen rechts. */
.site-header .header-top {
  grid-template-rows: auto auto;
  align-content: center;
  min-height: 180px;
  padding-block: .35rem;
}
.site-header .header-brand {
  position: static;
  grid-column: 1;
  grid-row: 1;
  width: min(29rem, calc(100% - 38rem));
  margin-inline: auto;
  transform: none;
}
.site-header .header-promo {
  position: static;
  grid-column: 1;
  grid-row: 2;
  width: max-content;
  max-width: 100%;
  margin: .15rem auto 0;
  transform: none;
}
.site-header .header-actions { top: 38%; }
.button,
.icon-button {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  padding: .62rem 1rem;
  border: 1px solid var(--red);
  border-radius: .7rem;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover,
.button:focus-visible { background: var(--red-dark); color: #fff; }
.button-small { min-height: 2.4rem; padding: .48rem .75rem; font-size: .9rem; }
.button-outline { background: transparent; color: var(--red-dark); }
.button-outline:hover { background: var(--red); color: #fff; }
.icon-button {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: .5rem;
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}
.icon-button:hover,
.icon-button:focus-visible { background: var(--pink); color: var(--red-dark); }
.icon-button svg { display: block; width: 1.25rem; height: 1.25rem; }
.theme-switch {
  display: inline-flex;
  width: 6.5rem;
  min-width: 6.5rem;
  height: 2.75rem;
  flex: 0 0 6.5rem;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
  padding: .35rem .45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.theme-icon { font-size: 1rem; line-height: 1; }
.switch-track { position: relative; width: 2.55rem; height: 1.3rem; flex: 0 0 2.55rem; border-radius: 999px; background: #d9d2c8; }
.switch-knob { position: absolute; top: .12rem; left: .12rem; width: 1.06rem; height: 1.06rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 22%); transition: transform .2s ease; }
.theme-switch[aria-pressed="true"] .switch-knob { transform: translateX(1.25rem); }
.theme-switch:focus-visible,
.header-search-button:focus-visible,
.header-reader-button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.nav-toggle { display: none; }
.primary-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .25rem .45rem;
  padding: 4.35px 28px;
  border-top: 1px solid var(--line);
}
.primary-navigation a {
  display: inline-block;
  padding: .5rem .62rem;
  border-radius: .5rem;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 720;
  text-decoration: none;
}
/* Hauptnavigation: kein rosa Hover- oder Aktivhintergrund. */
.primary-navigation a:hover { background: transparent; color: var(--red-dark); }
.primary-navigation a:focus-visible { background: transparent; color: var(--red-dark); outline: 2px solid var(--red-dark); outline-offset: 2px; }
.primary-navigation a[aria-current="page"] { background: transparent; color: inherit; }
body.is-compact .header-top { min-height: 4.6rem; }
body.is-compact .header-brand { width: min(16rem, calc(100% - 23rem)); }
body.is-compact .brand-logo { height: auto; max-height: 4.3rem; }
body.is-compact .header-promo,
body.is-compact .apple-placeholder { display: none; }
body[data-page="app"] .header-promo,
body[data-page="app"] .apple-placeholder,
body[data-page="app"] .footer-app-promo { display: none; }
@media (display-mode: standalone) {
  .header-promo,
  .apple-placeholder,
  .footer-app-promo { display: none; }
}

.page-shell {
  width: min(calc(100% - 2 * var(--site-gutter)), var(--site-width));
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 4rem) 5rem;
}

/* Seitlicher Rahmen für die IG-SAFE-Unterseiten */
body[data-page^="ig-safe"] main.page-shell.content-page {
  border-inline: 1px solid var(--line);
  padding-inline: clamp(1rem, 2.5vw, 2rem);
}
h1,
h2,
h3 { color: var(--ink); line-height: 1.16; text-wrap: balance; }
h1 { margin: .4rem 0 1rem; font-size: clamp(2.35rem, 5vw, 4.3rem); letter-spacing: -.035em; }
h2 { margin: .35rem 0 1rem; font-size: clamp(1.65rem, 3vw, 2.5rem); letter-spacing: -.025em; }
h3 { margin: .25rem 0 .55rem; font-size: 1.3rem; }
p { margin: 0 0 1rem; }
.eyebrow { margin: 0 0 .5rem; color: var(--red-dark); font-size: .8rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.home-section { margin-top: 1.1rem; padding-block: 1.5rem; }
.two-column { display: grid; grid-template-columns: minmax(14rem, .8fr) minmax(0, 1.2fr); align-items: start; gap: clamp(1.5rem, 5vw, 5rem); }
.home-card-grid,
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem; }
.topic-card {
  display: flex;
  min-height: 27.5rem;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--site-radius);
  background: var(--paper);
  box-shadow: var(--site-shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.topic-card:hover,
.topic-card:focus-visible { transform: translateY(-2px); border-color: var(--red); box-shadow: 0 .65rem 1.5rem rgb(55 35 30 / 12%); }
.topic-card-eyebrow { margin: 0 0 .7rem; color: var(--red); font-size: .95rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.topic-card h3 { margin: 0 0 .9rem; color: var(--ink); font-size: clamp(1.55rem, 2.2vw, 2rem); line-height: 1.2; font-weight: 650; }
.topic-card p { margin: 0; font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.55; }
.topic-card-action { display: inline-flex; align-items: center; gap: .35rem; margin-top: auto; padding-top: 1.5rem; color: var(--red-dark); font-size: 1.2rem; font-weight: 800; }
.app-promo-card,
.estimate-panel,
.donation-panel,
.chronology-panel { margin-top: 1.5rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: calc(var(--site-radius) + .25rem); background: var(--paper); box-shadow: var(--site-shadow); }
.app-promo-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2rem; background: var(--pink); }
.app-promo-card ul { padding-left: 1.3rem; }
.estimate-panel { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(15rem, .8fr); gap: 2rem; background: var(--pink); }
.estimate-stats { display: grid; align-content: center; gap: .7rem; margin: 0; }
.estimate-stats div { padding: .85rem 1rem; border-radius: .7rem; background: var(--paper); }
.estimate-stats dt { color: var(--muted); font-size: .9rem; }
.estimate-stats dd { margin: .15rem 0 0; color: var(--red-dark); font-size: 1.8rem; font-weight: 800; }
.button-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }

.site-footer {
  position: fixed;
  z-index: 50;
  inset-inline: 0;
  bottom: 0;
  min-height: 3.6rem;
  padding: .35rem 1rem .45rem;
  border-top: 1px solid rgb(132 43 56 / 18%);
  background: rgb(248 244 226 / 97%);
  box-shadow: 0 -.25rem 1rem rgb(48 42 40 / 7%);
  backdrop-filter: blur(8px);
}
.footer-grip {
  position: absolute;
  top: -1.15rem;
  left: 50%;
  display: grid;
  width: 2.375rem;
  height: 2.375rem;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 3px 10px rgb(55 35 25 / 14%);
  color: var(--red-dark);
  transform: translateX(-50%);
  cursor: pointer;
}
.footer-grip svg { display: block; width: 1.1875rem; height: 1.1875rem; transition: transform .2s ease; }
.footer-grip[aria-expanded="true"] svg { transform: rotate(180deg); }
.footer-compact-copy { max-width: min(var(--content-width), 100%); margin: .85rem auto 0; color: #514945; font-size: .72rem; line-height: 1.35; text-align: center; }
.site-footer:has(.footer-grip[aria-expanded="true"]) .footer-compact-copy { display: none; }
.footer-panel[hidden] { display: none; }
.footer-panel:not([hidden]) {
  display: grid;
  grid-template-columns: 20.625rem repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  width: min(72rem, 100%);
  max-height: min(60vh, 34rem);
  overflow: auto;
  margin: .6rem auto .25rem;
  padding: 1rem 1.2rem .8rem;
  border: 1px solid rgb(132 43 56 / 16%);
  border-radius: 1.35rem;
  background: var(--paper);
  box-shadow: var(--site-shadow);
}
.footer-brand { display: flex; width: min(20.625rem, 100%); flex-direction: column; align-items: center; align-self: center; }
.footer-brand img { display: block; width: 100%; max-width: 20.625rem; height: auto; border-radius: .625rem; }
.footer-brand-actions { display: flex; width: 100%; gap: .5rem; margin-top: .65rem; }
.footer-brand-actions a {
  display: inline-flex;
  min-width: 0;
  min-height: 2.5rem;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  padding: 0 .75rem;
  border: 1px solid var(--red);
  border-radius: .625rem;
  background: var(--red);
  color: #fff;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}
.footer-brand-actions a:hover,
.footer-brand-actions a:focus-visible { background: var(--red-dark); color: #fff; }
.footer-app-promo { display: flex; justify-content: center; width: 100%; margin: .55rem 0 .4rem; }
.footer-app-badges { display: flex; align-items: center; justify-content: center; gap: .45rem; }
.footer-app-play,
.footer-app-play .store-badge { display: block; width: 7.5rem; height: auto; }
.footer-app-apple { width: 5.1rem; min-width: 5.1rem; height: 2.55rem; }
.footer-panel nav { display: flex; flex-direction: column; align-items: flex-start; gap: .38rem; }
.footer-panel nav h2 { margin: 0 0 .2rem; font-size: 1rem; }
.footer-panel nav a { color: var(--muted); text-decoration: none; }
.footer-panel nav a:hover,
.footer-panel nav a:focus-visible { color: var(--red-dark); text-decoration: underline; }
.footer-copyright { grid-column: 1 / -1; margin: .25rem 0 0; padding-top: .6rem; border-top: 1px solid rgb(132 43 56 / 15%); font-size: .78rem; text-align: center; }

html[data-theme="dark"] .site-header { background: var(--cream); }
html[data-theme="dark"] .site-footer { background: rgb(33 31 29 / 97%); }
html[data-theme="dark"] .topic-card,
html[data-theme="dark"] .app-promo-card,
html[data-theme="dark"] .estimate-panel,
html[data-theme="dark"] .donation-panel,
html[data-theme="dark"] .chronology-panel,
html[data-theme="dark"] .footer-panel { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .footer-compact-copy { color: var(--muted); }

@media (max-width: 1000px) {
  .header-top {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: .45rem;
    min-height: 0;
    padding-block: .55rem;
  }
  .site-header .header-brand { position: static; width: min(29rem, calc(100% - 1rem)); margin-inline: auto; transform: none; }
  .site-header .brand-logo { width: min(460px, 100%); height: auto; max-height: 8rem; }
  .header-promo { position: static; width: max-content; max-width: 100%; justify-content: center; }
  .header-actions { position: static; flex-wrap: wrap; justify-content: center; transform: none; }
  .site-header .header-top { min-height: 0; }
  .site-header .primary-navigation { display: none !important; }
  body.is-compact .header-top { min-height: 0; }
  body.is-compact .header-brand { width: min(18rem, calc(100% - 1rem)); }
  body.is-compact .brand-logo { max-height: 3.6rem; }
  /* Store-Badge und Apple-Platzhalter bleiben auch im kleinen, kompakten Header sichtbar. */
  body.is-compact .header-promo,
  body.is-compact .apple-placeholder { display: inline-flex; }
  .home-hero,
  .two-column,
  .estimate-panel { grid-template-columns: 1fr; }
  .app-promo-card { grid-template-columns: 1fr; }
  .footer-panel:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .site-footer { padding-inline: .6rem; }
  .footer-compact-copy { max-width: calc(100% - 1rem); font-size: .66rem; }
  .footer-panel:not([hidden]) { gap: .9rem; padding: .8rem; }
  .footer-brand img { width: min(100%, 13rem); }
}
/* Kleine Browser-Webansicht am Tablet: Werbung links, Logo mittig, Steuerung rechts. */
@media (min-width: 601px) and (max-width: 1000px) {
  html:not(.igsafe-in-app) .site-header .header-top {
    grid-template-columns: minmax(12.8rem, 1fr) minmax(0, 1.4fr) minmax(12.8rem, 1fr);
    grid-template-rows: auto;
    align-content: center;
    justify-content: center;
    justify-items: stretch;
    width: min(calc(100% - 2 * var(--site-gutter)), var(--site-width));
    gap: .45rem 1rem;
  }
  html:not(.igsafe-in-app) .site-header .header-brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    width: min(29rem, 100%);
    margin-inline: auto;
    transform: none;
  }
  html:not(.igsafe-in-app) body.is-compact .site-header .header-brand {
    width: min(18rem, 100%);
  }
  html:not(.igsafe-in-app) .site-header .header-promo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    margin: 0;
  }
  html:not(.igsafe-in-app) .site-header .header-actions {
    position: static;
    top: auto;
    right: auto;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    flex-wrap: nowrap;
    margin: 0;
    transform: none;
  }
}
/* A tablet browser can carry a stale app-session class. The browser mode is
   authoritative here; these overrides defeat app-shell's important rules. */
@media (display-mode: browser) and (min-width: 601px) and (max-width: 1000px) {
  html.igsafe-app body .site-header .header-top {
    grid-template-columns: minmax(12.8rem, 1fr) minmax(0, 1.4fr) minmax(12.8rem, 1fr) !important;
    grid-template-rows: auto !important;
    align-content: center !important;
    justify-content: center !important;
    justify-items: stretch !important;
    width: min(calc(100% - 2 * var(--site-gutter)), var(--site-width)) !important;
    min-height: 0 !important;
    gap: .45rem 1rem !important;
  }
  html.igsafe-app body .site-header .header-brand {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    width: min(29rem, 100%) !important;
    margin-inline: auto !important;
  }
  html.igsafe-app body .site-header .header-promo {
    display: flex !important;
    position: static !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    width: max-content !important;
    max-width: 100% !important;
    margin: 0 !important;
    transform: none !important;
  }
  html.igsafe-app body .site-header .header-actions {
    position: static !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    transform: none !important;
  }
}
@media (max-width: 600px) {
  .home-card-grid,
  .portal-grid { grid-template-columns: minmax(0, 1fr); }
  .topic-card { min-height: 0; padding: 1.5rem; }
  .footer-panel:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  .footer-panel > * { grid-column: 1; }
  .footer-brand { grid-column: 1; }
  .footer-brand-actions { gap: .5rem; }
}
@media (max-width: 380px) {
  .header-actions .button-small { padding-inline: .45rem; font-size: .78rem; }
  .theme-switch { width: 3.75rem; min-width: 3.75rem; flex-basis: 3.75rem; }
  .theme-icon { display: none; }
}


/* IG SAFE – zentrale, zurückhaltende Inhaltsflächen (Test 2026-10-26)
   Nur Kurzfassungen und Betroffene-Langfassung; keine Header-/Footer-Änderung. */
:root {
  --igsafe-content-radius: 18px;
  --igsafe-content-shadow: 0 16px 42px rgb(42 32 32 / 22%);
  --igsafe-content-tint: #fffdf0;
}
/* Ecken in beiden Ansichten */
body :is(main.short-page, main.affected-page) .legal-card {
  border-radius: var(--igsafe-content-radius);
}
/* Die äußere Seitenfläche bleibt im ursprünglichen Beige (var(--cream)).
   Steingrau liegt ausschließlich auf der Inhaltskarte. */
html:not([data-theme="dark"]) body :is(main.short-page, main.affected-page) .legal-card {
  background: var(--igsafe-content-tint);
  box-shadow: var(--igsafe-content-shadow);
}
/* Dunkelansicht: bestehende Flächenfarben bleiben erhalten */
@media (max-width: 600px) {
  :root { --igsafe-content-shadow: 0 12px 30px rgb(42 32 32 / 18%); }
}


/* IG SAFE: Schatten nur für Inhaltsboxen und Bilder, keine Bedienelemente. */
:root { --igsafe-box-shadow: 0 12px 30px rgb(42 32 32 / 18%); --igsafe-image-shadow: 0 12px 30px rgb(42 32 32 / 20%); }
main :is(.legal-card,.content-box,.page-intro,.key-line,.quick-version-note,.ai-transparency-note,.igsafe-independent-notice,.topic-card,.topic-panel,.resource-card,.app-promo-card,.estimate-panel,.donation-panel,.chronology-panel) { box-shadow:var(--igsafe-box-shadow); }
main :is(figure,.quick-version-bridge) {box-shadow:var(--igsafe-image-shadow);border-radius:18px;}
main img:not(figure img):not(.quick-version-bridge img):not(.store-badge):not(.brand-logo) { border-radius:18px;box-shadow:var(--igsafe-image-shadow); }
html[data-theme="dark"] { --igsafe-box-shadow:0 14px 34px rgb(0 0 0 / 36%); --igsafe-image-shadow:0 14px 34px rgb(0 0 0 / 40%); }
@media (max-width:600px) {
 :root { --igsafe-box-shadow:0 9px 24px rgb(42 32 32 / 17%); --igsafe-image-shadow:0 9px 24px rgb(42 32 32 / 19%); }
 html[data-theme="dark"] { --igsafe-box-shadow:0 10px 26px rgb(0 0 0 / 32%); --igsafe-image-shadow:0 10px 26px rgb(0 0 0 / 36%); }
}
html:not([data-theme="dark"]) body :is(main.short-page,main.affected-page) .legal-card {box-shadow:var(--igsafe-content-shadow);}

/* IG SAFE: einheitliche Hinweisboxen */
:is(.legal-main,.page-shell) :is(.igsafe-independent-notice,.ai-transparency-note){display:block;margin:1rem 0 1.4rem;padding:1rem 1.1rem;border:1px solid var(--line,#dfd5c5);border-inline-start:4px solid var(--red,#b51f2c);border-radius:.8rem;background:var(--paper,var(--surface2,#fffdf6));line-height:1.6;text-align:left;}
:is(.legal-main,.page-shell) :is(.igsafe-independent-notice,.ai-transparency-note) p{margin:.45rem 0 0;}
:is(.legal-main,.page-shell) .transparency-detail{margin:.45rem 0 0;}
