/* ==========================================================
   Geotrend GmbH - Base Styles
   Reset, Typography, Layout
   ========================================================== */

/* -- Reset -- */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

ul, ol {
    list-style: none;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    background: none;
    outline: none;
}

button {
    cursor: pointer;
}

/* -- Typography -- */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-light);
    line-height: var(--line-height-tight);
    color: var(--color-text);
}

h1 {
    font-size: var(--font-size-4xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--font-size-3xl);
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

h6 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

p {
    margin-bottom: var(--space-16);
    color: var(--color-text-secondary);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-accent {
    color: var(--color-accent);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-lg {
    font-size: var(--font-size-lg);
}

/* -- Layout -- */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-24);
}

.section {
    padding: var(--space-96) 0;
}

/* Anker-Ziele (z. B. Footer-Links auf /#punktwolke oder /technologie#riegl)
   unterhalb des fixierten Headers (64px) freistellen, sonst verdeckt er den
   Anfang der angesprungenen Sektion bzw. Karte */
.section[id],
.tech-card[id] {
    scroll-margin-top: 80px;
}

.section--alt {
    background-color: var(--color-bg-secondary);
}

/* Abschliessende CTA-Kachel: oben ohne Sektions-Padding, denn die vorige
   Sektion bringt ihr eigenes padding-bottom mit. So ist der helle Abstand
   ueber der Kachel gleich gross wie der zwischen Kachel und Footer. */
.section--cta {
    padding-top: 0;
}

/* Ist die Sektion davor grau (z. B. Werte auf Ueber uns), ist deren
   padding-bottom eine graue Flaeche und erzeugt keinen hellen Zwischenraum.
   Dann braucht die CTA-Sektion ihr eigenes oberes Padding. */
.section--alt + .section--cta {
    padding-top: var(--space-96);
}

/* Fuer schmale Baender wie die Kennzahlen: die vollen 96px wirken dort wie ein Loch. */
.section--tight {
    padding: var(--space-48) 0;
}

.grid {
    display: grid;
    gap: var(--space-32);
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.flex {
    display: flex;
}

.flex--center {
    align-items: center;
    justify-content: center;
}

.flex--between {
    align-items: center;
    justify-content: space-between;
}

.flex--gap {
    gap: var(--space-16);
}

/* -- Visually hidden (accessible) -- */

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

/* Skip-Link: bei Tastaturfokus sichtbar einblenden.
   Betrifft nur Links (der Skip-Link in header.php), nicht rein informative .sr-only-Texte. */
a.sr-only:focus {
    position: fixed;
    top: var(--space-12);
    left: var(--space-12);
    z-index: var(--z-modal);
    width: auto;
    height: auto;
    margin: 0;
    padding: var(--space-12) var(--space-20);
    overflow: visible;
    clip: auto;
    clip-path: none;
    background-color: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    border: 1px solid var(--color-accent);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* -- Responsive -- */

@media (max-width: 1024px) {
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }

    .section {
        padding: var(--space-64) 0;
    }

    .section--cta {
        padding-top: 0;
    }

    .section--alt + .section--cta {
        padding-top: var(--space-64);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-16);
    }

    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }

    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }

    .section {
        padding: var(--space-48) 0;
    }

    .section--cta {
        padding-top: 0;
    }

    .section--alt + .section--cta {
        padding-top: var(--space-48);
    }
}
