/**
 * Brand styling for the site Tour: the floating "Take a tour" trigger and
 * full overrides of the bundled Shepherd.js popover (which ships with its
 * own hardcoded colors). Mirrors the --tg-* custom properties and the
 * .corner-fab / .lp-btn brand-button conventions used elsewhere in the
 * theme, with [data-bs-theme="dark"] variants throughout.
 */

/* ── Trigger button — fixed bottom-left, mirrors .corner-fab spacing ───── */
.zaira-tour-trigger {
  position:        fixed;
  left:            16px;
  bottom:          16px;
  z-index:         998;
  display:         flex;
  align-items:     center;
  gap:             8px;
  padding:         10px 18px 10px 14px;
  border:          none;
  border-radius:   999px;
  background:      var(--tg-primary-color);
  color:           var(--tg-secondary-color);
  font-family:     var(--tg-body-font-family);
  font-size:       14px;
  font-weight:     600;
  line-height:     1;
  cursor:          pointer;
  box-shadow:      0 2px 12px rgba(192, 154, 82, 0.35);
  transition:      background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.zaira-tour-trigger::before {
  content:                 "explore";
  font-family:             "Material Symbols Sharp";
  font-size:               18px;
  line-height:             1;
  font-variation-settings: 'wght' 400, 'FILL' 1, 'GRAD' 0, 'opsz' 24;
}

.zaira-tour-trigger:hover {
  background: color-mix(in srgb, var(--tg-primary-color) 82%, #000 18%);
  box-shadow: 0 4px 18px rgba(192, 154, 82, 0.48);
  transform:  translateY(-1px);
  color:      var(--tg-secondary-color);
}

.zaira-tour-trigger:focus-visible {
  outline:        2px solid var(--tg-primary-color);
  outline-offset: 3px;
}

@media (max-width: 575.98px) {
  .zaira-tour-trigger span {
    display: none;
  }
  .zaira-tour-trigger {
    padding: 10px;
    border-radius: 50%;
  }
  .zaira-tour-trigger::before {
    font-size: 20px;
  }
}

[data-bs-theme="dark"] .zaira-tour-trigger {
  background:  var(--tg-primary-color);
  color:       var(--tg-black);
  box-shadow:  0 2px 12px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .zaira-tour-trigger:hover {
  background: color-mix(in srgb, var(--tg-primary-color) 85%, #fff 15%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

/* ── Shepherd popover — full brand override ────────────────────────────
   The bundled shepherd.css hardcodes its own light-grey palette; every
   color here is redeclared against --tg-* tokens so the tour matches the
   site chrome in both light and dark mode. */
.shepherd-element {
  background:    var(--tg-white);
  color:         var(--tg-body-font-color);
  border-radius: 12px;
  box-shadow:    0 16px 48px rgba(13, 27, 42, 0.18);
  font-family:   var(--tg-body-font-family);
  max-width:     360px;
}

/* contrib's .shepherd-enabled.shepherd-element (same specificity, but later
   in tour.module.css) clobbers the rule above the moment a step is shown —
   replacing our radius/shadow with its own 2px radius, near-black shadow,
   and a cool grey-blue border. The mismatched 2px corners read as a hard
   square frame around the 12px-clipped white card (worst at the header,
   where the dark fill makes the seam obvious), so this re-asserts our
   values at matching specificity and drops the border — the shadow alone
   gives the card enough definition against the page. */
.shepherd-enabled.shepherd-element {
  background:    var(--tg-white);
  border:        none;
  border-radius: 12px;
  box-shadow:    0 16px 48px rgba(13, 27, 42, 0.18);
}

.shepherd-element .shepherd-arrow:before {
  background: var(--tg-white);
}

/* contrib also hardcodes the arrow that points from a *titled* step toward
   a target above it (placement "bottom") to its old #e6e6e6 header grey —
   it sits flush against our navy header, so recolor it to match in both
   schemes (dark mode's header uses --tg-black, not --tg-secondary-color). */
.shepherd-element.shepherd-has-title[data-popper-placement^="bottom"] > .shepherd-arrow:before {
  background-color: var(--tg-secondary-color);
}

[data-bs-theme="dark"] .shepherd-element.shepherd-has-title[data-popper-placement^="bottom"] > .shepherd-arrow:before {
  background-color: var(--tg-black);
}

/* Clip the header/footer to the card's rounded corners — shepherd-content's
   own (smaller) border-radius otherwise leaves slivers of the card
   background showing through the top corners. Scoped to .shepherd-content
   (not .shepherd-element) so the arrow, a sibling positioned outside the
   element's box via negative offsets, isn't clipped along with it. */
.shepherd-content {
  border-radius: 12px;
  overflow:      hidden;
}

.shepherd-has-title .shepherd-content .shepherd-header {
  background:       var(--tg-secondary-color);
  padding:          1em 1.25em;
  border-radius:    12px 12px 0 0;
}

.shepherd-title {
  color:           var(--tg-white);
  font-family:     var(--tg-heading-font-family);
  font-weight:     600;
  font-size:       17px;
}

/* Match contrib's selector specificity (.shepherd-has-title .shepherd-content
   .shepherd-cancel-icon) — a bare .shepherd-cancel-icon rule loses the
   cascade and the icon renders in contrib's hardcoded mid-grey, which has
   poor contrast against the navy header in both color schemes. */
.shepherd-has-title .shepherd-content .shepherd-cancel-icon {
  color:      var(--tg-gray-three);
  opacity:    0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.shepherd-has-title .shepherd-content .shepherd-cancel-icon:hover {
  color:   var(--tg-primary-color);
  opacity: 1;
}

.shepherd-text {
  padding:     1.25em;
  color:       var(--tg-body-font-color);
  font-size:   15px;
  line-height: var(--tg-body-line-height);
}

.shepherd-text a {
  color:           var(--tg-primary-color);
  text-decoration: underline;
}

.shepherd-footer {
  padding:        0 1.25em 1.25em;
  border-top:     none;
  display:        flex;
  align-items:    center;
  justify-content: flex-end;
  gap:            8px;
}

/* Drupal.theme.tourItemContent appends this badge as the last node inside
   .shepherd-text, and contrib pins it to the bottom-right corner of the
   card — exactly where the right-aligned "Back"/"Next" buttons sit, so the
   two overlap. Pin it to the bottom-LEFT instead: same row as the footer
   buttons (which stay flush right via justify-content: flex-end), with
   nothing else competing for that corner at any step or title length.
   `bottom` is tuned (rather than matching the footer's 1.25em padding) to
   land its smaller text on the same visual baseline as the buttons — the
   buttons' own 8px/14px padding+font give them a taller box that the
   footer's `align-items: center` centers within that bottom padding. */
.tour-progress {
  position:    absolute;
  bottom:      2.25em;
  left:        1.25em;
  right:       auto;
  color:       var(--tg-icon-color);
  font-size:   12px;
  font-weight: 500;
  line-height: 2;
}

.shepherd-button {
  background:    var(--tg-primary-color);
  color:         var(--tg-secondary-color);
  border:        none;
  border-radius: 999px;
  padding:       8px 18px;
  font-family:   var(--tg-body-font-family);
  font-size:     14px;
  font-weight:   600;
  transition:    background 0.2s ease, box-shadow 0.2s ease;
}

.shepherd-button:not(:disabled):hover {
  background: color-mix(in srgb, var(--tg-primary-color) 82%, #000 18%);
  color:      var(--tg-secondary-color);
}

.shepherd-button.shepherd-button-secondary {
  background: transparent;
  color:      var(--tg-icon-color);
  border:     1px solid var(--tg-border-color);
}

.shepherd-button.shepherd-button-secondary:not(:disabled):hover {
  background: var(--tg-gray-three);
  color:      var(--tg-secondary-color);
  border-color: var(--tg-border-color);
}

.shepherd-modal-overlay-container {
  opacity: 0.5;
}

/* ── Dark mode — Shepherd popover ──────────────────────────────────────── */
[data-bs-theme="dark"] .shepherd-element {
  background: var(--tg-teal);
  color:      var(--tg-gray-three);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  border:     1px solid var(--tg-border-dark);
}

[data-bs-theme="dark"] .shepherd-element .shepherd-arrow:before {
  background: var(--tg-teal);
}

[data-bs-theme="dark"] .shepherd-has-title .shepherd-content .shepherd-header {
  background: var(--tg-black);
}

[data-bs-theme="dark"] .shepherd-text {
  color: var(--tg-gray-three);
}

[data-bs-theme="dark"] .shepherd-text a {
  color: var(--tg-primary-color);
}

[data-bs-theme="dark"] .tour-progress {
  color: var(--tg-gray-two);
}

[data-bs-theme="dark"] .shepherd-button.shepherd-button-secondary {
  color:        var(--tg-gray-three);
  border-color: var(--tg-border-dark);
}

[data-bs-theme="dark"] .shepherd-button.shepherd-button-secondary:not(:disabled):hover {
  background: var(--tg-border-dark);
  color:      var(--tg-white);
}

[data-bs-theme="dark"] .shepherd-modal-overlay-container {
  opacity: 0.65;
}
