@layer overrides, semantic, site;

@import url("//cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css") layer(semantic);

@layer site {
:root {
    color-scheme: light dark;
    --borderRadius: 5px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --tocBg: #ffffff15;
        --blockquoteBg: #f9f9f9;
        --codeBg: #c0c9c833;
        --preBg: #ffffff70;
        --boxShadow: 1px 1px 10px 0px rgba(0, 0, 0, 1);
        --cardBoxShadow: 1px 1px 5px 0px rgba(0, 0, 0, 1);
        --avatarShadow: 0 0 0 0.1rem #fff, 0 0 0 0.4rem #eee;
        --textShadow: 0 5px 10px rgba(0, 0, 0, 0.5);
        --textShadowHover: 0 8px 20px rgba(0, 0, 0, 0.95);
        --shareText: #3e3e3e;
        --sidebarLinkText: #ffffffd6;
        --sidebarLinkHover: #ffffff;
        --tagItemHover: rgba(255, 255, 255, 0.18);
        --introText: #ddd;
        --utilityGradient: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.2) 21%);
        --colorOverlay: rgba(0, 0, 0, 0.6);
        --cardBar: #917d7d;
        --postBg: #21252e;
        --uiText: #b9bac0;
        --aboutBg: #21252e;
        --linkText: #6aa3db;
        --blogCardText: #cdced3;
        --red: #924848;
        --important: #c00a0a;
        --caution: #f1ff34;
        --info: #3761df;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --tocBg: #ffffff70;
        --blockquoteBg: #f9f9f9;
        --codeBg: #c0c9c833;
        --preBg: #ffffff70;
        --boxShadow: 1px 1px 10px 0px rgba(0, 0, 0, 1);
        --cardBoxShadow: 1px 1px 5px 0px rgba(0, 0, 0, 1);
        --avatarShadow: 0 0 0 0.1rem #fff, 0 0 0 0.4rem #eee;
        --textShadow: 0 5px 10px rgba(0, 0, 0, 0.5);
        --textShadowHover: 0 8px 20px rgba(0, 0, 0, 0.95);
        --shareText: #3e3e3e;
        --sidebarLinkText: #ffffffd6;
        --sidebarLinkHover: #ffffff;
        --tagItemHover: rgba(255, 255, 255, 0.18);
        --introText: #ddd;
        --utilityGradient: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.2) 21%);
        --colorOverlay: rgba(0, 0, 0, 0.6);
        --cardBar: #BDA26B;
        --postBg: #ececece8;
        --uiText: #000;
        --aboutBg: #1b1c1ded;
        --linkText: #4183c4;
        --blogCardText: #ffffff;
        --red: #db2828;
        --important: #c00a0a;
        --caution: #f1ff34;
        --info: #3761df;
    }
}

/*Fonts*/
@font-face {
    font-family: 'Abril Fatface';
    src: url('../fonts/AbrilFatface-Regular.otf') format('opentype');
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/SourceSansPro-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Droid Serif Italic';
    src: url('../fonts/DroidSerif-Italic.ttf') format('truetype');
}

@font-face {
    font-family: 'Inconsolata';
    src: url('../fonts/Inconsolata.otf') format('opentype');
}

/*
Mobile view
It doesn't make sense to split these ones
*/

