/* Highmark Project Portfolio -- gallery styles.
   Uses the same design tokens as the main theme (--space-*, --color-*,
   --hm-*, --radius-*, --shadow-*, --dur-*, --ease-out). If a token is
   missing this will still render, just with browser defaults, so it's
   safe to activate before the full theme is finished. */

.gal-typebar-wrap { position: relative; margin-bottom: var(--space-5, 2rem); }
.gal-typebar {
  display: flex; gap: 0.55rem; padding-bottom: var(--space-4, 1.5rem);
  border-bottom: 1px solid var(--color-border, #e4e6e8);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
.gal-typebar::-webkit-scrollbar { display: none; }
.gal-typebar-wrap::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: var(--space-4, 1.5rem); width: 40px;
  background: linear-gradient(90deg, transparent, var(--color-bg, #fff) 85%);
  pointer-events: none;
}
.gal-pill {
  display: inline-flex; align-items: center; gap: 0.45rem; flex: none; scroll-snap-align: start;
  border: 1.5px solid var(--color-border, #e4e6e8); background: var(--hm-white, #fff); color: var(--color-text, #1d1f23);
  border-radius: 999px; padding: 0.6rem 1.05rem; min-height: 44px; font-size: var(--fs-xs, 0.8rem); font-weight: 700;
  letter-spacing: 0.01em; cursor: pointer; white-space: nowrap;
  transition: border-color var(--dur-fast, 0.15s), background var(--dur-fast, 0.15s), color var(--dur-fast, 0.15s), transform var(--dur-fast, 0.15s);
}
.gal-pill svg { width: 15px; height: 15px; flex: none; opacity: 0.7; transition: opacity var(--dur-fast, 0.15s); }
.gal-pill:hover { border-color: var(--hm-gray-300, #cdd1d6); transform: translateY(-1px); }
.gal-pill.is-active { border-color: var(--color-accent, #e2231a); background: var(--color-accent, #e2231a); color: #fff; }
.gal-pill.is-active svg { opacity: 1; }
.gal-pill .n { opacity: 0.65; font-weight: 500; }

.gal-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-6, 2.5rem); align-items: start; }
@media (min-width: 900px) { .gal-layout { grid-template-columns: 220px 1fr; } }

.gal-side { display: flex; flex-direction: column; gap: 0.2rem; }
@media (min-width: 900px) { .gal-side { position: sticky; top: 104px; } }
.gal-side h4 { font-size: var(--fs-xs, 0.8rem); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted, #6b6f76); margin-bottom: 0.6rem; }
.gal-side-item {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  background: none; border: none; border-left: 2px solid transparent; text-align: left; width: 100%;
  padding: 0.6rem 0.7rem; min-height: 44px; border-radius: var(--radius-sm, 6px); cursor: pointer;
  font-size: var(--fs-sm, 0.9rem); font-weight: 600; color: var(--color-text, #1d1f23);
  transition: background var(--dur-fast, 0.15s), color var(--dur-fast, 0.15s), border-color var(--dur-fast, 0.15s);
}
.gal-side-item:hover { background: var(--color-bg-alt, #f4f3f0); }
.gal-side-item.is-active { background: var(--hm-red-100, #fdeceb); color: var(--color-accent-strong, #b81a13); border-left-color: var(--color-accent, #e2231a); }
.gal-side-item .n { font-size: var(--fs-2xs, 0.72rem); color: var(--color-text-muted, #6b6f76); font-weight: 500; }
.gal-side-item.is-active .n { color: var(--color-accent-strong, #b81a13); }

.gal-count { font-size: var(--fs-sm, 0.9rem); color: var(--color-text-muted, #6b6f76); margin-bottom: var(--space-3, 1rem); }

.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4, 1.5rem); }
.gal-grid--compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gal-card {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--color-border, #e4e6e8); border-radius: var(--radius-md, 10px); overflow: hidden;
  background: var(--hm-white, #fff); cursor: pointer; text-align: left; padding: 0; text-decoration: none; color: inherit;
  transition: transform var(--dur-med, 0.25s) var(--ease-out, ease), box-shadow var(--dur-med, 0.25s), border-color var(--dur-fast, 0.15s);
}
.gal-card:hover, .gal-card:focus-visible { transform: translateY(-5px); box-shadow: var(--shadow-lg, 0 20px 40px rgba(0,0,0,0.15)); border-color: transparent; outline: none; }
.gal-card:focus-visible { box-shadow: var(--shadow-lg, 0 20px 40px rgba(0,0,0,0.15)), 0 0 0 3px var(--hm-red-100, #fdeceb); }
.gal-card[hidden] { display: none; }
.gal-media {
  flex: none; aspect-ratio: 4 / 3; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--hm-steel-900, #0f1720), var(--hm-charcoal, #1d1f23));
}
.gal-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-med, 0.25s) var(--ease-out, ease); }
.gal-card:hover .gal-media img { transform: scale(1.05); }
.gal-media svg { color: rgba(255,255,255,0.28); width: 40px; height: 40px; transition: transform var(--dur-med, 0.25s) var(--ease-out, ease), color var(--dur-med, 0.25s); }
.gal-card:hover .gal-media svg { transform: scale(1.12); color: rgba(255,255,255,0.42); }
.gal-view-hint {
  position: absolute; inset: auto 0 0 0; z-index: 1; display: flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 0.9rem; font-size: var(--fs-xs, 0.8rem); font-weight: 700; color: #fff;
  background: linear-gradient(0deg, rgba(19,20,23,0.85), transparent);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--dur-fast, 0.15s), transform var(--dur-fast, 0.15s);
}
.gal-view-hint svg { width: 14px; height: 14px; }
.gal-card:hover .gal-view-hint, .gal-card:focus-visible .gal-view-hint { opacity: 1; transform: translateY(0); }
.gal-body { flex: 1; display: flex; flex-direction: column; padding: var(--space-3, 1rem) var(--space-4, 1.5rem) var(--space-4, 1.5rem); }
.gal-body h3 {
  font-size: var(--fs-base, 1rem); letter-spacing: -0.01em; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(var(--fs-base, 1rem) * 1.3 * 2);
}
.gal-location { display: block; font-size: var(--fs-2xs, 0.72rem); color: var(--color-text-muted, #6b6f76); margin-top: 0.2rem; }
.gal-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; padding-top: 0.6rem; }
.gal-tag { font-size: var(--fs-2xs, 0.72rem); font-weight: 700; color: var(--color-text-muted, #6b6f76); background: var(--color-bg-alt, #f4f3f0); border-radius: 999px; padding: 0.2rem 0.55rem; }
.gal-empty { padding: var(--space-7, 3.5rem) var(--space-4, 1.5rem); text-align: center; color: var(--color-text-muted, #6b6f76); }
.gal-empty[hidden] { display: none; }

.gal-rel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-2, 0.75rem); margin-bottom: var(--space-4, 1.5rem); }
.gal-rel-viewall { font-size: var(--fs-sm, 0.9rem); font-weight: 700; color: var(--color-accent, #e2231a); white-space: nowrap; }
.gal-rel-viewall:hover { text-decoration: underline; }

.gal-lightbox {
  position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center;
  padding: var(--space-4, 1.5rem); background: rgba(13,14,16,0.88); backdrop-filter: blur(4px);
}
.gal-lightbox[hidden] { display: none; }
.gal-lb-wrap { max-width: 620px; width: 100%; }
.gal-lb-toolbar { display: flex; justify-content: flex-end; margin-bottom: 0.6rem; }
.gal-lb-close {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.12); border: none; color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: background var(--dur-fast, 0.15s), transform var(--dur-fast, 0.15s);
}
.gal-lb-close:hover { background: var(--color-accent, #e2231a); transform: scale(1.06); }
.gal-lb-box { background: var(--hm-white, #fff); border-radius: var(--radius-md, 10px); width: 100%; overflow: hidden; box-shadow: var(--shadow-lg, 0 20px 40px rgba(0,0,0,0.15)); }
.gal-lb-media {
  aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--hm-steel-900, #0f1720), var(--hm-charcoal, #1d1f23)); position: relative;
}
.gal-lb-media svg { color: rgba(255,255,255,0.28); width: 64px; height: 64px; }
.gal-lb-body { padding: var(--space-4, 1.5rem) var(--space-5, 2rem) var(--space-5, 2rem); }
.gal-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 40px; height: 40px; border-radius: 50%; background: rgba(19,20,23,0.55); border: none; color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: background var(--dur-fast, 0.15s), transform var(--dur-fast, 0.15s);
}
.gal-lb-nav:hover { background: rgba(19,20,23,0.85); }
.gal-lb-nav:active { transform: translateY(-50%) scale(0.92); }
.gal-lb-prev { left: 0.7rem; }
.gal-lb-next { right: 0.7rem; }
.gal-lb-nav[disabled] { opacity: 0.35; cursor: default; pointer-events: none; }
.gal-lb-position { font-size: var(--fs-2xs, 0.72rem); font-weight: 700; color: var(--color-text-muted, #6b6f76); letter-spacing: 0.03em; margin-top: 0.5rem; }
.gal-lb-viewlink { color: var(--color-accent, #e2231a); }
