/*
 * m-lup-style.css – all styles of lernenundpunkten.com.
 * Colours and fonts are defined once in section 1 (see m-lup-colours.html);
 * change them there only.
 * © 2019 Milan Svoboda, Innsbruck – https://msvoboda.at
 * All rights reserved. Use, copying or changes only with written permission.
 *
 * 1. Settings (colours, fonts, sizes)
 * 2. Base and text (page, links, headings, lists, tables, buttons)
 * 3. Top bar and menu
 * 4. Home page
 * 5. Footer
 * 6. Phones
 */


/* 1. Settings ---------------------------------------------------------------- */

:root {
    /* colours */
    --clr-brand: #ffbf00;          /* the "&" circle, buttons, current menu item */
    --clr-link: #007bff;           /* links in the text; option with AA contrast: #0062cc */
    --clr-link-hover: #0062cc;
    --clr-primary: #3a3532;        /* smoky quartz = our black: text, headings, top bar */
    --clr-text-soft: #5c5651;
    --clr-grey-dark: #a9a29c;
    --clr-grey: #c6c0bb;
    --clr-grey-light: #efece9;
    --clr-off-white: #faf8f6;
    --clr-white: #ffffff;
    --clr-focus: #0062cc;

    /* roles */
    --clr-page-bg: var(--clr-white);
    --clr-text: var(--clr-primary);
    --clr-topbar-bg: var(--clr-primary);
    --clr-topbar-text: var(--clr-off-white);
    --clr-menu-current: var(--clr-brand);
    --clr-button-bg: var(--clr-brand);
    --clr-button-text: var(--clr-primary);
    --clr-button-hover: var(--clr-primary);
    --clr-button-hover-text: var(--clr-white);
    --clr-bullet: var(--clr-primary);
    --clr-footer-bg: var(--clr-grey-light);
    --clr-footer-text: var(--clr-text-soft);

    /* fonts: Arial for now; one line to change later */
    --font-text: Arial, Helvetica, sans-serif;
    --font-head: Arial, Helvetica, sans-serif;

    /* sizes */
    --ft-body: clamp(1.05rem, 1vw + 0.5rem, 1.15rem);
    --ft-h1: clamp(1.8rem, 4.5vw, 2.4rem);
    --ft-h2: clamp(1.3rem, 3vw, 1.45rem);
    --ft-h3: clamp(1.15rem, 2.5vw, 1.2rem);
    --max-w: 1100px;
    --text-max: 70ch;
    --gutter: 20px;
    --radius: 2px;
}


/* 2. Base and text ------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

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

/* The footer always sits at the bottom of the window, also on short pages. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--clr-page-bg);
    color: var(--clr-text);
    font-family: var(--font-text);
    font-size: var(--ft-body);
    line-height: 1.6;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

main {
    display: block;
    flex: 1 0 auto;
    width: 100%;
    padding-bottom: 3rem;
}

.page {
    max-width: var(--text-max);
}

a {
    color: var(--clr-link);
}

a:hover,
a:active {
    color: var(--clr-link-hover);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--clr-focus);
    outline-offset: 2px;
}

h1,
h2,
h3 {
    color: var(--clr-primary);
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    margin: 2rem 0 1rem 0;
    font-size: var(--ft-h1);
}

.text-h2 {
    margin: 1.6rem 0 0.5rem 0;
    font-size: var(--ft-h2);
}

.text-h3 {
    margin: 1.2rem 0 0.5rem 0;
    font-size: var(--ft-h3);
}

/* Text right after a heading: no top margin, the heading stays close to it. */
.text-h2 + p,
.text-h3 + p,
.text-h2 + .text-list,
.text-h3 + .text-list {
    margin-top: 0;
}

/* Lists from the markup (--item--): small square bullets. */
.text-list {
    list-style: none;
    margin: 0.7rem 0;
    padding-left: 1.5rem;
}

.text-list li {
    position: relative;
    padding-bottom: 0.3rem;
    line-height: 1.5;
}

.text-list li::before {
    content: "";
    position: absolute;
    top: 0.575em;
    left: -1.2rem;
    width: 0.35em;
    height: 0.35em;
    background: var(--clr-bullet);
}

/* Tables from the markup (| cell | cell |) */
.text-table {
    margin: 1rem 0;
    overflow-x: auto;
}

.text-table table {
    width: 100%;
    border-collapse: collapse;
}

