/* =========================================================
   ZX SPECTRUM ATTRIBUTE EXPLORER
   ========================================================= */

.attribute-explorer {
    max-width: 850px;
    margin: 20px auto;
    padding: 0 15px;
}

.attribute-explorer h1 {
    text-align: center;
    margin-bottom: 8px;
}

.attribute-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 18px auto;
}


/* =========================================================
   LAST UPDATED / REVISION INFORMATION
   ========================================================= */

.attribute-explorer .attribute-page-info {
    text-align: left !important;
    padding-left: 20px !important;
}

.attribute-explorer .attribute-page-info p {
    text-align: left !important;
    margin-left: 20px !important;
}

.attribute-page-info {
    margin-top: 30px;
    padding-top: 15px;
}

.attribute-page-info p {
    margin: 4px 0;
    padding-left: 50px;
}

/* =========================================================
   MAIN TOOL
   ========================================================= */

.attribute-tool {
    background: #555555;
    border-radius: 8px;
    padding: 18px;
    color: #ffffff;
}


/* =========================================================
   MAIN THREE-COLUMN LAYOUT
   INK | PAPER | CHARACTER
   ========================================================= */

.attribute-main {
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr;
    gap: 12px;
    align-items: stretch;
}


/* =========================================================
   PANELS
   ========================================================= */

.attribute-panel {
    background: #444444;
    border-radius: 6px;
    padding: 14px;
}

.attribute-panel h2 {
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 18px;
}


/* =========================================================
   COLOUR SELECTOR
   ========================================================= */

.colour-select {
    width: 100%;
    padding: 7px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #222222;
    background: #eeeeee;
    color: #111111;
}


/* =========================================================
   RGB BIT CONTROLS
   ========================================================= */

.colour-bits {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.colour-bit {
    text-align: center;
    font-size: 11px;
}

.colour-bit-name {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}


/* =========================================================
   SWITCH
   ========================================================= */

.bit-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.bit-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bit-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #222222;
    border-radius: 20px;
    transition: 0.2s;
}

.bit-slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    top: 3px;
    background-color: #eeeeee;
    border-radius: 50%;
    transition: 0.2s;
}

.bit-switch input:checked + .bit-slider {
    background-color: #888888;
}

.bit-switch input:checked + .bit-slider:before {
    transform: translateX(18px);
}


/* =========================================================
   CHARACTER CELL
   ========================================================= */

.character-panel {
    background: #444444;
    border-radius: 6px;
    padding: 14px;
    text-align: center;
}

.character-panel h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.character-size {
    font-size: 12px;
    margin-bottom: 5px;
}


/* =========================================================
   8x8 CHARACTER GRID
   ========================================================= */

.spectrum-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: 200px;
    height: 200px;
    margin: 8px auto;
    border: 2px solid #222222;
}

.grid-cell {
    width: 100%;
    height: 100%;
}


/* =========================================================
   BRIGHT / FLASH
   ========================================================= */

.attribute-options {
    background: #444444;
    border-radius: 6px;
    padding: 10px;
    margin-top: 12px;
    text-align: center;
}

.attribute-options h2 {
    margin: 0 0 7px 0;
    font-size: 17px;
}

.toggle-row {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    cursor: pointer;
}

.toggle-label input {
    width: 17px;
    height: 17px;
    cursor: pointer;
}


/* =========================================================
   ATTRIBUTE OUTPUT
   ========================================================= */

.attribute-output {
    background: #333333;
    color: #ffffff;
    border-radius: 6px;
    padding: 10px 15px;
    max-width: 500px;
    margin: 12px auto 0 auto;
}

.attribute-output h2 {
    text-align: center;
    margin: 0 0 5px 0;
    font-size: 17px;
}

.output-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #555555;
    font-family: monospace;
    font-size: 15px;
}

.output-row:last-child {
    border-bottom: none;
}

.output-label {
    font-weight: bold;
}


/* =========================================================
   ATTRIBUTE BIT MAP
   ========================================================= */

.attribute-bits {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
}

.attribute-bits p {
    margin: 4px 0;
}

.attribute-bits code {
    display: inline-block;
    background: #222222;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    letter-spacing: 2px;
}


/* =========================================================
   BOTTOM NAVIGATION
   ========================================================= */

.attribute-bottom-nav {
    margin-top: 15px;
    text-align: center;
}

.attribute-bottom-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {

    .attribute-main {
        grid-template-columns: 1fr 1fr;
    }

    .character-panel {
        grid-column: 1 / -1;
    }

    .spectrum-grid {
        width: 180px;
        height: 180px;
    }

}


@media (max-width: 450px) {

    .attribute-main {
        grid-template-columns: 1fr;
    }

    .character-panel {
        grid-column: auto;
    }

}
