/* Oh?
 * Sie interessieren sich sogar für den Aufbau meiner CSS Datei? Wie spannend, kann ich ja richtig was zeigen. =)
 * An den verschiedenen Stellen habe ich Notizen als Easter Egg für Sie hinterlegt als Bezeichnungen, warum ich was wie gemacht habe.
 */

/* Fonts von lokal laden - keine DSGVO-Probleme von wegen Drittanbieter ohne Zustimmung */
@font-face {
    font-display: swap;
    font-family: 'Bebas Neue';
    font-style: normal;
    font-weight: 400;
    src: url('bebas-neue-v14-latin-regular.woff2') format('woff2');
}
@font-face {
    font-display: swap;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 300;
    src: url('montserrat-v26-latin-300.woff2') format('woff2');
}
@font-face {
    font-display: swap;
    font-family: 'Montserrat';
    font-style: italic;
    font-weight: 300;
    src: url('montserrat-v26-latin-300italic.woff2') format('woff2');
}
@font-face {
    font-display: swap;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    src: url('montserrat-v26-latin-700.woff2') format('woff2');
}
@font-face {
    font-display: swap;
    font-family: 'Montserrat';
    font-style: italic;
    font-weight: 700;
    src: url('montserrat-v26-latin-700italic.woff2') format('woff2');
}

@font-face {
    font-family: "Font Awesome 6 Pro";
    font-style: normal;
    font-weight: 300;
    src: url('fa-light-300.woff2');
}

* {
    /* Globales Resetting. Normalerweise würde ich border-box nicht auf alles setzen, kann Drittanbieter-Zeug kaputt machen. Aber hier habe ich volle Kontrolle, also jo. */ 
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
}

/* Ich bin ein Fan von modernem CSS. Üblicherweise würde ich Fallbacks schreiben, aber ich gehe davon aus dass hier ein modernes Gerät sitzt. */
:root {
    --color-primary: #191c2f;
    --color-secondary: #476388;
    --color-accent: #72260f;
    --color-accent2: #b32d2a;
    --color-bright: #ebe0ce;
    --color-white: #ffffff;
    --color-bgimage: #333;
    --font-headlines: "Bebas Neue";
    --font-icon: "Font Awesome 6 Pro";
    --transition-ease-out-fast: cubic-bezier(0.67,0, 0.33, 1);
    background-color: var(--color-bright);
    color: var(--template-color-primary);
    font-family: "Montserrat";
    font-weight: 300;
    line-height: 1.7;
    min-height: 100svh; /* Eigentlich nur für Login Page wichtig. */
    text-wrap: pretty;
    word-break: break-word;
    hyphens: auto;
}

.vioma {
    --card-color: #83bb26;
    
    .color-accent {
        --color-accent2: var(--card-color);
    }
}

body {
    margin: 0;
    padding: 0 calc(50% - 960px);
}

.wrapper {
    background-color: var(--color-white);
}

:where(main, footer) > section {
    width: calc(100% - 2.5em);
    margin-inline: auto;
    container-type: inline-size;
}

:where(main, footer) > section {
    padding-top: clamp(1.25em, 6vw, 80px);
}

:where(main, footer) > section:last-child {
    padding-bottom: clamp(1.25em, 6vw, 80px);
}


/* Basis Formatierungen */

:where(h1, h2, h3, h4, h5, h6) { /* Ja ich kenne den Unterschied zwischen :where(), :is() und :has() and I LOVE IT */
    font-family: var(--font-headlines);
    font-weight: 400;
    letter-spacing: .0375em;
    line-height: 1.4;
    color: var(--color-accent);
    text-wrap: balance;
}

:where(h1, h2) {
    font-size: clamp(1.375em, 14cqi, 6em);
    line-height: 1.15;
}

:where(h2, h3) {
    color: var(--color-primary);
}

:where(h1, h2, h3, h4, h5, h6) strong,
hgroup > p > strong {
    color: var(--color-accent2);
    font-weight: inherit;
    white-space: pre;
}

article {
    container-type: inline-size;
}

hgroup {
    padding-block: 1em;

    > p {
        text-transform: uppercase;
        font-weight: bold;
        letter-spacing: .12em;
        margin: 0;
    }

    + p {
        margin-top: 0;
    }
}


small {
    /* Wird auf der gesamten Seite als Art Untertitel benutzt, also keine Klasse notwendig dafür */
    font-size: .8em;
    font-style: italic;
}

input {
    padding: .5em 1em;
    border: 2px solid color-mix(in srgb, var(--color-primary), transparent 20%);
}

input[type="submit"],
button {
    margin-left: auto;
    background-color: var(--color-primary);
    border: 2px solid var(--color-primary);
    color: var(--color-bright);
    font-family: inherit;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;

    &:hover {
        background-color: var(--color-secondary);
    }
}

p {
    margin-block: 1em;
}

.code {
    padding: .125em .375em;
    background-color: var(--color-bright);
    color: var(--color-accent);
    font-weight: bold;
    margin-inline: .25em;
    line-height: 1;
}

a:not([class]) {
    color: var(--color-accent2);
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    -webkit-text-fill-color: transparent;
    background: linear-gradient(to right, var(--color-accent) 50%, var(--color-accent2) 50%) top right no-repeat;
    background-size: 202% 100%;
    background-clip: text;
    transition: background-position .4s var(--transition-ease-out-fast);
}

a:not([class]):hover {
    background-position: top left;
}

/* Login Page */
.login {
    display: flex;

    body {
        margin: auto;
    }
    form {
        display: flex;
        flex-direction: column;
    }
}

