/* MedGermany design tokens. Names are fixed by docs/blog-revamp/CONTRACT.md and
   design.md records why each value is what it is. Window 1 owns the values and
   may add names, but never renames one. Every other stylesheet reads these
   names and never sets its own font-family or a literal colour. */

/* The owner chose three looks on 5 Nov, shown at design.md under "Faces":
   Figtree across the site, IBM Plex Sans on the blog list, and Newsreader with
   Hanken Grotesk on articles. A browser downloads only the faces a page uses.

   Site default: Figtree. Licence: fonts/OFL-figtree.txt. */
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Figtree";
    font-style: italic;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Figtree";
    font-style: italic;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-italic-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Blog list: IBM Plex Sans. Licence: fonts/OFL-ibm-plex-sans.txt. */
@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Sans";
    font-style: italic;
    font-weight: 100 700;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Sans";
    font-style: italic;
    font-weight: 100 700;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-italic-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Article titles: Newsreader, cut at optical size 28 and weight 400 to 700 so the
   display drawing stays under 100 KB. Licence: fonts/OFL-newsreader.txt. */
@font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/newsreader-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/newsreader-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Article text: Hanken Grotesk. Licence: fonts/OFL-hanken-grotesk.txt. */
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Hanken Grotesk";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Hanken Grotesk";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/hanken-grotesk-italic-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Metric-matched fallbacks: measured from the font files against Georgia and
   Arial, so the swap to the real face moves as little text as possible. */
@font-face {
    font-family: "Figtree Fallback";
    font-weight: 400;
    src: local("Arial"), local("Helvetica Neue"), local("Roboto");
    size-adjust: 100.31%;
    ascent-override: 94.71%;
    descent-override: 24.92%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Figtree Fallback";
    font-weight: 700;
    src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Neue Bold"), local("Roboto Bold");
    size-adjust: 100.31%;
    ascent-override: 94.71%;
    descent-override: 24.92%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "IBM Plex Sans Fallback";
    font-weight: 400;
    src: local("Arial"), local("Helvetica Neue"), local("Roboto");
    size-adjust: 101.57%;
    ascent-override: 100.92%;
    descent-override: 27.07%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "IBM Plex Sans Fallback";
    font-weight: 700;
    src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Neue Bold"), local("Roboto Bold");
    size-adjust: 101.57%;
    ascent-override: 100.92%;
    descent-override: 27.07%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Newsreader Fallback";
    src: local("Georgia"), local("Noto Serif"), local("Droid Serif");
    size-adjust: 93.37%;
    ascent-override: 78.72%;
    descent-override: 28.38%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Hanken Grotesk Fallback";
    font-weight: 400;
    src: local("Arial"), local("Helvetica Neue"), local("Roboto");
    size-adjust: 101.7%;
    ascent-override: 98.32%;
    descent-override: 29.79%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Hanken Grotesk Fallback";
    font-weight: 700;
    src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Neue Bold"), local("Roboto Bold");
    size-adjust: 101.7%;
    ascent-override: 98.32%;
    descent-override: 29.79%;
    line-gap-override: 0%;
}

