/*
 * m-lup-style.css – all styles of lernenundpunkten.com.
 * © 2019 Milan Svoboda, Innsbruck – https://msvoboda.at
 * All rights reserved. Use, copying or changes only with written permission.
 *
 * 1. Settings (fonts, colours, sizes)
 * 2. Base and text (page, links, headings, lists, tables, buttons)
 * 3. Top bar and menu
 * 4. Layout (two columns with box, cards)
 * 5. Home page
 * 6. Footer
 * 7. Tablets and phones
 */


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

/* Text font: Atkinson Hyperlegible Next (own server, licence in
   assets/fonts/), Regular and Bold, each in two parts: basic Latin and
   extended Latin – the browser loads a part only when a page needs it. */
@font-face {
    font-family: 'Atkinson Hyperlegible Next';
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/atkinson-next-latin-400.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: 'Atkinson Hyperlegible Next';
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/atkinson-next-latin-ext-400.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: 'Atkinson Hyperlegible Next';
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/atkinson-next-latin-700.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: 'Atkinson Hyperlegible Next';
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/atkinson-next-latin-ext-700.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;
}

:root {
    /* colours */
    --clr-brand: #ffbf00;          /* the "&" circle, current menu item, button hover */
    --clr-brand-ink: #221e1c;      /* the "&" on yellow; darker so it looks like the text */
    --clr-link: #0062cc;
    --clr-link-hover: #004a99;
    --clr-primary: #3a3532;        /* smoky quartz = our black: text, headings, top bar */
    --clr-primary-dark: #221e1c;   /* button hover */
    --clr-text-soft: #5c5651;
    --clr-grey-dark: #a9a29c;
    --clr-grey: #c6c0bb;
    --clr-grey-light: #efece9;
    --clr-off-white: #faf8f6;
    --clr-white: #ffffff;

    /* roles */
    --clr-page-bg: var(--clr-white);
    --clr-text: var(--clr-primary);
    --clr-focus: var(--clr-link);
    --clr-topbar-bg: var(--clr-primary);
    --clr-topbar-text: var(--clr-off-white);
    --clr-topbar-line: var(--clr-text-soft);   /* line above the opened menu */
    --clr-menu-current: var(--clr-brand);
    --clr-button-bg: var(--clr-primary);
    --clr-button-text: var(--clr-white);
    --clr-button-hover: var(--clr-primary-dark);
    --clr-button-hover-text: var(--clr-brand);
    --clr-bullet: var(--clr-primary);
    --clr-box-bg: var(--clr-grey-light);
    --clr-title-line: var(--clr-primary);      /* line below box and card titles */
    --clr-footer-hover: var(--clr-primary);
    --clr-footer-bg: var(--clr-grey-light);
    --clr-footer-text: var(--clr-text-soft);
    --clr-footer-line: var(--clr-grey);        /* top edge, like the card borders */

    /* fonts: text Atkinson; headings, logo, menu and buttons Arial */
    --font-text: 'Atkinson Hyperlegible Next', Arial, 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);
    --topbar-h: 3.6rem;
    --max-w: 1100px;
    --text-max: 70ch;
    --gutter: 20px;
    --gap: 1.5em;              /* between cards, columns, and above the footer */
    --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 {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* --gap between the last box and the footer (main.container, so that the
   padding of .container does not remove it). */
main.container {
    flex: 1 0 auto;
    padding-bottom: var(--gap);
}

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

/* Links: underlined, darker on mouseover. Text links of the markup are
   normal weight (the markup puts them in <strong>). */
a {
    color: var(--clr-link);
}

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

.text-link {
    font-weight: 400;
}

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

h1,
h2,
h3,
h4 {
    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);
}

/* Headings in the text: a line below, like box and card titles. */
.text-h2 {
    margin: 1.6rem 0 0.5rem 0;
    padding-bottom: 0.35em;
    border-bottom: 2px solid var(--clr-title-line);
    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 round 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: calc(-1.2rem - 2px);
    width: 0.35em;
    height: 0.35em;
    border-radius: 50%;
    background: var(--clr-bullet);
}

/* Tables from the markup (| cell | cell |): first column left, others right. */
.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]]]): dark with white
   text; on mouseover darker with yellow text. */
