/* ==========================================================================
   Search results: the two view buttons, and the tile view.

   The list view is the page as it has always been - not a single rule here
   touches it. Everything below applies only inside .amd-sr-grid, which the
   buttons put on the results container.
   ========================================================================== */

/* ---- the buttons themselves ---- */
.amd-sr-view-btns {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
    align-items: center;
}

.amd-sr-view-btn {
    width: 28px;
    height: 26px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    background: #e8e8e8;
    border: 1px solid #c4c4c4;
    border-radius: 3px;
    font-family: Tahoma, Arial, sans-serif;
}

.amd-sr-view-btn:hover { background: #dcdcdc; }

.amd-sr-view-btn--on {
    background: #fff;
    border-color: #9a9a9a;
    color: #000;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}

/* ==========================================================================
   TILE VIEW - eight to a row
   ========================================================================== */

.amd-sr-grid .amd-myadv-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

/* every result becomes a tile; the rows are direct children of the list */
.amd-sr-grid .amd-myadv-list > * {
    display: flex;
    flex-direction: column;
    width: 12.5%;
    box-sizing: border-box;
    border-right: 1px solid rgba(0, 0, 0, .08);
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    padding: 0;
    background: rgba(255, 255, 255, .70);
}

.amd-sr-grid .amd-myadv-list > *:hover { background: #fff; }

/* columns stack instead of standing in a row */
.amd-sr-grid .amd-myadv-col {
    width: auto;
    max-width: none;
    flex: none;
    padding: 0;
    border: 0;
}

/* picture on top, fixed height like the cards elsewhere on the site */
.amd-sr-grid .amd-myadv-col-pic {
    order: 1;
    width: 100%;
    height: 98px;
    overflow: hidden;
    background: #f0f0f0;
}

.amd-sr-grid .amd-myadv-pic {
    width: 100%;
    height: 98px;
    object-fit: cover;
    display: block;
    max-width: none;
    max-height: none;
}

.amd-sr-grid .amd-myadv-nopic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 98px;
    font-size: 26px;
    color: #999;
}

/* name next, then price and date */
.amd-sr-grid .amd-myadv-col-name {
    order: 2;
    padding: 6px 8px 2px;
    min-width: 0;
}

.amd-sr-grid .amd-sr-meta-col {
    order: 3;
    padding: 0 8px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    align-items: baseline;
}

/* the long text of a result has no place on a tile */
.amd-sr-grid .amd-sr-snip,
.amd-sr-grid .amd-myadv-id { display: none; }

.amd-sr-grid .amd-sr-name-hl {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.amd-sr-grid .amd-sr-sub-label {
    font-size: 10px;
    color: #888;
    margin-bottom: 2px;
}

.amd-sr-grid .amd-sr-price {
    font-size: 13px;
    font-weight: bold;
    color: #444;
}

.amd-sr-grid .amd-myadv-date-start,
.amd-sr-grid .amd-sr-year {
    font-size: 10px;
    color: #888;
}

/* ---- narrower screens ---- */
@media (max-width: 1100px) {
    .amd-sr-grid .amd-myadv-list > * { width: 25%; }
}

@media (max-width: 700px) {
    .amd-sr-grid .amd-myadv-list > * { width: 50%; }
}
