/*
 * meszi.de
 * Basis-Styles
 */


/* ---------------------------------------------------------
   Lokale Fonts
   --------------------------------------------------------- */

@font-face {
    font-family: "Open Sans";
    src: url("/fonts/OpenSans-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Open Sans";
    src: url("/fonts/OpenSans-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("/fonts/JetBrainsMono-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("/fonts/JetBrainsMono-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}


/* ---------------------------------------------------------
   Grundeinstellungen
   --------------------------------------------------------- */

:root {
    --background: #000;
    --foreground: #fff;
    --muted: #aaa;
    --border: #777;

    --content-width: 54rem;
    --page-padding: clamp(1rem, 4vw, 2.75rem);

    --font-sans:
        "Open Sans",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --font-mono:
        "JetBrains Mono",
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
}


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


html {
    background: var(--background);
    color: var(--foreground);
    font-size: 93.75%; /* 15px statt 16px */
}

body {
    margin: 0;

    background-color: var(--background);

    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 3px,
            rgba(255, 255, 255, 0.018) 3px,
            rgba(255, 255, 255, 0.018) 4px
        );

    color: var(--foreground);

    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.5;
}


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

.imgleft {
	text-align: left;
	float: left;
	margin: 0 1.5rem 1.5rem 1.5rem;
}

.imgright {
	text-align: right;
	float: right;
	margin: 0 1.5rem 1.5rem 1.5rem;
}


/* ---------------------------------------------------------
   Links / Fokus
   --------------------------------------------------------- */

a {
    color: inherit;

    text-decoration-line: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}


a:hover {
    text-decoration-thickness: 0.14em;
}


a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}


/* ---------------------------------------------------------
   Skip-Link
   --------------------------------------------------------- */

.skip-link {
    position: absolute;
    top: 0;
    left: 1rem;

    z-index: 1000;

    padding: 0.75rem 1rem;

    background: var(--foreground);
    color: var(--background);

    transform: translateY(-150%);
}


.skip-link:focus {
    transform: translateY(0);
}


/* ---------------------------------------------------------
   Gesamtlayout
   --------------------------------------------------------- */

.site {
    position: relative;

    width: min(
        calc(100% - 2rem),
        calc(var(--content-width) * 1.1)
    );

    margin: 2rem auto;

    /*
     * Auf Desktop bewusst ungefähr gleicher optischer
     * Abstand nach oben und zu den Seiten.
     */
    padding: 3.25rem 3.5rem;

    border: 1px solid var(--border);
}


/* ---------------------------------------------------------
   Header / Branding
   --------------------------------------------------------- */

.site-header {
    text-align: center;
}

.site-brand {
    position: relative;

    top: -15px;
	width: 15rem;
    max-width: 60vw;

    margin: 0 auto;
}


.site-tag {
    display: block;

    width: 100%;
    height: auto;
}


/*
 * Der eigentliche Site-Name bleibt HTML-Text.
 * Er liegt rechts unten leicht über dem dekorativen Tag.
 */

.site-title {
    position: absolute;

    right: 10px;
    bottom: 15px;

    color: var(--foreground);

    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;

    letter-spacing: 0.06em;

    text-decoration: none;
}


.site-title:hover {
    text-decoration: none;
}


.site-title:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}


.site-claim {
    margin: 2rem 0 2.5rem 0;

    font-family: var(--font-mono);
	font-size: 1rem;
    font-weight: 450;
    line-height: 1.2;
}


/* ---------------------------------------------------------
   Navigation
   --------------------------------------------------------- */

.main-nav {
    margin: 2rem 0 1rem;
	padding-top: 0.75rem;
	border-top: 1px dotted var(--border);
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 0.2rem 0.7rem;

    margin: 0;
    padding: 0;

    list-style: none;
}

.main-nav li {
    margin: 0;
}


.main-nav a {
    display: inline-flex;
    align-items: center;

    min-height: 2.2rem;
    padding: 0.1rem 0;

    font-size: 1.1rem;

    text-decoration: none;

    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}


.main-nav a:hover {
    border-top-color: currentColor;
    border-bottom-color: currentColor;
}


.main-nav a[aria-current="page"] {
    font-weight: 600;

    border-bottom-color: currentColor;
}


/* ---------------------------------------------------------
   Trennung Navigation → Content
   --------------------------------------------------------- */

.content-separator {
    width: 100%;

    margin: 2.25rem auto;
	margin-top: 1rem;

    border: 0;
    border-top: 1px dotted var(--border);
}


/* ---------------------------------------------------------
   Hauptinhalt
   --------------------------------------------------------- */

.site-content {
    min-width: 0;

    overflow-wrap: break-word;
}


.site-content > h1:first-child {
    margin-top: 0;
}


h1,
h2,
h3,
h4 {
    line-height: 1.25;
}


h1 {
    margin: 0 0 1rem;

    font-size: 1.2rem;
    font-weight: 600;
}

h2 {
    margin: 1.2rem 0 0.4rem;

    font-size: 1.05rem;
    font-weight: 600;
}

h3 {
    margin: 1.1rem 0 0.4rem;

    font-size: 1rem;
    font-weight: 600;
}

h4 {
    margin: 1.1rem 0 0.35rem;

    font-size: 1rem;
    font-weight: 600;
}

p {
    margin: 0 0 0.55rem;
}


hr {
    height: 0;

    margin: 1.35rem 0 1.6rem;

    border: 0;
    border-top: 1px dotted var(--border);
}

.site-content > p {
    margin-left: 1rem;
}


/* ---------------------------------------------------------
   Code / Terminal
   --------------------------------------------------------- */

code,
pre {
    font-family: var(--font-mono);
}


code {
    font-size: 0.9em;
}


pre {
    overflow-x: auto;

    margin: 1rem 0 1.5rem;
    padding: 1rem;

    border: 1px solid var(--border);

    font-size: 0.85rem;
    line-height: 1.5;

    white-space: pre;
}


pre code {
    font-size: inherit;
}


/*
 * Spezieller Terminalblock.
 *
 * Kann aus Markdown als eingebettetes HTML kommen:
 *
 * <pre class="terminal"><code>...</code></pre>
 */

.terminal {
    overflow-x: auto;

    margin: 1rem 0 1.5rem;
    padding: 1rem;

    border: 1px solid var(--border);

    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.5;

    white-space: pre;
}


.terminal code {
    font: inherit;
}


.terminal mark.inverse {
    padding-inline: 0.15em;

    background: #777;
    color: #000;
}


/* ---------------------------------------------------------
   News
   --------------------------------------------------------- */

/*
 * Die H1 "news" bleibt semantisch im Dokument vorhanden,
 * wird auf der Startseite aber nur visuell ausgeblendet.
 */

.page-news .site-content > h1:first-child {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);

    white-space: nowrap;

    border: 0;
}


