* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --h1-size: 2.027rem;
    --h2-size: 1.802rem;
    --h3-size: 1.602rem;
    --h4-size: 1.424rem;
    --h5-size: 1.266rem;
    --h6-size: 1.125rem;
}

body {
    background: #fcf2e8 url(bg.png) fixed;
    letter-spacing: 1px;
    font-family: "Karla";
    font-size: 16px;
    line-height: 1.2rem;
    font-weight: 400;
    color: #9e847f;
    letter-spacing: 0rem;
}

img {
    border: 0;
    border-radius: 4px;
}

#main {
    width: 90%;
    max-width: 670px;
    margin: 20px auto;
}

#left {
    float: left;
    width: 170px;
    margin: 0 auto;
}

#left-inner {
    padding: 4px;
    background: transparent;
}
#header-bow {
    display: block;
    margin: auto;

    &:hover {
        transform: rotate(5deg);
    }
}

#navigation {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
}

button {
    font-size: inherit;
    font-family: inherit;
    color: #E790A5;
    font-weight: 700;

    &.btn {
        filter: none;
    }
}

.btn {
    cursor: pointer;
    border-width: 4px;
    border-style: solid;
    border-image: url("btnborder.png") 6 fill round;
    margin-bottom: 8px;
    padding: 4px 6px;
    filter: drop-shadow(0px 1px 0px #eed5cb);
    font-weight: 700;

    & a:not(.index-link) {
        text-decoration: none;
    }

    &.off {
        filter: grayscale(1);
        pointer-events: none;
    }

    &:hover {
        transform: translateY(1px);
        filter: none;
    }
}

#right {
    width: calc(100% - 170px);
    max-width: 500px;
    float: left;
    margin: 0 auto;
}

#right-inner {
    padding: 8px 8px 8px 16px;
}

.disclaimer {
    border-width: 4px;
    border-style: solid;
    border-image: url("btnborder.png") 6 fill round;
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 8px;
    filter: drop-shadow(0px 1px 0px #eed5cb);
    word-break: break-word;
}

#description {
    padding: 12px;
    margin-top: 0px;
}

.title {
    transform: translateZ(0); 
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #a2b5c2;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px dotted #f1dbd1;
}

.post {
    position: relative;
    transform: translateZ(0); 
    border-width: 20px;
    border-style: solid;
    border-image-source: url("bd.png");
    border-image-slice: 41 fill;
    border-image-width: 20px;
    border-image-repeat: round;
    background-color: white;
    background-clip: padding-box;
    margin-bottom: 8px;
    padding: 4px 2px 2px 2px;
    filter: drop-shadow(0px 1px 0px #eed5cb);

    & .title {
        display: flex;
        justify-content: space-between;
        

        & .date {
            min-width: fit-content;
            align-self: flex-end;
        }
    }

    & .bows {
        display: flex;
        position: absolute;
        top: -16px;
        left: -20px;
        & img {
            width: 20px;
        }
        column-gap: 4px;
    }

    & img, & audio, & video {
        max-width: 100%;
    }

    &.red {
        border-image: url("bd_red.png") 41 fill round;
    }
    &.orange {
        border-image: url("bd_orange.png") 41 fill round;
    }
    &.yellow {
        border-image: url("bd_yellow.png") 41 fill round;
    }
    &.green {
        border-image: url("bd_green.png") 41 fill round;
    }
    &.cyan {
        border-image: url("bd_cyan.png") 41 fill round;
    }
    &.blue {
        border-image: url("bd_blue.png") 41 fill round;
    }
    &.purple {
        border-image: url("bd_purple.png") 41 fill round;
    }
    &.pink {
        border-image: url("bd_pink.png") 41 fill round;
    }
    &.gray {
        border-image: url("bd_gray.png") 41 fill round;
    }
    &.white {
        border-image: url("bd_white.png") 41 fill round;
    }

}

p {
    margin-block-end: 0.5rem;
}

a:not(.index-link) {
    text-decoration: 2px underline rgba(231, 144, 165, 0.2);
    text-underline-offset: 2px;
    color: #E790A5;

    &:hover {
        color: #BD6A7E;
        text-decoration: 2px underline rgba(231, 144, 165, 0.4);
    }

    &:not(:hover):visited {
        color: #6f92aa;
        text-decoration: 2px underline rgba(111, 146, 170, 0.2);
    }

    &:focus, &:focus-visible, &:focus-within {
        outline: none;
    }
}

b {
    color: #a2b5c2;
}
em, i {
    color: #BD6A7E;
}

hr {
    border: none;
    border-top: 2px dotted #f1dbd1;
    margin: 16px 0px;
}



*::selection {
    background-color: #e4f0f7;
}

h1,h2,h3,h4,h5,h6 {
    color: #a2b5c2;
    margin-bottom: 12px;
}

h1 {
    font-size: var(--h1-size);
}
h2 {
    font-size: var(--h2-size);
}
h3 {
    font-size: var(--h3-size);
}
h4 {
    font-size: var(--h4-size);
}
h5 {
    font-size: var(--h5-size);
}
h6 {
    font-size: var(--h6-size);
}

blockquote {
    padding-left: 10px;
    border-left: 2px solid #a2b5c2;
    margin: 8px 0;
}

::-webkit-scrollbar-thumb {
    background-color: #fff;  
    border-radius: 20px;
    border:1px solid #e0c2b6;
}
  
::-webkit-scrollbar {
    width: 8px; 
    background: #fcf6ee;
}

#close-refs {
    position: absolute;
    right: 8px;
    top: 4px;
    color: #e0c2b6;

    &:hover {
        color: #9e847f;
        cursor: pointer;
    }
}

