/**
Main CSS file for matuadoc.co.nz

Created by Matua Doc.
Created 2025-09-06.
**/

/* Import */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

/* Variables */

:root {
    --font: "Figtree", "Verdana", "Helvetica Neue", "Helvetica", sans-serif;
    --mono-font: Menlo, Monaco, Consolas, monospace;
    /* Default (light) theme */
    --bg: hsl(55, 22%, 92%);
    
    --text: #000;
    --border: #666;
    --accent: hsl(225, 50%, 50%);
    --disabled: #aaa;
    
    --width: 800px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: hsl(55, 11%, 8%);
        
        --text: #fafafa;
        --border: #aaa;
        --accent: #f6c844;
        --disabled: #aaa;
    }
}

/* Global */

body {
    background-color: var(--bg);
    flex-direction: column;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85em;
    display: flex;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Images */

figure {
    display: flex;
    flex-direction: column;
    align-items: center;
}

figcaption {
    font-style: italic;
}

/* Fonts */

a, code {
    color: var(--accent)
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
}

h1, h2 {
    font-weight: 700;
    font-size: 3em;
    margin: 2rem 0;
}

h1 {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

h2 {
    margin-top: 2em;
    font-size: 2em;
}

h1 + h2 {
    margin-top: 0;
}

h1:has(+ h2) {
    margin-bottom: 0;
}

main h1:first-of-type {
    margin-top: 0;
}

h2 + h3 {
    margin-top: 0;
}

h2:has(+ h3) {
    margin-bottom: 0;
}

h3 + h4 {
    margin-top: 0;
}

h3:has(+ h4) {
    margin-bottom: 0;
}

/* Header */

header {
    font-size: 1.2em;
    line-height: 2em;
    z-index: 2
}

header h1 {
    font-size: 4em;
    font-weight: 900;
    margin: 2rem auto 2rem 0;
    border: none;
}

header ul {
    list-style: none;
    padding-left: 0;
    text-align: var(--accent);
}

header .emoji {
    font-size: 1.2em;
    margin-right: 1rem;
    height: 2em;
    width: 2em;
    line-height: 2em;
    text-align: center;
}

@media only screen and (prefers-color-scheme: dark) {
    header .emoji {
        background-color: rgba(255,255,255,0.2);
        border-radius: 2em;
    }
}

#top {
    display: flex;
    justify-content: center;
}

#top a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#menu {
    display: flex;
    flex-direction: column;
}

#menu-toggle {
    display: none;
}

nav ul li, #menu div ul li {
    margin-bottom: 1em;
}

nav ul li a, #menu div ul li {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.link-title {
    display: flex;
    flex-direction: column;
    width: 180px;
}

.link-title span {
    line-height: 1.25em;
}

.link-title span:first-of-type {
    font-weight: bold;
}

/* Main */

#main {
    display: flex;
    column-gap: 5em;
    flex-direction: row;
    justify-content: center;
    margin: 2em auto;
    margin-bottom: 0;
    z-index: 100;
    height: fit-content;
}

main {
    background-color: var(--bg);
    font-size: 1.2em;
    line-height: 2rem;
    padding: 2.5em;
    padding-top: 0;
    min-width: var(--width);
    max-width: var(--width);
    height: fit-content;
    margin-bottom: 2em;
}

main h1 {
    line-height: 1.25em;
}

main img {
    max-width: calc(var(--width) - 2.5em);
}

main iframe {
    width: calc(var(--width) - 2.5em);
    min-height: 400px;
    text-align: center;
}

#details {
    display: flex;
    flex-direction: column;
    padding-bottom: 4em;
}

#details h1 {
    margin-bottom: 0;
    padding-bottom: 0;
}

footer {
    text-align: center;
}

/* Custom */

.side-by-side {
    display: flex;
    gap: 1rem;          /* optional spacing between images */
}

.side-by-side img {
    flex: 1 1 0;        /* allow images to shrink and grow evenly */
    max-width: 50%;    /* prevent overflow */
    height: auto;       /* preserve aspect ratio */
    object-fit: contain;
}