/* Land Logic Global — search overlay + chat widget styles.
 * Dark theme, blue accent, glassmorphism — matches the rest of the site.
 * Variables (--blue, --bg-card, etc.) are assumed defined on :root by the host page.
 */

/* ============================================================
 * Search button (in nav)
 * ============================================================ */
.llg-search-btn {
  background: transparent;
  border: 1px solid rgba(168, 184, 208, 0.6);
  color: #a8b8d0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  padding: 0;
}
.llg-search-btn:hover,
.llg-search-btn:focus-visible {
  color: var(--blue, #3b82f6);
  border-color: var(--blue, #3b82f6);
}
.llg-search-btn svg { display: block; }

/* ============================================================
 * Search overlay / modal
 * ============================================================ */
.llg-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 20px 20px;
}
.llg-search-overlay.open { display: flex; }
.llg-search-panel {
  width: 100%;
  max-width: 640px;
  background: rgba(10, 15, 26, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(59, 130, 246, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.llg-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}
.llg-search-header svg { color: #94a0b3; flex-shrink: 0; }
.llg-search-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 17px;
  font-family: inherit;
  padding: 8px 0;
}
.llg-search-input::placeholder { color: #94a0b3; }
.llg-search-close {
  background: transparent;
  border: 1px solid rgba(168, 184, 208, 0.6);
  color: #b8c5d8;
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 10px;
  min-height: 24px;
  min-width: 24px;
  cursor: pointer;
  font-family: inherit;
}
.llg-search-close:hover { color: var(--blue, #3b82f6); border-color: var(--blue, #3b82f6); }

.llg-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.llg-search-hint,
.llg-search-empty {
  color: #94a0b3;
  font-size: 14px;
  padding: 24px 16px;
  text-align: center;
}
.llg-search-empty a { color: var(--blue, #3b82f6); }
.llg-search-result {
  display: block;
  padding: 14px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.llg-search-result:hover {
  background: rgba(59, 130, 246, 0.08);
}
.llg-search-result:focus-visible {
  background: rgba(59, 130, 246, 0.08);
  outline: 3px solid var(--blue, #3b82f6);
  outline-offset: -2px;
}
.llg-search-result-cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--blue, #3b82f6);
  font-weight: 600;
  margin-bottom: 4px;
}
.llg-search-result-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.llg-search-result-body {
  font-size: 13px;
  color: #b8c5d8;
  line-height: 1.5;
}
.llg-search-result mark {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
  border-radius: 2px;
  padding: 0 2px;
}

@media (max-width: 600px) {
  .llg-search-overlay { padding: 6vh 12px 12px; }
  .llg-search-panel { max-height: 88vh; }
  .llg-search-input { font-size: 16px; }
}

/* ============================================================
 * Chat widget — bubble + panel
 * ============================================================ */
.llg-chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--blue, #3b82f6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4), 0 0 0 0 rgba(59, 130, 246, 0.4);
  z-index: 9500;
  transition: transform 0.2s, box-shadow 0.3s;
  animation: llg-chat-pulse 3s ease-in-out infinite;
}
.llg-chat-bubble:hover { transform: scale(1.06); box-shadow: 0 12px 32px rgba(59, 130, 246, 0.55); }
.llg-chat-bubble svg { width: 28px; height: 28px; }
.llg-chat-bubble.hidden { display: none; }
@keyframes llg-chat-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(59,130,246,0.4), 0 0 0 0 rgba(59,130,246,0.4); }
  50%      { box-shadow: 0 8px 24px rgba(59,130,246,0.5), 0 0 0 12px rgba(59,130,246,0); }
}
@media (prefers-reduced-motion: reduce) {
  .llg-chat-bubble { animation: none; }
}

.llg-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 360px;
  height: 500px;
  max-height: calc(100vh - 48px);
  background: rgba(10, 15, 26, 0.97);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(59, 130, 246, 0.12);
  z-index: 9500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.llg-chat-panel.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.llg-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(6, 182, 212, 0.08));
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}
.llg-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.llg-chat-title {
  flex: 1;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.llg-chat-title small {
  display: block;
  color: #94a0b3;
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}
.llg-chat-close {
  background: transparent;
  border: none;
  color: #b8c5d8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.llg-chat-close:hover { color: #fff; background: rgba(255,255,255,0.05); }

.llg-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.llg-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.llg-chat-msg.assistant {
  align-self: flex-start;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: #e8eef9;
  border-bottom-left-radius: 4px;
}
.llg-chat-msg.user {
  align-self: flex-end;
  /* Explicit #2563eb (5.17:1 vs #fff) — do NOT use var(--blue), which resolves
     to #3b82f6 (3.68:1, fails WCAG AA 1.4.3) on host pages. */
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.llg-chat-msg.error {
  align-self: flex-start;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #fca5a5;
  font-size: 13px;
}
.llg-chat-msg a { color: inherit; text-decoration: underline; }

.llg-chat-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.llg-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue, #3b82f6);
  animation: llg-chat-dot 1.2s infinite ease-in-out;
}
.llg-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.llg-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes llg-chat-dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-3px); }
}

.llg-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(59, 130, 246, 0.15);
  background: rgba(6, 8, 15, 0.5);
}
.llg-chat-input {
  flex: 1;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(168, 184, 208, 0.6);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  resize: none;
  transition: border-color 0.2s;
  max-height: 100px;
  min-height: 40px;
}
.llg-chat-input:focus-visible {
  border-color: var(--blue, #3b82f6);
  outline: 3px solid var(--blue, #3b82f6);
  outline-offset: -2px;
}
.llg-chat-input::placeholder { color: #94a0b3; }
.llg-chat-send {
  background: var(--blue, #2563eb);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.llg-chat-send:hover { background: #2563eb; }
.llg-chat-send:active { transform: scale(0.95); }
.llg-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Mobile — keep bubble above sticky CTA; tighten panel */
@media (max-width: 480px) {
  .llg-chat-bubble {
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0) + 90px); /* clear sticky mobile CTA */
    width: 54px;
    height: 54px;
  }
  .llg-chat-bubble svg { width: 24px; height: 24px; }
  .llg-chat-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: calc(env(safe-area-inset-bottom, 0) + 16px);
    height: calc(100vh - 100px);
  }
}

/* llg-corner-guard */
/* ── Bottom-right corner: the chat bubble owns it ──────────────────────────
   .llg-chat-bubble is fixed at right:24px/bottom:24px and is 60px across, so it
   covers the bottom-right 84x84px of the viewport at every screen width. Two
   things were sitting underneath it:
     · the "Site by Earth Tab" credit — the footer's last line, flush right on
       desktop (Dimitrios, August 8, 2026, screenshot of the bubble over it);
     · the back-to-top button, fixed at right:30px/bottom:30px and 48px across,
       so entirely INSIDE the bubble's footprint, and at z-index 50 against the
       bubble's 9500 it renders behind it. A <=768px rule had already bumped it
       clear on mobile; nothing ever moved it on desktop, where it has been
       invisible and unclickable.
   Reserve the lane rather than move the bubble — its corner is the one place a
   visitor expects to find it. */
.site-footer .footer-bottom > :last-child { margin-right: 84px; }
@media (max-width: 768px) {
  /* stacked and centred at this width — clear the bubble vertically instead */
  .site-footer .footer-bottom > :last-child { margin-right: 0; }
  .site-footer .footer-bottom { padding-bottom: 84px; }
}
footer[role="contentinfo"]:not(.site-footer) { padding-bottom: 84px; }
.back-to-top { bottom: 96px; }
