/* ==========================================================================
   Teachers give badges (inc/teacher-badges.php, js/teacher-badges.js)

   Loads only where teacher-dashboard.css loads, and uses its colours (--lh-td-*). Buttons are the
   Teacher Dashboard's two buttons (.lh-mc-btn and .lh-mc-btn.is-pri, "Two buttons" in that file);
   nothing here restyles them. Mockup: docs/mockups/awards/teacher-badges.html (Ben chose it 2026-10-25).
   ========================================================================== */

/* hidden must win over every display below (CLAUDE.md 4d). */
.lh-tb [hidden]
{
    display: none !important;
}

.lh-tb
{
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- the grid a teacher picks from --- */
.lh-tb-grid
{
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 104px, 1fr ) );
    gap: 8px;
}

.lh-tb-tile
{
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px 8px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var( --lh-td-soft );
    font-family: inherit;
    color: var( --awb-custom_color_1 );
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.lh-tb-tile:hover,
.lh-tb-tile:focus-visible
{
    border-color: var( --awb-custom_color_1 );
}

.lh-tb-tile[ aria-pressed="true" ]
{
    border-color: var( --awb-custom_color_1 );
    background: var( --awb-custom_color_10 );
}

.lh-tb-tile img,
.lh-tb-tile .lh-tb-noimg
{
    width: 52px;
    height: 52px;
}

.lh-tb-n
{
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
    text-wrap: balance;
}

.lh-tb-p
{
    font-size: 11px;
    line-height: 1.4;
    color: var( --awb-custom_color_12 );
}

.lh-tb-has
{
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var( --awb-color5 );
    font-size: 11px;
    line-height: 20px;
    font-weight: 600;
    color: var( --awb-custom_color_1 );
}

.lh-tb-noimg
{
    display: inline-block;
    border-radius: 50%;
    background: var( --lh-td-line );
}

.lh-tb-noimg--26
{
    width: 26px;
    height: 26px;
}

.lh-tb-noimg--30
{
    width: 30px;
    height: 30px;
}

.lh-tb-noimg--44
{
    width: 44px;
    height: 44px;
}

/* --- the Give form: its flex gap equals its padding (CLAUDE.md 4a) --- */
.lh-tb-give
{
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var( --lh-td-line );
    border-radius: 12px;
    background: var( --lh-td-soft );
}

.lh-tb-give-head
{
    display: flex;
    align-items: center;
    gap: 12px;
}

.lh-tb-give-img img
{
    display: block;
    width: 64px;
    height: 64px;
}

.lh-tb .lh-tb-give-t
{
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
    color: var( --awb-custom_color_1 );
}

.lh-tb .lh-tb-give-p
{
    margin: 2px 0 0;
}

.lh-tb-field
{
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lh-tb-field label
{
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    color: var( --awb-custom_color_1 );
}

.lh-tb-field textarea
{
    width: 100%;
    min-height: 74px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var( --lh-td-line );
    border-radius: 10px;
    background: var( --awb-color1 );
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: var( --awb-custom_color_1 );
    resize: vertical;
}

.lh-tb-row
{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.lh-tb .lh-tb-done
{
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid var( --awb-color5 );
    border-radius: 12px;
    background: var( --awb-custom_color_10 );
    font-size: 14px;
    line-height: 1.4;
    color: var( --awb-custom_color_1 );
}

.lh-tb .lh-tb-done.is-bad
{
    border-color: var( --lh-td-bad-line );
    background: var( --lh-td-bad-bg );
}

/* --- From teachers --- */
.lh-tb-gifts
{
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lh-tb-gift
{
    display: grid;
    grid-template-columns: 44px minmax( 0, 1fr ) auto;
    gap: 12px;
    align-items: center;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var( --lh-td-line );
    border-radius: 12px;
    background: var( --awb-color1 );
}

.lh-tb-gift img
{
    display: block;
    width: 44px;
    height: 44px;
}

.lh-tb .lh-tb-gift-t
{
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    color: var( --awb-custom_color_1 );
}

.lh-tb .lh-tb-note
{
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    font-style: italic;
    color: var( --awb-custom_color_1 );
}

.lh-tb-take
{
    display: contents;
}

.lh-tb-confirm:not( [ hidden ] )
{
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var( --lh-td-warn-line );
    border-radius: 10px;
    background: var( --lh-td-warn-bg );
}

.lh-tb .lh-tb-confirm p
{
    flex: 1 1 200px;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var( --awb-custom_color_1 );
}

/* --- earned by the child --- */
.lh-tb-auto
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lh-tb-auto span
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border-radius: 20px;
    background: var( --awb-custom_color_10 );
    font-size: 13px;
    line-height: 1.4;
    color: var( --awb-custom_color_1 );
}

.lh-tb-auto span.is-locked
{
    background: var( --lh-td-soft );
    color: var( --awb-custom_color_12 );
}

.lh-tb-auto img
{
    width: 26px;
    height: 26px;
}

/* --- the homework card's block --- */
.lh-tb-card
{
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var( --lh-td-line );
    border-radius: 12px;
    background: var( --lh-td-soft );
}

.lh-tb .lh-tb-card-t
{
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    color: var( --awb-custom_color_1 );
}

.lh-tb-chips
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.lh-tb-chip
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 4px 14px 4px 6px;
    border: 2px solid var( --lh-td-line );
    border-radius: 30px;
    background: var( --awb-color1 );
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    color: var( --awb-custom_color_1 );
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.lh-tb-chip:hover,
.lh-tb-chip:focus-visible,
.lh-tb-chip[ aria-pressed="true" ]
{
    border-color: var( --awb-custom_color_1 );
}

.lh-tb-chip[ aria-pressed="true" ]
{
    background: var( --awb-custom_color_10 );
}

.lh-tb-chip img
{
    width: 30px;
    height: 30px;
}

.lh-tb-card .lh-tb-grid
{
    margin-top: 10px;
}

.lh-tb-card .lh-tb-give
{
    background: var( --awb-color1 );
}

@media ( max-width: 640px )
{
    .lh-tb-gift
    {
        grid-template-columns: 44px minmax( 0, 1fr );
    }

    .lh-tb-gift [ data-lh-tb-ask ]
    {
        grid-column: 2;
        justify-self: start;
    }
}