@media screen and (max-width: 767px) {

    ::-webkit-scrollbar {
        width: 2vw;
    }
    .post-head {
        font-size: 2rem;
    }
    .post-head,
    .dream-tags,
    .copyright,
    .disqus {
        padding-top: 1rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/*Site settings*/

html {
    font-size: 12px;

    @media screen and (min-width: 400px) {
        font-size: 16px;
    }
}

body,
body.pushable {
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover !important;
}

a {
    color: var(--linkText);
}

.anchor {
    visibility: hidden;

    h1:hover &,
    h2:hover &,
    h3:hover &,
    h4:hover &,
    h5:hover &,
    h6:hover &,
    h7:hover &,
    h8:hover &,
    h9:hover & {
        visibility: visible;
    }
}


li:not('.toc') {
    line-height: 1.4285;
}

.row.box {
    position: relative;
    display: flex;
    flex-direction: row;
}

.column-box {
    display: flex;
    flex-direction: column;
}

.flexbox {
    .both& {
        flex: 1 1 auto;
    }

    .none& {
        flex: 0 0 auto;
    }

    .shrink& {
        flex: 0 1 auto;
    }

    .grow& {
        flex: 1 0 auto;
    }
}

.glass {
    backdrop-filter: blur(5px);
}

.pusher {
    background-color: transparent !important;
    perspective: 100rem;
    height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    overflow-y: auto !important;

    &.dimmed {
        overflow-y: hidden !important;
    }

    &::-webkit-scrollbar {
        width: 5px;

        @media screen and (min-width: 768px) {
            width: 2vw;
        }

        @media screen and (min-width: 992px) {
            width: 0.8vw;
        }
    }

    &::-webkit-scrollbar-thumb {
        background: #aaa;
        background-color: rgba(255, 255, 255, 0.4);

        &:hover {
            background-color: rgba(255, 255, 255, 0.6);
        }



    }
}

.ui {
    &.secondary.segment {
        background-color: var(--postBg);
        padding: auto 1.5rem 0 1.5rem;
        color: var(--uiText);
    }

    &.grid {
        margin-left: 0;
        margin-right: 0;
    }

    &.label {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    &.inverted.segment {
        background-color: var(--aboutBg);
    }
}

ul>li {
    margin-bottom: 0.2rem;
}

/*About section*/

.about,
.four-o-four {
    height: auto;
    overflow-y: hidden;
}

.about .twemoji {
    font-size: 1.1rem;
}

.four-o-four .twemoji {
    text-align: center;
}

/*Top nav bar*/

.top.bar {
    background-color: #00000066;
    overflow-y: hidden;
    height: 7vh;
    overflow-x: auto;

    @media screen and (max-width: 767px) {
        .item {
            margin: 0;
            padding-right: 0;
        }

        &::-webkit-scrollbar {
            display: none;
        }
    }
}

/*Post settings*/

.post-title {
    color: var(--uiText);
    font: bold 3rem 'Source Sans Pro';
    margin-bottom: 1px;

    .sub {
        &.title {
            font-size: 2rem;
        }

        &.header {
            letter-spacing: 0.05rem;
            font: 1.4rem 'Source Sans Pro';
        }
    }
}

.sub {
    &.header {
        div {
            display: inline-block;

            &:not(:last-child) {
                margin-right: 1rem;
            }
        }

        span {
            white-space: nowrap;
        }

        i:not(.comment) {
            margin-right: 0.1rem !important;
        }
    }
}

.toc {
    font-size: 1.1rem;
    line-height: 1;
    background-color: var(--tocBg);
    border: 1px solid #8a8a8a6b;
    border-radius: var(--borderRadius);
    margin-bottom: 10px;
    overflow-x: auto;
}

.post-list {
    height: auto;
    width: auto;
    overflow: hidden;

    .cards {
        flex-wrap: wrap;
    }
}

.post-content {
    font-size: 1.1rem;

    @media screen and (max-width: 600px) {
        p img:not(.emoji),
        ul li img {
            max-width: 100% !important;
        }
    }

    @media screen and (max-width: 767px) {
        img:not(.emoji) {
            max-width: 100%;
        }
    }

    blockquote {
        background: val(--blockquoteBg);
        border-left: 8px solid #ccc;
        padding: 0.4rem 0.8rem;
        margin: 0.5rem 0 0.5rem 0;
    }

    ul+blockquote {
        margin-left: 2.5rem;
    }

    code {
        font-size: 0.8rem;
        background-color: val(--codeBg);
        padding: 0 0.2rem;
        border: 1px solid #929696;
        border-radius: 0.2rem;
    }

    pre {
        background: var(--preBg);
        border: 1px solid #8a8a8a6b;
        border-radius: var(--borderRadius);
        overflow-x: auto;

        code {
            font-family: 'Inconsolata', monospace;
            font-size: 1.2rem;
            background-color: unset;
            padding: initial;
            border: unset;
        }
    }

    img:not(.emoji) {
        position: relative;
        max-width: 80%;
        display: block;
    }
}

blockquote {
    &.alert {
        border-left-width: 3px;

        &.alert-note {
            border-left-color: var(--info);
        }

        &.alert-important {
            border-left-color: var(--important);
        }

        &.alert-tip {
            border-left-color: var(--info);
        }

        &.alert-caution {
            border-left-color: var(--caution);
        }

        &.alert-warning {
            border-left-color: var(--important);
        }
    }
}

p>img:not(.emoji),
li>img {
    box-shadow: var(--boxShadow);
    margin: 1rem auto;
}

.emoji {
    height: 1.1rem;
    width: 1.1rem;
    vertical-align: -0.15rem;
    background-color: transparent;
}

.youtube {
    &.container {
        position: relative;
        margin: auto auto 1rem auto;
        width: 80%;
        padding-bottom: 45%;
        box-shadow: var(--boxShadow);

        .youtube {
            position: absolute;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
    }

    @media screen and (max-width: 600px) {
        width: 100% !important;
    }
}

/*Syntax Highlighting*/

.highlight {
    border-radius: var(--borderRadius);
    margin-bottom: 1rem;
    margin-top: 1rem;
    border: 1px solid #8a8a8a6b;

    pre {
        background: initial;
        padding: initial;
        border: initial;
        border-radius: initial;
    }

    &>div {
        height: auto;
        width: 100%;
        max-height: 30rem;
        overflow-y: auto;
        padding: 0 2px 0 2px;

        &::-webkit-scrollbar {
            width: 8px;
        }
    }

    table {
        overflow-y: hidden;
    }
}

.chroma {
    padding: 0 0.2rem 0 0.2rem;
}

/*Share card*/

.share {
    align-items: center;
    width: 100%;
    flex-wrap: wrap;

    .name {
        margin-bottom: 1px;
        display: block;
        color: val(--shareText);
        font: bold 1.2rem 'Lato';
        transition: 1s;

        &:hover {
            text-decoration: underline;
        }
    }

    .desc {
        display: block;
        color: val(--shareText);
        font-size: 0.9rem;
    }

    .buttons {
        margin: auto;
        margin-right: 0;
        flex-wrap: wrap;
    }
}

.author .avatar {
    height: 5rem;
    width: 5rem;
    margin: auto;
    border-radius: 50%;
    box-shadow: var(--avatarShadow);
}

.info {
    max-width: 60%;
    margin-left: 1rem;
}


.spacer {
    min-width: 1rem;
}

.facebook {
    align-self: flex-start;
    width: 7.5rem;
    margin-right: 0.1rem;
    transition: 1s;
}

.twitter {
    align-self: flex-end;
    margin-left: 0.1rem;
    width: 7.5rem;
    transition: 1s;
}

.twitter:hover,
.facebook:hover {
    opacity: 0.8;
}

/*Flip settings*/

.flipper {
    transition: 0.8s;
    transform-style: preserve-3d;
    position: relative;

    .flip-it & {
        transform: rotateY(180deg);
    }
}

/*Page sections, front and back*/

.front,
.back {
    min-height: 100vh;
    background: inherit;
    backface-visibility: hidden;
    height: auto;
    width: 100vw;
    position: absolute;
}

.front {
    z-index: 2;
    transform: rotateY(0deg);
}

.back {
    transform: rotateY(180deg);
    padding-bottom: 1rem;
}

/*Sidebar*/

#sidebar {
    display: flex;
    flex-flow: column;
    overflow: hidden;
    min-height: 100vh;

    #author {
        border-radius: 0;
        border-top: 0;
    }

    #footer {
        border-radius: 0;
        border-bottom: 0;
    }

    &::-webkit-scrollbar {
        width: 4px;
    }

    .content {
        &.active,
        &.animating {
            font-size: 14px;
            padding: 0.1rem 0.1rem 0 1.5rem;
        }

        a i {
            position: absolute;
            left: 0.3rem;
            top: 25%;
        }
    }


    .item {
        padding: 0.3rem 0.3rem 0.3rem 2rem;
        color: white;

        &:before {
            background: transparent;
        }
    }

    .link {
        color: var(--sidebarLinkText);

        &:hover {
            color: var(--sidebarLinkHover);
        }
    }
}

#author .sub.header {
    color: var(--sidebarLinkHover);
}

