/* ==========================================================================
   FORMED BY SCRIPTURE — BIBLE GPS
   ==========================================================================
   Bible GPS has its own look inside the platform: a soft green map, six
   coloured regions, and navigation blue for the route and the Navigate
   button. The page frame (header, footer, type) stays Formed by Scripture.

   Region colours come from data/bible-gps.js, so the map, the arrival card
   and the detail panel always agree.
   ========================================================================== */
.gps-page { --nav: #1A73E8; --nav-d: #1558B8; --g-ink: #17231D; --g-deep: #173D30; }
.gps-head { padding: clamp(1.5rem, 4vw, 2.75rem) 0 var(--s-4); }
.gps-head h1 { font-size: var(--t-xl); margin: 0 0 var(--s-2); }
.gps-head__sub { margin: 0; color: var(--ink-70); }
.gps-shell { padding-bottom: var(--s-9); }

.gps-stage { position: relative; height: min(74vh, 720px); min-height: 460px; border-radius: 24px; overflow: hidden; background: #E6F0E7;
  box-shadow: 0 1px 0 rgba(23,61,48,.08), 0 24px 60px -30px rgba(23,61,48,.45); }
#gps-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
#gps-svg:active { cursor: grabbing; }
#gps-svg:focus-visible { outline: 3px solid var(--nav); outline-offset: -3px; }
#gps-world { will-change: transform; }

/* map text */
.gps-rl__n { font-family: var(--display); font-weight: 700; letter-spacing: .08em; fill: #173D30; paint-order: stroke; stroke: #F7F8F4; stroke-width: .28em; stroke-linejoin: round; pointer-events: none; }
.gps-shelf { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: .22em; fill: #FFFFFF; opacity: .85; pointer-events: none; }
.gps-b { cursor: pointer; outline: none; }
.gps-b__dot { fill: #FFFFFF; stroke: #173D30; stroke-width: 4; }
.gps-b__halo { fill: #FFFFFF; opacity: 0; }
.gps-b text, .gps-w text { font-family: var(--body); font-weight: 600; font-size: 17px; fill: #17231D; paint-order: stroke; stroke: #FFFFFF; stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.gps-b:hover .gps-b__halo, .gps-b:focus-visible .gps-b__halo { opacity: .55; }
.gps-b:focus-visible .gps-b__dot { stroke: var(--nav); stroke-width: 7; }
.gps-b.is-dest .gps-b__dot { stroke: #FFFFFF; stroke-width: 6; r: 17px; }
.gps-b.is-dest .gps-b__halo { opacity: .6; fill: var(--nav); animation: gps-pulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.gps-b.is-dest text { font-family: var(--display); font-weight: 700; }
.gps-w { opacity: .0; pointer-events: none; }
.gps-w.is-on { opacity: 1; pointer-events: auto; cursor: pointer; }
@keyframes gps-pulse { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }

/* progressive disclosure by zoom: 0 whole story, 1 a region, 2 close in */
#gps-svg[data-z='0'] .gps-b:not(.is-dest) { opacity: 0; pointer-events: none; }
#gps-svg[data-z='0'] .gps-shelf, #gps-svg[data-z='0'] .gps-w text { opacity: 0; }
#gps-svg[data-z='1'] .gps-b:not(.is-dest) text { opacity: 0; }
#gps-svg[data-z='2'] .gps-rl__n { opacity: .55; }
.gps-b, .gps-b text, .gps-shelf, .gps-rl__n { transition: opacity .25s ease; }

/* search */
.gps-go { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 8px; max-width: 520px; z-index: 3; }
.gps-go input { flex: 1; min-width: 0; height: 52px; border: 0; border-radius: 16px; padding: 0 18px; font: inherit; font-size: 1rem; color: var(--g-ink); background: #FFFFFF; box-shadow: 0 8px 24px -8px rgba(23,61,48,.4); }
.gps-go input:focus-visible { outline: 3px solid var(--nav); outline-offset: 2px; }
.gps-go > button { height: 52px; padding: 0 20px; border: 0; border-radius: 16px; background: var(--nav); color: #FFFFFF; font-family: var(--display); font-weight: 600; font-size: .95rem; cursor: pointer; box-shadow: 0 8px 24px -8px rgba(26,115,232,.7); }
.gps-go > button:hover { background: var(--nav-d); }
.gps-go > button:focus-visible, .gps-zoom button:focus-visible, .gps-card button:focus-visible, .gps-sheet button:focus-visible, .gps-list button:focus-visible, .gps-skip button:focus-visible { outline: 3px solid var(--g-deep); outline-offset: 2px; }
.gps-sug { position: absolute; top: 60px; left: 0; right: 0; list-style: none; margin: 0; padding: 6px; background: #FFFFFF; border-radius: 16px; box-shadow: 0 16px 40px -12px rgba(23,61,48,.45); }
.gps-sug:empty { display: none; }
.gps-sug button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 10px; padding: 12px; font: inherit; text-align: left; cursor: pointer; color: var(--g-ink); }
.gps-sug button:hover, .gps-sug button:focus-visible { background: #EEF4EF; outline: none; }
.gps-sug button span:last-child { margin-left: auto; color: #58695E; font-size: .85rem; }
.gps-sug__dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.gps-sug__none { padding: 12px; color: #58695E; font-size: .9rem; }

/* controls */
.gps-zoom { position: absolute; right: 14px; bottom: 14px; display: grid; gap: 6px; z-index: 2; }
.gps-zoom button, .gps-skip button { width: 46px; height: 46px; border: 0; border-radius: 14px; background: #FFFFFF; color: var(--g-deep); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px -6px rgba(23,61,48,.45); }
.gps-skip { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2; }
.gps-skip button { width: auto; padding: 0 18px; font-family: var(--display); font-size: .85rem; font-weight: 600; }

/* arrival card */
.gps-card { position: absolute; left: 14px; right: 74px; bottom: 14px; max-width: 400px; z-index: 2; background: #FFFFFF; border-radius: 22px; padding: 16px 18px 14px; box-shadow: 0 20px 50px -16px rgba(23,61,48,.55); border-top: 6px solid var(--c, #245B46); animation: gps-rise .35s ease-out; }
@keyframes gps-rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.gps-card__eyebrow { margin: 0; font-family: var(--display); font-weight: 600; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--d, #245B46); }
.gps-card h2 { margin: 2px 0 2px; font-size: 1.7rem; color: var(--g-ink); }
.gps-card__where { margin: 0 0 10px; font-size: .9rem; color: #58695E; }
.gps-card__row { display: flex; gap: 8px; margin-top: 12px; }
.gps-card__open { flex: 1; height: 46px; border: 0; border-radius: 14px; background: var(--d, #173D30); color: #FFFFFF; font-family: var(--display); font-weight: 600; font-size: .95rem; cursor: pointer; }
.gps-card__about { height: 46px; padding: 0 14px; border: 0; border-radius: 14px; background: #EEF4EF; color: var(--g-deep); font-family: var(--display); font-weight: 600; font-size: .9rem; cursor: pointer; }
.gps-card__x { width: 46px; height: 46px; border: 0; border-radius: 14px; background: #EEF4EF; color: var(--g-deep); font-size: 22px; cursor: pointer; }

.gps-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.gps-strip li { flex: 1; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--c) 22%, #FFFFFF); display: flex; align-items: center; justify-content: center; gap: 5px; font-family: var(--display); font-size: .68rem; font-weight: 600; color: #17231D; }
.gps-strip li span { opacity: .7; }
.gps-strip li.is-on { flex: 3.4; background: var(--c); color: #FFFFFF; }
.gps-strip li.is-on span { opacity: 1; }
.gps-strip li.is-on b { font-weight: 600; white-space: nowrap; }
.gps-strip li.is-also { box-shadow: inset 0 0 0 2px var(--c); }
/* white text needs a dark enough fill: gold and coral get dark text instead */
.gps-strip li.is-on[style*='#D2A640'], .gps-strip li.is-on[style*='#EE8F5B'] { color: #17231D; }

/* detail panel */
.gps-panel-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(13,37,29,.5); display: flex; align-items: flex-end; justify-content: center; }
.gps-panel-wrap[hidden], .gps-card[hidden], .gps-skip[hidden] { display: none; }
.gps-sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: #F7F8F4; border-radius: 26px 26px 0 0; animation: gps-rise .3s ease-out; }
.gps-sheet__head { position: sticky; top: 0; padding: 20px 64px 18px 22px; background: linear-gradient(140deg, var(--c), var(--d)); color: #FFFFFF; border-radius: 26px 26px 0 0; }
.gps-sheet__head p { margin: 0 0 4px; font-family: var(--display); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #FFFFFF; opacity: .92; max-width: none; }
.gps-sheet__head h2 { margin: 0; font-size: 2.1rem; color: #FFFFFF; text-shadow: 0 1px 12px rgba(0,0,0,.25); }
.gps-sheet__x { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255,255,255,.92); color: #17231D; font-size: 22px; cursor: pointer; }
.gps-sheet__body { padding: 18px 22px 26px; color: #17231D; }
.gps-facts { margin: 16px 0 0; display: grid; gap: 14px; }
.gps-facts dt { font-family: var(--display); font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #58695E; }
.gps-facts dd { margin: 3px 0 0; line-height: 1.5; }
.gps-more { margin-top: 16px; background: #FFFFFF; border-radius: 16px; padding: 4px 16px; }
.gps-more summary { cursor: pointer; padding: 12px 0; font-family: var(--display); font-weight: 600; color: #173D30; }
.gps-more .gps-facts { margin: 0 0 14px; }
.gps-more p { margin: 0 0 12px; }
.gps-sheet__lab { color: #245B46; font-weight: 600; }
.gps-sheet__fine { margin: 16px 0; font-size: .8rem; color: #58695E; }
.gps-sheet__back { width: 100%; height: 50px; border: 0; border-radius: 16px; background: #173D30; color: #FFFFFF; font-family: var(--display); font-weight: 600; cursor: pointer; }

/* list alternative */
.gps-list { margin-top: var(--s-5); background: #FFFFFF; border-radius: 20px; padding: 4px 20px; }
.gps-list summary { cursor: pointer; padding: 16px 0; font-family: var(--display); font-weight: 600; color: #173D30; }
.gps-list h3 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c); margin: 14px 0 8px; }
.gps-list ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gps-list button { border: 0; border-radius: 999px; background: #EEF4EF; color: #17231D; padding: 9px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.gps-list button:hover { background: #DCE9DF; }
.gps-note { margin: var(--s-4) 0 0; font-size: var(--t-xs); color: #58695E; max-width: 70ch; }

@media (min-width: 900px) {
  .gps-panel-wrap { align-items: stretch; justify-content: flex-end; }
  .gps-sheet { max-height: none; height: 100%; max-width: 460px; border-radius: 26px 0 0 26px; }
  .gps-sheet__head { border-radius: 26px 0 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gps-card, .gps-sheet, .gps-b.is-dest .gps-b__halo { animation: none; }
  .gps-b, .gps-b text, .gps-shelf, .gps-rl__n { transition: none; }
}

/* ---- reading Scripture inside the destination panel ---- */
.gps-w.is-here circle { stroke: #1A73E8; stroke-width: 7; stroke-dasharray: none; }
.gps-w.is-here text { font-family: var(--display); font-weight: 700; }
.gps-b.is-away .gps-b__halo { animation: none; opacity: 0; }
.gps-tabs { display: flex; gap: 6px; margin: 16px 0 4px; background: #E9EFEA; border-radius: 14px; padding: 4px; }
.gps-tabs button { flex: 1; height: 40px; border: 0; border-radius: 10px; background: none; font-family: var(--display); font-weight: 600; font-size: .9rem; color: #44554A; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.gps-tabs button[aria-selected='true'] { background: #FFFFFF; color: #17231D; box-shadow: 0 2px 8px -4px rgba(23,61,48,.5); }
.gps-read__bar { display: flex; gap: 6px; margin-top: 14px; }
.gps-read__bar button, .gps-read__bar select { height: 44px; border: 0; border-radius: 12px; background: #FFFFFF; color: #17231D; font: inherit; font-weight: 600; cursor: pointer; }
.gps-read__bar button { width: 44px; font-size: 22px; }
.gps-read__bar button:disabled { opacity: .35; cursor: default; }
.gps-read__bar select { flex: 1; min-width: 0; padding: 0 10px; }
.gps-read__bar #gps-tr { flex: 0 0 auto; }
.gps-read__bar button:focus-visible, .gps-read__bar select:focus-visible, .gps-tabs button:focus-visible, .gps-read__text:focus-visible { outline: 3px solid #173D30; outline-offset: 2px; }
.gps-read__meter { height: 5px; border-radius: 3px; background: #DCE5DE; margin-top: 12px; overflow: hidden; }
.gps-read__meter i { display: block; height: 100%; background: var(--d); border-radius: 3px; }
.gps-read__pos { margin: 6px 0 0; font-size: .78rem; color: #58695E; }
.gps-read__text { margin: 14px 0 18px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.12rem; line-height: 1.7; color: #17231D; }
.gps-v { margin: 0 0 .55em; padding: 2px 8px; border-radius: 8px; max-width: none; }
.gps-v sup { font-family: var(--body); font-size: .68rem; font-weight: 600; color: #58695E; margin-right: 6px; }
.gps-v.is-on { background: color-mix(in srgb, var(--c) 24%, #FFFFFF); box-shadow: inset 4px 0 0 var(--c); }
.gps-read__wait { font-family: var(--body); font-size: .95rem; color: #58695E; }

/* Licensed translations: notes above the text, and the credit link. */
.gps-read__note { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: #FFFFFF; font-size: .85rem; color: #3A4A41; max-width: none; }
.gps-sheet__fine a { color: inherit; text-decoration: underline; }
.gps-read__bar #gps-tr { max-width: 46%; }

/* The passage panel sits above the site header, its heading and close
   button stay put, and only the text scrolls. The page behind holds still. */
.gps-panel-wrap { z-index: 300; }
.gps-sheet { display: flex; flex-direction: column; overflow: hidden; max-height: 88dvh; }
.gps-sheet__head { position: relative; flex: 0 0 auto; z-index: 2; }
.gps-sheet__x { width: 44px; height: 44px; z-index: 3; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.gps-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
body:has(.gps-panel-wrap:not([hidden])) { overflow: hidden; }
@media (min-width: 900px) { .gps-sheet { max-height: none; height: 100dvh; } }

/* FIRST SCREEN: where you left off, and a few places to begin. One row under
   the search box; it scrolls sideways on a phone and leaves once you travel. */
.gps-start { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; padding: 2px 2px 6px; scrollbar-width: none; }
.gps-start::-webkit-scrollbar { display: none; }
.gps-start[hidden] { display: none; }
.gps-start button { flex: 0 0 auto; height: 44px; padding: 0 16px; border: 1px solid rgba(23,61,48,.16); border-radius: 999px; background: #FFFFFF; color: var(--g-ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.gps-start button:hover { background: #FFFFFF; }
.gps-start button:focus-visible { outline: 3px solid var(--g-deep); outline-offset: 2px; }
.gps-start__resume { display: inline-flex; flex: 0 0 auto; border-radius: 999px; background: var(--g-deep, #173D30); }
.gps-start__resume button { background: none; color: #FFFFFF; border: 0; }
.gps-start__resume button:hover { background: rgba(255,255,255,.12); }
.gps-start__resume button small { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; opacity: .75; margin-right: 8px; font-weight: 600; }
.gps-start__resume button + button { padding: 0 12px 0 6px; font-size: 1.1rem; }
/* READER TOOLS: text size and a link to this passage, on the chapter line. */
.gps-read__tools { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.gps-read__tools .gps-read__pos { margin: 0 auto 0 0; }
.gps-read__tools button { height: 36px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: #FFFFFF; color: #17231D; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.gps-read__tools button small { font-size: .8em; margin-left: 1px; }
.gps-read__tools button:focus-visible, .gps-read__next:focus-visible { outline: 3px solid #173D30; outline-offset: 2px; }
.gps-read__text { font-size: var(--fs, 1.12rem); }
.gps-read__next { display: block; width: 100%; height: 50px; margin: 0 0 10px; border: 0; border-radius: 16px; background: #FFFFFF; color: #17231D; font-family: var(--display); font-weight: 600; font-size: .95rem; cursor: pointer; }
/* Chapter and translation share the bar evenly on a phone. */
.gps-read__bar #gps-ch { flex: 1 1 7.5rem; min-width: 7.5rem; }
.gps-read__bar #gps-tr { flex: 0 1 auto; max-width: 40%; }
