/*
 * R13 post-launch UI correction layer.
 *
 * Bounded to confirmed live defects only. This file intentionally does not
 * redefine the locked R7 visual system, page composition, color or typography.
 */

/* Contact runtime block markup omits the contact-shell class on the hero grid.
   Give the grid the same approved shell contract directly. */
.contact-hero-grid{
  width:min(var(--contact-shell),calc(100% - (var(--gutter)*2)));
  margin-inline:auto;
}

@media(max-width:780px){
  /* Preserve tertiary visual hierarchy while restoring usable touch geometry. */
  main .actions > .text-action{
    display:inline-flex;
    align-items:center;
    min-height:44px;
    padding-block:10px;
  }

  .hub-hero .actions > .text-action,
  .contact-hero .actions > .text-action,
  .service-hero .actions > .text-action,
  .managed-hero .actions > .text-action,
  .final-service-cta .actions > .text-action,
  .final-managed-cta .actions > .text-action{
    justify-content:center;
  }

  .channel-detail a,
  .guide-card .read-guide,
  .section-copy p > .dsp-related-route,
  .article-body p > .dsp-related-route{
    display:inline-flex;
    align-items:center;
    min-height:44px;
    padding-block:8px;
  }

  /* Preserve the current title + arrow link semantics while giving both
     controls bounded mobile touch geometry. */
  .service-row{
    grid-template-columns:38px minmax(0,1fr) 44px;
  }

  .service-row h3 a{
    display:flex;
    align-items:center;
    min-height:44px;
  }

  .service-row .arrow{
    align-self:center;
  }

  .service-row .arrow a{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    min-width:44px;
    min-height:44px;
  }
}


/* R13 human-review rejection repair — global shell and template cleanup. */

/* Home historically constrained the header element itself. Keep the canvas
   viewport-wide everywhere; only header-inner owns the readable shell. */
.site-header{
  width:100%;
  max-width:none;
  margin-inline:0;
  height:auto;
  display:block;
}

/* Special-page heroes use the same centered shell contract as their body. */
.blog-hero-grid{
  width:min(var(--blog-shell),calc(100% - (var(--gutter)*2)));
  margin-inline:auto;
}

/* The About generator wraps number + copy in one paragraph. Put the grid on
   that paragraph instead of forcing the whole paragraph into a 52px track. */
.capability-rail > div{
  display:block;
}
.capability-rail > div > p{
  display:grid;
  grid-template-columns:52px minmax(0,1fr);
  gap:18px;
  align-items:start;
  margin:0;
}

/* Public proof modules show the work, not implementation/evidence notes. */
.proof-section .proof-head > p{
  display:none;
}

/* Normalize templated proof canvases so source image dimensions cannot make
   a page arbitrarily tall. */
.service-proof-grid,
.project-proof-grid{
  min-height:0;
}
.service-proof-grid figure,
.project-proof-grid figure{
  position:relative;
  min-width:0;
  min-height:0;
  overflow:hidden;
}
.service-proof-grid img,
.project-proof-grid img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.service-proof-grid:not(.proof-count-1):not(.proof-count-2):not(.proof-count-4),
.project-proof-grid:not(.proof-count-1):not(.proof-count-2):not(.proof-count-4){
  height:clamp(430px,38vw,540px);
  grid-template-rows:repeat(2,minmax(0,1fr));
}

.service-proof-grid.proof-count-1,
.project-proof-grid.proof-count-1{
  display:grid;
  grid-template-columns:1fr;
}
.service-proof-grid.proof-count-1 figure,
.project-proof-grid.proof-count-1 figure{
  min-height:0;
  height:clamp(360px,36vw,500px);
  aspect-ratio:auto;
}

.service-proof-grid.proof-count-2,
.project-proof-grid.proof-count-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:auto;
}
.service-proof-grid.proof-count-2 figure,
.project-proof-grid.proof-count-2 figure{
  min-height:0;
  aspect-ratio:8/5;
}

.service-proof-grid.proof-count-4,
.project-proof-grid.proof-count-4{
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(2,minmax(0,1fr));
  height:clamp(430px,38vw,520px);
}
.service-proof-grid.proof-count-4 figure,
.project-proof-grid.proof-count-4 figure{
  min-height:0;
  aspect-ratio:auto;
}

@media(max-width:780px){
  .capability-rail > div > p{
    grid-template-columns:42px minmax(0,1fr);
    gap:14px;
  }

  .service-proof-grid:not(.proof-count-1):not(.proof-count-2):not(.proof-count-4),
  .project-proof-grid:not(.proof-count-1):not(.proof-count-2):not(.proof-count-4){
    height:auto;
  }

  .service-proof-grid.proof-count-1,
  .service-proof-grid.proof-count-2,
  .service-proof-grid.proof-count-4,
  .project-proof-grid.proof-count-1,
  .project-proof-grid.proof-count-2,
  .project-proof-grid.proof-count-4{
    display:flex;
    flex-direction:column;
  }

  .service-proof-grid.proof-count-1 figure,
  .service-proof-grid.proof-count-2 figure,
  .service-proof-grid.proof-count-4 figure,
  .project-proof-grid.proof-count-1 figure,
  .project-proof-grid.proof-count-2 figure,
  .project-proof-grid.proof-count-4 figure{
    min-height:0;
    height:auto;
    aspect-ratio:4/3;
  }
}
