/* Gallery page. Scoped to .fm-gal and .fm-lb (title bar comes from grid.css). */
.fm-gal { --g-red: #dc2626; --g-navy: #0b1325; --g-ink: #0f172a; --g-muted: #64748b; padding: 56px 0 100px; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: var(--g-ink); -webkit-font-smoothing: antialiased; background-color: #f8fafc;   }
.fm-gal *, .fm-gal *::before, .fm-gal *::after, .fm-lb *, .fm-lb *::before, .fm-lb *::after { box-sizing: border-box; }
.fm-gal a, .fm-lb a { text-decoration: none; }
.fm-gal-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* filters */
.fm-gal-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.fm-gal-filters a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 30px; border: 1.5px solid #dbe2ec; background: #fff; font-size: 12.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--g-ink); transition: background .25s, color .25s, border-color .25s, transform .25s, box-shadow .25s; }
.fm-gal-filters a small { font-size: 11px; font-weight: 800; color: var(--g-muted); background: #f1f5f9; border-radius: 20px; padding: 2px 8px; transition: background .25s, color .25s; }
.fm-gal-filters a:hover { transform: translateY(-2px); border-color: var(--g-ink); }
.fm-gal-filters a.active { background: var(--g-red); border-color: var(--g-red); color: #fff; box-shadow: 0 10px 22px rgba(220,38,38,.3); }
.fm-gal-filters a.active small { background: rgba(255,255,255,.22); color: #fff; }

/* grid */
.fm-gal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.fm-gal-item { position: relative; margin: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; cursor: zoom-in; box-shadow: 0 2px 6px rgba(15,23,42,.04); transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease, border-color .4s ease; animation: fmGalIn .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--gd, 0s); }
@keyframes fmGalIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.fm-gal-item:hover { transform: translateY(-8px); border-color: transparent; box-shadow: 0 26px 50px rgba(11,19,37,.2), 0 0 0 1px rgba(220,38,38,.5); }
.fm-gal-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--g-navy); }
.fm-gal-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1s cubic-bezier(.22,.61,.36,1); }
.fm-gal-item:hover .fm-gal-media img { transform: scale(1.1); }
.fm-gal-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,19,37,0) 50%, rgba(11,19,37,.55)); opacity: 0; transition: opacity .4s ease; }
.fm-gal-item:hover .fm-gal-media::after { opacity: 1; }
.fm-gal-shine { position: absolute; top: 0; left: -80%; width: 50%; height: 100%; z-index: 3; background: linear-gradient(100deg, transparent, rgba(255,255,255,.3), transparent); transform: skewX(-18deg); pointer-events: none; }
.fm-gal-item:hover .fm-gal-shine { left: 130%; transition: left .9s ease; }
.fm-gal-zoom { position: absolute; z-index: 4; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: var(--g-red); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 28px rgba(220,38,38,.45); opacity: 0; transform: scale(.5); transition: opacity .35s ease, transform .4s cubic-bezier(.2,.7,.2,1); }
.fm-gal-item:hover .fm-gal-zoom { opacity: 1; transform: scale(1); }
.fm-gal-cat { position: absolute; z-index: 4; left: 12px; top: 12px; background: rgba(11,19,37,.82); backdrop-filter: blur(4px); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; padding: 6px 11px; border-radius: 4px; }
.fm-gal-item figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 15px; }
.fm-gal-item figcaption b { font-family: 'Rajdhani', 'Inter', sans-serif; font-size: 17px; line-height: 1.15; font-weight: 800; text-transform: uppercase; color: var(--g-ink); transition: color .25s; }
.fm-gal-item:hover figcaption b { color: var(--g-red); }
.fm-gal-item figcaption span { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #94a3b8; }

/* load more */
.fm-gal-more { margin-top: 48px; text-align: center; }
.fm-gal-status { font-size: 13px; color: var(--g-muted); margin: 0 0 12px; }
.fm-gal-status b { color: var(--g-ink); }
.fm-gal-bar { width: 260px; max-width: 80%; height: 4px; border-radius: 2px; background: #e2e8f0; margin: 0 auto 26px; overflow: hidden; }
.fm-gal-bar i { display: block; height: 100%; background: linear-gradient(90deg, #dc2626, #f97316); border-radius: 2px; transition: width .6s ease; }
.fm-gal-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 38px; border: 0; border-radius: 10px; background: var(--g-red); color: #fff; font-family: inherit; font-size: 13.5px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; cursor: pointer; box-shadow: 0 14px 28px rgba(220,38,38,.35); transition: transform .25s ease, box-shadow .25s ease, background .25s ease; }
.fm-gal-btn::before { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.3), transparent); transform: skewX(-18deg); }
.fm-gal-btn:hover:not(:disabled) { background: #b91c1c; transform: translateY(-3px); box-shadow: 0 20px 36px rgba(220,38,38,.42); }
.fm-gal-btn:hover:not(:disabled)::before { left: 130%; transition: left .8s ease; }
.fm-gal-btn svg { transition: transform .25s ease; }
.fm-gal-btn:hover:not(:disabled) svg { transform: translateY(3px); }
.fm-gal-btn:disabled { opacity: .75; cursor: progress; }
.fm-gal-btn[hidden] { display: none; }
.fm-gal-btn.loading svg { animation: fmGalSpin .8s linear infinite; }
@keyframes fmGalSpin { to { transform: rotate(360deg); } }
.fm-gal-empty { text-align: center; padding: 80px 20px; color: var(--g-muted); font-size: 16px; }
.fm-gal-empty a { display: block; margin-top: 10px; color: var(--g-red); font-weight: 700; }

/* lightbox */
.fm-lb { position: fixed; inset: 0; z-index: 999999; display: none; align-items: center; justify-content: center; padding: 30px 70px; background: rgba(5,10,20,.95); backdrop-filter: blur(8px); }
.fm-lb.open { display: flex; animation: fmLbIn .3s ease both; }
@keyframes fmLbIn { from { opacity: 0; } to { opacity: 1; } }
.fm-lb-fig { margin: 0; max-width: 1100px; width: 100%; }
.fm-lb-fig img { display: block; width: 100%; max-height: 74vh; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 70px rgba(0,0,0,.6); }
.fm-lb-fig figcaption { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 16px; color: #cbd5e1; }
.fm-lb-fig small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: #f87171; margin-bottom: 4px; }
.fm-lb-fig b { display: block; font-family: 'Rajdhani', sans-serif; font-size: 26px; line-height: 1.1; font-weight: 800; text-transform: uppercase; color: #fff; }
.fm-lb-fig figcaption span { font-size: 14px; }
.fm-lb-side { display: flex; align-items: center; gap: 18px; flex: none; }
.fm-lb-side span { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: 1.5px; color: #94a3b8; }
.fm-lb-side a { display: inline-flex; align-items: center; height: 44px; padding: 0 22px; border-radius: 8px; background: #dc2626; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; transition: background .25s, transform .25s; }
.fm-lb-side a:hover { background: #b91c1c; color: #fff; transform: translateY(-2px); }
.fm-lb-close { position: absolute; top: 22px; right: 26px; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: background .25s, transform .3s; }
.fm-lb-close:hover { background: #dc2626; transform: rotate(90deg); }
.fm-lb-nav { position: absolute; top: 50%; width: 50px; height: 50px; margin-top: -25px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .25s, border-color .25s, transform .25s; }
.fm-lb-nav:hover { background: #dc2626; border-color: #dc2626; transform: scale(1.08); }
.fm-lb-prev { left: 18px; }
.fm-lb-next { right: 18px; }
html.fm-lb-lock, html.fm-lb-lock body { overflow: hidden; }

@media (max-width: 1100px) { .fm-gal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) {
  .fm-gal-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .fm-lb { padding: 70px 14px 24px; }
  .fm-lb-fig figcaption { flex-direction: column; align-items: flex-start; }
  .fm-lb-nav { top: auto; bottom: 18px; margin: 0; width: 44px; height: 44px; }
  .fm-lb-prev { left: 14px; }
  .fm-lb-next { right: 14px; }
}
@media (max-width: 480px) {
  .fm-gal { padding: 36px 0 70px; }
  .fm-gal-grid { grid-template-columns: 1fr; }
  .fm-gal-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .fm-gal-item { animation: none; }
  .fm-gal-media img, .fm-gal-item { transition: none; }
}
