/* assets/styles/style.css */
/* === Base, layout, components (no mobile rules) === */

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

/* Prevent font size inflation */
html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

/* Reset default margins */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin-block-end: 0;
}

/* Lists without bullets if role=list */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* Body defaults */
body {
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    color: var(--fg);
    background-color: var(--bg);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: background-color 200ms ease, color 200ms ease;
}

/* Shorter line-heights on headings & interactive */
h1,
h2,
h3,
h4,
button,
input,
label {
    line-height: 1.1;
}

/* Balance wrapping on headings */
h1,
h2,
h3,
h4 {
    text-wrap: balance;
    color: var(--heading);
    transition: color 200ms ease;
}

/* Unclassed links inherit color and get nice underline skip */
a:not([class]) {
    text-decoration-skip-ink: auto;
    color: currentColor;
}

a {
    color: var(--link-color);
    transition: color 150ms ease;
}

a:hover,
a:focus-visible {
    color: var(--link-hover);
}

/* Media defaults */
img,
picture {
    max-width: 100%;
    display: block;
}

/* Form controls inherit fonts */
input,
button,
textarea,
select {
    font: inherit;
}

/* Textarea sensible minimum */
textarea:not([rows]) {
    min-height: 10em;
}

/* Anchored elements scroll margin */
:target {
    scroll-margin-block: 5ex;
}

/* === Fonts === */
@font-face {
    font-family: open-sans;
    src: url(/assets/fonts/opensans-variable.ttf) format(truetype);
    font-weight: 100 1000;
}

@font-face {
    font-family: roboto-mono;
    src: url(/assets/fonts/robotomono-variable.ttf) format(truetype);
    font-weight: 100 1000;
}

@font-face {
    font-family: google-sans-code;
    src: url(/assets/fonts/GoogleSansCode-VariableFont_wght.ttf) format(truetype);
    font-weight: 100 1000;
}

@font-face {
    font-family: oxanium;
    src: url(/assets/fonts/Oxanium-VariableFont_wght.ttf) format(truetype);
    font-weight: 100 1000;
}

@font-face {
    font-family: Roboto;
    src: url(/assets/fonts/Roboto.ttf) format(truetype);
    font-weight: 100 1000;
}

/* === Layout tokens === */
:root {
    --footer-height: 6rem;
    --nav-height: 6rem;
    --content-padding: 2rem;
}

/* === Layout === */
p {
    margin-top: 1rem;
    color: var(--text-muted);
    transition: color 200ms ease;
}

blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 0.85rem;
    border-inline-start: 4px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text-muted);
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

h2 {
    margin-bottom: 1rem;
}

h3 {
    margin-top: 2rem;
}

.main-nav {
    position: sticky;
    top: 0;
    background-color: var(--nav-bg);
    color: var(--nav-fg);
    padding: 2rem;
    font-size: 1.5em;
    display: flex;
    gap: 2rem;
    height: var(--nav-height);
    z-index: 10;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 16px 32px -28px var(--shadow-color);
    backdrop-filter: saturate(160%) blur(12px);
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.main-nav a {
    display: block;
    text-decoration: none;
    position: relative;
    color: var(--nav-fg);
    transition: color 150ms ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--link-underline);
    transition: transform 200ms cubic-bezier(.58, .58, .51, 1.19);
    transform: scaleX(0);
    transform-origin: left;
    overflow: hidden;
}

.main-nav a:hover::after {
    transform: scaleX(1);
}

/* Burger (hidden by default; shown on mobile) */

.lang-switcher {
    display: inline-flex;
    gap: .35rem;
    align-items: center;
    margin-left: 1rem;
    font-weight: 600;
}

.lang-switcher span {
    opacity: .75;
    color: var(--text-muted);
    transition: color 200ms ease, opacity 200ms ease;
}

.lang-switcher a {
    color: currentColor;
    text-decoration: none;
    font-variant: small-caps;
}

.lang-switcher a.active {
    text-decoration: underline;
}

.burger-menu,
.burger-container {
    display: none;
}

.burger-menu-container {
    text-align: left;
    position: fixed;
    top: 1.5rem;
    right: 1rem;
    width: 2rem;
    height: 1.5rem;
}

.burger-menu {
    position: relative;
    top: .5rem;
    height: 2px;
    transition: transform 0.3s ease;
}

.burger-menu::before,
.burger-menu::after {
    content: '';
    position: absolute;
    width: 2rem;
    height: 2px;
    transition: transform 300ms ease;
}

.burger-menu,
.burger-menu::before,
.burger-menu::after {
    background-color: var(--nav-fg);
}

.burger-menu::before {
    top: -.5rem;
}

.burger-menu::after {
    top: .5rem;
}

.burger-menu-container.active .burger-menu {
    transform: rotate(135deg);
}

.burger-menu-container.active .burger-menu::before {
    transform: rotate(0deg);
    top: 0;
}

.burger-menu-container.active .burger-menu::after {
    transform: rotate(90deg);
    top: 0;
}

.wrapper {
    flex: 1 0 auto;
    min-height: auto;
    background-color: var(--wrapper-bg);
    color: var(--fg);
    transition: background-color 200ms ease, color 200ms ease;
}
/* 
.wrapper:has(.content--homepage) {
    min-height: calc(100vh - var(--nav-height));
} */