/*Header*/

#header {
    padding: 0;

    section,
    header,
    footer {
        background-color: transparent;
    }

    .title.header-title,
    .active.title.header-title,
    .title.active.header-title {
        padding: 0;
    }
}

.dream-categories::-webkit-scrollbar {
    width: 4px;
}

#tag-category-pop {
    margin-top: 1px;

    &.ui.red.label {
        border-color: var(--red) !important;
        color: var(--uiText) !important;
    }
}

.hand.point.icon {
    position: relative;
    transition: 0.4s;
    backface-visibility: visible;

    &.active {
        transform: rotateX(180deg);
    }
}

#tag-category {
    padding-bottom: 0;

    &.active {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
    }

    div {
        a {
            color: var(--sidebarLinkText);
        }

        .link {
            color: var(--sidebarLinkText);

            &:hover {
                color: var(--sidebarLinkHover);
            }
        }
    }

    a p {
        padding-left: 2rem;
    }

    .accordion {
        margin-top: 0;
    }

    .item i {
        position: absolute;
        left: 0;

        div {
            position: relative;
            padding-top: 0.3rem;
            padding-bottom: 0.3rem;
            transition: 0.5s;

            &:hover {
                background-color: var(--tagItemHover);
            }
        }
    }

    .content, .content.active, .content.animating {
        padding: 0.1rem 0 0.1rem 1.6rem;
    }

    .content a i {
        position: absolute;
        left: 0.3rem;
        top: 20%;
    }

    .dream-tags {
        overflow: hidden;
        height: auto;
    }

    .dream-categories {
        overflow-x: hidden;
        max-height: 15rem;
    }
}

