/* =====================================================================
   Client gallery (27 Oct 2026). Sits on style.css + portal.css.
   --brand is the client's colour when they have one (lines, brackets,
   timeline marks); text keeps KJG's accent so it stays readable.
   ===================================================================== */
:root{--brand:var(--accent);}
.portal-body [hidden]{display:none !important;}

/* a client colour (gallery.js applyBrand) replaces KJG red everywhere on the page, readable in both themes */
html.has-brand{--accent:var(--brand);--accent-soft:var(--brand-soft);}
html.has-brand[data-theme="dark"]{--accent-text:var(--brand-on-dark);}
html.has-brand[data-theme="light"]{--accent-text:var(--brand-on-light);}
html.has-brand .btn.primary,html.has-brand .btn.primary:hover{background:var(--brand);border-color:var(--brand);color:var(--brand-ink);}
html.has-brand .btn.primary:hover{filter:brightness(1.12);}

/* header: KJG logo (back to the portal) + the client's logo, Download all on the right */
.g-brands{display:flex;align-items:center;gap:18px;min-width:0;}
.g-head-logo{display:flex;align-items:center;height:44px;padding-left:18px;border-left:1px solid var(--line);}
.g-head-logo img{max-height:40px;max-width:140px;width:auto;object-fit:contain;}
.g-zip-top,.g-zip{display:inline-flex;align-items:center;gap:9px;}
.g-zip-top svg,.g-zip svg{width:16px;height:16px;flex:none;}
.g-zip-top small{font-size:11px;opacity:.72;font-weight:500;letter-spacing:.04em;}

.ig-link{display:inline-flex;align-items:center;gap:8px;}
.ig-link svg{width:18px;height:18px;}

.g-main{padding-top:64px;}
.g-state{min-height:42vh;display:grid;align-content:center;gap:18px;}
.g-state .p-h1{max-width:16ch;}
.g-state .kicker::before{background:var(--brand);}

/* ---------- header block ---------- */
.g-hero{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:48px;align-items:end;margin-bottom:80px;}
.g-hero .kicker{margin-bottom:20px;}
.g-hero .kicker::before{background:var(--brand);}
.g-hero .p-h1{margin-bottom:20px;}
.g-logo{display:block;margin-bottom:30px;}
/* transparent PNG/SVG logos sit straight on the page; a faint shadow keeps white logos visible in light mode */
.g-logo img{display:block;width:auto;height:auto;max-height:120px;max-width:min(340px,80%);object-fit:contain;}
[data-theme="light"] .g-logo img,[data-theme="light"] .g-head-logo img{filter:drop-shadow(0 0 1px rgba(0,0,0,.35));}
.g-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;color:var(--muted);font-size:15px;margin-bottom:30px;}
.g-meta .sep{width:4px;height:4px;border-radius:50%;background:var(--faint);}
.g-note{background:var(--surface);border-radius:var(--radius);padding:24px 26px;}
.g-note .contact-card{margin-bottom:14px;grid-template-columns:44px minmax(0,1fr);}
.g-note .contact-card img{width:44px;height:44px;border-radius:50%;}
.g-note p{white-space:pre-line;line-height:1.6;}

/* ---------- sections ---------- */
.g-section{margin-bottom:80px;}
.g-section .panel-head{padding-bottom:14px;border-bottom:1px solid var(--line);position:relative;}
.g-section .panel-head::after{content:'';position:absolute;left:0;bottom:-1px;width:56px;height:2px;background:var(--brand);}

/* video cards */
/* cards take the video's own shape (--ar from gallery.js): wide films get wide cards, vertical edits tall ones */
.g-videos{display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start;}
.g-card{background:var(--surface);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;
  flex:1 1 calc(var(--ar) * 360px);max-width:calc(var(--ar) * 480px);min-width:min(100%,200px);}
