/* Shared standard for documented repairs; only explicitly marked grids opt in.
   Layered important sizing supersedes legacy page-specific photo overrides. */
@layer prostar-work-cards {
  .prostar-work-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 275px)) !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 1142px !important;
    margin: 0 auto !important;
  }

  .prostar-work-grid > article {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 1px solid #c7dceb !important;
    border-radius: 15px !important;
    background: #fff !important;
    box-shadow: 0 6px 20px rgba(3, 30, 60, .07) !important;
    scroll-margin-top: 176px !important;
  }

  .prostar-work-grid > article > figure {
    display: block !important;
    position: relative !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
  }

  .prostar-work-grid > article > figure::before,
  .prostar-work-grid > article > figure::after {
    content: none !important;
  }

  .prostar-work-grid > article > figure > img {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: contain !important;
  }

  /* These documented photo sets consist of matching 3:4 images. */
  .prostar-work-grid > article > figure.washer-repair-pair,
  .prostar-work-grid > article > figure.repair-photo-collage {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto !important;
    gap: 0 !important;
  }
  .prostar-work-grid > article > figure.repair-photo-collage {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
  }
  .prostar-work-grid > article > figure.repair-photo-collage > img:first-child {
    grid-row: span 2 !important;
  }

  .prostar-work-grid > article > figure > figcaption {
    position: absolute !important;
    inset: auto 8px 8px 8px !important;
    width: max-content !important;
    max-width: calc(100% - 16px) !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    background: #031e3ce8 !important;
    color: #fff !important;
    font-size: .68rem !important;
    line-height: 1.3 !important;
    z-index: 2 !important;
  }

  .prostar-work-grid > article > :is(.repair-story-copy, div:not([class])) {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 14px !important;
  }
  .prostar-work-grid > article h3 {
    margin: 5px 0 6px !important;
    color: var(--navy) !important;
    font-size: 1.15rem !important;
    line-height: 1.25 !important;
  }
  .prostar-work-grid > article > :is(.repair-story-copy, div:not([class])) > p {
    margin: 0 0 10px !important;
    font-size: .92rem !important;
    line-height: 1.5 !important;
  }
  .prostar-work-grid > article > :is(.repair-story-copy, div:not([class])) > .text-link {
    align-self: flex-start !important;
    margin-top: 4px !important;
    font-size: .85rem !important;
  }
  .prostar-work-grid > article .repair-story-tags {
    margin-bottom: 5px !important;
  }
  .prostar-work-grid > article .repair-story-tags span {
    padding: 3px 6px !important;
  }
  .prostar-work-grid > article .repair-story-copy > details {
    margin: 0 0 8px !important;
  }
  .prostar-work-grid > article .repair-story-copy > details > summary {
    padding: 5px 0 !important;
  }
  @media (max-width: 700px) {
    .prostar-work-grid {
      grid-template-columns: minmax(0, 320px) !important;
    }
  }
}
