/* books-fork-modal.css - Unobtrusive methodology books fork component */

:root {
  --books-fork-sab: env(safe-area-inset-bottom, 0px);
  --books-fork-sal: env(safe-area-inset-left, 0px);
}

/* Floating Trigger Chip */
.books-fork__chip {
  position: fixed;
  bottom: calc(1rem + var(--sab, var(--books-fork-sab)));
  left: calc(1rem + var(--sal, var(--books-fork-sal)));
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(51, 65, 85, 0.8);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.books-fork__chip:hover {
  border-color: rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -5px rgba(16, 185, 129, 0.25);
}

.books-fork__chip:active {
  transform: translateY(0);
}

.books-fork__chip:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

.books-fork__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
}

.books-fork__label-full {
  display: inline;
}

.books-fork__label-short {
  display: none;
}

/* Mobile responsive collision avoidance (< 640px) */
@media (max-width: 639px) {
  .books-fork__chip {
    max-width: calc(100vw - 200px);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    padding: 8px 14px;
    font-size: 12px;
  }
  .books-fork__label-full {
    display: none;
  }
  .books-fork__label-short {
    display: inline;
  }
}

/* Modal Overlay */
.books-fork__overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1rem, var(--sab, var(--books-fork-sab))) max(1rem, var(--sal, var(--books-fork-sal)));
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 1;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.books-fork__overlay[hidden] {
  display: none;
  opacity: 0;
}

/* Modal Dialog Box */
.books-fork__dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #0f172a;
  border: 1px solid rgba(51, 65, 85, 0.85);
  border-radius: 24px;
  padding: 24px 24px 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}

/* Dialog Close Button */
.books-fork__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.5);
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.books-fork__close:hover {
  background: #334155;
  color: #ffffff;
}

.books-fork__close:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Dialog Header */
.books-fork__header {
  text-align: center;
  margin-bottom: 20px;
  padding-left: 28px;
  padding-right: 28px;
}

.books-fork__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(71, 85, 105, 0.6);
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.books-fork__title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.books-fork__desc {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.45;
}

/* Wings Grid */
.books-fork__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 639px) {
  .books-fork__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Wing Card */
.books-fork__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border-radius: 18px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  overflow-wrap: break-word;
  min-width: 0;
}

.books-fork__card:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Left Card: PSLC */
.books-fork__card--pslc {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.books-fork__card--pslc:hover {
  border-color: rgba(16, 185, 129, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(6, 78, 59, 0.35);
}

/* Right Card: Vibe PPM */
.books-fork__card--vibe {
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.books-fork__card--vibe:hover {
  border-color: rgba(99, 102, 241, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(49, 46, 129, 0.35);
}

.books-fork__card-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.books-fork__card-tag--pslc {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.books-fork__card-tag--vibe {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.books-fork__card-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
}

.books-fork__card-text {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0 0 14px;
}

.books-fork__card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.books-fork__card-action--pslc {
  color: #34d399;
}

.books-fork__card-action--vibe {
  color: #818cf8;
}

/* Whitepaper Bridge */
.books-fork__bridge {
  text-align: center;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 12px;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}

.books-fork__bridge a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

.books-fork__bridge a:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

/* Legal Attribution Disclaimer */
.books-fork__footer {
  border-top: 1px solid rgba(51, 65, 85, 0.6);
  padding-top: 12px;
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.45;
  text-align: center;
}

.books-fork__footer a {
  color: #94a3b8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.books-fork__footer a:hover {
  color: #cbd5e1;
}

/* Footer Trigger Button (.site-footer__fork-btn) */
.site-footer__fork-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  margin-left: 8px;
}

.site-footer__fork-btn:hover {
  border-color: #10b981;
  color: #047857;
  background: #f0fdf4;
  transform: translateY(-1px);
}

.site-footer__fork-btn:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}
