/*===============================================*\
|| TerraLoc footer                                ||
|| ---------------------------------------------- ||
|| One footer, every page. It was built for the   ||
|| landing's finale and lived in tl-landing.css   ||
|| under .tl-land-* names; it is site furniture   ||
|| now, so it has its own file and its own        ||
|| prefix. The landing keeps only the closing     ||
|| pitch above it.                                ||
\*===============================================*/

.tl-foot {
  /*
   * The same pin as the landing sections and the auth screens, and for the
   * same reason: this footer is night ground on every page, including pages
   * whose theme has flipped --tl-paper to near-black. Only the tokens that
   * differ between the two palettes are listed; --tl-night-*, --tl-sage and
   * the radii read the same in both.
   */
  --tl-paper:        #F3F2EC;
  --tl-panel:        #FAF9F4;
  --tl-cta:          #C86B3F;
  --tl-cta-rgb:      200, 107, 63;
  --tl-sage:         #9FB08A;
  --tl-night:        #14180F;
  --tl-night-ink:    #C9CDBD;
  --tl-night-line:   #2C3625;
  --tl-night-dim:    #6E7663;
  --tl-night-muted:  #8B937D;
  --tl-night-faint:  #55604A;

  position: relative;
  background: var(--tl-night);
  color: var(--tl-night-ink);
  overflow: hidden;
  padding: 0;
}

/* The landing stacks the closing pitch directly on top of this, both on night
   ground, so the seam has to be invisible: no border, no gap, and the profile
   above carries the space. */
.tl-land-finale + .tl-foot { margin-top: 0; }

.tl-foot-wrap {
  position: relative;
  z-index: 2;
  width: min(94%, 1600px);
  margin: 0 auto;
}

/* The ridge glow, warm, off to the right, exactly where the mockup puts it. */
.tl-foot-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 520px at 80% 6%, rgba(var(--tl-cta-rgb, 200, 107, 63), 0.13), transparent 65%);
  pointer-events: none;
}



/* The contour rings. Two clusters, one rising out of the bottom left corner
   and one small pair top right, drawn at 0.7 so they read as ground rather
   than as a graphic. */
/*
 * The contours are one 700px-tall SVG, and on the landing they have to cross
 * the seam between the closing pitch and this footer. Two blocks cannot share
 * one element, so both draw the same SVG and this copy is lifted by the height
 * of the block above it: the halves line up and read as one arc.
 *
 * 26rem is that block's height. It is also right for a standalone footer,
 * where there is nothing above and the same part of the artwork should show.
 */
.tl-foot-contours {
  position: absolute;
  left: 0;
  top: -26rem;
  width: 100%;
  height: 700px;
  opacity: 0.7;
  pointer-events: none;
}

/* The glow belongs to the block above on the landing, which already covers
   the top of the dark region; a second one here would put a bright patch in
   the middle of it. */
.tl-land-finale + .tl-foot .tl-foot-glow { display: none; }

/* The small pair, in the top right corner where the mockup puts it. Anchored
   to the footer's own top, which is the whole reason it needs its own box. */
.tl-foot-contours--corner {
  right: 0;
  top: 0;
  width: 26%;
  min-width: 20rem;
  height: 21rem;
}










.tl-foot-profile { margin: 5.625rem 0 4rem; position: relative; }


.tl-foot-profile svg { display: block; width: 100%; height: 110px; }


/* The three marks sit ON the profile, not spread evenly under it: the summit
   is at 26%, which is where the line actually peaks. space-between put it in
   the middle of the page, a long way from the point it labels. */
.tl-foot-profile-marks {
  position: relative;
  height: 1rem;
  margin-top: 0.75rem;
  font-family: var(--tl-font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tl-night-dim);
}



.tl-foot-profile-marks span { position: absolute; top: 0; white-space: nowrap; }


.tl-foot-mark-start  { left: 0; color: var(--tl-night-faint); }


.tl-foot-mark-summit { left: 26%; transform: translateX(-50%); color: var(--tl-night-muted); }


.tl-foot-mark-end    { right: 0; color: var(--tl-sage); }





