/*
 * The three searches of tapka.cz and a breed's address under each (search.xhtml, wide-layout.xhtml).
 * A plain file: default.css is a build product nothing can rebuild, and it is not edited.
 */

/* the logout is a button, so that the page needs no script; it looks like the links beside it */
#user-menu .search-logout {
    display: inline-block;
    margin-top: 30px;
    padding: 6px 12px;
    border: 0;
    border-radius: 5px;
    background: none;
    color: #ffffff;
    font-size: 1.3em;
}

#user-menu .search-logout:hover {
    background-color: #2fa9be;
}

.search-head {
    padding: 0 16px 8px;
}

.search-list {
    padding: 0 16px 32px;
}

.search-cards,
.search-kennels {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.search-card[hidden] {
    display: none;
}

.search-card a {
    display: block;
    color: inherit;
}

.search-card-picture {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eeeeee;
}

.search-card-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-card-parents {
    display: flex;
    aspect-ratio: 2 / 1;
}

.search-card-parents img {
    width: 50%;
}

.search-card-name {
    display: block;
    margin-top: 6px;
    font-weight: bold;
}

.search-card-breed,
.search-card-kennel {
    display: block;
    color: #666666;
}

#search-map {
    width: 100%;
    height: 40vh;
    min-height: 260px;
}

/* the checkbox floats in the map's top left corner, so it is on the screen whenever the map is */
.search-follow {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    margin: 0;
    padding: 6px 10px;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
}

.search-follow input {
    margin: 0 4px 0 0;
    vertical-align: -1px;
}

/* the window of a place on the map: the kennel above, then a row for each of its dogs or litters */
.search-map-kennel {
    font-weight: bold;
    font-size: 14px;
}

.search-map-window {
    min-width: 200px;
    max-width: 260px;
}

.search-map-window a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    color: #333333;
    font-size: 13px;
    line-height: 1.3;
}

.search-map-window a:hover span {
    text-decoration: underline;
}

.search-map-window a + a {
    border-top: 1px solid #eeeeee;
}

.search-map-window img {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    background: #eeeeee;
}

/*
 * The layout. Below 992 px one column: the map above the list, about 40 % of the screen high.
 * From 992 px two columns: the list scrolls with the page and the map stays in view beside it.
 */

.search-map-pane {
    position: relative;
    background: #f4f4f4;
}

/* Google refused the key or never came: the list takes the whole width (search-map.js) */
.search-map-pane[hidden] {
    display: none;
}

.search-breadcrumb {
    margin: 16px 0 0;
    padding: 0;
    background: none;
}

.search-head h1 {
    margin-top: 12px;
    font-size: 28px;
}

.search-list h2 {
    margin: 32px 0 12px;
    font-size: 20px;
}

.search-filter .btn {
    margin: 0 4px 4px 0;
}

.search-count {
    margin: 4px 0 12px;
    color: #666666;
}

.search-none {
    padding: 12px 16px;
    background: #f4f4f4;
    border-left: 4px solid #2fa9be;
}

.search-part {
    clear: both;
}

.search-kennels {
    columns: 220px;
    column-gap: 24px;
}

.search-kennels li {
    padding: 2px 0;
    break-inside: avoid;
}

/* the breeds of the results: chips, the chosen one filled */
.search-breeds h2 {
    margin-bottom: 10px;
}

.search-breeds a,
.search-breed {
    display: inline-block;
    margin: 0 6px 8px 0;
    padding: 4px 8px 4px 12px;
    border: 1px solid #bfe3ea;
    border-radius: 16px;
    background: #f2fafb;
    color: #1f7f8f;
}

.search-breeds a:hover,
.search-breeds a:focus {
    border-color: #2fa9be;
    text-decoration: none;
}

.search-breed.active {
    border-color: #2fa9be;
    background: #2fa9be;
    color: #ffffff;
}

.search-breeds .badge {
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 12px;
    font-weight: normal;
    vertical-align: 2px;
}

.search-breed.active .badge {
    background: rgba(255, 255, 255, 0.25);
}

/* back to every breed: a plain link beside the chips */
.search-breeds a.search-breeds-clear {
    padding: 4px 4px;
    border: 0;
    background: none;
    color: #1f7f8f;
    text-decoration: underline;
}

/* every breed of Tapka, in columns */
.search-all-breeds-list {
    columns: 200px;
    column-gap: 24px;
}

.search-all-breeds-list a {
    display: block;
    padding: 2px 0;
    break-inside: avoid;
}

.search-invite {
    margin: 32px 0;
    text-align: center;
}

.search-invite .btn {
    white-space: normal;
}

@media (max-width: 767px) {
    /* the logo is 192 px wide and its column a third of the screen: smaller, so that it does not run under the links */
    #logo-top img {
        width: 140px;
        height: auto;
        margin-top: 20px;
    }

    /* three links and a logo in a phone's width */
    #user-menu a,
    #user-menu .search-logout {
        margin-top: 12px;
        padding: 4px 6px;
        font-size: 1em;
    }

    .search-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /* two columns of breeds, not a hundred lines of one, and each a finger high */
    .search-all-breeds-list {
        columns: 2;
        column-gap: 16px;
    }

    .search-all-breeds-list a {
        padding: 6px 0;
    }
}

@media (max-width: 359px) {
    #logo-top img {
        width: 110px;
        margin-top: 26px;
    }
}

@media (min-width: 992px) {
    .search-with-map {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(400px, 40%);
        /* the map is a screen high across both rows: what the list leaves short goes under the list, not under the head */
        grid-template-rows: auto 1fr;
        align-items: start;
    }

    .search-with-map .search-head {
        grid-column: 1;
        grid-row: 1;
        padding: 0 24px 0;
    }

    .search-with-map .search-list {
        grid-column: 1;
        grid-row: 2;
        padding: 0 24px 48px;
    }

    .search-with-map .search-map-pane {
        grid-column: 2;
        grid-row: 1 / span 2;
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .search-with-map #search-map {
        flex: 1;
        height: auto;
    }

    .search:not(.search-with-map) .search-head,
    .search:not(.search-with-map) .search-list {
        max-width: 1170px;
        margin: 0 auto;
    }
}

/* the breadcrumb: one line, a slash between the steps, no numbers */
.search-breadcrumb {
    list-style: none;
}

.search-breadcrumb li {
    display: inline;
}

.search-breadcrumb li + li::before {
    content: "/";
    padding: 0 8px;
    color: #999999;
}
