/* ==========================================================================
   Portalseite greenscan — seitenspezifische Layouts
   Gleiche Basis wie 2nd look: Tokens aus shared/, alle Groessen fluid.
   ========================================================================== */

@layer layout {

  /* --- Zweitton dieser Einheit: warmes Sand ------------------------------
     greenscan imaging spricht Patienten an — der Ton ist warm und einladend,
     im Gegensatz zum kuehlen Blau von consulting und dem tiefen Petrol von
     2nd look. Die Limette bleibt als Klammer der Dachmarke unangetastet.
     Nachgerechnet: Text 5,68:1 auf Weiss, Limette 5,54:1 auf der tiefen
     Flaeche, heller Text darauf 8,51:1. */
  /* Eigene Masse dieser Seite, alle aus dem Entwurf abgeleitet und fluid
     zwischen 375 und 1440 px gerechnet. Versatz und Bahnrand sind exakt die
     des Entwurfs, Hero und Kreis bewusst angepasst. */
  .portal {
    --ton-flaeche: #f6f2e8;
    --ton-linie: #d9cba8;
    --ton-text: #7a6432;
    --ton-tief: #4a3d1e;
    --auf-ton-tief: #e8e6e0;
    --auf-ton-tief-leise: #b6b0a2;

    --hero-h: clamp(33rem, 26.6rem + 27.3vw, 51.25rem);     /* 528 → 820 */
    --hero-fuss: clamp(3.5rem, 2.5rem + 4.27vw, 7.5rem);    /*  56 → 120 */
    --kachel-versatz: clamp(0rem, -5.2rem + 13vw, 6.5rem);  /*   0 → 104 */
    --kreis: clamp(4rem, 3.65rem + 1.5vw, 5rem);            /*  64 →  80 */
    --bahn-pad: clamp(1.25rem, 0.63rem + 2.63vw, 3rem);     /*  20 →  48 */
  }

  /* Die Bahn der Portalseite laeuft ueber die volle Fensterbreite mit festem
     Rand — anders als der 1180er Container der OnePager. Der Deckel bei
     1800 px verhindert nur, dass die Kachelleiste auf sehr breiten Schirmen
     auseinanderfaellt. */
  .portal-bahn {
    inline-size: 100%;
    max-inline-size: 112.5rem;   /* 1800 */
    margin-inline: auto;
    padding-inline: var(--bahn-pad);
  }

  /* --- Kopfzeile --------------------------------------------------------- */
  .portal-header {
    position: relative;
    z-index: 40;
    background: var(--paper);
    border-block-end: 1px solid var(--border);
  }

  .portal-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-md);
    padding-block: var(--sp-sm);
  }

  .portal-header__logo {
    display: inline-flex;
    align-items: center;
  }

  .portal-header__logo img {
    inline-size: clamp(9.5rem, 7.5rem + 4vw, 13.125rem);
    block-size: auto;
  }

  /* Die Seite ist nicht mehr nur Verteiler, sondern hat eigene Abschnitte —
     deshalb eine schlanke Sprungnavigation. Auf schmalen Fenstern rutscht sie
     unter das Logo, statt zu verschwinden: bei nur drei Punkten passt sie. */
  .portal-header__nav ul {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .portal-header__nav a {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    padding-block-end: 3px;
    border-block-end: 2px solid transparent;
    transition: border-color var(--dur) var(--ease);
  }

  .portal-header__nav a:hover,
  .portal-header__nav a:focus-visible,
  .portal-header__nav a[aria-current] {
    color: var(--green);
    border-block-end-color: var(--lime);
  }

  @media (max-width: 40rem) {
    .portal-header__inner {
      flex-direction: column;
      align-items: flex-start;
      gap: var(--sp-xs);
    }

    .portal-header__nav ul { gap: var(--sp-sm); }
    .portal-header__logo img { inline-size: 9.5rem; }
  }

  /* --- Hero -------------------------------------------------------------- */
  /* Hoehe wie im Entwurf. Der untere Innenabstand haelt den Text von der
     Kachelleiste frei, die spaeter darueber liegt. */
  .portal-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-block-size: var(--hero-h);
    padding-block: var(--sp-lg) var(--hero-fuss);
    overflow-x: clip;
    isolation: isolate;
  }

  .portal-hero__bild {
    position: absolute;
    inset: 0;
    z-index: -2;
    display: block;
  }

  .portal-hero__bild img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    object-position: 50% 50%;
  }

  /* Der Schleier laeuft von links dunkel nach rechts offen — der Text steht
     links, das Motiv bleibt rechts sichtbar. */
  .portal-hero__schleier {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg,
      rgb(9 26 3 / 0.82) 0%,
      rgb(9 26 3 / 0.62) 38%,
      rgb(9 26 3 / 0.18) 66%,
      rgb(9 26 3 / 0) 100%);
  }

  /* Schmale Fenster: der Text steht ueber dem ganzen Bild, also deckt der
     Schleier durchgehend ab. Der Ausschnitt rueckt nach rechts, sonst zeigt
     das Bild nur die dunkle Flaeche links neben der Weltkarte. */
  @media (max-width: 48rem) {
    .portal-hero__bild img { object-position: 72% 50%; }

    .portal-hero__schleier {
      background: linear-gradient(180deg,
        rgb(9 26 3 / 0.78) 0%,
        rgb(9 26 3 / 0.66) 60%,
        rgb(9 26 3 / 0.72) 100%);
    }
  }

  .portal-hero__inhalt {
    position: relative;
  }

  .portal-hero__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-sm);
    max-inline-size: 40rem;   /* mit der groesseren Schrift ab 02.08.2026 */
  }

  .portal-hero__kicker {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    letter-spacing: var(--ls-kicker);
    text-transform: uppercase;
    color: var(--paper);
    margin: 0;
  }

  .portal-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    font-size: var(--fs-hero);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-heading);
    color: var(--paper);
    text-wrap: pretty;
  }

  .portal-hero__sub {
    margin: 0;
    font-size: var(--fs-lead);
    line-height: var(--lh-lead);
    color: rgb(255 255 255 / 0.92);
    max-inline-size: 34rem;
    text-wrap: pretty;
  }

  .portal-hero__cta {
    margin-block-start: var(--sp-2xs);
    padding-inline: var(--sp-lg);
  }

  /* --- Kachelleiste ------------------------------------------------------
     Liegt zur Haelfte ueber der Hero-Unterkante. Der negative Versatz faellt
     unter 900px auf null, dort steht die Leiste einfach unter dem Bild. */
  .portal-kacheln {
    position: relative;
    z-index: 10;
    margin-block-start: calc(var(--kachel-versatz) * -1);
    margin-block-end: var(--sp-2xl);
  }

  /* Die aufgeklappte Standortliste schwebt ueber dem Bereich darunter. Auf
     einer kurzen Seite laege sie sonst auf der Fusszeile — der Zuschlag
     schafft ihr Platz. */
  .portal-kacheln:has(.kachel__aufklapp[open]) {
    padding-block-end: 7rem;
  }

  .kachelleiste {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgb(255 255 255 / 0.96);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
  }

  .kachel {
    position: relative;
    display: flex;
  }

  /* Trennlinien statt Rahmen: die letzte Kachel bekommt keine. */
  .kachel + .kachel::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    inline-size: 1px;
    background: var(--lime-line);
  }

  /* Gestapelt liegt die Linie oben statt links. */
  @media (max-width: 54rem) {
    .kachel + .kachel::before {
      inset: 0 var(--sp-md) auto;
      inline-size: auto;
      block-size: 1px;
    }
  }
}