.text-button,
.text-button:link,
.text-button:visited {
    display: inline-block;
    padding: 0.7rem 3.2rem;
    background: var(--clr-button-bg);
    color: var(--clr-button-text);
    font-family: var(--font-head);
    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);
    text-decoration: none;
}

.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;
    z-index: 20;
    padding: 0.5rem 1rem;
    background: var(--clr-white);
    color: var(--clr-primary);
}

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


/* 3. Top bar and menu ----------------------------------------------------------- */
/* The bar keeps its height; on phones the menu opens below it (section 7). */

.topbar {
    position: relative;
    z-index: 10;
    background: var(--clr-topbar-bg);
    color: var(--clr-topbar-text);
    font-family: var(--font-head);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--topbar-h);
}

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

.brand-text {
    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-brand-ink);
    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);
    font-weight: 700;
    text-decoration: none;
}

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

/* Current page: yellow and underlined (not by colour alone). */
.menu a[aria-current="page"] {
    color: var(--clr-menu-current);
    text-decoration: underline;
    text-underline-offset: 0.3em;
}

/* Hamburger: three bars, an X while the menu is open (only on phones). */
.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.menu-bars,
.menu-bars::before,
.menu-bars::after {
    display: block;
    width: 26px;
    height: 3px;
    margin: 0 auto;
    background: var(--clr-topbar-text);
    transition: transform 0.2s, background 0.2s;
}

.menu-bars {
    position: relative;
}

.menu-bars::before,
.menu-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-bars::before {
    top: -8px;
}

.menu-bars::after {
    top: 8px;
}

.menu-button[aria-expanded="true"] .menu-bars {
    background: transparent;
}

.menu-button[aria-expanded="true"] .menu-bars::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-button[aria-expanded="true"] .menu-bars::after {
    top: 0;
    transform: rotate(-45deg);
}


/* 4. Layout -------------------------------------------------------------------- */

/* Two columns: text 2/3, box 1/3 (a page with _pages/<key>-box.txt). */
.split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: calc(var(--gap) * 2);
    align-items: start;
}

.box {
    margin-top: 2rem;
    padding: 0.2rem 1.4rem 1rem 1.4rem;
    background: var(--clr-box-bg);
    border-radius: var(--radius);
}

/* Titles of boxes and cards: a line below; their text a bit smaller. */
.box .text-h2,
.card .card-title {
    padding-bottom: 0.35em;
    border-bottom: 2px solid var(--clr-title-line);
    font-size: var(--ft-h3);
}

.box .text-h2 {
    margin-top: 1rem;
}

.box p,
.card-text {
    font-size: 0.9em;
    line-height: 1.4;
}

/* Cards (e.g. Systembeschreibung): 3 per row, 2 on tablets, 1 on phones. */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.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.5rem 1.2rem;
}

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

.card-text p {
    margin: 0;
}


/* 5. 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;
}


/* 6. Footer --------------------------------------------------------------------- */

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

/* Home page: a line on top sets the footer apart from the background image. */
.page-home .footer {
    border-top: 1px solid var(--clr-footer-line);
}

/* Round dot between footer items (after the name, between the links). */
.footer-dot,
.footer-links li + li::before {
    display: inline-block;
    width: 0.3em;
    height: 0.3em;
    margin: 0 0.6em;
    border-radius: 50%;
    background: var(--clr-footer-text);
    vertical-align: middle;
}

.footer-links li + li::before {
    content: "";
}

.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 links: colour of the footer text, our black on mouseover. */
.footer a {
    color: var(--clr-footer-text);
}

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

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


/* 7. Tablets (up to 1024px) and phones (up to 768px) ----------------------------- */

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

@media (max-width: 768px) {
    /* The menu opens below the bar (m-lup-script.js), with a light line
       on top; bar, logo and hamburger stay where they are. */
    .menu-button {
        display: block;
    }

    .menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        padding: 0.4rem var(--gutter) 0.8rem var(--gutter);
        background: var(--clr-topbar-bg);
        border-top: 1px solid var(--clr-topbar-line);
    }

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

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

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

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

    .split {
        gap: 0;
    }

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

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