/************/
/* DOCUMENT */
/************/

@font-face {
    font-family: "zephiecomic";
    src: url("/fonts/zephiecomic2.ttf");
}

:root {
    --blue: 50, 50, 255;
    --cyan: 50, 255, 255;
    --pink: 255, 50, 255;
    --red: 255, 50, 50;
    --yellow: 255, 255, 50;
    --green: 50, 255, 50;
}

* {
    box-sizing: border-box;
    color: white;
}

/* * > * {
    border: 1px solid grey !important;
} */

html {
    background-color: black;
}

body {
    max-width: 1000px;
    margin: auto;
    font-family: "zephiecomic", "BrightChalk", sans-serif;
    padding-bottom: 20px;
}

.sprite {
    background-size: 100%;
    background-image: url("/design/comix-sprites.png");
}

/**********/
/* HEADER */
/**********/

header {
    aspect-ratio: 10 / 1.33;
    background-image: url("/design/comix-header-boundary.png");
    background-size: 100%;
    background-repeat: no-repeat;
    display: grid;
    grid-template-columns: 34% 1fr;
    image-rendering: pixelated;
    position: relative;
}

.header-left {
    display: grid;
    max-width: 100%;
    grid-template-columns: 9% auto 9%;
    grid-template-areas: "pad1 logo pad2";
    align-items: center;
    justify-content: center;
}

.header-logo {
    max-width: 100%;
    background-position: 0 27.659574%;
    grid-area: logo;
}

.header-logo:hover {
    background-position: 0 0%;
}

.header-right {
    display: grid;
    grid-template-rows: 53% 47%;
    overflow: hidden;
}

.mobile-menu {
    display: none;
}

.header-carousel span {
    display: inline-block;
    opacity: 0.3;
    max-height: 100%;
    max-width: 100%;
    overflow: hidden;
}

.header-menu {
    display: flex;
    justify-content: space-around;
    padding-top: 5px;
    position: relative;
}

.header-button {
    height: 20px;
    background-repeat: no-repeat;
    background-position: 50%;
    background-size: 100%;
}

.header-button:hover {
    transform: scale(1.05);
}

.random-comic {
    background-image: url("/design/comix-random.png");
    width: 88px;
}

.random-comic:hover,
.random-comic:active {
    background-image: url("/design/comix-random-hover.gif");
}

.archive {
    background-image: url("/design/comix-archive.png");
    width: 70px;
}

.search {
    background-image: url("/design/comix-search.png");
    width: 67px;
    border: none;
    background-color: rgba(0, 0, 0, 0);
}

/**********/
/* SEARCH */
/**********/

.search-window {
    position: absolute;
    background-color: black;
    right: 10px;
    top: 90%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 10px 10px 10px;
    border-image-slice: 3 3 3 3;
    border-image-width: 3px 3px 3px 3px;
    border-image-outset: 1px 1px 1px 1px;
    border-image-repeat: round round;
    border-image-source: url("/design/comix-preview-border.png")
}

.search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
}

.search-label {
    font-weight: bold;
}

input[type="text"] {
    border: 1px solid white;
    background-color: black;
}

.search-submit {
    background-color: black;
    border: 2px outset white;
}

.search-submit:active {
    border: 2px inset white;
}

.tag-search {
    position: relative;
}

.tag-search-label {
    position: absolute;
    font-weight: bold;
}

.tag-search-list {
    padding: 0px 40px;
    max-height: 80px;
    overflow: scroll;
}

.tag-li {
    padding-right: 15px;
    width: max-content;
}

.tag-link {
    text-decoration: underline;
}

.tag-count {
    font-size: 0.8em;
}

/********/
/* MAIN */
/********/

main {
    max-width: 900px;
    margin: 50px auto;
    padding: 10px;
}

.comic-view {
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
        "top"
        "center"
        "bottom";
    row-gap: 20px;
}

.view-top {
    display: grid;
    grid-template-columns: 100px 1fr 100px;
    grid-area: top;
    align-items: center;
}

