/* General Recipe Styles */
.recipe-container {
    display: flex;
    flex-direction: column;
    align-self: flex-start;
    padding: 1rem;
    flex-shrink: 0;

    box-sizing: border-box;
    width: fit-content;
}

.recipe-container ul {
    padding: 0 1rem 1.5rem 1rem;
    margin: 0;
}

.recipe-container p {
    letter-spacing: 0.02rem;
    line-height: 1.5;
    text-wrap: balance;

    margin: 0;
    padding: 0 0 1.5rem 0;
}

.recipe-container ul {
    padding-bottom: 1rem;
}

.recipe-box {
    box-sizing: border-box;
    background-color: #363636;
    border: 2px solid #303030;
}

.recipe-area {
    display: block;
    /* Elements in the document rely on the crafting area to position items on the website! */
    position: relative;
    box-sizing: border-box;

    /* This fills in the background so there aren't strange lines around the border. */
    background-color: #C6C6C6;

    /* Makes a rectangular grid to position the items in the crafting area! */
    aspect-ratio: 1 / 0.5;
    width: 468px;

    /* Adds a small gap under the recipe. */
    margin-bottom: 1rem;
}

.recipe-back {
    position: absolute;
    display: grid;
    grid-area: 1 / 1;
    width: 100%;
    z-index: 1;
    object-fit: contain;

    border: 4px solid #C6C6C6;
    /* Use box-shadow here instead of outline to keep outline for accessibility. */
    box-shadow: 0 0 0 4px #ffffff;

    image-rendering: pixelated;
    box-sizing: border-box;
}

.recipe-result-container {
    position: absolute;
    grid-area: 1 / auto;
    z-index: 2;

    width: 100%;
    height: 100%;
    pointer-events: none;
}

.recipe-item {
    width: 64px;
    image-rendering: pixelated;
    z-index: 2;
}

/* Crafting Styles */
.crafting-ing-container {
    position: absolute;
    padding-top: 16px;
    padding-left: 12px;
}

.crafting-ingredients {
    position: absolute;
    display: grid;
    /* Creates 3 equal columns and rows that scale with the container */
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    height: auto;

    box-sizing: border-box;
    gap: 6px;
}

.crafting-slot {
    display: grid;
    width: 64px;

    aspect-ratio: 1 / 1;
}

.crafting-result {
    position: absolute;
    left: 87%;
    top: 50%;
    width: 64px;
    z-index: 2;

    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    image-rendering: pixelated;
}

.crafting-result-count {
    position: absolute;
    left: 96%;
    top: 56%;
    width: 11%;
    z-index: 3;
    height: auto;
    transform: translate(-50%, -50%);
}

/* Furnace Styles */
.furnace-slot-container {
    position: absolute;
    display: grid;
    grid-template-columns: 1fr;
    gap: 72px;

    left: 106px;
    top: 14px;
}

.furnace-slot-container .input-slot {
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
}

.furnace-slot-container .fuel-slot {
    grid-column: 1;
    grid-row: 2; /* Stacks directly beneath the first item */
    z-index: 2;
}

.furnace-result {
    position: absolute;
    left: 79%;
    top: 50%;

    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    image-rendering: pixelated;
}

/* Stonecutter */
.stonecutter-button {
    position: absolute;
    left: 184px;
    top: 90px;
    z-index: 2;

    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    image-rendering: pixelated;
}

.stonecutter-slot-container {
    position: absolute;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 172px;

    z-index: 2;
    left: 66px;
    top: 106px;
}

.stonecutter-count {
    position: absolute;
    transform: translate(-50%, -50%);

    z-index: 3;
    left: 356px;
    top: 152px;
}

/* Desktops */
@media (min-width: 1280px) {
    /* Recipe Styles */
    .recipe-container p {
        
    }

    .recipe-item {
        width: 32px;
    }

    .recipe-area {
        width: 234px;
    }

    /* Crafting Styles */
    .crafting-slot {
        width: 32px;
    }

    .crafting-ingredients {
        gap: 3px;
    }

    .crafting-ing-container {
        padding-top: 8px;
        padding-left: 7px;
    }

    .crafting-result {
        width: 32px;
    }

    /* Furnace Styles */
    .furnace-slot-container {
        gap: 36px;

        left: 53px;
        top: 7px;
    }

    /* Stonecutter */
    .stonecutter-button {
        left: 93px;
        top: 46px;
    }

    .stonecutter-slot-container {
        gap: 82px;

        left: 35px;
        top: 53px;
    }

    .stonecutter-count {
        position: absolute;
        transform: translate(-50%, -50%);

        z-index: 3;
        left: 178px;
        top: 77px;
    }
}