/* ============================================================
 * Wallpaper Lists — feature stylesheet
 *
 * Matches the site's existing visual language: Verdana 10pt,
 * #46678A primary blue, #F4F4F4 box backgrounds, GIF-based
 * .blueButton, table-based grids. Do not introduce CSS custom
 * properties or modern flex/grid layouts here — see
 * docs/PATTERNS.md "DesktopNexus retro blue-box aesthetic".
 * ============================================================ */

/* ---- 2x2 thumbnail tile (the visual cue for a list) --------- */
.list-thumb-grid {
    border-collapse: separate;
    border-spacing: 2px;
    background: #DCDCDC;
    border: 1px solid #DCDCDC;
    padding: 0;
}
.list-thumb-cell {
    padding: 0;
    background: #F4F4F4;
    width: 90px;
    height: 90px;
    vertical-align: top;
    overflow: hidden;
}
.list-thumb-cell img {
    display: block;
    width: 90px;
    height: 90px;
    object-fit: cover;
    border: 0;
}
.list-thumb-cell-empty {
    background:
        repeating-linear-gradient(45deg, #EAEAEA, #EAEAEA 6px, #F4F4F4 6px, #F4F4F4 12px);
}

/* Larger size used on list detail page header */
.list-thumb-grid-lg .list-thumb-cell,
.list-thumb-grid-lg .list-thumb-cell img { width: 138px; height: 138px; }

/* Smaller size used inside grids of many list cards */
.list-thumb-grid-sm .list-thumb-cell,
.list-thumb-grid-sm .list-thumb-cell img { width: 72px; height: 72px; }

/* ---- list-grid (row of list cards) -------------------------- */
.list-card {
    float: left;
    width: 196px;
    margin: 0 16px 22px 0;
    background: #FFF;
    border: 1px solid #DCDCDC;
}
.list-card-link, .list-card-link:visited {
    color: #333;
    text-decoration: none;
    display: block;
}
.list-card-link:hover { text-decoration: none; }
.list-card-link:hover .list-card-name { text-decoration: underline; }
.list-card-body {
    padding: 8px 10px 10px;
}
.list-card-name {
    font-size: 11pt;
    font-weight: bold;
    color: #46678A;
    line-height: 1.2;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-card-meta {
    font-size: 8pt;
    color: #666;
    line-height: 1.4;
}
.list-card-meta a { color: #46678A; }
.list-card-loves { color: #B33; font-weight: bold; }

/* Clear after card row */
.list-card-row::after { content: ''; display: block; clear: both; }

/* ---- list detail header ------------------------------------- */
.list-detail-header table { width: 100%; }
.list-detail-meta { padding-left: 18px; vertical-align: top; }
.list-detail-meta h2 { margin: 0 0 6px; color: #46678A; }
.list-detail-byline { color: #666; font-size: 9pt; margin: 0 0 8px; }
.list-detail-byline a { color: #46678A; }
.list-detail-stats { font-size: 9pt; color: #333; margin: 0 0 10px; }
.list-detail-description { margin: 0 0 12px; line-height: 1.45; color: #333; }
.list-detail-actions { margin-top: 8px; }
.list-detail-actions .blueButton { margin-right: 6px; }
.list-detail-actions .is-loved { font-weight: bold; }

/* ---- forms (new + edit + manage) ---------------------------- */
.list-form-row { margin: 0 0 14px; }
.list-form-row label { display: block; font-weight: bold; color: #333; margin: 0 0 3px; }
.list-form-row input[type="text"],
.list-form-row textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 6px;
    border: 1px solid #C5D2E2;
    background: #FFF;
    font: 10pt Verdana, Arial, Helvetica, sans-serif;
    color: #333;
}
.list-form-row input[type="text"]:focus,
.list-form-row textarea:focus {
    border-color: #46678A;
    outline: none;
}
.list-form-hint { font-size: 8pt; color: #888; margin: 3px 0 0; }
.list-form-optional { font-weight: normal; color: #888; font-size: 9pt; }
.list-form-actions { margin-top: 14px; }
.list-form-actions .blueButton { margin-right: 6px; }

/* Thumb picker on the edit page */
.list-thumb-picker { margin-top: 4px; max-height: 320px; overflow-y: auto; padding: 4px; background: #F4F4F4; border: 1px solid #DCDCDC; }
.list-thumb-picker label {
    float: left;
    margin: 0 6px 6px 0;
    padding: 2px;
    border: 2px solid transparent;
    cursor: pointer;
    background: #FFF;
}
.list-thumb-picker label.is-selected {
    border-color: #46678A;
}
.list-thumb-picker img { display: block; border: 0; }
.list-thumb-picker input[type="checkbox"] { display: none; }
.list-thumb-picker::after { content: ''; display: block; clear: both; }

/* Manage page wallpaper grid (with remove button overlay) */
.list-manage-item {
    position: relative;
    float: left;
    margin: 0 16px 16px 0;
    border: 1px solid #DCDCDC;
    background: #FFF;
}
.list-manage-item img { display: block; border: 0; }
.list-manage-remove {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(0,0,0,0.7);
    color: #FFF;
    border: 0;
    padding: 2px 6px;
    font: 8pt Verdana, sans-serif;
    cursor: pointer;
}
.list-manage-remove:hover { background: #B33; }
.list-manage-grid::after { content: ''; display: block; clear: both; }
.list-manage-status { display: block; margin-top: 6px; font-size: 9pt; color: #666; min-height: 1em; }
.list-manage-status.is-error { color: #B33; }
.list-manage-status.is-success { color: #1A7A1A; }

/* Delete confirmation form */
.list-delete-row { margin-top: 8px; }
.list-delete-row input[type="text"] {
    padding: 5px 6px;
    border: 1px solid #C5D2E2;
    font: 10pt Verdana, sans-serif;
    width: 260px;
    margin-right: 6px;
}
.list-delete-row .blueButton.is-danger { /* hover shows it's destructive */ }

/* ---- /{username}/lists sub-toggle --------------------------- */
.list-subtoggle {
    margin: 0 0 12px;
    padding: 6px 0 8px;
    border-bottom: 1px solid #DCDCDC;
    font-size: 10pt;
}
.list-subtoggle a {
    color: #46678A;
    text-decoration: none;
    margin-right: 18px;
    font-weight: bold;
}
.list-subtoggle a.is-active {
    color: #333;
    border-bottom: 2px solid #46678A;
    padding-bottom: 6px;
}
.list-subtoggle .list-subtoggle-cta { float: right; font-weight: normal; }

/* ---- "In these lists" section on wallpaper view ------------- */
.wp-in-lists-grid { padding: 4px 0; }
.wp-in-lists-card {
    display: inline-block;
    width: 96px;
    margin: 0 8px 8px 0;
    vertical-align: top;
    text-decoration: none;
    color: #333;
}
.wp-in-lists-card .list-thumb-grid { margin-bottom: 4px; }
.wp-in-lists-card-name {
    display: block;
    font-size: 8pt;
    color: #46678A;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wp-in-lists-card:hover .wp-in-lists-card-name { text-decoration: underline; }
.wp-in-lists-empty { color: #888; font-size: 9pt; padding: 4px 0; }
.wp-in-lists-loading { color: #888; font-size: 9pt; }

/* ---- Add-to-List modal -------------------------------------- */
.atl-modal[aria-hidden="true"] { display: none; }
.atl-modal[aria-hidden="false"] {
    position: fixed; inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.55);
}
.atl-modal-panel {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-width: 92vw;
    background: #FFF;
    border: 1px solid #6485AE;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.atl-modal-header {
    background: #6485AE;
    color: #FFF;
    padding: 6px 10px;
    font-weight: bold;
}
.atl-modal-close {
    float: right;
    background: transparent;
    border: 0;
    color: #FFF;
    font-size: 14pt;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.atl-modal-close:hover { color: #FFD; }
.atl-modal-body {
    padding: 10px 12px;
    max-height: 60vh;
    overflow-y: auto;
}
.atl-modal-body ul { list-style: none; padding: 0; margin: 0 0 10px; }
.atl-modal-body ul li {
    padding: 6px 0;
    border-bottom: 1px solid #EEE;
    overflow: hidden;
}
.atl-modal-body ul li .atl-modal-list-name { color: #333; }
.atl-modal-body ul li .atl-modal-list-count { color: #888; font-size: 8pt; margin-left: 6px; }
.atl-modal-add-btn {
    float: right;
    background: #46678A;
    color: #FFF;
    border: 0;
    padding: 3px 10px;
    font: 9pt Verdana, sans-serif;
    cursor: pointer;
}
.atl-modal-add-btn:hover { background: #355678; }
.atl-modal-add-btn.is-added { background: #1A7A1A; }
.atl-modal-create { padding-top: 8px; border-top: 1px solid #DCDCDC; }
.atl-modal-create summary { cursor: pointer; color: #46678A; font-weight: bold; padding: 4px 0; }
.atl-modal-create-form { margin-top: 6px; }
.atl-modal-create-form input[type="text"] {
    width: 220px;
    padding: 4px 6px;
    border: 1px solid #C5D2E2;
    font: 10pt Verdana, sans-serif;
    margin-right: 4px;
}
.atl-modal-error { color: #B33; font-size: 8pt; min-height: 1em; margin: 4px 0 0; }
.atl-modal-loading,
.atl-modal-empty { color: #888; padding: 8px 0; font-style: italic; }
.atl-modal-footer { padding: 8px 12px; border-top: 1px solid #DCDCDC; text-align: right; }

/* a11y */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- mobile breakpoints ------------------------------------- */
@media (max-width: 600px) {
    .list-card { width: 46%; margin-right: 8px; }
    .list-card:nth-child(2n) { margin-right: 0; }
    .list-detail-meta { padding: 12px 0 0; display: block; }
    .list-detail-header table td { display: block; width: 100%; }
    .atl-modal-panel { width: 100vw; height: 100vh; max-width: 100vw; transform: none; top: 0; left: 0; }
    .atl-modal-body { max-height: calc(100vh - 100px); }
}
