/* FÍF Vís okkum títt virksemi — front-page section + lightbox.
   Everything is scoped to .fif-vj / .fvj-lb; colours follow the fif-athletics
   theme tokens, with fallbacks so the shortcode also works elsewhere. */
.fif-vj, .fvj-lb, .fvjs {
  --vj-ink: var(--ink, #0d1b33); --vj-soft: var(--ink-soft, #3c4a63); --vj-faint: var(--ink-faint, #6b7a94);
  --vj-ground: var(--ground, #eef3fa); --vj-surface: var(--surface, #fff); --vj-line: var(--line, #d7e0ee);
  --vj-blue: var(--blue, #1d4ed8); --vj-red: var(--red, #dc3a2c);
  --vj-sea: #cfdcf0;
  --vj-shadow: 0 1px 2px rgba(13,27,51,.06), 0 8px 24px rgba(13,27,51,.08);
  --vj-display: "Avenir Next Condensed", "HelveticaNeue-CondensedBold", "Arial Narrow", "Roboto Condensed", sans-serif;
}
/* [hidden] must win over each element's own display (the gallery is display:flex — its ✕ "did nothing") */
.fif-vj[hidden], .fif-vj [hidden], .fvj-gal[hidden], .fvj-lb[hidden], .fvj-lb [hidden] { display: none !important; }
.fif-vj { padding: 30px 0 56px; color: var(--vj-ink); }
.fif-vj * { box-sizing: border-box; }
.fvj-in { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.fvj-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.fvj-eyebrow { font-family: var(--vj-display); font-weight: 800; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--vj-blue); }
.fif-vj .fvj-title { font-family: var(--vj-display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.02; margin: 4px 0 6px; color: var(--vj-ink); letter-spacing: -.01em; }
.fvj-lead { margin: 0; color: var(--vj-soft); max-width: 58ch; }
.fvj-stats { display: flex; gap: 22px; margin-top: 10px; font-size: .84rem; color: var(--vj-faint); font-variant-numeric: tabular-nums; }
.fvj-stats b { color: var(--vj-ink); font-family: var(--vj-display); font-size: 1.15rem; margin-right: 4px; }
.fif-vj .fvj-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 11px 20px; background: var(--vj-blue); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.fif-vj .fvj-btn:hover { filter: brightness(1.08); color: #fff; }
.fvj-btn svg { width: 18px; height: 18px; }

.fvj-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
/* isolation: Leaflet's panes use z-index up to 1000; keep them under the theme's sticky header */
.fvj-map { position: relative; isolation: isolate; border-radius: 16px; overflow: hidden; box-shadow: var(--vj-shadow); border: 1px solid var(--vj-line); min-height: 520px; background: var(--vj-sea); }
.fvj-map-el { position: absolute; inset: 0; }
.fif-vj .leaflet-container, .fvj-lb .leaflet-container, .fvjs .leaflet-container { background: var(--vj-sea); font: inherit; }
.fvj-map-key { position: absolute; left: 12px; bottom: 12px; z-index: 500; background: var(--vj-surface); border: 1px solid var(--vj-line); border-radius: 10px; padding: 7px 11px; font-size: .78rem; color: var(--vj-soft); box-shadow: var(--vj-shadow); pointer-events: none; }
/* Yvirlit | Kort | Loftmynd: under the view buttons, top right */
.fif-vj .fvj-map .leaflet-top.leaflet-right { top: 50px; }
.fif-vj .fvj-layers { display: flex; background: var(--vj-surface); border: 1px solid var(--vj-line); border-radius: 999px; padding: 3px; box-shadow: var(--vj-shadow); margin: 10px 12px 0 0 !important; }
.fif-vj .fvj-layers button { border: 0; background: transparent; color: var(--vj-soft); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.fif-vj .fvj-layers button.on { background: var(--vj-ink); color: #fff; }
.fif-vj .fvj-map .leaflet-control-attribution { font-size: 10px; }
.fvj-views { position: absolute; top: 12px; right: 12px; z-index: 500; display: flex; background: var(--vj-surface); border: 1px solid var(--vj-line); border-radius: 999px; padding: 3px; box-shadow: var(--vj-shadow); }
.fif-vj .fvj-views button { border: 0; background: transparent; color: var(--vj-soft); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.fif-vj .fvj-views button.on { background: var(--vj-blue); color: #fff; }

.fvj-pin { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(13,27,51,.35); background: #2559dd center / cover no-repeat; transition: transform .18s; position: relative; cursor: pointer; }
.fvj-pin::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.fvj-pin.clip::before { content: "▶"; position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--vj-red); color: #fff; font-size: 9px; display: grid; place-items: center; border: 2px solid #fff; }
.fvj-pin .n { position: absolute; right: -9px; bottom: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--vj-blue); color: #fff; border: 2px solid #fff; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.fvj-pin.hot, .fvj-pin:hover { transform: scale(1.25) translateY(-4px); }
.leaflet-marker-icon.fvj-hot { z-index: 9999 !important; }
/* a bubble fanned out: thumbnails on thin lines back to the spot */
.fvj-leg { stroke: #fff; stroke-width: 2; stroke-opacity: .9; fill: none; }
.fvj-pin.fvj-spider { animation: fvj-pop .18s ease-out; }
.fvj-pin.fvj-spider::after { display: none; }
/* many from one place: the pick grid */
.fvj-pick-pop .leaflet-popup-content-wrapper { border-radius: 14px; padding: 0; }
.fvj-pick-pop .leaflet-popup-content { margin: 10px; width: auto !important; }
.fvj-pick { width: 252px; max-width: calc(100vw - 80px); }
.fvj-pick .h { font-weight: 700; font-size: .84rem; color: var(--vj-ink); margin: 0 4px 8px; }
.fvj-pick .g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.fvj-pick .it { position: relative; border: 0; padding: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #2559dd; cursor: pointer; }
.fvj-pick .it img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.fvj-pick .it:hover img { transform: scale(1.06); }
.fvj-pick .it .n { position: absolute; inset: auto 0 0 0; padding: 10px 4px 3px; background: linear-gradient(transparent, rgba(8,16,32,.8)); color: #fff; font-size: .66rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.fvj-pick .it.clip::before { content: "▶"; position: absolute; top: 4px; right: 4px; z-index: 1; width: 18px; height: 18px; border-radius: 50%; background: rgba(8,16,32,.7); color: #fff; font-size: 8px; display: grid; place-items: center; }
@keyframes fvj-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

.fvj-feed { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* justified rows, laid out by front.js: every photo keeps its own shape; each
   row is scaled so its photos share one height and fill the width exactly.
   Before the script runs, tiles sit at one fixed height in their own shape. */
.fvj-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.fif-vj .fvj-tile { position: relative; flex: none; width: calc(var(--r, 1.333) * 140px); max-width: 100%; height: 140px; border-radius: 10px; overflow: hidden; background: var(--vj-line); display: block; color: #fff; text-decoration: none; }
.fvj-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.fvj-tile:hover img, .fvj-tile.hot img { transform: scale(1.04); }
.fvj-ph { position: absolute; inset: 0; background: linear-gradient(140deg, #16368f, #2559dd); }
/* videos: a round play button in the middle, the length in the corner */
.fvj-play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(8,16,32,.55); border: 2px solid rgba(255,255,255,.9); box-shadow: 0 2px 10px rgba(0,0,0,.3); transition: transform .2s, background .2s; }
.fvj-play::after { content: ""; position: absolute; left: 17px; top: 13px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.fvj-tile:hover .fvj-play { transform: scale(1.1); background: rgba(29,78,216,.85); }
.fvj-cap { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(8,16,32,.82)); font-size: .78rem; line-height: 1.25; }
.fvj-cap b, .fvj-cap span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fvj-cap b { font-size: .88rem; }
.fvj-more { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: .86rem; color: var(--vj-faint); }
.fif-vj .fvj-more a { color: var(--vj-blue); font-weight: 700; text-decoration: none; }
.fvj-empty { margin: 0; padding: 26px; border: 1px dashed var(--vj-line); border-radius: 14px; background: var(--vj-surface); color: var(--vj-soft); text-align: center; }
.fvj-note { margin: 16px 0 0; font-size: .84rem; color: var(--vj-faint); }
.fif-vj .fvj-note a { color: var(--vj-soft); font-weight: 600; }

/* ---- "Vís allar": the gallery ---- */
.fvj-gal { position: fixed; inset: 0; z-index: 100001;   /* above WordPress's admin bar (99999) */ background: var(--vj-ground); display: flex; flex-direction: column; padding: 0 !important; }
.fvj-gal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; padding-top: max(14px, env(safe-area-inset-top)); background: var(--vj-surface); border-bottom: 1px solid var(--vj-line); }
.fvj-gal-top .t { font-family: var(--vj-display); font-size: 1.35rem; color: var(--vj-ink); }
.fvj-gal-top .t .n { color: var(--vj-faint); font-weight: 600; }
.fif-vj .fvj-gal-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--vj-line); background: var(--vj-surface); color: var(--vj-ink); font-size: 18px; cursor: pointer; }
.fvj-gal-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px calc(30px + env(safe-area-inset-bottom)); }
.fvj-gal-body .fvj-tiles { max-width: 1280px; margin: 0 auto; }
.fvj-gal-more { text-align: center; color: var(--vj-faint); font-size: .86rem; padding: 18px 0; min-height: 1em; }
@media (max-width: 560px) { .fvj-gal-top { padding-left: 16px; padding-right: 16px; } .fvj-gal-body { padding-left: 12px; padding-right: 12px; } }

/* ---- lightbox ---- */
.fvj-lb { position: fixed; inset: 0; z-index: 100002; background: rgba(5,10,20,.94); display: grid; grid-template-columns: minmax(0, 1fr) 340px; color: #e6edf8; font-family: inherit; }
.fvj-lb * { box-sizing: border-box; }
.fvj-stage { position: relative; display: grid; place-items: center; padding: 56px 64px; min-width: 0; min-height: 0; }
.fvj-stage img, .fvj-stage video { max-width: 100%; max-height: calc(100vh - 112px); border-radius: 8px; object-fit: contain; background: #000; }
.fvj-lb button { font: inherit; cursor: pointer; }
.fvj-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; line-height: 1; }
.fvj-nav:hover, .fvj-x:hover { background: rgba(255,255,255,.25); }
.fvj-prev { left: 12px; } .fvj-next { right: 12px; }
.fvj-x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; }
.fvj-side { background: #0f1a2e; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.fvj-side .fvj-eyebrow { color: #8fb0ff; }
.fvj-side h3 { font-family: var(--vj-display); font-size: 1.7rem; line-height: 1.05; margin: 0; color: #fff; }
.fvj-side p { margin: 0; color: #b4c1d8; white-space: pre-line; }
.fvj-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .88rem; margin: 0; }
.fvj-meta dt { color: #8193b1; } .fvj-meta dd { margin: 0; }
.fvj-mini { height: 170px; border-radius: 10px; overflow: hidden; flex: none; }
.fvj-lb .fvj-layers { display: flex; background: rgba(255,255,255,.92); border-radius: 999px; padding: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.3); margin: 6px 6px 0 0 !important; }
.fvj-lb .fvj-layers button { border: 0; background: transparent; color: #3c4a63; border-radius: 999px; padding: 3px 9px; font: inherit; font-size: .7rem; font-weight: 700; cursor: pointer; }
.fvj-lb .fvj-layers button.on { background: #0d1b33; color: #fff; }
.fvj-mini .leaflet-control-zoom { margin: 6px 0 0 6px !important; }
.fvj-mini .leaflet-control-zoom a { width: 24px; height: 24px; line-height: 24px; font-size: 15px; }
.fvj-mini .leaflet-control-attribution { font-size: 9px; line-height: 1.3; padding: 0 4px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* reactions + comments */
.fvj-rx { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }   /* six reactions: two even rows */
.fvj-rx button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #e6edf8; border-radius: 999px; padding: 5px 11px; font-size: .95rem; transition: background .15s, transform .15s; }
.fvj-rx button:hover { background: rgba(255,255,255,.14); }
.fvj-rx button:active { transform: scale(.94); }
.fvj-rx button.on { background: rgba(109,151,255,.28); border-color: #8fb0ff; }
.fvj-rx .c { font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: .6em; }
.fvj-rx .c:empty { display: none; }
.fvj-rx-who { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: #b4c1d8; margin-top: -4px; }
.fvj-rx-who:empty { display: none; }
.fvj-rx-who .e { font-size: .85rem; }
.fvj-cm { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.fvj-cm h4 { margin: 0; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: #8fb0ff; }
.fvj-cm h4 .n { color: #8193b1; margin-left: 4px; }
.fvj-cm-list { display: flex; flex-direction: column; gap: 10px; }
.fvj-cm-empty { font-size: .86rem; color: #8193b1; }
.fvj-cm-item { background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 10px; font-size: .88rem; }
.fvj-cm-item .h { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.fvj-cm-item .h b { color: #fff; }
.fvj-cm-item .h span { color: #8193b1; font-size: .76rem; white-space: nowrap; }
.fvj-cm-item .x { color: #c9d5ea; white-space: pre-line; overflow-wrap: anywhere; }
.fvj-cm-item.waiting { opacity: .7; }
.fvj-cm-item .w { font-size: .76rem; color: #fbbf24; margin-top: 4px; }
.fvj-cm-form { display: flex; flex-direction: column; gap: 6px; }
.fvj-cm-form textarea, .fvj-cm-form input { width: 100%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 16px; }
.fvj-cm-form textarea { resize: vertical; min-height: 60px; }
.fvj-cm-form ::placeholder { color: #8193b1; }
.fvj-cm-form .row { display: flex; gap: 6px; }
.fvj-cm-form .row input { flex: 1; min-width: 0; }
.fvj-cm-form button { border: 0; border-radius: 999px; padding: 8px 16px; background: var(--vj-blue); color: #fff; font-weight: 700; }
.fvj-cm-form button:disabled { opacity: .6; }
.fvj-cm-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.fvj-cm-form .ts:empty { display: none; }
.fvj-cm-form .er { color: #ff8a7a; font-size: .84rem; font-weight: 700; }
.fvj-cm-form .er:empty { display: none; }
/* chips in a tile's corner: clip length, reactions, comments — they wrap on narrow tiles */
.fvj-tile.tiny .fvj-play { display: none; }
/* Strava's mark on orange: this run has a route */
.fvj-chip.strava { background: #fc4c02; display: inline-flex; align-items: center; justify-content: center; padding: 1px 6px; }
.fvj-chip.strava svg { width: 12px; height: 15px; display: block; }
.fif-vj .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
/* the Strava embed in the lightbox */
.fvj-strava { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.fvj-strava h4 { margin: 0; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: #fc7a45; }
.fvj-strava .emb { border-radius: 10px; overflow: hidden; background: #fff; min-height: 60px; }
.fvj-strava .emb iframe { width: 100% !important; max-width: 100%; }
.fvj-strava .open { color: #fc7a45; font-size: .84rem; font-weight: 700; text-decoration: none; }
.fvj-strava .open.btn { align-self: flex-start; background: #fc4c02; color: #fff; border-radius: 999px; padding: 8px 14px; }
.fvj-chips { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.fvj-chip { background: rgba(8,16,32,.72); color: #fff; border-radius: 999px; font-size: .7rem; line-height: 1.5; padding: 1px 8px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fvj-count { margin-top: auto; font-size: .8rem; color: #8193b1; font-variant-numeric: tabular-nums; }
.fvj-dot { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--vj-red); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
body.fvj-lock { overflow: hidden; }

@media (max-width: 960px) {
  .fvj-grid { grid-template-columns: 1fr; }
  .fvj-map { min-height: 380px; }
  /* phones: the photo/video in a fixed area at the top, everything else below,
     and the whole lightbox scrolls — a tall portrait video can no longer spill
     over the reactions, and you can react while it plays */
  .fvj-lb { display: block; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .fvj-stage { height: 56vh; height: 56svh; padding: 56px 12px 12px; }
  .fvj-media { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
  .fvj-stage img, .fvj-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; }
  .fvj-x { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 5; background: rgba(15,26,46,.75); }
  .fvj-nav { top: calc(50% + 22px); z-index: 4; width: 40px; height: 40px; font-size: 20px; }
  .fvj-side { max-height: none; overflow: visible; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); }
  .fvj-mini { height: 180px; }
}
@media (max-width: 560px) {
  .fvj-in { padding: 0 16px; }
  .fvj-map { min-height: 320px; }
}
@media (prefers-reduced-motion: reduce) { .fif-vj *, .fvj-lb * { transition: none !important; } }
