/* Gallery page (Dec 2026): past trips + Ghana/Kenya photo collage. Mobile first. */

/* Past trips: compact 2-up cards on phones, 4-up on wide screens */
.gal-trips { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
.gal-trips .blog-card img { aspect-ratio: 4 / 3; height: auto; }
.gal-trips .blog-card > div { padding: 12px; }
.gal-trips .blog-card h3 { font-size: 1rem; line-height: 1.25; margin: 4px 0; }
.gal-trips .blog-card p:not(.kicker) { display: none; }
.gal-trips .blog-card .kicker { font-size: .72rem; }
.gal-trips .link-arrow { font-size: .85rem; }
@media (min-width: 700px) {
  .gal-trips { gap: 16px; }
  .gal-trips .blog-card p:not(.kicker) { display: block; font-size: .92rem; }
  .gal-trips .blog-card > div { padding: 16px; }
}
@media (min-width: 1024px) { .gal-trips { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }

/* Filter chips */
.gal-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.gal-chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--white); color: var(--ink); font: 600 .95rem var(--body); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s, border-color .2s;
}
.gal-chip span { font-weight: 500; opacity: .65; font-size: .85em; }
.gal-chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--white); }
.gal-chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Collage grid: 2 columns on phones, 3 on tablets, 4 on desktop */
.gal-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 118px; grid-auto-flow: row dense; gap: 6px;
}
@media (min-width: 640px) { .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 8px; } }
@media (min-width: 1024px) { .gal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; gap: 10px; } }

.gal-item { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius-sm); background: var(--paper-2); }
.gal-item--tall { grid-row: span 2; }
.gal-item--wide { grid-column: span 2; }
.gal-item--big { grid-column: span 2; grid-row: span 2; }
.gal-item.is-hidden { display: none; }

.gal-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gal-open img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.gal-open:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
@media (hover: hover) { .gal-item:hover .gal-open img { transform: scale(1.05); } }

/* Captions: hidden in the collage (shown in the viewer), visible on hover for desktop */
.gal-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px;
  background: linear-gradient(transparent, rgba(13, 42, 47, .82)); color: var(--white);
  font-size: .78rem; line-height: 1.3; pointer-events: none; opacity: 0; transform: translateY(8px);
  transition: opacity .3s, transform .3s var(--ease);
}
@media (hover: hover) { .gal-item:hover figcaption, .gal-open:focus-visible + figcaption { opacity: 1; transform: none; } }
.gal-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--gold); color: var(--ink); font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
}

/* Scroll-in animation (only when JS runs and motion is allowed) */
.gal-js .gal-item { opacity: 0; transform: translateY(28px) scale(.96); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.gal-js .gal-item.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .gal-js .gal-item { opacity: 1; transform: none; transition: none; }
  .gal-open img { transition: none; }
}

/* See more */
.gal-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 24px; text-align: center; }
.gal-count { margin: 0; color: var(--ink-3); font-size: .95rem; }
.gal-more .btn { min-height: 48px; }

/* Viewer */
.gal-box {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(8, 24, 27, .96); color: var(--white);
}
.gal-box[open] { display: flex; align-items: center; justify-content: center; }
.gal-box::backdrop { background: rgba(8, 24, 27, .9); }
.gal-box figure { margin: 0; padding: 56px 12px 76px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gal-box img { max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 8px; }
.gal-box figcaption { font-size: .92rem; line-height: 1.4; text-align: center; max-width: 60ch; color: #e8efee; }
.gal-box__close, .gal-box__nav {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: var(--white); font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.gal-box__close { top: 10px; right: 10px; }
.gal-box__nav { bottom: 14px; }
.gal-box__prev { left: 14px; }
.gal-box__next { right: 14px; }
@media (min-width: 900px) {
  .gal-box__nav { top: 50%; bottom: auto; transform: translateY(-50%); }
  .gal-box figure { padding: 56px 80px 24px; }
}
.gal-box__close:focus-visible, .gal-box__nav:focus-visible { outline: 3px solid var(--gold); }