/* Header Stuff */

.hero {
    display: grid;
    background-color: var(--color-bgimage);
    border-bottom: 5px solid var(--color-accent);
    aspect-ratio: 2/1;
    width: 100%;
    max-height: 50svh;
    overflow: hidden;
    container-type: inline-size;

    > * {
        grid-area: 1/1/2/2;
        z-index: 10;
    }
}

.hero-img {
    position: absolute;
    inset: 0;
    opacity: .8;
    animation: hero-opacity 10s;
    height: 100%;
    object-fit: cover;
}

.hero-headline {
    margin: 18cqw 10cqw auto auto;
    max-width: 50cqi;
    color: var(--color-white);
    font-size: 5cqi;
    text-align: center;
    text-shadow: 3px 6px 10px rgba(0,0,0,.33); 
    line-height: 1;
}

.portrait {
    border-radius: 1em;
    box-shadow: 2px 3px 10px rgba(0,0,0,.16);
}

/* Basic Main Stuff */

.color-accent {
    color: var(--color-accent2);
    font-weight: bold;
    text-transform: uppercase;
}

.grid {
    display: grid;
    gap: clamp(1.25em, 3vw, 50px);
}

.visuallyhidden {
    position: absolute !important;
    overflow: hidden !important;
    height: 1px !important;
    width: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important
}

ul > li {
    display: block;
    padding-block: .25em;
}

ul:not(.no-icons) > li::before {
    content: "\f054";
    font-family: var(--font-icon);
    font-weight: 300;
    display: inline-block;
    padding-right: .75em;
    scale: 1.25;
}

.info {
    position: relative;
    background-color: var(--color-bright);
    padding: .75em;
    font-size: .8em;

    > *:first-child {
        margin-top: 0;
    }

    > *:last-child {
        margin-bottom: 0;
    }

    .code {
        background-color: color-mix(in srgb, var(--color-primary), transparent 90%);
    }
}

.info-close {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 4px 0 0 0;
    background: color-mix(in srgb, var(--color-primary), transparent 90%);
    color: var(--color-accent2);
    border: none;
    appearance: none;
}

.info-close::before {
    content: "\f00d";
    font-family: var(--font-icon);
}

.info-close:hover {
    color: var(--color-white);
}

.grid-card {
    position: relative;
    perspective: 1000px;
    aspect-ratio: 9/15;
    transition: scale .4s var(--transition-ease-out-fast);
}

.grid-card:nth-child(3) {
    --card-color: var(--color-accent2);
}

.grid-card.flip .grid-card-rotate {
    transform: rotateY(180deg);
}

.grid-card:not(.flip):hover {
    scale: 1.05;
}

.grid-card-rotate {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform .6s var(--transition-ease-out-fast);
    transform-style: preserve-3d;
    border-radius: 1em;

    > * {
        position: absolute;
        inset: 0;
        backface-visibility: hidden;
    }
}

.grid-card-front {
    background: linear-gradient(340deg, color-mix(in srgb, var(--card-color, var(--color-primary)), #000 20%), var(--card-color, var(--color-primary)));
    color: var(--color-white);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10%;
    border-radius: 1rem;
    font-family: var(--font-headlines);
    font-size: clamp(2em, 15cqi, 5em);
    font-weight: 400;
    letter-spacing: .075em;
    line-height: 1;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 2px 3px 10px rgba(0,0,0,.16);
    cursor: pointer;
}

.grid-card-back {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 4cqi;
    transform: rotateY(-180deg);
    box-shadow: 2px 3px 10px rgba(0,0,0,.16);
    border-radius: 1rem;
    /* border: 8px solid color-mix(in srgb, var(--color-primary), var(--color-white) 50%); */
    overflow: hidden;
    z-index: 10;

    h2 {
        position: relative;
        display: block;
        margin-bottom: auto;
        padding-block: 1em;
        color: var(--color-white);
        text-align: center;
        z-index: 1;

        ~ * {
            padding: 1.25em 1.75em 2.5em;
        }
    }

    h2::before {
        content: "";
        background: linear-gradient(45deg, color-mix(in srgb, var(--card-color, var(--color-primary)), var(--color-white) 20%), var(--card-color, var(--color-primary)));
        position: absolute;
        top: -25%;
        left: -50%;
        width: 200%;
        height: 125%;
        transform: rotateZ(-185deg);
        z-index: -1;
    }
}


@media (min-width: 768px) {

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

@media (min-width: 960px) {

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

    .grid-span-2 {
        grid-column: span 2;
    }
}

@media (min-width: 1400px) {

    :where(main, footer) > section {
        max-width: calc(100% - 520px);
    }
}

/* Keyframes für Animationen */

@keyframes hero-opacity {
    0% {
        opacity: .8;
    }
    50% {
        opacity: .9;
    }
    100% {
        opacity: .8;
    }
}

/* Druckvorschau optimieren */

@media print {

    @page {
        margin: 0;
    }

    @page :first {
        margin-top: 0;
    }

    thead {
        display: none;
    }

    tfoot {
        display: none;
    }

    body {
        font-size: 80%;
    }

    main,
    footer {
        padding-inline: 3.5em;
    }

    .noprint,
    .grid-card-front {
        display: none !important;
    }

    :where(.hero-headline) {
        -webkit-print-color-adjust: exact;
    }

    .grid-span-2 {
        grid-column: span 2;
    }

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

    .grid-card-rotate {
        transform: rotate(180deg);
    }
}