/* Shared categorical browsing and compact plant presentation. */
.public-site .public-layout {
    max-width: none;
}

.public-site main {
    box-sizing: content-box;
    max-width: 800px;
    min-width: 0;
    width: 100%;
}

.public-site .welcome {
    max-width: 800px;
}

.public-site .public-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 800px;
}

.public-cards .card {
    box-sizing: border-box;
    flex: 0 0 240px;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
}

.heading-count {
    font: 400 16px Arial, sans-serif;
    white-space: nowrap;
}

.public-site footer nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    justify-content: space-between;
    gap: 24px 20px;
    align-items: start;
}

.plant-tile {
    width: 160px;
    display: block;
    text-decoration: none;
}

.tile-image {
    display: flex;
    width: 160px;
    height: 160px;
    background: #f4f7f3;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
}

.tile-image img {
    width: 160px;
    height: 160px;
    object-fit: cover;
}

.tile-label {
    display: block;
    width: 160px;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    overflow-wrap: anywhere;
    color: #2e6f40;
}

.tile-chamoru {
    display: block;
}

.plant-tile:hover .tile-label {
    text-decoration: underline;
}

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #65766a;
    font: 13px Arial, sans-serif;
    gap: 10px;
}

.photo-placeholder svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
}

.cards-controls {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 23px;
    gap: 12px;
    font: 12px Arial, sans-serif;
}

.cards-controls-top {
    margin: 28px 0 25px;
}

.cards-controls-bottom {
    margin: 40px 0 0;
}

.cards-controls nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.cards-controls form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.cards-controls a, .cards-controls .page-disabled, .cards-controls select {
    box-sizing: border-box;
    height: 23px;
    border: 1px solid #9bad9e;
    border-radius: 5px;
    font: 12px/19px Arial, sans-serif;
    padding: 1px 8px;
    background: #f1f2f1;
    text-decoration: none;
    color: #000;
}

.cards-controls .page-disabled {
    color: #777;
    border-color: #cad2cc;
}

.cards-controls select {
    width: 62px;
    max-width: 62px;
    padding: 1px 4px;
}

.empty-results {
    padding: 24px 0;
}

.group-description {
    font-size: 14px;
    white-space: normal;
}

#coming-soon {
    border: 1px solid #9bad9e;
    border-radius: 5px;
    padding: 24px;
}

#coming-soon::backdrop {
    background: #0005;
}

.plant-grid {
    display: grid;
    max-width: 800px;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

.plant-grid .public-gallery {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    width: 100%;
}

.plant-grid .plant-box {
    grid-column: 2;
    grid-row: 1;
    top: 0;
    width: 280px;
    box-sizing: border-box;
}

.plant-grid .plant-details, .plant-grid .plant-description, .plant-grid .admin-plant-tools {
    grid-column: 1/-1;
    width: 100%;
}

.plant-grid .plant-details {
    grid-row: 2;
}

.plant-grid .plant-details .summary {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    border: 1px solid #d8e3da;
    border-radius: 4px;
    overflow: hidden;
}

.plant-grid .plant-details .summary dt, .plant-grid .plant-details .summary dd {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #d8e3da;
    line-height: 1.5;
}

.plant-grid .plant-details .summary dt {
    font-size: 16px;
    font-weight: 700;
    background: #f1f6f1;
    color: #2e6f40;
}

.plant-grid .plant-details .summary dd {
    font-size: 14px;
}

.plant-grid .plant-details .summary dd::after {
    display: none;
}

.plant-grid .plant-description h2 {
    font-size: 16px;
}

.plant-grid .plant-description p {
    font-size: 14px;
    line-height: 1.6;
}

.plant-grid .scientific em {
    font-size: 14px;
    font-weight: 400;
}

.plant-grid .scientific .kew-author {
    font-size: 14px;
    font-weight: 400;
}

.plant-grid .public-gallery .gallery-layout {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.plant-grid .public-gallery .gallery-main {
    width: 100%;
    height: 350px;
}

.plant-grid .public-gallery .gallery-thumbnails {
    display: flex;
    flex-direction: row;
    overflow: auto;
    max-height: none;
}

.plant-grid .public-gallery .gallery-caption, .plant-grid .public-gallery .gallery-credit {
    margin-left: 0;
}

@media (max-width: 1150px) {
    .cards-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .cards-controls nav {
        position: static;
        transform: none;
        order: 0;
    }

    .cards-controls form {
        justify-content: flex-end;
        order: 1;
    }

}

@media (max-width: 800px) {
    .public-site .public-layout {
        display: flex;
        flex-direction: column;
    }

    .public-site .site-nav {
        flex-basis: auto;
    }

    .public-site main {
        box-sizing: border-box;
        max-width: 840px;
    }

    .public-site .site-nav nav {
        display: flex;
        flex-wrap: wrap;
    }

}

@media (max-width: 650px) {
    .plant-grid {
        display: flex;
        flex-direction: column;
    }

    .plant-grid .plant-box {
        width: 100%;
    }

    .plant-grid .plant-details .summary {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .plant-grid .public-gallery .gallery-main {
        height: 300px;
    }

}
/* Space between thumbnails and their horizontal scrollbar */
.plant-grid .public-gallery .gallery-thumbnails {
    padding-bottom: 16px;
}

/* Space between the thumbnail strip and caption */
.plant-grid .public-gallery .gallery-caption {
    margin-top: 12px;
}

/* Minor Update: IUCN integration — shared public/admin infobox. */
.plant-grid .box-binomial .scientific em {
    font-family: Georgia, serif;
    font-size: 18px;
    font-style: italic;
    overflow-wrap: anywhere;
}

.plant-grid .box-binomial .scientific .kew-author {
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-style: normal;
    overflow-wrap: anywhere;
}

.plant-grid .iucn-status {
    margin-top: 16px;
}

.plant-grid .iucn-scale {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 8px;
    overflow: visible;
}

.plant-grid .scale-label {
    fill: #69716c;
    font: 11px Arial, sans-serif;
    text-anchor: middle;
}

.plant-grid .scale-label.selected {
    fill: #111;
    font-weight: 700;
}

.plant-grid .selected-outline {
    fill: none;
    stroke: #111;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.plant-grid .iucn-selected-status {
    display: block;
    margin: 5px 0 0;
    color: #111;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}

/* Shared public/admin distribution details in the plant information box. */
.plant-grid .distribution {
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.plant-grid .distribution > div + div {
    margin-top: 4px;
}

.plant-grid .classification-heading {
    position: relative;
}

.classification-heading .info-tip {
    position: static;
}

.classification-heading .info-tip [role=tooltip] {
    right: 0;
    box-sizing: border-box;
    max-width: calc(100vw - 48px);
}

/* Keep the upright variety marker at the same size as the scientific name. */
.plant-grid .box-binomial .scientific {
    font-family: Georgia, serif;
    font-size: 18px;
    font-style: normal;
}