.content {
    max-width: 60rem;
    margin-inline: auto;
    padding: var(--content-padding);
    background: var(--surface-1);
    /* border-radius: 1.25rem; */
    /* border: 1px solid var(--border-subtle); */
    /* box-shadow: 0 28px 48px -36px var(--shadow-color); */
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.content--legal {
    background: none;
    border: none;
    box-shadow: none;
}

.content--legal>p {
    margin-bottom: 1rem;
}

.legal-card {
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    background: var(--surface-1);
    margin-top: 1.5rem;
}

.legal-card:first-of-type {
    margin-top: 0;
}

.legal-card h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.legal-card p {
    margin-top: 1rem;
    line-height: 1.6;
}

.legal-card ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.legal-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.legal-address {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.legal-contact {
    margin-top: 1rem;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.site-footer .footer-links {
    margin-left: auto;
    display: flex;
    gap: 1rem;
}

.content.content--homepage,
.content--homepage {
    background: none;
    border: none;
    box-shadow: none;
}

/* Hero image + intro */
#bwImage {
    --img-width: 15rem;
    width: var(--img-width);
    float: left;
    border-radius: .5rem;
    --margin: 2rem;
    cursor: pointer;
    margin-right: var(--margin);
    margin-bottom: var(--margin);
    filter: grayscale(100%);
    transform-origin: left;
    transition: filter 200ms ease, width 200ms ease;
    z-index: 1;
    position: relative;
}

.introduction {
    position: relative;
}

#bwImage:hover {
    filter: grayscale(0);
}

#bwImage.img-larger {
    width: calc(var(--img-width) * 1.5);
}

#bwImage+p {
    margin-top: 0;
}

/* Video */
.video-container h3 {
    margin-bottom: 1rem;
}

.video-container video {
    max-width: 40rem;
}

/* YouTube link pill */
.yt-link {
    margin-top: .5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.yt-link img {
    height: 2em;
}

.yt-link p {
    margin: 0;
}

/* Gallery */
#gallery {
    touch-action: manipulation;
}

#gallery h2 {
    margin-top: 4rem;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.gallery-container img {
    width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-2);
    transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.gallery-container img:hover {
    box-shadow: 0 20px 32px -28px var(--shadow-color);
    transform: translateY(-2px) scale(1.01);
    border-color: var(--border-strong);
}

.folded {
    display: none;
}

.folded.show {
    display: block;
}

.show-more {
    display: block;
    margin: 10px auto;
    padding: 5px 10px;
    cursor: pointer;
}

.hide {
    display: none;
}

.gallery-container.show-all .hide {
    display: block;
}

#gallery h2+p {
    margin-bottom: 2rem;
}

#gallery button {
    border: none;
    color: black;
    transform: scale(1);
    transition: transform 100ms ease;
}

#gallery button:hover {
    transform: scale(2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    touch-action: manipulation;
}

.modal-content {
    max-height: 100%;
    max-width: 100%;
    margin: auto;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: var(--fg);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1010;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: var(--fg);
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

/* Footer */
footer {
    height: var(--footer-height);
    width: 100%;
    background-color: var(--footer-bg);
    color: var(--footer-fg);
    padding: 1rem;
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -12px 32px -28px var(--shadow-color);
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

/* How To's */

.howtos-page.content {
    max-width: unset;
}

/* === Howto List Button Styles === */
#howto-list {
    padding-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}


/* === Howto List Button Styles (Nav-like) === */
#howto-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

#howto-list button {
    background: none;
    color: var(--heading);
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1.1em;
    padding: 0;
    margin: 0;
    position: relative;
    cursor: pointer;
    transition: color 0.2s;
    min-width: 0;
    min-height: 0;
    text-align: left;
    display: inline-block;
    width: max-content;
}

#howto-list button::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    background-color: var(--link-underline);
    transition: transform 200ms cubic-bezier(.58, .58, .51, 1.19);
    transform: scaleX(0);
    transform-origin: left;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

#howto-list button:hover::after,
#howto-list button:focus::after {
    transform: scaleX(1);
}

#howto-list button.active::after {
    transform: scaleX(1);
}

#howto-list button.active {
    color: var(--link-color);
    font-weight: bold;
}

/* === Howtos Page Flex Layout === */
.howtos-flex-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.howto-sidebar {
    min-width: 240px;
    max-width: 500px;
    width: 25%;
    background: var(--surface-2);
    color: var(--text-muted);
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 24px 44px -34px var(--shadow-color);
    padding: 2rem 1rem 2rem 2rem;
    /* Keep sidebar tall while yielding space to the footer */
    max-height: calc(100vh - var(--nav-height) - (var(--content-padding) * 2));
    max-height: calc(100dvh - var(--nav-height) - (var(--content-padding) * 2));
    height: calc(100vh - var(--nav-height) - (var(--content-padding) * 2));
    height: calc(100dvh - var(--nav-height) - (var(--content-padding) * 2));
    overflow-y: auto;
    position: sticky;
    top: calc(var(--nav-height) + var(--content-padding));
}

:root.footer-visible .howto-sidebar {
    max-height: calc(100vh - var(--nav-height) - (var(--content-padding) * 2) - var(--footer-height));
    max-height: calc(100dvh - var(--nav-height) - (var(--content-padding) * 2) - var(--footer-height));
    height: calc(100vh - var(--nav-height) - (var(--content-padding) * 2) - var(--footer-height));
    height: calc(100dvh - var(--nav-height) - (var(--content-padding) * 2) - var(--footer-height));
}

.howto-sidebar h1 {
    margin-bottom: 1.5rem;
}

#howto-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0;
}

.howto-content-area {
    flex: 1 1 0;
    min-width: 0;
    background: var(--surface-1);
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 28px 48px -36px var(--shadow-color);
    padding: 2rem;
    overflow-x: auto;
}

@media (max-width: 900px) {
    .howtos-flex-layout {
        flex-direction: column;
    }

    .howto-sidebar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        position: static;
        height: auto;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .howto-content-area {
        padding: 1rem;
    }
}