.comic-nav-link {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.comic-nav-link:active {
    filter: brightness(0.8);
}

.prev-comic {
    background-position: 0 66.990291%;
    background-size: 270.192308%;
}

.prev-comic:hover,
.prev-comic:active {
    background-position: 0 50.485437%;
}

.next-comic {
    background-position: 0 100%;
    background-size: 355.696203%;
}

.next-comic:hover,
.next-comic:active {
    background-position: 0 83.495146%;
}

.comic-header {
    display: grid;
    text-align: right;
    padding: 0px 20px;
}

.view-center {
    margin: 0 auto;
}

.comic-title {
    color: white;
    font-size: 2.2em;
    font-style: italic;
}

.comic-date {
    color: rgba(var(--cyan));
    font-weight: bold;
    font-size: 0.8em;
}

.comic {
    max-width: 100%;
    margin: auto;
}

.comic-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.comic-info-right {
    text-align: center;
}

details {
    text-align: center;
}

.comic-tags-button {
    color: rgba(var(--red));
    font-size: 1.2em;
    margin-bottom: 5px;
}

.comic-tag {
    color: rgba(var(--yellow));
    text-decoration: underline;
}

.comic-bsky {
    display: inline-block;
    background-image: url("/design/comic-bsky.png");
    background-size: 100%;
    background-position: 50%;
    background-repeat: no-repeat;
    width: 100px;
    height: 20px;
}

.view-bottom {
    color: rgba(var(--green));
}

/**********/
/* FOOTER */
/**********/

footer {
    display: flex;
    justify-content: center;
    text-align: center;
    margin-top: 25px;
    gap: 25px;
}

.badge {
    display: inline-block;
    height: 31px;
    width: 88px;
    background-image: url("/design/badge.gif");
}

.footer-home {
    background-image: url("/design/comix-logo-bw.png");
    background-size: 100%;
    background-position: 50%;
    background-repeat: no-repeat;
    height: 31px;
    width: 75px;
}

/***********/
/* ARCHIVE */
/***********/

.archive-header {
    text-align: center;
    font-size: 1.2em;
    font-style: italic;
    margin-bottom: 30px;
}

.archive-container {
    display: grid;
    max-width: 600px;
    margin: 0 auto;
    gap: 20px;
    justify-content: center;
}

.archive-link {
    max-width: max-content;
}

.archive-link:hover .archive-preview {
    transform: scale(1.02);
}

.archive-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px;
}

.archive-preview {
    height: 100px;
    width: 100px;
    border-image-slice: 4 4 4 4;
    border-image-width: 4px 4px 4px 4px;
    border-image-outset: 2px 2px 2px 2px;
    border-image-repeat: round round;
    border-image-source: url("/design/comix-preview-border.png")
}

.archive-title {
    font-size: 2em;
}

.archive-date {
    font-size: 1em
}

/****************************/
/****************************/
/********** MOBILE **********/
/****************************/
/****************************/

@media (max-width: 600px) {

    /**********/
    /* HEADER */
    /**********/

    header {
        aspect-ratio: unset;
        height: 70px;
        width: 280px;
        margin: 0 auto;
        background-image: none;
        display: grid;
        grid-template-columns: 63% 1fr;
        image-rendering: pixelated;
        position: relative;
    }

    .header-left {
        background-image: url("/design/comix-header-boundary-mobile.png");
        background-size: 100%;
        background-repeat: no-repeat;
    }

    .header-right {
        display: grid;
        grid-template-rows: 1fr;
        grid-template-areas: "menu";
    }

    .header-carousel {
        display: none;
    }

    .header-menu {
        grid-area: menu;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "item-1"
            "item-2"
            "item-3";
        align-items: center;
        justify-items: center;
        position: relative;
        bottom: 3px;
    }

    .archive {
        grid-area: item-1;
    }

    .search-window {
        top: 110%;
        right: 10%;
    }
    
    /********/
    /* MAIN */
    /********/

    .comic-view {
        row-gap: 10px;
    }

    .view-top {
        grid-template-columns: 80px 1fr 80px;
    }

    .comic-header {
        padding: 0px;
    }

    .comic-title {
        font-size: 1.8em;
    }

    .comic-nav-sprite {
        transform: scale(0.8);
    }
}