ul {
    line-height: 1.4rem;
    padding-left: 0.5rem;
    list-style-position: outside;

    & li {
        padding-left: 8px;

        &::marker {
        color: #E790A5;
        content: '•';
        
        }
    }
}

#filters, #index-list {
    padding-left: 2px;
}

#filters li {
    padding-left: 0;

    &:hover {
        color: #6f92aa;
        text-decoration: 2px underline rgba(111, 146, 170, 0.2);
        cursor: pointer;
    }

    & img {
        margin-right: 8px;
        display: inline;
        margin-bottom: -2px;
    }

    &::marker {
        color: transparent;
    }
}

#index-list li {
    color: #9e847f;
    padding-left: 0;

    & .index-link {
        color: #9e847f;
        text-decoration: none;

        &:hover {
            color: #6f92aa;
            text-decoration: 2px underline rgba(111, 146, 170, 0.2);
        }
    }

    &::marker {
        color: transparent;
    }
}

#index-toggle {
    & summary::-webkit-details-marker,
    & summary::marker {
        display: none;
        content: none;
    }

    & summary .title::after {
        content: ' >';
        position: absolute;
        top: 0px;
        right: 0px;
        color: #a2b5c2;
    }
    &[open] summary .title::after {
        content: " >";
        transform: rotate(90deg);
    }
}


@media (max-width: 520px) {
    #main {
        width: 90%;
    }
    #left, #right {
        float: none;
        width: 100%;
    }
    #right-inner {
        padding-right: 0;
        padding-left: 0;
        padding-top: 12px;
    }
    #navigation {
        justify-content: center;
        column-gap: 24px;
    }
    /*#references {
        position: absolute;
        left: 20px;
        top: 24px;
        padding-right: 20px;
        z-index: 99;
    }*/
    #left-container {
        display: flex;
        column-gap: 12px;
        
        & > * {
            flex: 1 1 0;
            height: fit-content;
        }
    }
    #index {
        order: 1;
    }
    #references {
        order: 2;
    }
}
@media (min-width: 520px) {
    #close-refs {
        display: none;
    }
}

#landpage {
    min-height: 90vh;
    display: flex;
    align-items: center;
}
#landpage-inner {
    display: flex;
    flex-direction: column;
    margin: auto;
    justify-items: center;
    align-items: center;
}

#top-btn {
    background-image: url(/resources/top-page.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 60px;
    width: 60px;
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 99; 
    border: none; 
    outline: none; 
    background-color: transparent; 
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    text-shadow: 2px 0 #E790A5, -2px 0 #E790A5, 0 2px #E790A5, 0 -2px #E790A5, 1px 1px #E790A5, -1px -1px #E790A5, -1px 1px #E790A5, 1px -1px #E790A5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 500ms;

    &:hover {
        background-image: url(/resources/top-page-h.png);
        color: #FDF5EC;
    }
    & span {
        display: inline-block;
        margin-top: 10px;
    }
    &.show {
        opacity: 1;
        pointer-events: all;
    }
}

.two-cols {
    display: flex;
    flex-wrap: wrap;
    container-type: inline-size;
    container-name: right;
    column-gap: 12px;
    margin-bottom: 12px;
    
    & > * {
        flex: 1 1 0;
    }
}

@container right (width < 300px) {
    .two-cols > * {
        flex: 100%;
    }
}