.g-card .viewfinder{border-radius:0;border:0;padding:0;width:100%;aspect-ratio:var(--ar);cursor:pointer;font:inherit;}
.g-card .viewfinder video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:brightness(.62);pointer-events:none;}
.g-card .vf-c{border-color:var(--brand);}
.g-card .vf-play{background:var(--brand);}
.g-card .vf-hud.bottom{bottom:20px;}
.g-card-body{padding:18px 20px 20px;display:flex;flex-direction:column;gap:12px;flex:1;}
.g-card-name{font-weight:600;font-size:17px;line-height:1.3;overflow-wrap:anywhere;}
.g-card-meta{font-size:13.5px;color:var(--muted);display:flex;flex-wrap:wrap;gap:4px 12px;}
.g-card-foot{margin-top:auto;display:flex;flex-wrap:wrap;gap:10px;align-items:center;}
.g-card-foot .chip{margin-left:auto;}

/* photo grid (justified rows, laid out in gallery.js) */
.g-photos{display:flex;flex-direction:column;gap:6px;}
.g-row{display:flex;gap:6px;}
.g-tile{position:relative;flex:none;border:0;padding:0;background:var(--surface-2);overflow:hidden;cursor:zoom-in;border-radius:3px;}
.g-tile img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .7s var(--ease-out),filter .3s ease;}
.g-tile:hover img{transform:scale(1.03);filter:brightness(.85);}
.g-tile::before,.g-tile::after{content:'';position:absolute;width:16px;height:16px;border:0 solid var(--brand);opacity:0;transition:opacity .25s ease;z-index:1;}
.g-tile::before{top:10px;left:10px;border-top-width:2px;border-left-width:2px;}
.g-tile::after{bottom:10px;right:10px;border-bottom-width:2px;border-right-width:2px;}
.g-tile:hover::before,.g-tile:hover::after,.g-tile:focus-visible::before,.g-tile:focus-visible::after{opacity:1;}
.g-tile .g-tile-name{position:absolute;inset:auto 0 0 0;padding:8px 10px;font-size:12.5px;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.6));text-align:left;}

/* other files */
.g-files .file{gap:16px;}
.g-files .go{display:flex;gap:14px;}

/* ---------- help, review, usage ---------- */
.g-help{margin-bottom:56px;}
.g-steps{list-style:none;counter-reset:step;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;border-radius:var(--radius);overflow:hidden;}
.g-steps li{counter-increment:step;background:var(--surface);padding:24px;line-height:1.55;}
.g-steps li::before{content:'0' counter(step);display:block;font-family:var(--mono);font-size:12px;color:var(--accent-text);margin-bottom:12px;letter-spacing:.06em;}
.g-steps strong{display:block;font-weight:600;margin-bottom:4px;}
.g-steps span{color:var(--muted);font-size:15px;}
.g-expiry-note{margin-top:18px;}

.g-review{max-width:640px;margin-bottom:56px;}
.g-review-lede{margin:-8px 0 24px;}
.g-stars button{font-size:22px;color:var(--faint);}
.g-stars button[aria-pressed="true"]{background:var(--surface-2);color:var(--accent);}
.g-review-name{max-width:340px;}
.g-review-done .p-note{margin:12px 0 22px;}
.g-hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0;}
.g-error{color:var(--accent-text);font-size:14px;margin:-6px 0 16px;}

.g-usage{max-width:760px;padding-top:28px;border-top:1px solid var(--line);}
.g-usage-title{font-size:13px;letter-spacing:.12em;text-transform:uppercase;font-weight:600;color:var(--muted);margin-bottom:10px;}
.g-usage p{font-size:14px;color:var(--muted);line-height:1.65;}
.g-usage a{color:var(--fg);text-decoration:underline;text-underline-offset:3px;}