/* 72px between the columns and nothing else: no padding, no margin.
   The separation above and below is carried by the profile's margin-bottom
   and the meta row's margin-top instead, so this element stays a plain
   three-part row and the gaps live on the things being separated. */
.tl-foot-cols {
  display: flex;
  gap: 4.5rem;
}



/* Brand at a fixed 330px, the three link columns as their own even grid that
   takes the remaining width, compass last. They were five flex children, which
   bunched them all to the right. */
.tl-foot-brandcol { width: 330px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1rem; }


.tl-foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem;
  flex-grow: 1;
}



.tl-foot-brand { display: inline-block; }


.tl-foot-brand img { display: block; height: 26px; width: auto; }



.tl-foot-col h4 {
  margin: 0 0 0.875rem;
  font-family: var(--tl-font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tl-sage);
}


/*
 * The links come from [[jscms_menu menustyle=2]], which emits Bootstrap's
 * ul.nav.flex-column > li.nav-item > a.nav-link. .nav-link brings its own
 * 0.5rem/1rem padding and --bs-nav-link-color, so both are reset here; the
 * selector covers a plain <a> too, so the column still styles correctly if a
 * menu is empty and the heading stands alone.
 */
.tl-foot-col .nav { --bs-nav-link-padding-y: 0; --bs-nav-link-padding-x: 0; }


.tl-foot-col a,
.tl-foot-col .nav-link {
  display: block;
  padding: 0.25rem 0;
  color: var(--tl-night-ink);
  font-size: 0.9375rem;
  text-decoration: none;
}


.tl-foot-col a:hover,
.tl-foot-col .nav-link:hover,
.tl-foot-col .nav-link.active { color: var(--tl-paper); }


.tl-foot-col p,
.tl-foot-brandcol p { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--tl-night-muted); }



/* The store links: outline pills at first, the official badges now (the
   --badge modifier below). */
.tl-foot-stores { display: flex; gap: 0.625rem; margin-top: 0.375rem; flex-wrap: wrap; }


.tl-foot-store {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
  padding: 0 0.875rem;
  border: 1px solid var(--tl-night-line);
  border-radius: var(--tl-radius);
  color: var(--tl-night-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}


.tl-foot-store:hover { border-color: var(--tl-sage); color: var(--tl-paper); }

/* The pills are the official badges now, the hero's, at the social buttons'
   height so the two rows under the blurb line up. The pill frame goes; the
   badge carries its own rim. A modifier rather than a rewrite of the pill, so
   a page still baked with the old markup keeps its pills. */
.tl-foot-store--badge {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 7px;
  line-height: 0;
  transition: box-shadow .15s ease;
}
/* max-width: none, or a narrow box squeezes the width while the height
   holds and the artwork letterboxes into a smaller badge. */
.tl-foot-store--badge img { display: block; width: auto; max-width: none; height: 40px; }
.tl-foot-store--badge:hover,
.tl-foot-store--badge:focus-visible { outline: 0; box-shadow: 0 0 0 2px var(--tl-night), 0 0 0 3px var(--tl-sage); }

/* A store whose address is still '#' is not drawn: until Apple approved the
   app, the App Store link went nowhere. */
.tl-foot-store[href="#"],
.tl-foot-store[href=""] { display: none; }

/* Where TerraLoc is on social media: square buttons in the stores' outline,
   one row under them. The addresses are Admin > Social; a network left empty
   there is not drawn, and with neither filled in the row goes too. */
.tl-foot-social { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.tl-foot-social-btn[href=""],
.tl-foot-social-btn[href="#"] { display: none; }
.tl-foot-social:not(:has(.tl-foot-social-btn:not([href=""]):not([href="#"]))) { display: none; }
.tl-foot-social-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--tl-night-line);
  border-radius: var(--tl-radius);
  color: var(--tl-night-ink);
  text-decoration: none;
}
.tl-foot-social-btn:hover { border-color: var(--tl-sage); color: var(--tl-paper); }



/* The compass and the coordinates, bottom right of the columns. The rose is
   the mockup's own drawing: two rings, tick marks, and a two-tone needle. */
.tl-foot-compass {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  margin-left: auto;
}


