/*
  lab.css
  ───────
  Minimal custom styles that Tailwind utilities can't express cleanly.
  Everything else is handled by Tailwind classes in the templates.
*/

/* ── HTMX ────────────────────────────────────────────────────
   Loading indicator — fades the target while a request is in flight.
   The spinner div uses class="htmx-indicator" and is hidden by default.
   When a request fires, htmx adds htmx-request to the triggering element,
   which makes .htmx-indicator visible via opacity transition.
*/
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease;
}
.htmx-request .htmx-indicator {
  opacity: 1;
}
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* Smooth swap animation — elements fade out before swap, in after */
.htmx-swapping {
  opacity: 0;
  transition: opacity 150ms ease;
}
.htmx-settling {
  opacity: 1;
  transition: opacity 150ms ease;
}


/* ── Timeline ────────────────────────────────────────────────
   Vertical line for the member profile timeline.
   Used alongside Tailwind's before: pseudo-element approach.
   Kept here for cases where Tailwind's JIT doesn't pick it up.
*/
.timeline-line::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.375rem;
  bottom: 0;
  width: 1px;
  background-color: #f3f4f6;
}


/* ── Publications ────────────────────────────────────────────
   Hanging indent for reference list entries.
*/
.pub-ref {
  padding-left: 2em;
  text-indent: -2em;
}


/* ── KaTeX ───────────────────────────────────────────────────
   Display math horizontal scroll on narrow viewports.
*/
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
}


/* ── Blog prose ──────────────────────────────────────────────
   Tailwind's prose plugin handles most of this.
   These fill gaps for elements prose doesn't cover.
*/
.prose pre {
  border-radius: 0.75rem;
  padding: 0;
}

.prose pre code {
  display: block;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.7;
}

/* Inline code — remove prose backtick pseudo-content */
.prose code::before,
.prose code::after {
  content: none;
}


/* ── Scrollbar ───────────────────────────────────────────────
   Thin scrollbar for the member modal and any other overflow-y-auto panels.
*/
.overflow-y-auto::-webkit-scrollbar {
  width: 5px;
}
.overflow-y-auto::-webkit-scrollbar-track {
  background: transparent;
}
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 3px;
}
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: #d1d5db;
}


/* ── Line clamp fallback ─────────────────────────────────────
   Tailwind includes line-clamp from v3.3+.
   Kept here as a fallback for older Tailwind CDN versions.
*/
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ── Lightbox ────────────────────────────────────────────────
   Prevent body scroll when gallery lightbox is open.
   Alpine toggles this class on <body> via @click handlers.
*/
body.lightbox-open {
  overflow: hidden;
}


/* ── Focus ring ──────────────────────────────────────────────
   Consistent focus ring across interactive elements.
   Supplements Tailwind's focus: utilities.
*/
:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}