/* ---------- watch & comment ---------- */
/* like the photo viewer: the video sits in a fixed box and scales inside it, so it never runs off the screen */
dialog.g-watch{position:fixed;inset:0;max-width:none;max-height:none;width:100vw;height:100vh;height:100dvh;margin:0;padding:0;border:0;background:#000;color:#fff;}
dialog.g-watch[open]{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,400px);grid-template-rows:100%;}
dialog.g-watch::backdrop{background:#000;}
.w-stage{display:flex;flex-direction:column;min-width:0;min-height:0;padding:18px 24px 18px;}
.w-bar{display:flex;align-items:center;gap:14px;margin-bottom:14px;}
.w-title{min-width:0;flex:1;}
.w-sec{display:block;font-size:12.5px;color:#a3a3a3;letter-spacing:.06em;text-transform:uppercase;}
.w-title h2{font-weight:600;font-size:18px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.w-version{background:#1a1a1a;color:#d4d4d4;}
.w-close{position:static;flex:none;background:#1a1a1a;color:#fff;}
.w-video{position:relative;flex:1 1 0;min-height:0;}
.w-video video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000;}
.w-track{position:relative;height:34px;margin-top:10px;}
.w-track-line{position:absolute;left:0;right:0;top:50%;height:2px;margin-top:-1px;background:#2a2a2a;border-radius:2px;}
.w-head{position:absolute;top:50%;left:0;width:2px;height:16px;margin:-8px 0 0 -1px;background:#fff;pointer-events:none;}
.w-mark{position:absolute;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;border:2px solid #000;background:var(--brand);cursor:pointer;padding:0;transition:transform .2s ease;}
.w-mark:hover,.w-mark.on{transform:scale(1.35);}
.w-mark.old{background:#6b6b6b;}

.w-side{background:#111;display:flex;flex-direction:column;min-height:0;border-left:1px solid rgba(255,255,255,.08);--fg:#fff;--muted:#a3a3a3;--line:rgba(255,255,255,.1);--surface-2:#1a1a1a;--surface-3:#242424;--bg:#000;}
.w-decide{padding:18px 20px;border-bottom:1px solid var(--line);display:grid;gap:12px;}
.w-decide .w-dl{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:14px;color:var(--muted);}
.w-decide .w-dl strong{color:#fff;font-weight:600;}
.w-decide .dlg-actions .btn{flex:1;justify-content:center;}
.w-decide textarea{width:100%;min-height:72px;font:15px/1.4 var(--body);color:#fff;background:#000;border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;resize:vertical;}
.w-notes-head{display:flex;justify-content:space-between;align-items:baseline;padding:16px 20px 8px;}
.w-notes-head h3{font-size:13px;letter-spacing:.12em;text-transform:uppercase;font-weight:600;}
.w-notes-head span{font-size:13px;color:var(--muted);}
.w-notes{list-style:none;flex:1;min-height:0;overflow-y:auto;padding:0 12px;}
.w-notes li{padding:12px 8px;border-radius:8px;}
.w-notes li + li{border-top:1px solid var(--line);}
.w-notes li.on{background:#1a1a1a;}
.w-notes .n-top{display:flex;align-items:center;gap:10px;margin-bottom:4px;font-size:13px;color:var(--muted);}
.w-notes .n-name{color:#fff;font-weight:600;font-size:14px;}
.w-notes .n-kian .n-name{color:var(--accent-text);}
.w-notes .n-when{margin-left:auto;white-space:nowrap;}
.w-notes .n-tc{font:500 12px/1 var(--mono);padding:5px 7px;border-radius:5px;background:var(--accent-soft);color:var(--accent-text);border:0;cursor:pointer;}
.w-notes .n-tc.whole{background:#242424;color:#d4d4d4;cursor:default;}
.w-notes .n-old{font-size:12px;color:#6b6b6b;}
.w-notes .n-body{white-space:pre-wrap;line-height:1.5;font-size:15px;overflow-wrap:anywhere;}
.w-notes .n-empty{color:var(--muted);font-size:14px;padding:12px 8px;}
.w-form{padding:14px 20px 18px;border-top:1px solid var(--line);display:grid;gap:10px;}
.w-form textarea{width:100%;min-height:84px;font:15px/1.45 var(--body);color:#fff;background:#000;border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px;resize:vertical;}
.w-form textarea:focus,.w-form input:focus,.w-decide textarea:focus{outline:none;border-color:#fff;}
.w-form-row{display:flex;gap:10px;align-items:center;}
.w-form input#wName{flex:1;min-width:0;font:15px var(--body);color:#fff;background:#000;border:1px solid var(--line);border-radius:var(--radius-sm);padding:11px 12px;}
.w-stamp{margin:0;color:#d4d4d4;}
.w-stamp b{font:500 13px var(--mono);color:var(--accent-text);}
.w-whole{font-size:13px;color:var(--muted);}
.w-form .g-error{margin:0;}

/* ---------- photo viewer ---------- */
/* the photo always fits the screen whole: the stage is a fixed box under the bar and the image is
   centred inside it with object-fit, so tall and wide photos keep their shape and never run off the bottom */
dialog.g-viewer{position:fixed;inset:0;max-width:none;max-height:none;width:100vw;height:100vh;height:100dvh;margin:0;padding:0;border:0;background:#000;color:#fff;overflow:hidden;}
dialog.g-viewer::backdrop{background:#000;}
dialog.g-viewer[open]{display:block;}
.v-bar{position:absolute;top:0;left:0;right:0;height:68px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:0 20px;z-index:2;--fg:#fff;--line:rgba(255,255,255,.2);}
.v-count{font:500 13px var(--mono);color:#a3a3a3;}
.v-stage{position:absolute;top:68px;left:72px;right:72px;bottom:24px;margin:0;touch-action:pan-y;}
.v-stage img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none;}
.v-nav{position:absolute;top:50%;width:52px;height:52px;margin-top:-26px;border-radius:50%;border:0;background:rgba(255,255,255,.08);color:#fff;cursor:pointer;display:grid;place-items:center;transition:background .2s ease;}
.v-nav:hover{background:rgba(255,255,255,.18);}
.v-nav svg{width:22px;height:22px;}
.v-prev{left:12px;}
.v-next{right:12px;}

/* ---------- responsive ---------- */
@media (max-width:1024px){
  .g-hero{grid-template-columns:1fr;gap:28px;align-items:start;}
  dialog.g-watch[open]{display:flex;flex-direction:column;overflow-y:auto;}
  .w-stage{padding:12px 12px 6px;flex:none;}
  /* phones: the box takes the video's own shape (set from its size in gallery.js), capped at 60% of the screen */
  .w-video{flex:none;aspect-ratio:var(--ar,16/9);max-height:60dvh;width:100%;}
  .w-side{border-left:0;flex:none;}
  .w-notes{overflow:visible;flex:none;}
}
@media (max-width:760px){
  .g-steps{grid-template-columns:1fr;}
}
@media (max-width:640px){
  .g-videos{gap:12px;}
  .g-card{flex-basis:100%;max-width:100%;}
  .g-card.tall{flex-basis:calc(50% - 6px);max-width:calc(50% - 6px);min-width:0;}
  .g-card.tall .g-card-body{padding:14px;}
  .g-card.tall .g-card-foot .btn{flex:1 1 100%;justify-content:center;}
  .g-head-logo{height:34px;padding-left:12px;}
  .g-head-logo img{max-height:30px;max-width:90px;}
  .g-brands{gap:12px;}
  .g-zip-top span,.g-zip-top small{display:none;}
  .g-zip-top{padding:10px 12px;}
  .g-main{padding-top:36px;}
  .g-hero{margin-bottom:56px;}
  .g-section{margin-bottom:56px;}
  .ig-link span{display:none;}
  .g-row,.g-photos{gap:4px;}
  .v-bar{height:60px;padding:0 12px;}
  .v-stage{top:60px;left:0;right:0;bottom:calc(12px + env(safe-area-inset-bottom));}
  .v-nav{display:none;}
  .w-title h2{font-size:16px;}
}
@media (prefers-reduced-motion: reduce){
  .g-tile img,.w-mark{transition:none;}
}
