/* Workstream 07: gallery-only enhancements. Existing image crops remain in styles.css. */
[hidden] { display: none !important; }
.gallery-project h2, .gallery-project h3, #project-finder, #additional-projects {
  scroll-margin-top: 7rem;
}
.gallery-project h2:focus, .gallery-project h3:focus, #finder-title:focus {
  outline: 3px solid #2563eb;
  outline-offset: 5px;
}
.gallery-photo { display: block; cursor: zoom-in; }
.gallery-photo:focus-visible { outline-offset: -4px; }
.section .project-story { margin-top: 1rem; }
.section .project-back { font-size: .85rem; margin-top: .8rem; }
.project-finder label { display: block; font-weight: 650; margin-bottom: .45rem; }
.finder-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.project-finder select {
  width: 100%; min-height: 48px; padding: .65rem .75rem;
  border: 1px solid #64748b; border-radius: .5rem;
  color: #111827; background: white; font: inherit;
}
.section .finder-help { margin-top: .8rem; font-size: .9rem; color: #374151; }
#project-status:empty { display: none; }
#project-matches { columns: 2; column-gap: 2rem; }
#project-matches li { break-inside: avoid; }
#project-matches a { display: inline-block; padding: .35rem 0; }
.additional-projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.25rem; }
.additional-project { min-width: 0; border-top: 1px solid #d1d5db; padding-top: 1rem; }
.additional-project h3 { margin: 0 0 .75rem; font-size: 1.1rem; }
.additional-project .before-after { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Match the existing 180px thumbnail height and object-fit, including .focus-top. */
.gallery-viewer {
  width: min(1100px, calc(100% - 2rem)); max-width: none;
  max-height: 94vh; max-height: 94dvh; padding: 1rem;
  border: 0; border-radius: .85rem; color: #111827; background: #fff;
  box-shadow: 0 15px 65px #0008; overflow: auto;
}
.gallery-viewer::backdrop { background: rgb(2 6 23 / 88%); }
.viewer-toolbar, .viewer-actions { display: flex; gap: .75rem; align-items: center; justify-content: space-between; }
.viewer-toolbar h2 { font-size: 1.1rem; margin: 0; }
.gallery-viewer button {
  min-height: 44px; padding: .5rem .85rem; border: 1px solid #64748b;
  border-radius: .4rem; background: #111827; color: #fff; font: inherit; cursor: pointer;
}
#viewer-close { flex: 0 0 auto; }
.viewer-position { margin: .6rem 0; color: #374151; font-size: .85rem; }
.gallery-viewer figure { margin: 0; }
.gallery-viewer img {
  display: block; width: 100%; height: 65vh; height: 65dvh;
  object-fit: contain; background: #0f172a;
}
.gallery-viewer figcaption { padding: .65rem 0; line-height: 1.45; }
.viewer-actions a { color: #1d4ed8; text-align: center; padding: .6rem .2rem; }
@media (max-width: 768px) {
  .finder-fields, .additional-projects { grid-template-columns: 1fr; }
  #project-matches { columns: 1; }
  .gallery-project h2, .gallery-project h3, #project-finder, #additional-projects { scroll-margin-top: 10rem; }
}
@media (max-width: 560px) {
  .additional-project .before-after { grid-template-columns: 1fr; }
  .gallery-viewer { width: calc(100% - 1rem); padding: .75rem; }
  .gallery-viewer img { height: 53vh; height: 53dvh; }
  .viewer-actions { flex-wrap: wrap; }
  .viewer-actions a { order: 3; width: 100%; }
}