@layer components {

  /* --- Einzelne Kachel ---------------------------------------------------- */
  .kachel__flaeche {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2xs);
    padding: var(--sp-md) var(--sp-md);
    text-align: center;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--dur) var(--ease);
  }

  /* summary traegt sonst ein Dreieck und ist kein Flex-Container. */
  .kachel__flaeche::-webkit-details-marker { display: none; }
  summary.kachel__flaeche { list-style: none; }

  .kachel__flaeche:hover,
  .kachel__flaeche:focus-visible {
    background: var(--paper-soft);
    color: inherit;
  }

  .kachel__kreis {
    display: grid;
    place-items: center;
    inline-size: var(--kreis);
    block-size: var(--kreis);
    border-radius: 50%;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
  }

  .kachel__kreis svg {
    inline-size: 62%;
    block-size: 62%;
  }

  .kachel__flaeche:hover .kachel__kreis,
  .kachel__flaeche:focus-visible .kachel__kreis {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }

  @media (prefers-reduced-motion: reduce) {
    .kachel__flaeche:hover .kachel__kreis,
    .kachel__flaeche:focus-visible .kachel__kreis { transform: none; }
  }

  .kachel__titel {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-semi);
    line-height: var(--lh-heading);
    color: var(--ink);
  }

  .kachel__text {
    font-size: var(--fs-sm);
    line-height: var(--lh-lead);
    color: var(--grey);
    max-inline-size: 18.75rem;
  }

  /* --- Standorte-Aufklapper ----------------------------------------------
     Reines <details>, funktioniert ohne JavaScript. Auf breiten Fenstern
     schwebt die Liste unter der Kachel, gestapelt steht sie im Fluss. */
  .kachel__aufklapp {
    display: flex;
    flex: 1;
  }

  .kachel--standorte { z-index: 1; }
  .kachel--standorte:has(.kachel__aufklapp[open]) { z-index: 20; }

  .kachel__aufklapp[open] > .kachel__flaeche { background: var(--paper-soft); }

  .standorte {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }

  .standorte a {
    display: block;
    padding: var(--sp-xs) var(--sp-md);
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: var(--fw-semi);
    color: var(--ink);
    text-decoration: none;
  }

  .standorte li + li a { border-block-start: 1px solid var(--border-soft); }

  .standorte a:hover,
  .standorte a:focus-visible { background: var(--paper-soft); }

  /* Die Liste haengt unter der Leiste heraus, nicht ueber der Kachel — sonst
     verdeckt sie Titel und Beschreibung, auf die sie sich bezieht. */
  @media (min-width: 54.0625rem) {
    .standorte {
      position: absolute;
      inset-inline-start: 50%;
      transform: translateX(-50%);
      inset-block-start: calc(100% - 1.75rem);
      inline-size: min(20rem, calc(100vw - 2 * var(--bahn-pad)));
    }
  }

  @media (max-width: 54rem) {
    .kachel__aufklapp { flex-direction: column; }
    .standorte {
      margin: 0 var(--sp-md) var(--sp-md);
      box-shadow: none;
    }
  }
}

