/* ========= SIDEBAR ========= */
main {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

.sidebar {
    z-index: 1;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: var(--space-sm);
    position: sticky;
    /* box-shadow: 0 0 30px 1px var(--bg-accent); */
    border-right: 1px solid var(--bg-accent);
    box-shadow: 0 0 30px 1px #000;
    top: 0;
    left: 0;
    font-weight: 600;
    justify-content: flex-start;
    gap: var(--space-xx);
}


.sidebar a {
    font-size: 1.2rem;
    color: var(--text);
    border-radius: var(--radius);
    width: 100%;
    display: block;
    padding: var(--space-sm) var(--space-lg);
}

.sidebar a:hover, .sidebar a.active {
    color: var(--text);
    background-color: var(--bg-accent);
}

.sidebar ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

#site-title {
    color: white;
    padding: 0;
    margin: 0;
    text-align: center;
}

#content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    width: 100%;
    padding: var(--space-lg);
}

/* ========= SECTION ========= */
.section-hero {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--bg-accent);
}

.section-hero-main {
    min-width: 30vw;
    flex: 1;
}

.section-hero-description {
    color: var(--text-secondary);
}

.section-hero-count {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: var(--font-small);
}

.section-hero-image {
    min-width: 40vw;
    flex: 1;
    margin: 0;
    max-width: 100%;
    order: 1;
}

/* ========= POST PREVIEW ========= */
.section-container {
    max-width: 80vw;
    margin: auto;
}
.preview-list {
    width: 90%;
    margin: auto;
    display: grid;
    gap: var(--space-md);
    grid-template-columns: 1fr 1fr 1fr;
    margin-top: 2rem;
}

.taxonomy-preview-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: 2rem;
}


.preview-card {
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    border: 2px solid var(--bg-accent);
    border-radius: var(--radius);
    /* height: 24rem; */
    height: 100%;
    justify-content: space-between;
}


.term-preview-card {
    background-color: var(--bg);
    display: flex;
    flex-direction: row;
    border: 2px solid var(--bg-accent);
    border-radius: var(--radius);
    /* height: 24rem; */
    height: 100%;
    justify-content: space-between;
    padding: 1rem;
}
.term-preview-description {
    margin: auto 0 auto 0;
    width: 50%;
}
.term-preview-title {
    width: 50%;
}

.preview-hero h3 {
    padding: .5rem 1rem 0 1rem;
}

.preview-hero a, .preview-image a {
    color: var(--text);
}

.preview-image {
    overflow: hidden;
    position: relative;
    /* transition: transform .3s; */
}

.preview-image img {
    aspect-ratio: 16/9;
}

.preview-hero:hover .preview-image {
    color: var(--text);
    /* transform: scale(1.05); */
}

.featured-card {
    max-width: 35vw;
    position: relative;
}