.text-table th,
.text-table td {
    padding: 0.4rem 0.7rem;
    border-bottom: 1px solid var(--clr-grey);
    text-align: right;
    vertical-align: top;
}

.text-table th:first-child,
.text-table td:first-child {
    text-align: left;
}

/* Button links from the markup ([[[/kontakt*Kontakt]]]) */
.text-button,
.text-button:link,
.text-button:visited {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    background: var(--clr-button-bg);
    color: var(--clr-button-text);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius);
}

.text-button:hover,
.text-button:active {
    background: var(--clr-button-hover);
    color: var(--clr-button-hover-text);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* "Zum Inhalt springen": hidden above the window, visible on focus. */
.skip-link {
    position: absolute;
    top: -3rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--clr-white);
    color: var(--clr-primary);
    z-index: 10;
}

.skip-link:focus {
    top: 0.5rem;
}


/* 3. Top bar and menu ----------------------------------------------------------- */

.topbar {
    background: var(--clr-topbar-bg);
    color: var(--clr-topbar-text);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.6rem;
}

.brand,
.brand:hover {
    color: var(--clr-topbar-text);
    text-decoration: none;
}

.brand-text {
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-image {
    display: block;
    height: 2.4rem;
    width: auto;
}

/* The "&" in a yellow circle (logo). */
.brand-circle {
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    line-height: 1.35em;
    border-radius: 50%;
    background: var(--clr-brand);
    color: var(--clr-primary);
    text-align: center;
}

.menu ul {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu a,
.menu a:visited {
    color: var(--clr-topbar-text);
    text-decoration: none;
}

.menu a:hover {
    color: var(--clr-white);
    text-decoration: underline;
}

.menu a[aria-current="page"] {
    color: var(--clr-menu-current);
}

.menu-button {
    display: none;
    padding: 0.4rem 0.9rem;
    background: transparent;
    color: var(--clr-topbar-text);
    font: inherit;
    border: 1px solid var(--clr-grey-dark);
    border-radius: var(--radius);
    cursor: pointer;
}


/* 4. Home page ------------------------------------------------------------------- */

/* Background image: hand with phone on the left, text on the right.
   Fills the window, stays in place when scrolling; not on phones. */
.page-home {
    background: var(--clr-white) url("/assets/lundp-whitebg.png") center center / cover no-repeat fixed;
}

.home {
    max-width: 640px;
    margin-left: auto;
    padding-top: 2.5rem;
}

.home-logo {
    margin: 0;
    font-family: var(--font-head);
    font-size: clamp(2.2rem, 7vw, 3.4rem);
    font-weight: 700;
    line-height: 1.2;
}

.home .home-title {
    margin: 0.4rem 0 2rem 0;
    color: var(--clr-text-soft);
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.home .text-list {
    font-size: 1.1em;
}

.home .text-button {
    margin-top: 1rem;
    font-size: 1.4rem;
}


/* 4b. Cards (e.g. Systembeschreibung): 3 per row, 2 on tablets, 1 on phones -- */

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--clr-white);
    border: 1px solid var(--clr-grey);
    border-radius: var(--radius);
}

.card-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.card .card-title {
    margin: 1rem 1.2rem 0.4rem 1.2rem;
    font-size: var(--ft-h3);
}

.card-text {
    margin: 0 1.2rem 1rem 1.2rem;
}

.card-text p {
    margin: 0;
}

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


/* 5. Footer --------------------------------------------------------------------- */

.footer {
    background: var(--clr-footer-bg);
    color: var(--clr-footer-text);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
}

.footer-copy {
    margin: 0;
}

.footer a {
    color: var(--clr-footer-text);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}


/* 6. Phones (up to 768px) -------------------------------------------------------- */

@media (max-width: 768px) {
    .topbar-inner {
        flex-wrap: wrap;
    }

    /* The menu opens below the bar after a tap on "Menü" (m-lup-script.js). */
    .menu-button {
        display: block;
    }

    .menu {
        display: none;
        width: 100%;
        padding-bottom: 0.8rem;
    }

    .menu.menu-open {
        display: block;
    }

    .menu ul {
        flex-direction: column;
        gap: 0;
    }

    .menu a {
        display: block;
        padding: 0.6rem 0;
    }

    .home {
        margin-left: 0;
        padding-top: 1.5rem;
    }

    .page-home {
        background-image: none;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}
