:root {
    --accent1: #54839b;
    --bg1: #e6f7f9;
    --mid1: #c5e9ec;

    --accent2: #db8585;
    --bg2: #fde9e9;
    --mid2: #ffbcbc;
}

body {
    margin: 0;
    color: #626262;
    font-family: "Nunito", sans-serif;
    background-image: url(images/gallerybg.gif);
    background-attachment: fixed;
}

a {
    color: #626262;
}

sup {
    font-size: 10px;
}

h3 {
    font-family: "Alan Sans", sans-serif;
}

.footnote {
    display: none;
    width: 170px;
    padding: 3px;
    background-color: white;
    border: 2px dotted black;
    border-radius: 0.25em;
    text-align: center;

    position: absolute;
    z-index: 100;
    bottom: 70%;
    left: 50%;
}

sup:hover + .footnote {
    display: block;
}

.container {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-gap: 20px;
    grid-template:
        "sidebar main"
        / 300px 1fr;
}

aside {
    grid-area: sidebar;
    width: 220px;
    height: 100%;
    margin: 0;
    padding: 20px;
    position: fixed;
    z-index: 99;
    background-color: white;
    border-inline: 2px dashed var(--accent1); /* border & outline styles referenced nomnomnami's pastille template */
    outline: 4px solid white;
    display: flex;
    flex-direction: column;
    text-align: center;
    font-size: 15px;
}

footer {
    width: 220px;
    padding: 20px;
    position: fixed;
    bottom: 2px;
    font-size: small;
    text-align: center;
}

.icon {
    width: 170px;
    height: 170px;
    margin: 30px auto;
    outline: 2px solid var(--accent1);
    transition: 0.2s;
    border-radius: 50%;
    background-color: white;
    overflow: hidden;
}

.icon:hover {
    outline: 2px solid var(--accent1);
    outline-offset: 4px;
}

.icon a img {
    width: 170px;
    height: auto;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    color: var(--accent1);
}

nav {
    margin: 20px auto;
    display: flex;
    justify-content: space-evenly;
}

nav li a {
    min-width: 120px;
    height: 20px;
    margin: 8px;
    padding: 5px;
    display: inline-block;
    text-align: center;
    outline: 2px solid var(--accent1);
    transition: 0.2s;
    background-color: #e6f7f9;
    border-radius: 1rem;
}

nav li a:visited {
    color: var(--sidebar-text);
}

nav li a:hover {
    background: var(--bg2);
    color: var(--accent2);
    outline: 2px solid var(--mid2);
    outline-offset: 3px;
    text-decoration: none;
}

footer {
    margin-bottom: auto;
    z-index: 100;
}

main {
    grid-area: main;
    width: 800px;
    min-height: 795px;
    background-image: url(images/gallerymainbg.png);
}

#pin {
    width: 90%;
    position: relative;
    margin: 1rem auto;
    padding: 20px;
    background-color: #e6f7f9;
    border: 2px solid var(--accent1);
    border-radius: 1rem;
}

#pin summary {
    font-size: 1.2em;
    font-family: "Alan Sans", sans-serif;
    border-bottom: 2px dashed var(--accent1);
}

#pin label {
    background: var(--mid1);
    padding: 3px 11px 4px 3px;
    border: 1.5px solid var(--accent1);
    border-radius: 0.5em;
    display: inline-block;
    margin-left: 0.5em;
}

#pin label:hover {
    background: var(--mid2);
    text-decoration: underline;
}

#pin label:has(input:checked) {
    background: var(--bg2);
    text-decoration: underline;
}

#pin input {
    appearance: none;
}

.tagged:has(input:checked) .img {
    display: none;
}

.tagged:has(#all:checked) article,
.tagged:has(#me:checked) article[class~="me"],
.tagged:has(#oc:checked) article[class~="oc"],
.tagged:has(#fanart:checked) article[class~="fanart"] {
    display: inline-block;
}

#gallerymain {
    margin: 25px;
}

.gallery {
    display: flex;
    justify-content: space-evenly;
    flex-flow: wrap;
    gap: 20px;
}

.img {
    width: 130px;
    height: 130px;
    border: 1px dotted black;
    overflow: hidden;
}

.img > img {
    width: 130px;
    height: 130px;
    object-fit: cover;
}

/* modal code from w3schools */

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 111; /* Sit on top */
    padding-top: 100px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0, 0, 0); /* Fallback color */
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
}

/* Modal Content (image) */
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

/* Caption of Modal Image */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}
