/* Box sizing rules */
*,
*::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;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* Set core body defaults */
body {
    min-height: 100vh;
    line-height: 1.5;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
    line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
    text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
    text-decoration-skip-ink: auto;
    color: currentColor;
}

/* Make images easier to work with */
img,
picture {
    max-width: 100%;
    display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
    min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
    scroll-margin-block: 5ex;
}

@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;
}

/* VARIABLES */
:root {
    --footer-height: 6rem;
    --nav-height: 6rem;
    --wrapper-height: calc(100vh - var(--footer-height) - var(--nav-height));
}

body {
    font-family: roboto-mono;
    margin: 0;
    background-color: #333;
}

p {
    margin-top: 1rem;
}

h2 {
    margin-bottom: 1rem;
}

h3 {
    margin-top: 2rem;
}

.main-nav {
    position: sticky;
    top: 0;
    background-color: #333;
    padding: 2rem;
    color: #fff;
    font-size: 1.5em;
    display: flex;
    gap: 2rem;
    height: var(--nav-height);
    z-index: 10;
}

.main-nav a {
    display: block;
    text-decoration: none;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: white;
    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-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;
    background-color: #fff;
    transition: transform 0.3s ease;
}

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

.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 {
    min-height: var(--wrapper-height);
    background-color: #fff;
}

.wrapper:has(.content--homepage) {
    min-height: calc(100vh - var(--nav-height));
}

.content {
    max-width: 60rem;
    margin-inline: auto;
    padding: 2rem;
}

#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-container h3 {
    margin-bottom: 1rem;
}

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


.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;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.gallery-container img:hover {
    box-shadow: -5px -5px 6px #CCCCCC;
    transform: translate(2px, 2px);
}

.folded {
    display: none;
    /* Initially hide the folded images */
}

.folded.show {
    display: block;
    /* Show images when the show class is added */
}

.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 {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Allow scrolling within the modal if needed */
    background-color: rgba(0, 0, 0, 0.9);
    touch-action: manipulation;
}

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

/* Modal Button styling */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    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 {
    height: var(--footer-height);
    width: 100%;
    background-color: #333;
    color: #fff;
    padding: 1rem;
}