:root {
    /* Brand: values come from the logo and existing site, and stay as they are */
    --mg-teal: #1B3942;
    --mg-blue: #0A6EF1;
    --mg-orange: #E68C12;
    --mg-orange-strong: #B25E00;

    /* Ink and surfaces */
    --mg-ink: #1B3942;
    --mg-body: #33424A;
    --mg-muted: #5D6970;
    --mg-link: #0A5FD0;
    --mg-line: #DDE3E6;
    --mg-paper: #FFFFFF;
    --mg-wash: #F4F6F7;
    --mg-on-teal: #FFFFFF;
    --mg-on-teal-muted: #C9D6DA;
    --mg-callout-bg: #F4F6F7;
    --mg-callout-rule: #E68C12;

    /* Added by Window 1: states and the two non-brand colours the site needs */
    --mg-blue-strong: #0858C4;
    --mg-line-strong: #C3CDD2;
    --mg-field-edge: #7E8B92;
    --mg-wash-blue: #F0F7FB;
    --mg-teal-deep: #10262D;
    --mg-focus: #0A5FD0;
    --mg-focus-on-dark: #FFFFFF;
    --mg-whatsapp: #0F8237;
    --mg-whatsapp-strong: #0C6D2E;
    --mg-success: #047857;
    --mg-success-bg: #ECFDF5;
    --mg-danger: #B91C1C;
    --mg-danger-bg: #FEF2F2;

    /* Fonts */
    --mg-font-title: "Figtree", "Figtree Fallback", Arial, "Helvetica Neue", sans-serif;
    --mg-font-body: "Figtree", "Figtree Fallback", Arial, "Helvetica Neue", sans-serif;
    --mg-weight-title: 600;
    --mg-weight-label: 600;
    --mg-weight-strong: 700;
    --mg-tracking-title: -0.015em;

    /* Type scale, phone to desktop. H1 > H2 > H3 holds at every width. H1 is
       28px at 360 so "Gleichwertigkeitsprüfung" stays whole on the smallest
       phone we test; it reaches 51px at 1280. */
    --mg-size-display: clamp(2.125rem, 1.6rem + 2.8vw, 3.75rem);
    --mg-size-h1: clamp(1.75rem, 1.2rem + 2.5vw, 3.25rem);
    --mg-size-h2: clamp(1.4375rem, 1.25rem + 0.85vw, 2rem);
    --mg-size-h3: clamp(1.1875rem, 1.125rem + 0.35vw, 1.375rem);
    --mg-size-h4: 1.125rem;
    --mg-size-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
    --mg-size-body: 1.0625rem;
    --mg-size-prose: clamp(1.0625rem, 1.03rem + 0.15vw, 1.125rem);
    --mg-size-label: 0.9375rem;
    --mg-size-small: 0.875rem;
    --mg-size-xs: 0.8125rem;
    --mg-leading-tight: 1.15;
    --mg-leading-snug: 1.3;
    --mg-leading-body: 1.65;

    /* Layout */
    --mg-container: 1200px;
    --mg-measure: 68ch;
    --mg-gutter: clamp(16px, 4vw, 32px);
    --mg-space-section: clamp(40px, 6vw, 80px);
    --mg-radius-lg: 20px;
    --mg-radius-md: 12px;
    --mg-radius-pill: 999px;

    /* Fixed chrome. Use these for sticky offsets and scroll-margin-top. */
    --mg-header-h: 60px;
    --mg-dock-h: calc(56px + env(safe-area-inset-bottom, 0px));

    /* Liquid glass: CSS only, always paired with a solid fallback */
    --mg-glass-bg: rgba(255, 255, 255, 0.72);
    --mg-glass-bg-header: rgba(255, 255, 255, 0.88); /* blue links must hold 4.5:1 while the header crosses the teal hero */
    --mg-glass-bg-dark: rgba(16, 38, 45, 0.62);
    --mg-glass-solid: #FFFFFF;
    --mg-glass-solid-dark: #1B3942;
    --mg-glass-blur: 16px;
    --mg-glass-rim: rgba(255, 255, 255, 0.35);

    /* Motion: opacity and transform only */
    --mg-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --mg-duration: 180ms;
}

@media (min-width: 769px) {
    :root {
        --mg-dock-h: 0px;
    }
}

@media (min-width: 1200px) {
    :root {
        --mg-header-h: 72px;
    }
}

html {
    font-synthesis: none;
}

/* Per-page type. Views set these classes on <body> through $this->params['bodyClass'].
   The --bs-* and older names are declared on :root, where they resolve to the site
   default, so anything that reads a font token is declared again for these pages. */
body.page-library,
body.page-article {
    --bs-font-sans-serif: var(--mg-font-body);
    --bs-body-font-family: var(--mg-font-body);
    --primary-font: var(--mg-font-title);
    --secondary-font: var(--mg-font-body);
}

body.page-library {
    --mg-font-title: "IBM Plex Sans", "IBM Plex Sans Fallback", Arial, "Helvetica Neue", sans-serif;
    --mg-font-body: "IBM Plex Sans", "IBM Plex Sans Fallback", Arial, "Helvetica Neue", sans-serif;
    --mg-tracking-title: -0.012em;
}

body.page-article {
    --mg-font-title: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
    --mg-font-body: "Hanken Grotesk", "Hanken Grotesk Fallback", Arial, "Helvetica Neue", sans-serif;
    --mg-weight-title: 500;
    --mg-tracking-title: -0.01em;
    --mg-size-h1: clamp(1.8125rem, 1.25rem + 2.5vw, 3.25rem);
}
