/* portrait.css — interactive glyph portrait (pairs with portrait.js)
   Classes used: .ap-figure  .ap-canvas  .ap-layers  .ap-caption */

/* 1) TOKENS — ADAPTED: pointing at the site's own colour variables */
.ap-figure{
  --ap-fg:var(--ink);     /* main letters + active button  -> site's primary text colour */
  --ap-ac:var(--acc);     /* shadow letters + active underline + focus ring -> site's accent colour */
  --ap-mut:var(--mute);   /* caption + inactive buttons    -> site's muted text colour */
}

/* 2) FIGURE — the canvas is 4:5, so capping the width at 76svh x .8 caps the height at 76svh */
.ap-figure{
  margin:0;width:100%;justify-self:center;
  max-width:min(100%,calc(76vh*.8));
  max-width:min(100%,calc(76svh*.8));
}
.ap-canvas{display:block;width:100%;aspect-ratio:4/5;touch-action:pan-y;cursor:crosshair}

/* 3) CAPTION + LAYER BUTTONS */
.ap-figure figcaption{margin-top:10px;color:var(--ap-mut);font-size:12px;line-height:1.6}
.ap-caption{margin:0 0 .4em;max-width:62ch}

.ap-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin:12px 0 8px}
.ap-layers{display:flex;flex-wrap:wrap;gap:6px 18px}
.ap-layers button{all:unset;display:inline-block;cursor:pointer;color:var(--ap-mut);font-size:12px;border-bottom:2px solid transparent}
.ap-layers button:hover{color:var(--ap-fg)}
.ap-layers button[aria-pressed=true]{color:var(--ap-fg);border-color:var(--ap-ac)}
.ap-layers button:focus-visible{outline:2px solid var(--ap-ac);outline-offset:3px}

.ap-photo-btn{all:unset;cursor:pointer;color:var(--ap-fg);font-size:12px;font-weight:500;padding:6px 12px;border:1px solid var(--ap-fg);border-radius:4px;transition:all 0.2s}
.ap-photo-btn:hover{background:var(--ap-fg);color:var(--paper)}
.ap-photo-btn:focus-visible{outline:2px solid var(--ap-ac);outline-offset:3px}
.ap-photo-btn .hide-text{display:none}
.ap-photo-btn[aria-pressed=true] .show-text{display:none}
.ap-photo-btn[aria-pressed=true] .hide-text{display:inline}
.ap-photo-btn[aria-pressed=true]{background:var(--ap-ac);color:var(--paper);border-color:var(--ap-ac)}

/* 4) PHONES — portrait moves above the hero text (works when the hero is a grid or flex container) */
@media (max-width:820px){
  .ap-figure{order:-1;max-width:min(100%,calc(56vh*.8));max-width:min(100%,calc(56svh*.8))}
  .ap-layers{display:none} /* Hide layer buttons on mobile - just show photo */
  .ap-photo-btn{display:none} /* Hide photo toggle on mobile - always shows photo */
}
