/* ===========================================================================
   Linkerr custom styles.
   Tailwind provides the utility layer; this file holds the design tokens
   (CSS variables) for light/dark theming and a handful of component helpers
   that are awkward to express purely with utilities.
   =========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
}

.dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #818cf8;
  --accent-hover: #6366f1;
}

/* Prevent the flash of un-styled Alpine content before Alpine initializes. */
[x-cloak] {
  display: none !important;
}

/* Smooth color transitions when toggling dark mode. */
html {
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* ---------------------------------------------------------------------------
   Multi-line truncation helpers (used by link cards / descriptions).
   --------------------------------------------------------------------------- */
.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;
}

/* ---------------------------------------------------------------------------
   Link card hiding for client-side search. When app.js filters results it
   sets `hidden` on non-matching cards; this guarantees they collapse fully
   regardless of the display utility Tailwind applied.
   --------------------------------------------------------------------------- */
.link-card[hidden] {
  display: none !important;
}

/* A whole category section is hidden when none of its cards match the query. */
.category-section[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Drag-and-drop reorder affordance for the admin category list.
   --------------------------------------------------------------------------- */
.cat-item.dragging {
  opacity: 0.5;
}

.cat-item.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

/* Nicer scrollbars in dark mode for overflow tables. */
.dark ::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
.dark ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}
.dark ::-webkit-scrollbar-track {
  background: transparent;
}

/* Search input: hide the native clear button for a cleaner look. */
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Horizontal scroll carousel: hide scrollbar but keep scroll functionality. */
.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
