
/* ========================================
   1. GENERAL PAGE STYLING
======================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f1e8;
    color: #333333;
}

header,
main {
    max-width: 1100px;
    margin: 0 auto;
}

h1 {
    color: #5c5033;
}

h2 {
    color: #8b6748;
}


/* ========================================
   2. CONTENT PANELS
======================================== */

.content-panel {
    background-color: white;
    border: 1px solid #dddddd;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

#alpaca-preview {
    border: 2px solid #8b6748;
}


/* ========================================
   3. ALPACA IMAGE PREVIEW
======================================== */

.alpaca-stage {
    position: relative;
    width: min(300px, 100%);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

.alpaca-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Image stacking order */

.alpaca-background, .alpaca-leg {
    z-index: 0;
}

.alpaca-neck, .alpaca-nose {
    z-index: 1;
}

.alpaca-ears {
    z-index: 2;
}

.alpaca-hair {
    z-index: 3;
}

.alpaca-eyes {
    z-index: 4;
}

.alpaca-mouth {
    z-index: 6;
}

.alpaca-accessory {
    z-index: 7;
}


/* ========================================
   4. MAIN PAGE LAYOUT
======================================== */

main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
}

section {
    min-width: 0;
}


/* ========================================
   5. CATEGORY BUTTONS
======================================== */

.category-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.category-buttons button {
    padding: 9px 6px;
    font-size: 13px;
}


/* ========================================
   6. STYLE OPTION BUTTONS
======================================== */

.style-options {
    display: grid;
    width: 100%;
    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 130px), 1fr));
    gap: 8px;
}

.style-options button {
    white-space: nowrap;
    font-size: 13px;
    padding: 10px 6px;
}


/* ========================================
   7. SHARED BUTTON STYLING
======================================== */

.category-buttons button,
.style-options button {
    border: 1px solid #a7c4ed;
    border-radius: 25px;
    background-color: transparent;
    color: #4779ba;
    cursor: pointer;
}

.category-buttons button:hover,
.style-options button:hover {
    background-color: #315fa5;
    color: white;
}

/* Selected buttons */

.category-buttons button.active,
.style-options button.active {
    background-color: #315fa5;
    color: white;
    border-color: #315fa5;
}

/* Keyboard accessibility */

button:focus-visible {
    outline: 3px solid #d69e36;
    outline-offset: 3px;
}


/* ========================================
   8. RANDOMIZE AND DOWNLOAD BUTTONS
======================================== */

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.action-buttons button {
    padding: 13px 16px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s ease;
}

#randomize-button {
    background-color: #315fa5;
    color: white;
    border: 1px solid #315fa5;
}

#download-button {
    background-color: white;
    color: #315fa5;
    border: 1px solid #315fa5;
}

#randomize-button:hover {
    background-color: #24477d;
}

#download-button:hover {
    background-color: #eaf0fa;
}

.action-buttons button:hover {
    transform: translateY(-2px);
}


/* ========================================
   9. RESPONSIVE DESIGN
======================================== */

@media (max-width: 700px) {

    main {
        grid-template-columns: 1fr;
    }

}
