/*  Copyright (C) 2022-2024 Florian Guthmann

    Author: Florian Guthmann <florian.guthmann@fau.de>

    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This file is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
*/

/* Variables */
:root {
    /* Static variables */
    --corners: .2rem;
    --borders: 2px;

    /* Theme-dependent variables */
    --accent-alt:    #016c47;
    --accent:        #960096;
    --bg-accent:     #ffd4d1;
    --bg-alt:        #f0f0f0;
    --bg:            #f9f9f9;
    --fg:            #404040;
    --fg-alt:        #554;
    --primary-alt:   #375073;
    --primary:       #593773;
    --secondary-alt: #721045;
    --secondary:     #f0f0ff;
    --text-hl:       #b5d0ff;
    --success:       #189b6d;
    --warning:       #ec4444;
}

@media screen and (prefers-color-scheme: dark){
    :root {
        --accent-alt:    #7090ff;
        --accent:        #6ae4b9;
        --bg-accent:     #285747;
        --bg:            black;
        --bg-alt:        #333;
        --fg:            #eeeee8;
        --fg-alt:        #ddddd8;
        --primary-alt:   #79a8ff;
        --primary:       #b6a0ff;
        --secondary-alt: #feacd0;
        --secondary:     #21008f;
        --success:       #30ecaa;
        --warning:       #ff7171;
    }
}

@media screen and (width >= 769px) and (prefers-color-scheme: dark) {
    :root{
        --bg-alt: #3b3b3b;
        --bg:     #333;
    }
}

@media screen and (width >= 769px) {
    body{
        max-width: 90vw;
    }
}

/* General styles */

*, *::before, *::after {
    /* This should be the default anyway */
    box-sizing: border-box;
}

body {
    /* media-independent */
    margin: 0 auto;
    padding: 0 2rem;
    background-color: var(--bg);
    color: var(--fg);
    line-height: 1.4;
}

/* Text elements */

a {
    color: var(--primary-alt);
    border-radius: var(--corners);
    padding: .1em;
}

a:hover {
    background-color: var(--text-hl);
    color: var(--fg-alt);
}

b, strong {
    color: var(--accent);
}

details {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: var(--corners);
    border: var(--borders) solid;
    background-color: var(--bg-alt);
}

details[open] {
    padding-bottom: 1rem;
}

details[open] > summary {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid;
}

details[open] > p {
    margin: 1rem;
}

summary:hover {
    cursor: pointer;
}

blockquote {
    margin-left: inherit;
    font-style: italic;
}

blockquote::before {
    content: '»';
}

blockquote::after {
    content: '«';
}