@layer layout {

  /* --- Fusszeile ---------------------------------------------------------- */
  .portal-footer {
    margin-block-start: auto;
    background: var(--ton-tief);
    color: var(--auf-ton-tief);
    border-block-start: 1px solid var(--ton-linie);
  }

  .portal-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-md);
    padding-block: var(--sp-lg);
  }

  .portal-footer__marke {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--auf-ton-tief-leise);
  }

  .portal-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-md);
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--fs-sm);
  }

  .portal-footer__nav a {
    color: var(--auf-ton-tief);
    text-decoration: none;
  }

  .portal-footer__nav a:hover,
  .portal-footer__nav a:focus-visible {
    color: var(--lime);
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  /* Der Fuss soll auch bei kurzem Inhalt unten stehen. */
  body.portal {
    min-block-size: 100svh;
    display: flex;
    flex-direction: column;
  }
  body.portal main { flex: 1; }
}

@layer components {

  /* --- Sektionsueberschrift ------------------------------------------------ */
  .section-title {
    display: inline-block;
    border-block-end: 4px solid var(--lime);
    padding-block-end: var(--sp-2xs);
    margin-block-end: var(--sp-lg);
  }

  /* --- Prof. Klein ---------------------------------------------------------
     Portraet links, Text rechts. Das Bild ist quadratisch beschnitten und
     rund maskiert — dasselbe Motiv wie auf 2nd look. */
  .person {
    display: grid;
    gap: var(--sp-gap);
    align-items: start;
  }

  @media (min-width: 56rem) {
    .person { grid-template-columns: 22rem 1fr; }
  }

  .person__bild {
    margin: 0;
    inline-size: min(22rem, 60vw);
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: var(--paper-soft);
    box-shadow: var(--shadow-sm);
  }

  .person__bild img {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    object-position: 50% 30%;
  }

  .person__body h2 {
    font-size: var(--fs-xl);
    line-height: var(--lh-heading);
    text-wrap: pretty;
  }

  .person__rolle {
    margin-block-start: var(--sp-3xs);
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
    color: var(--green);
  }

  .person__body .lead { margin-block-start: var(--sp-sm); }

  .person__belege {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
    gap: var(--sp-md);
    list-style: none;
    margin: var(--sp-lg) 0 0;
    padding: 0;
  }

  .person__belege li {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3xs);
    padding-inline-start: var(--sp-sm);
    border-inline-start: var(--border-w) solid var(--lime);
  }

  /* Verlinkte Kennzahlen fuehren in die Publikationsliste */
  .person__belege a {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3xs);
    text-decoration: none;
  }

  .person__belege a:hover .person__label,
  .person__belege a:focus-visible .person__label {
    color: var(--ink);
    text-decoration: underline;
  }

  .person__zahl {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    line-height: 1;
    color: var(--ink);
  }

  .person__label {
    font-size: var(--fs-sm);
    line-height: var(--lh-lead);
    color: var(--grey);
  }

  .person__buch {
    margin-block-start: var(--sp-lg);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
    color: var(--grey);
    max-inline-size: var(--measure);
  }

  .person__mehr { margin-block-start: var(--sp-md); }

  /* --- Presse und Auszeichnungen ------------------------------------------- */
  .presse {
    display: grid;
    gap: var(--sp-gap);
    align-items: start;
  }

  @media (min-width: 62rem) {
    .presse { grid-template-columns: 1.4fr 1fr; }
  }

  .presse__liste {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .presse__liste li {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    gap: var(--sp-sm);
    padding-block-end: var(--sp-md);
    border-block-end: 1px solid var(--border);
  }

  .presse__liste li:last-child {
    border-block-end: 0;
    padding-block-end: 0;
  }

  .presse__jahr {
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--lime-text);
  }

  .presse__inhalt {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3xs);
  }

  .presse__titel {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
    line-height: var(--lh-heading);
    color: var(--ink);
    text-wrap: pretty;
  }

  .presse__quelle {
    font-size: var(--fs-sm);
    color: var(--grey);
  }

  .presse__siegel-titel {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    letter-spacing: var(--ls-kicker);
    text-transform: uppercase;
    color: var(--grey);
    margin-block-end: var(--sp-md);
  }

  .siegel-leiste {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    gap: var(--sp-lg);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  /* Gleiche Zellhoehe + contain: alle Siegel wirken aehnlich gross,
     egal wie unterschiedlich ihre Seitenverhaeltnisse sind. */
  .siegel-leiste img {
    display: block;
    inline-size: 100%;
    block-size: clamp(6rem, 5rem + 4vw, 8.5rem);
    object-fit: contain;
  }

  .siegel-leiste a {
    display: block;
  }

  /* --- Rechtstexte ---------------------------------------------------------
     Impressum und Datenschutz. Die Texte stammen wörtlich vom Auftraggeber. */
  .rechtstext h2 {
    display: inline-block;
    margin-block: var(--sp-xl) var(--sp-sm);
    font-size: var(--fs-xl);
    line-height: var(--lh-heading);
    border-block-end: 4px solid var(--lime);
    padding-block-end: var(--sp-2xs);
  }

  .rechtstext h3 {
    margin-block: var(--sp-md) var(--sp-2xs);
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
  }

  .rechtstext p,
  .rechtstext address {
    margin-block-start: var(--sp-2xs);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
  }

  .rechtstext address { font-style: normal; }

  .rechtstext .dot-list { margin-block-start: var(--sp-2xs); }

  .rechtstext__copy {
    margin-block-start: var(--sp-xl);
    color: var(--grey);
  }

  .rechtstext__zurueck { margin-block-start: var(--sp-lg); }
}
