/* Public home page (portal/home.ftl): filters on the left, search and results on the right */

.ph-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
@media (max-width: 767.98px) {
    .ph-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    /* one column: filters, results, then the feeds */
    .ph-layout > aside { display: contents; }
    .ph-machines { order: 2; }
}

/* who runs this IPT and the totals, above the filters and results */
.ph-intro { display: flex; flex-direction: column; gap: 4px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid #dee2e6; }
.ph-intro p { margin: 0; }
.ph-intro h1 { margin: 0; text-wrap: balance; }
.ph-intro .ph-where { color: #6c757d; font-size: 0.875rem; margin-bottom: 4px; }
/* main.css colours every link with !important */
.ph-where a { color: inherit !important; text-decoration: underline; text-decoration-color: #dee2e6; }
.ph-where a:hover, .ph-where a:focus-visible { color: rgb(var(--color-gbif-primary)) !important; }
.ph-lead { color: #495057; font-size: 0.875rem; max-width: 72ch; }
.ph-intro .ph-facts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.8125rem; color: #6c757d; }
.ph-facts b { color: #212529; font-weight: 600; font-variant-numeric: tabular-nums; }
.ph-facts .material-icon { vertical-align: -0.15em; }

/* filters: always open on wide screens, a collapsed "Filters" disclosure on narrow ones */
.ph-filters > summary { display: none; }
@media (max-width: 767.98px) {
    .ph-filters { border: 1px solid #dee2e6; border-radius: 6px; padding: 8px 12px; }
    .ph-filters > summary { display: list-item; cursor: pointer; color: #4E565F; font-weight: 500; }
    .ph-filters[open] > summary { margin-bottom: 10px; }
}
.ph-facet { margin-bottom: 18px; font-size: 0.875rem; }
.ph-facet h2 { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; font-weight: 600; margin: 0 0 6px; }
.ph-facet label { display: flex; gap: 7px; align-items: flex-start; padding: 2px 0; cursor: pointer; color: #4E565F; line-height: 1.3; }
.ph-facet label .form-check-input { margin-top: .15em; flex-shrink: 0; }
.ph-facet label .ph-n { margin-left: auto; padding-left: 6px; color: #6c757d; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.ph-facet label.ph-zero { color: #adb5bd; }
.ph-facet label.ph-zero .ph-n { color: #adb5bd; }
.ph-machines { border-top: 1px solid #dee2e6; padding-top: 12px; font-size: 0.8125rem; }
.ph-machines a { display: block; padding: 2px 0; }

/* search */
.ph-search { max-width: 420px; margin-bottom: 12px; }
.ph-search input { color: #212529; }
.ph-search input:focus { outline: 0; border-color: rgba(var(--color-gbif-primary), .7); box-shadow: 0 0 0 .2rem rgba(var(--color-gbif-primary), .2); }

/* active filters, as removable chips */
.ph-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ph-chips:empty { display: none; }
.ph-chip { font-size: 0.75rem; border: 1px solid rgba(var(--color-gbif-primary), .8); background: rgba(var(--color-gbif-primary), .08); color: #212529; border-radius: 14px; padding: 1px 4px 1px 10px; display: inline-flex; gap: 4px; align-items: center; }
.ph-chip button { border: 0; background: none; padding: 0; cursor: pointer; color: #6c757d; border-radius: 50%; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.ph-chip button:hover, .ph-chip button:focus-visible { background: rgba(0, 0, 0, .08); color: #212529; }
button.ph-chip-clear { font-size: 0.75rem; border: 1px dashed #adb5bd; background: #fff; color: #4E565F; border-radius: 14px; padding: 1px 10px; cursor: pointer; }

/* count, sort, view */
.ph-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; font-size: 0.8125rem; color: #6c757d; }
.ph-bar .ph-count { flex: 1; }
.ph-bar .ph-count b { color: #212529; font-weight: 600; }
.ph-bar label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.ph-bar select { width: auto; }
/* select2 on the sort, at the height of the List/Table toggle (select2-ipt.css) */
.ph-bar .select2-container--bootstrap4 { --s2-font-size: .8125rem; --s2-height: 26px; --s2-padding-x: .5rem; --s2-radius: 4px; }
.ph-seg { display: inline-flex; border: 1px solid #dee2e6; border-radius: 4px; overflow: hidden; }
.ph-seg button { border: 0; background: #fff; font-size: 0.8125rem; padding: 2px 10px; cursor: pointer; color: #6c757d; }
.ph-seg button + button { border-left: 1px solid #dee2e6; }
.ph-seg button[aria-pressed="true"] { background: #f6f7f8; color: #212529; font-weight: 600; }

.ph-results { transition: opacity .15s; }
.ph-results[aria-busy="true"] { opacity: .5; }

/* list view */
.ph-res { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; padding: 14px 4px; border-bottom: 1px solid #dee2e6; }
.ph-logo { width: 56px; height: 56px; border-radius: 6px; border: 1px solid #dee2e6; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; }
.ph-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
a.ph-logo-none { background: #f6f7f8; border-color: #eef0f2; color: #ced4da !important; text-decoration: none; font-size: 1.5rem; }
.ph-res h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.35; }
/* main.css colours every link with !important, so the link colours here need it too */
.ph-res h3 a { color: #212529 !important; text-decoration: none; }
.ph-res h3 a:hover, .ph-res h3 a:focus-visible { color: rgb(var(--color-gbif-primary)) !important; }
.ph-org { font-size: 0.8125rem; color: #6c757d; margin-top: 1px; }
.ph-desc { font-size: 0.8125rem; color: #495057; margin: 5px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.ph-pill { font-size: 0.6875rem; border: 1px solid #dee2e6; border-radius: 10px; padding: 0 8px; line-height: 18px; color: #4E565F !important; background: #fff; white-space: nowrap; text-decoration: none; }
a.ph-pill:hover, a.ph-pill:focus-visible { border-color: #adb5bd; color: #212529 !important; }
.ph-pill.ph-pill-gbif { border-color: rgba(var(--color-gbif-primary), .7); }
.ph-pill .material-icon { vertical-align: -0.15em; }
.ph-pills .dt-content-pill { font-size: 0.6875rem; line-height: 18px; padding: 0 8px; border-radius: 10px; }
.ph-meta { text-align: right; font-size: 0.8125rem; color: #6c757d; white-space: nowrap; }
.ph-meta b { display: block; color: #212529; font-size: 0.9375rem; font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
    .ph-res { grid-template-columns: 44px minmax(0, 1fr); }
    .ph-logo { width: 44px; height: 44px; }
    .ph-meta { grid-column: 2; text-align: left; white-space: normal; }
    .ph-meta b { display: inline; margin-right: 4px; }
}

/* table view */
.ph-table-wrap { overflow-x: auto; }
table.ph-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
table.ph-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #dee2e6; white-space: nowrap; }
table.ph-table td { padding: 7px 8px; border-bottom: 1px solid #f1f3f5; vertical-align: top; }
table.ph-table .ph-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.ph-table td a { color: #212529 !important; font-weight: 500; text-decoration: none; }
table.ph-table td a:hover { color: rgb(var(--color-gbif-primary)) !important; }

/* pager */
.ph-pager { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.ph-pager:empty { display: none; }
.ph-pager button { border: 1px solid #dee2e6; background: #fff; border-radius: 4px; min-width: 30px; padding: 2px 8px; cursor: pointer; font-size: 0.8125rem; color: #4E565F; }
.ph-pager button[aria-current="page"] { border-color: rgb(var(--color-gbif-primary)); background: rgba(var(--color-gbif-primary), .08); font-weight: 600; color: #212529; }
.ph-pager button:disabled { color: #adb5bd; cursor: default; }
.ph-pager .ph-gap { padding: 2px 4px; color: #6c757d; }

/* nothing to show */
.ph-empty { border: 1px dashed #dee2e6; border-radius: 8px; padding: 30px; text-align: center; color: #6c757d; margin-top: 8px; }
.ph-empty h2, .ph-empty h3 { color: #4E565F; font-weight: 500; font-size: 1.125rem; margin: 0 0 6px; }
.ph-empty p:last-child { margin-bottom: 0; }

mark.ph-mark { background: rgba(var(--color-gbif-primary), .22); padding: 0 1px; border-radius: 2px; color: inherit; }

/* the record count links to the resource page's Data records section; it keeps the text colours until hovered */
a.ph-records { color: inherit !important; text-decoration: none; }
a.ph-records:hover, a.ph-records:focus-visible { color: rgb(var(--color-gbif-primary)) !important; }
a.ph-records:hover b, a.ph-records:focus-visible b { color: inherit; }
table.ph-table td a.ph-records { font-weight: normal; }