#tag-category,
#tag-category.active {
    padding-top: 0;
}

/*Card settings*/

@keyframes changeLetter {
    0% {
        width: 10%;
    }
    100% {
        width: 80%;
    }
}

.intro {
    margin: auto;
    font: 200 1.2rem 'Droid Serif Italic';
    line-height: 1.2;
    width: 80%;
    color: var(--introText);
    opacity: 0;
    transition: 0.4s;
    z-index: 2;
    max-height: 6rem;
    height: 0;
}

.utility-info {
    position: absolute;
    height: auto;
    padding-left: 1rem;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    text-align: left;
    transition: 0.4s;
    background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.1) 21%);

    span {
        font-size: 1rem;
        white-space: nowrap;
    }
}

.title-content {
    position: absolute;
    bottom: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    z-index: 2;
    width: 100%;
    transition: all 0.4s;
    padding-left: 1rem;
    padding-right: 1rem;

    @media screen and (max-width: 300px) {
        top: 30px;
    }
}

.color-overlay {
    position: absolute;
    background: rgba(0, 0, 0, 0.4);
    height: 100%;
    width: 100%;
    z-index: 1;
    top: 0;
    left: 0;
    transition: background 0.4s cubic-bezier(0.33, 0.66, 0.66, 1);
}

.card {
    &.title-content {
        opacity: 0;
        bottom: 0;
        transition: 1s;
    }

    &.color-overlay {
        background: rgba(0, 0, 0, 0);
    }
}

