.photo-block {
  max-width: 500px;
  margin: 0 auto 1.5em;
}

.photo-block img {
  display: block;
  width: 100%;
  padding-bottom: 0 !important; /* override doctext img rule */
}

.photo-block .caption {
  margin-top: 0.35em;
  line-height: 1.5;
  text-align: left;
}

.doctext .who-title {
  font-size: 1.2em;
  color: #b00000;
}

/* Thumbnails: kill doctext img padding, keep images "tight" */
#work section.compact-thumbs img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
}

/* Prevent stretched columns creating phantom space */
#work .compact-thumbs .row {
  align-items: flex-start;
}

/* Spacing policy around the thumb block */
#work .who-title + section.compact-thumbs {
  margin-top: 0.75em;
}

#work section.compact-thumbs {
  margin-bottom: 1.75em;
}

#work section.compact-thumbs + p {
  margin-top: 0;
}


/* Desktop/tablet: keep uniform tile sizing (prevents "last one gets huge") */
#work section.compact-thumbs .row > div {
  width: auto !important;                 /* override HTML5UP .col-* % widths */
  flex: 0 1 clamp(200px, 24vw, 310px);    /* uniform tiles */
  min-width: 200px;
}

/* Phone: default to 2-up (big thumbs), but single-image sections become 1-up */
@media screen and (max-width: 736px) {
  /* 2 per row */
  #work section.compact-thumbs .row > div {
    flex: 0 1 calc(50% - 6.25px);  /* matches gtr-25 gutter */
    min-width: 0;
  }

  /* If there is only ONE thumbnail in this section, make it full width */
  #work section.compact-thumbs .row > div:only-child {
    flex-basis: 100%;
  }
}

/* Opt-in: strict 2x2 grid that hugs thumbs (no 3+1, no spreading) */
#work section.compact-thumbs.grid2 .row {
  display: grid;

  /* hug content instead of stretching to full container width */
  grid-template-columns: repeat(2, auto);

  /* keep the 2x2 block centered */
  justify-content: center;

  /* prevent rows from spacing out vertically */
  align-content: start;

  /* center items inside cells */
  justify-items: center;

  column-gap: 12.5px;  /* matches gtr-25 visual spacing */
  row-gap: 12.5px;

  margin: 0 !important; /* truly cancels HTML5UP row negative margins */
}

#work section.compact-thumbs.grid2 .row.gtr-25 > *,
#work section.compact-thumbs.grid2 .row > * {
  padding: 0 !important;  /* cancels HTML5UP gutter padding */
  width: auto !important;
}

/* Desktop cap */
#work section.compact-thumbs.grid2 img {
  width: 100%;
  max-width: 310px;
}

/* Phones: allow images to shrink to fit cell */
@media screen and (max-width: 736px) {
  #work section.compact-thumbs.grid2 img {
    max-width: 100%;
  }
}

/* =========================
   YouTube thumbnail + caption
   ========================= */

.yt-figure{
  width: 100%;
  max-width: 560px;
  margin: 1em auto;
}

/* Thumbnail link */
.yt-thumb{
  display: block;
  width: 100%;
  position: relative;
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
}

/* Thumbnail image */
.yt-thumb img{
  display: block;
  width: 100%;
  height: auto;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 1;
}

.yt-thumb:hover img{
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}

/* Play button */
.yt-thumb::after{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
  z-index: 2;
}

.yt-thumb::before{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 22px solid #fff;
  pointer-events: none;
  z-index: 3;
}

/* Caption (default left; can opt into center) */
.yt-figure figcaption{
  margin-top: 0.15em;
  font-size: 0.9em;
  line-height: 1.4;
  color: rgba(0,0,0,0.65);
  text-align: left;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.yt-figure.caption-center figcaption{
  text-align: center;
}

.yt-figure.caption-left figcaption{
  text-align: left !important;
  padding-left: 0.4em;
}

.yt-figure.caption-left{
  text-align: left !important;
}

/* =========================
   Link styling (tuned, higher contrast)
   ========================= */

a {
  color: #176f95;                 /* darker cyan-blue (more contrast) */
  text-decoration: none;
  border-bottom: 1.5px solid rgba(23,111,149,0.45);
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: #0f566f;                 /* clear but not loud */
  border-bottom-color: currentColor;
}

a:visited {
  color: #1e5f77;                 /* darker visited, still non-purple */
  border-bottom-color: rgba(30,95,119,0.45);
}

a:focus-visible {
  outline: 3p
}

/* =========================
   Box cards: neutral link styling
   ========================= */

.box a {
  color: #111;              /* near-black */
  border-bottom: none;      /* no underline/border */
  font-weight: 600;         /* optional: helps affordance */
}

.box a:hover {
  color: #000;              /* subtle hover feedback */
}


/* =========================
   Nav menu: remove underline only
   ========================= */

#nav a {
  border-bottom: none !important;   /* cancel global link underline */
  text-decoration: none !important;
}