.featured-title {
    width: 100%;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.featured-list {
    padding: var(--space-xs);
    justify-content: center !important;
}

.preview-hero:hover .preview-title {
    /* color: var(--primary); */
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-decoration-thickness: 3px;
}

.preview-image a:hover {
    color: var(--text);
}

.preview-footer {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.tag-list {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: var(--space-xs);
    width: 100%;
}

.preview-tag {
    color: var(--secondary);
    font-size: var(--font-small);
    border-radius: .3rem;
    padding: .1rem .2rem;
    border: 1px solid var(--secondary);
}

.preview-time {
    position: absolute;
    right: var(--space-xs);
    bottom: var(--space-xs);
    background-color: rgba(var(--bg-rgb), .9);
    padding: 5px var(--space-xs) 5px var(--space-xs);
    border-radius: var(--radius);
    font-size: var(--font-xs);
}

.preview-date {
    position: absolute;
    right: var(--space-xs);
    top: var(--space-xs);
    background-color: rgba(var(--bg-rgb), .9);
    padding: 5px var(--space-xs) 5px var(--space-xs);
    border-radius: var(--radius);
    font-size: var(--font-xs);
}

.preview-description {
    color: var(--text-secondary);
    font-size: var(--font-small);
}

.preview-content {
    /* margin-top: var(--space-xs); */
    /* padding: 0 var(--space-xs) 0 var(--space-xs); */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0rem 1rem 1rem 1rem;
}


/* ========= POST ========= */
.post-hero {
    display: flex;
    flex-direction: row;
    flex-wrap: no-wrap;
    justify-content: space-around;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--bg-accent);
    max-width: 70vw;
    margin: auto;
}

.post-hero h1 {
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-decoration-thickness: 3px;
}

.post-hero-footer {
    display: flex;
    flex-direction: row;
}

.post-hero-time {
    width: 100%;
    color: var(--text-secondary);
}

.post-hero-image {
    max-width: 40vw;
}
.post-hero-image img {
    aspect-ratio: 16/9;
}

.post-hero-content {
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}


.post-description {
    /* color: var(--text-secondary); */
    max-width: 30vw;
}

.post-time {
    color: var(--text-secondary);
}

.blog-post {
    max-width: 45vw;
    margin: auto;
    font-size: 1.2em;
}

.blog-post > * {
    margin-bottom: 2rem;
}

.blog-post h1, .blog-post h2,
.blog-post h3, .blog-post h4,
.blog-post h5, .blog-post h6 {
    font-size: 2em;
}

.highlight pre {
    padding: 1rem;
    border-radius: var(--radius);
}

footer {
    width: 100%;
    color: var(--text-secondary);
}

/* ========= HOME ========= */
.home-hero {
    width: 100%;
    position: relative;
}

.hero-author {
    position: absolute;
    height: 144px;
    border-radius: 100%;
    width: 144px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.home-hero h1 {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

.home-hero h2 {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
}

.home-content {
    display: flex;
    flex-direction: row;
    max-width: 80vw;
    margin: 0 auto 0 auto;
    gap: var(--space-lg);
}

.home-featured > ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.contact-main {
    width: 100%;
    margin: auto;
    text-align: center;
    font-size: 3em;
}

.hero-background {
    filter: brightness(50%) blur(3px);
    height: 100%;
    aspect-ratio: 16/9;
}

.recent-posts > ul {
    width: 100%;
    display: grid;
    gap: var(--space-md);
    grid-template-columns: 1fr 1fr 1fr;
    margin-top: 2rem;
}

.see-more {
    font-size: 2em;
    display: block;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
    border: 1px solid var(--bg-accent);
    border-radius: var(--radius);
}

code:not(pre code) {
    background-color: black;
    padding: .5rem .3rem;
    border-radius: var(--radius);
    font-family: monospace !important;
    white-space: nowrap;
    border: 1px solid var(--bg-accent);
}

pre {
    border-radius: var(--radius);
    font-family: monospace !important;
    border: 1px solid var(--bg-accent);
    overflow: scroll;
}

.github-button {
    color: var(--text) !important;
    border: 1px solid var(--text) !important;
    display: flex !important;
    justify-content: space-between !important;
    padding: var(--space-xs) var(--space-lg) !important;
    font-weight: semibold;
    font-size: 1.2rem;
    margin: auto 0 2rem 0;
}

.github-button > svg > path {
    /* fill-stone-100 group-hover:fill-black */
    fill: var(--text);
}

.section-title {
    background-color: black;
    border: 1px solid var(--bg-accent);
    padding: var(--space-xs);
    border-radius: var(--space-xs);
}

.glitch {
    display: inline-grid;
    grid-template-columns: 1fr;
}

.glitch span {
  font-weight: bold;
  grid-row-start: 1;
  grid-column-start: 1;
  --stack-height: calc(100% / var(--stacks) - 1px);
  --inverse-index: calc(calc(var(--stacks) - 1) - var(--index));
  --clip-top: calc(var(--stack-height) * var(--index));
  --clip-bottom: calc(var(--stack-height) * var(--inverse-index));
  clip-path: inset(var(--clip-top) 0 var(--clip-bottom) 0);
  animation: stack 340ms cubic-bezier(.46,.29,0,1.24) 1 backwards calc(var(--index) * 120ms), glitch 2s ease infinite 2s alternate-reverse;
}

.glitch span:nth-child(odd) { --glitch-translate: 8px; }
.glitch span:nth-child(even) { --glitch-translate: -8px; }

@keyframes stack {
  0% {
    opacity: 0;
    transform: translateX(-50%);
    text-shadow: -2px 3px 0 red, 2px -3px 0 blue;
  }
  60% {
    opacity: 0.5;
    transform: translateX(50%);
  }
  80% {
    transform: none;
    opacity: 1;
    text-shadow: 2px -3px 0 red, -2px 3px 0 blue;
  }
  100% { text-shadow: none; }
}

@keyframes glitch {
  0% {
    text-shadow: -2px 3px 0 red, 2px -3px 0 blue;
    transform: translate(var(--glitch-translate));
  }
  2% { text-shadow: 2px -3px 0 red, -2px 3px 0 blue; }
  4%, 100% { text-shadow: none; transform: none; }
}


/* ========= RESPONSIVENESS ========= */
@media (max-width: 1200px) {
    .preview-list {
        grid-template-columns: 1fr 1fr 1fr;
        width: 100%;
    }
    main {
        display: block;
    }
    .sidebar {
        flex-direction: row;
        justify-content: space-between;
        height: 100%;
        padding: var(--space-xs);
    }
    .sidebar .github-button {
        display: none !important;
    }
    .sidebar ul {
        flex-direction: row;
    }
    .sidebar a {
        padding: var(--space-xs) var(--space-lg);
    }
    .sidebar hr {
        display: none;
    }
    #site-title {
        margin: auto var(--space-xs) auto var(--space-xs);
    }
    .home-content {
        flex-direction: column;
    }
    .home-featured > ul {
        flex-direction: row;
    }
}

/* Desktops */
@media (max-width: 1000px) {
    .post-hero-image {
        display: none;
    }
    .preview-list {
        grid-template-columns: 1fr 1fr;
    }
    /* .post-hero-footer { */
    /*     flex-direction: column; */
    /* } */
    /* .tag-list { */
    /*     justify-content: flex-start; */
    /* } */
    .post-hero {
        width: 90vw;
    }
    .post-description {
        max-width: 55vw;
        margin: auto auto var(--space-md) auto;
    }
    .home-featured > ul {
        display: grid;
        /* grid-template-rows: 1fr 1fr; */
        grid-template-columns: 1fr 1fr;
    }
    .recent-posts > ul {
        grid-template-columns: 1fr 1fr;
    }
    .home-featured > ul > li > article {
        max-width: 100%;
    }
}
/* Tablets & etc */
@media (max-width: 768px) {
    .sidebar {
        justify-content: space-around;
    }
    .section-hero-main {
        min-width: 50vw;
    }
    .section-hero-image {
        display: none;
    }
    .preview-list {
        grid-template-columns: 1fr;
    }
    .recent-posts > ul {
        grid-template-columns: 1fr;
    }
    .sidebar a {
        padding: var(--space-xs) var(--space-md);
    }
    .blog-post {
        max-width: 70vw;
    }
    #site-title {
        display: none;
    }
    .contact-main {
        font-size: 2em;
    }
    .post-hero {
        padding: 0;
    }
    .post-hero-footer {
        flex-direction: column;
    }
    .post-hero-footer .tag-list {
        margin-top: var(--space-sm);
        justify-content: space-around;
    }
    .home-featured > ul {
        display: flex;
        flex-direction: column;
    }
    .home-featured > ul > li {
        margin: auto;
    }
    .home-hero h2 {
        display: none;
    }
}
/* Mobile */
@media (max-width: 480px) {
    .sidebar a {
        padding: .2rem .8rem;
    }
    .sidebar ul {
        gap: 0;
    }
    .contact-main {
        font-size: 1.5em;
    }
}