.blog-card {
    position: relative;
    width: calc(100% - 2rem);
    margin-bottom: 1rem;
    margin-right: auto;
    margin-left: auto;
    overflow: hidden;
    color: var(--blogCardText);
    transition: 0.4s;
    background: var(--sidebarLinkHover);
    box-shadow: var(--cardBoxShadow);
    z-index: 0;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 425px;
    container-type: size;

    @media screen and (min-width: 1386px) {
        width: calc(50% - 2rem);
        margin-right: 0.5rem;
        margin-left: 0.5rem;
    }

    &:hover {
        box-shadow: var(--boxShadow);

        h3:after {
            animation: changeLetter 0.3s 1 linear;
            width: 80%;
        }

        .title-content {
            bottom: 6rem;

            @container (max-width: 510px) {
                bottom: 7.5rem;
            }
        }

        .card.title-content {
            opacity: 1;
            bottom: 0;
        }

        .intro {
            opacity: 1;
        }

        .utility-info {
            background: var(--utilityGradient);
        }

        .color-overlay {
            background: var(--colorOverlay);
        }
    }

    h3:after {
        content: " ";
        display: block;
        width: 10%;
        height: 0.2rem;
        margin: 0.5rem auto;
        border: 0;
        z-index: 2;
        background: var(--cardBar);
        transition: all 0.4s;
    }

    .title {
        color: var(--blogCardText);
        font: 400 2rem 'Abril Fatface', cursive;
        letter-spacing: 1px;
        text-shadow: var(--textShadow);
        transition: 0.4s;

        &:hover {
            text-shadow: var(--textShadowHover);
        }
      }

    .sub.title {
        font: 400 1rem 'Abril Fatface';
    }
}

.utility-list {
    list-style-type: none;
    padding: 0;

    div {
        display: inline-block;

        &:not(:last-child) {
            margin-right: 1rem;
        }
    }

    span {
        @media screen and (max-width: 300px) {
            font-size: 1.2rem !important;
        }
    }
}

.license.statement {
  font-size: 1.1rem;
  padding-left: 1rem;
  margin: auto;
}

/* Search */

.searchHint {
    color: var(--uiText);
    padding: .5rem;
    opacity: 1;
    transition: 1s;

    .icon {
        margin-left: .5rem;
    }
}

#fastSearch {
    visibility: hidden;
    display: inline-block;
    position: absolute;
    left: 40%;
    top: 1rem;
    width: 30rem;
    border-radius: var(--borderRadius);
    background-color: color-mix(in lch, var(--postBg), transparent 5%);
    border: 1px solid color-mix(in lch, var(--postBg), white 20%);

    input {
        padding: 4px 10px;
        width: 100%;
        height: 3rem;
        font-size: 1.6rem;
        font-weight: bold;
        border: none;
        outline: none;
        text-align: left;
        display: inline-block;
        background: transparent;
        color: var(--sidebarLinkText);
    }

    > ul {
        position: relative;
        margin: 0;
        padding: 0;
        border-radius: var(--borderRadius);
        background-clip: border-box;

        > li {
            border-bottom: 1px dotted color-mix(in lch, var(--postBg), white 20%);
            border-radius: var(--borderRadius);
            background-clip: border-box;
        }

        li {
            list-style: none;
            margin-left: 0;
            margin-bottom: 0;

            &.title {
                font-size: 1.1rem;
                margin-bottom: 10px;
                display: inline-block;
            }

            > a {
                text-decoration: none !important;
                padding: 10px;
                display: inline-block;
                width: 100%;
                color: var(--sidebarLinkText);

                &:hover, &:focus {
                    outline: 0;
                    background-color: color-mix(in lch, color-mix(in lch, var(--postBg), black 30%), transparent 50%);
                    color: var(--sidebarLinkHover);
                    border-radius: var(--borderRadius);
                    background-clip: border-box;
                }
            }
        }
    }
}

} /* /layer */


/* Fun with layers!
    This layer forces overrides of certain values that Semantic UI has
    stuck !important on. We can use layers to say no, we really do want it this other color.
*/
@layer overrides {
    @media (prefers-color-scheme: dark) {
        .ui.label {
            &.green, &.red, &.olive, &.orange, &.yellow, &.purple, &.pink, &.teal, &.violet, &.blue {
                filter: brightness(80%);
            }
        }
    }
} /* /overrides */
