/* Unit image sets (wave 10, 2026-11-09, core/unitphotos.py): focal-point crops, photo shelves, emblems, the generated
   cover with the unit's emblem as a soft watermark, and the optional college colour tint (off by default). */

/* emblem watermark over the generated drawing: the Hub's one-colour emblem, tiled, drawn white and very soft */
.w-cover-art, .w-unit-photo[data-art], .p-cover-art { position: relative }
.w-art-emblem { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; background-size: 88px 88px;
  background-position: center; opacity: .13; filter: brightness(0) invert(1) }
.w-unit-photo { position: relative }

/* small emblem badge on unit cards (shown only when the Hub's emblem index lists the unit) */
.w-cover .w-emblem-badge { position: absolute; inset-block-end: 10px; inset-inline-start: 10px; width: 40px; height: 40px;
  object-fit: contain; padding: 4px; border-radius: 50%; background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); z-index: 2; transition: none; transform: none }
a:hover > .w-cover img.w-emblem-badge, a:focus-visible > .w-cover img.w-emblem-badge { transform: none }

/* emblem next to the name on unit and programme pages */
.w-unit-emblem { width: 64px; height: 64px; object-fit: contain; padding: 6px; border-radius: 14px;
  background: rgba(255, 255, 255, .94); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); margin-block-end: 4px }
.w-prog-emblem { width: 36px; height: 36px; object-fit: contain; float: inline-end; margin-inline-start: 8px }

/* optional college colour tint (UnitPhotoSetting.tint): a soft wash in the college colour */
.w-tinted, [data-tint] { position: relative }
.w-tinted::before, [data-tint]::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--tint, transparent); mix-blend-mode: soft-light; opacity: .55 }
.w-shelf-item a { display: block; position: relative; border-radius: var(--r-sm, 8px); overflow: hidden }

/* the cover of a programme page (its own photo, else its department's / college's cover, else the drawing) */
.p-cover { width: 100%; aspect-ratio: 16 / 6; max-height: 300px; border-radius: var(--r-lg, 14px); overflow: hidden;
  margin-block-end: var(--s-3, 16px); background: var(--green-900, #0B3D2E) }
.p-cover img { width: 100%; height: 100%; object-fit: cover; display: block }

/* photo shelves of a unit page */
.w-shelf + .w-shelf { margin-block-start: var(--s-5, 32px) }
.w-shelf-title { margin: 0 0 var(--s-2, 12px); font-size: 19px; font-weight: 600; color: var(--ink, #12201A) }
.w-shelf-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2, 12px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)) }
.w-shelf-item { margin: 0; display: flex; flex-direction: column; gap: 6px }
.w-shelf-item img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  border-radius: var(--r-sm, 8px); box-shadow: var(--sh-1, 0 1px 3px rgba(0, 0, 0, .15)) }
.w-shelf-item a:focus-visible { outline: 3px solid var(--focus, #C9A54C); outline-offset: 2px; border-radius: 8px }

@media (max-width: 720px) {
  /* phones: the 4:5 crop of an editor's cover fills a taller box */
  .w-unit-photo[data-crop="phone"] { aspect-ratio: 4 / 5; max-height: 460px }
  .p-cover { aspect-ratio: 4 / 5; max-height: 420px }
  .p-cover-art { aspect-ratio: 16 / 10 }
  .w-shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
  .w-unit-emblem { width: 52px; height: 52px }
}
@media (max-width: 400px) { .w-shelf-grid { grid-template-columns: 1fr } }

/* editor: focal point picker */
.e-focal { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; line-height: 0;
  border-radius: 8px; overflow: hidden; touch-action: manipulation }
.e-focal img { max-width: 100%; max-height: 360px; display: block }
.e-focal-dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 0 0 2px #0B3D2E, 0 2px 6px rgba(0, 0, 0, .4); pointer-events: none }
.e-crops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px }
.e-crops figure { margin: 0; font-size: 12px; text-align: center }
.e-crops img { display: block; height: 72px; width: auto; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .2) }
.e-shelf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px }
.e-photo-card { border: 1px solid rgba(0, 0, 0, .12); border-radius: 10px; padding: 12px; display: flex;
  flex-direction: column; gap: 8px; background: #fff }
.e-photo-card img.e-photo-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px }
.e-refresh li { margin-block: 4px }
@media (prefers-reduced-motion: reduce) { .e-focal-dot { transition: none } }