.tl-foot-compass svg { display: block; }


.tl-foot-compass-co {
  font-family: var(--tl-font-mono);
  font-size: 0.65625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tl-night-dim);
  text-align: right;
  line-height: 1.7;
}



.tl-foot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--tl-night-line);
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  padding: 1.125rem 0 1.25rem;
  font-family: var(--tl-font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tl-night-faint);
}



/* The wordmark, oversized and cropped by the page edge. It is an OUTLINE, not
   a solid: transparent fill with a hairline stroke, which is why it reads as a
   watermark rather than as another heading. */
.tl-foot-ghost-box {
  position: relative;
  height: clamp(2.5rem, 10.2vw, 9.25rem);
  overflow: hidden;
  margin-top: 0.625rem;
}


.tl-foot-ghost {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--tl-font-display);
  font-size: clamp(4rem, 16.3vw, 14.75rem);
  line-height: 0.8;
  font-weight: 800;
  letter-spacing: 0;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(159, 176, 138, 0.28);
  white-space: nowrap;
  user-select: none;
}



/* The middle meta item is a live readout, with the dot to match. */
.tl-foot-gps { display: inline-flex; align-items: center; gap: 0.5625rem; color: var(--tl-sage) !important; }


.tl-foot-gps .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tl-sage);
  animation: tl-foot-pulse 2s ease-in-out infinite;
}

/* ---------- responsive ----------
   Bootstrap's breakpoints, matching the rest of the template. */

@media (max-width: 991.98px) {
  .tl-foot-cols { flex-direction: column; gap: 2.75rem; }

  /* Wherever the columns stack the compass was left adrift at the right of a
     band of its own. It joins the coordinates on one line, small, on the
     same left edge, as the first line of the meta block it belongs with. */
  .tl-foot-compass {
    flex-direction: row;
    align-items: center;
    gap: .875rem;
    margin: 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tl-night-line);
  }
  .tl-foot-compass svg { width: 44px; height: 44px; }
  .tl-foot-compass-co { text-align: left; line-height: 1.6; }

  /* One block with the compass under one hairline, not a second line 80px
     below the first. */
  .tl-foot-meta { margin-top: 1rem; padding: 0 0 1rem; border-top: 0; gap: .5rem; }

  /* The summit label collides with START up to about 900px. */
  .tl-foot-mark-summit { display: none; }
}

@media (max-width: 767.98px) {
  .tl-foot-meta { flex-direction: column; align-items: flex-start; }
}

/* The phone. Below 576 the footer was the desktop row stacked: two link
   columns of unequal length, Help and legal alone on a third row with half
   the width empty, and gaps of 44 to 90px with nothing in them. Now it is one
   column on one left edge, each block parted from the next by the same
   hairline and the same space. */
@media (max-width: 575.98px) {
  .tl-foot-profile { margin: 3rem 0 2.5rem; }
  .tl-foot-profile svg { height: 72px; }

  .tl-foot-cols { gap: 0; }
  .tl-foot-brandcol { width: auto; gap: .875rem; padding-bottom: 2rem; }
  .tl-foot-brandcol p { max-width: 22rem; }
  .tl-foot-stores { margin-top: .25rem; }
  .tl-foot-social { margin-top: 0; }

  /* Each menu is a full-width section, its links in two even columns, so no
     column runs on while its neighbour has stopped. Three columns side by
     side did not fit ("Route planner" broke across two lines), and two left
     Help and legal alone on a third row. */
  .tl-foot-grid { display: block; }
  .tl-foot-col { padding: 1.375rem 0 1.25rem; border-top: 1px solid var(--tl-night-line); }
  .tl-foot-col h4 { margin-bottom: .625rem; }
  .tl-foot-col .nav { display: block; columns: 2; column-gap: 1.5rem; }
  .tl-foot-col .nav-item { break-inside: avoid; }
  /* 40px rows: a thumb target, and still a short list. */
  .tl-foot-col a,
  .tl-foot-col .nav-link { padding: .5rem 0; line-height: 1.5; }
}

@keyframes tl-foot-pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .tl-foot .pulse,
  .tl-foot-gps .pulse { animation: none !important; }
}
