/* Shared appearance for profile cards and published vacancies. */
:root {
  --profile-royal-gold: #c5a04a;
  --profile-gap: clamp(16px, 2vw, 24px);
}
html body :is(.help-provider-card, .help-profile-card, .footer-profile-card, .recent-firm-card, .pt-card, .material-provider, .finder-result, .hr-item, .rc-firm, .client-local-provider, [data-profile-kind], #adsList > .ad-card),
html body .identity-profile-dialog {
  box-sizing: border-box;
  min-width: 0;
  border: 4px solid var(--profile-royal-gold) !important;
  border-radius: 18px !important;
  background-color: white !important;
  box-shadow: none !important;
}
html body :has(> :is(.help-provider-card, .help-profile-card, .footer-profile-card, .recent-firm-card, .pt-card, .material-provider, .finder-result, .hr-item, .rc-firm, .client-local-provider, [data-profile-kind], #adsList > .ad-card) + :is(.help-provider-card, .help-profile-card, .footer-profile-card, .recent-firm-card, .pt-card, .material-provider, .finder-result, .hr-item, .rc-firm, .client-local-provider, [data-profile-kind], #adsList > .ad-card)),
html body #adsList,
html body #wkList {
  gap: var(--profile-gap) !important;
}
#materialet .material-providers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
#materialet .material-provider {
  padding: clamp(14px, 2vw, 20px);
  margin: 0;
}

:root { --profile-columns: 4; }
@media (max-width: 1000px) { :root { --profile-columns: 2; } }
@media (max-width: 600px) { :root { --profile-columns: 1; } }

html body :is(#adsList, #wkList, .material-providers, .help-provider-list,
  .footer-profile-grid, .recent-firm-grid, .client-local-providers, .hr-list,
  :has(> :is(.finder-result, .rc-firm, .fr-row, .pt-card) + :is(.finder-result, .rc-firm, .fr-row, .pt-card))):not([hidden]) {
  display: grid !important;
  grid-template-columns: repeat(var(--profile-columns), minmax(0, 1fr)) !important;
}

/* Give each listing enough space for a photo and a readable text column. */
html body :is(#autoResults,#adsList,#wkList,.material-providers,.help-provider-list,
  .footer-profile-grid,.recent-firm-grid,.client-local-providers,.hr-list,
  :has(> :is(.vehicle-profile-card,.rc-firm,.finder-result,.pt-card,.fr-row))):not([hidden]) {
  grid-template-columns: minmax(0,1fr) !important;
}
html body #autoResults > .auto-card,
html body #mobiljet #furnitureMarket .animal-results > .animal-card,
html body article.vehicle-profile-card {
  display: grid !important;
  grid-template-columns: minmax(0,2fr) minmax(0,3fr) !important;
  column-gap: 5% !important;
  align-items: start;
}
html body #autoResults .auto-card-body,
html body .vehicle-profile-card-body,
html body #mobiljet .animal-card-info { min-width: 0; overflow-wrap: anywhere; }
html body #autoResults .auto-card-media { width: 100%; }
html body :is(.auto-card-body,.animal-card-info,.vehicle-profile-actions,.material-provider) > .tnv-product-document {
  margin-top: 5%;
  width: 100%;
}
html body #mobiljet #furnitureMarket .animal-results > article.animal-card { margin: 5% !important; }

/* Keep the original identity, description and actions in the same card. */
html body :is(.wk-card,.ad-card,.help-profile-card,.help-provider-card,.footer-profile-card,
  .recent-firm-card,.client-local-provider,.finder-result,.pt-card,.hr-item):has(> :is(.profile-identity-heading,.wk-top) > .profile-identity-avatar) {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(0,3fr);
  column-gap: 5%;
  align-content: start;
  align-items: start;
}
html body :is(.wk-card,.ad-card,.help-profile-card,.help-provider-card,.footer-profile-card,
  .recent-firm-card,.client-local-provider,.finder-result,.pt-card,.hr-item):has(> :is(.profile-identity-heading,.wk-top) > .profile-identity-avatar) > * { grid-column: 2; min-width: 0; }
html body :is(.wk-card,.ad-card,.help-profile-card,.help-provider-card,.footer-profile-card,
  .recent-firm-card,.client-local-provider,.finder-result,.pt-card,.hr-item) > :is(.profile-identity-heading,.wk-top):has(> .profile-identity-avatar) {
  display: contents !important;
}
html body :is(.wk-card,.ad-card,.help-profile-card,.help-provider-card,.footer-profile-card,
  .recent-firm-card,.client-local-provider,.finder-result,.pt-card,.hr-item) > :is(.profile-identity-heading,.wk-top) > .profile-identity-avatar {
  grid-column: 1; grid-row: 1 / span 8; justify-self: center;
  width: min(100%, 9rem); height: auto; aspect-ratio: 1;
}
html body :is(.profile-identity-heading,.wk-top) > .profile-identity-avatar + * { grid-column: 2; }
