/* Compact application thumbnails; all original links work without JavaScript. */
.ghag-gallery, .ghag-dialog {
  --ghag-surface: var(--surface-solid, #fff);
  --ghag-ink: var(--ink, #242426);
  --ghag-muted: var(--muted, #66676c);
  --ghag-line: var(--line, #dddde2);
  --ghag-accent: var(--accent, #c71938);
  font-family: var(--font, Ubuntu, system-ui, sans-serif);
  color: var(--ghag-ink);
  box-sizing: border-box;
}
.ghag-gallery *, .ghag-dialog * { box-sizing: border-box; }
.ghag-gallery {
  grid-column: 1 / -1;
  clear: both;
  width: 100%;
  min-width: 0;
  margin: 28px 0;
  padding: 18px;
  border: 1px solid var(--ghag-line);
  border-radius: 20px;
  background: var(--ghag-surface);
  scroll-margin-top: 120px;
}
.ghag-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
}
.ghag-heading h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--ghag-ink);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.ghag-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid var(--ghag-line);
  border-radius: 999px;
  color: var(--ghag-muted);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
.ghag-count:hover { border-color: var(--ghag-accent); color: var(--ghag-accent); }
.ghag-count > span { font-size: 18px; }
.ghag-strip-controls { display: flex; flex: 0 0 auto; gap: 6px; }
.ghag-strip-controls[hidden] { display: none; }
.ghag-strip-controls button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--ghag-line);
  border-radius: 50%;
  background: var(--ghag-surface);
  color: var(--ghag-ink);
  font: 22px/1 var(--font, Ubuntu, system-ui, sans-serif);
  cursor: pointer;
  box-shadow: none;
}
.ghag-strip-controls button:disabled { opacity: .35; cursor: default; }
.ghag-strip-controls button:not(:disabled):hover { border-color: var(--ghag-accent); color: var(--ghag-accent); }
.ghag-grid {
  display: flex;
  gap: 14px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px 4px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--ghag-muted) transparent;
  list-style: none;
}
.ghag-card { flex: 0 0 220px; width: 220px; min-width: 0; margin: 0; padding: 0; scroll-snap-align: start; list-style: none; }
.ghag-open {
  position: relative;
  display: block;
  width: 100%;
  height: 165px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--bg, #f3f3f5);
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}
.ghag-open img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; object-position: center; transition: transform .25s ease; }
.ghag-expand { position: absolute; top: 9px; inset-inline-end: 9px; z-index: 1; display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: rgba(20,20,22,.65); color: #fff; font-size: 19px; line-height: 1; pointer-events: none; }
.ghag-overlay { position: absolute; inset-inline: 0; bottom: 0; display: block; padding: 30px 12px 11px; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; pointer-events: none; }
.ghag-tile-label { display: block; font-size: 15px; line-height: 1.35; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
@media (hover: hover) { .ghag-open:hover img { transform: scale(1.035); } }
.ghag-gallery a:focus-visible, .ghag-gallery button:focus-visible, .ghag-grid:focus-visible,
.ghag-dialog a:focus-visible, .ghag-dialog button:focus-visible { outline: 3px solid var(--ghag-accent); outline-offset: 3px; }
.ghag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 8px; color: var(--ghag-muted); font-size: 12px; line-height: 1.5; }
.ghag-meta > :first-child { color: var(--ghag-accent); font-weight: 700; }
.ghag-project { display: inline-flex; align-items: center; gap: 8px; color: var(--ghag-accent); font-size: 14px; line-height: 1.5; font-weight: 500; text-decoration: none; text-underline-offset: 4px; }
.ghag-project:hover { text-decoration: underline; }

.ghag-dialog {
  width: min(960px, calc(100vw - 64px));
  max-width: none;
  max-height: calc(100dvh - 64px);
  padding: 0;
  margin: auto;
  overflow: auto;
  border: 1px solid var(--ghag-line);
  border-radius: 20px;
  background: var(--ghag-surface);
  color: var(--ghag-ink);
  box-shadow: 0 20px 100px rgba(0,0,0,.25);
}
.ghag-dialog::backdrop { background: rgba(0,0,0,.8); }
.ghag-viewer { position: relative; background: #141416; }
/* Outrank WooCommerce's automatic image height so portraits stay within the viewer. */
.ghag-dialog .ghag-viewer > img.ghag-full {
  display: block;
  width: 100%;
  height: min(58dvh, 600px);
  max-height: calc(100dvh - 210px);
  object-fit: contain;
  object-position: center;
  margin: 0;
  background: #141416;
}
.ghag-dialog button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ghag-line);
  border-radius: 50%;
  background: var(--ghag-surface);
  color: var(--ghag-ink);
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}
.ghag-dialog .ghag-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 2;
  background: rgba(20,20,22,.82);
  border-color: rgba(255,255,255,.5);
  color: #fff;
  font-size: 30px;
}
.ghag-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 26px;
}
.ghag-dialog-description { min-width: 0; flex: 1; }
.ghag-dialog .ghag-caption { margin: 0 0 7px; font-size: 21px; font-weight: 500; line-height: 1.3; color: var(--ghag-ink); }
.ghag-dialog .ghag-context { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--ghag-muted); }
.ghag-navigation { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; direction: ltr; }
.ghag-position { min-width: 42px; color: var(--ghag-muted); text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.ghag-dialog [hidden] { display: none !important; }
@media (max-width: 680px) {
  .ghag-gallery { margin: 24px 0; padding: 14px 14px 12px; border-radius: 17px; scroll-margin-top: 100px; }
  .ghag-heading { gap: 9px; margin-bottom: 13px; }
  .ghag-heading h2 { font-size: 23px; }
  .ghag-count { min-height: 36px; padding: 5px 10px; font-size: 13px; }
  .ghag-strip-controls button { width: 36px; min-width: 36px; height: 36px; }
  .ghag-grid { gap: 11px; padding-bottom: 10px; }
  .ghag-card { flex-basis: 160px; width: 160px; }
  .ghag-open { height: 120px; border-radius: 9px; }
  .ghag-overlay { padding: 28px 10px 9px; }
  .ghag-tile-label { font-size: 14px; }
  .ghag-expand { width: 26px; height: 26px; font-size: 18px; top: 7px; inset-inline-end: 7px; }
  .ghag-dialog { width: calc(100vw - 32px); max-height: calc(100dvh - 32px); border-radius: 15px; }
  .ghag-dialog .ghag-viewer > img.ghag-full { height: min(52dvh, 500px); max-height: calc(100dvh - 260px); }
  .ghag-dialog-footer { align-items: flex-start; flex-direction: column; gap: 16px; padding: 18px; }
  .ghag-dialog .ghag-caption { font-size: 18px; }
  .ghag-navigation { align-self: center; }
}
@media (max-width: 480px) { .ghag-strip-controls { display: none; } }
@media (prefers-reduced-motion: reduce) { .ghag-open img { transition: none; } }