/*
 * Markdown-Konvention:
 *
 * [12.07.2023]
 *
 * ## alles neu macht der juli
 *
 * Text ...
 *
 * ---
 *
 * [17.01.2023]
 *
 * ## der musiker
 *
 * ...
 */


/* Datum */

.page-news .site-content > p:first-of-type,
.page-news .site-content > hr + p {
    margin: 0 0 0.15rem;

    color: var(--muted);

    font-size: 0.75rem;
    line-height: 1.4;
}


/* Headline unmittelbar nach dem Datum */

.page-news .site-content > p:first-of-type + h2,
.page-news .site-content > hr + p + h2 {
    margin: 0 0 0.55rem;
}


/* Trenner zwischen News-Einträgen */

.page-news .site-content > hr {
    margin: 1.75rem 0 1.75rem;
}


/* ---------------------------------------------------------
   Release-Komponente
   --------------------------------------------------------- */

hr.section-break {
    margin-block: 2.5rem;
}

.release-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));

    gap: 1.25rem;

    margin: 2.5rem 0 1.5rem 0;
    padding: 0;

    list-style: none;
}

.release-card {
    min-width: 0;
    text-align: center;
}

.release-cover {
    width: min(100%, 7.5rem);
    aspect-ratio: 1;

    margin: 0 auto 0.4rem;

    object-fit: cover;

    border: 1px solid var(--border);

    filter: grayscale(1);
    transition: filter 0.2s ease;
}

.release-card:hover .release-cover,
.release-card:focus-within .release-cover {
    filter: grayscale(0);
}

.release-info {
    font-size: 0.85rem;
    line-height: 1.35;
}

.release-title {
    font-weight: 600;
}

.release-projects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 0 0.25em;
}

.release-project {
    white-space: nowrap;
}

.release-links {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 0.1rem;

    margin-top: 0.4rem;

    font-size: 0.95em;
}

.release-links a {
    color: var(--muted);
}

.release-links a:hover,
.release-links a:focus-visible {
    color: var(--foreground);
}


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-footer {
    width: min(
        calc(100% - 2rem),
        var(--content-width)
    );

    margin: -1.2rem auto 2rem;

    text-align: center;

    color: var(--muted);

    font-size: 0.75rem;
}


.site-footer a {
    color: inherit;
}


/* ---------------------------------------------------------
   Kleine Displays
   --------------------------------------------------------- */

@media (max-width: 48rem) {

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

@media (max-width: 36rem) {

    .site {
        width: calc(100% - 1rem);

        margin: 0.5rem auto;

        /*
         * Etwas großzügiger als vorher:
         * Die Gewichtung Rahmen → Inhalt bleibt dadurch
         * auch mobil erhalten.
         */
        padding:
            1.5rem
            1.25rem
            1.5rem;
    }


	.site-brand {
		width: 10rem;
		max-width: 55vw;
	}

	.site-title {
		font-size: 0.8rem;
	}

	.site-claim {
		margin-top: 0.4rem;
		font-size: 0.95rem;
	}


    .main-nav {
        margin:
            1.35rem
            0
            1.35rem;
    }


    .main-nav ul {
        column-gap: 0.9rem;
    }


    .main-nav a {
        min-height: 2.4rem;
    }


    /*
     * Wichtig:
     * Nicht nur margin-bottom überschreiben.
     *
     * Sonst bleiben die 2.25rem margin-top aus der
     * Desktop-Regel bestehen.
     */
	.content-separator {
		width: 100%;
		margin: 1.4rem auto;
	}


    .page-news .site-content > hr {
        margin:
            1.4rem
            0
            1.4rem;
    }
	
    .release-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 1rem;
    }

    .release-cover {
        width: min(100%, 7rem);
    }


    .site-footer {
        width: calc(100% - 1rem);
    }
}

/* ---------------------------------------------------------
   Sehr schmale Viewports / große Schrift
   --------------------------------------------------------- */

@media (max-width: 24rem) {

    .site {
        padding:
            1.25rem
            1rem
            1.25rem;
    }


	.site-brand {
		width: 8.5rem;
		max-width: 60vw;
	}


    .main-nav {
        margin-top: 1rem;
    }
}
