@import "tailwindcss";

/* ── Register CSS variables as Tailwind theme tokens ─────────────────────────
   This lets us use utilities like bg-primary, text-primary, border-primary,
   ring-primary, and opacity modifiers like bg-primary/10 throughout the app. */
@theme inline {
  --color-primary: var(--color-primary);
  --color-secondary: var(--color-secondary);
}

/* ── Smooth scrolling ─────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ── Selection color ─────────────────────────────────────────────────────── */
::selection {
  background-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
  color: inherit;
}

/* ── Focus visible ────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Line-clamp utilities ─────────────────────────────────────────────────── */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.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;
}

/* ── Font-serif utility for Boutique template ─────────────────────────────── */
.font-serif {
  font-family: var(--font-serif, Georgia, serif);
}

/* ── Section container utility ────────────────────────────────────────────── */
.section-container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .section-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .section-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ── Card base utility ────────────────────────────────────────────────────── */
.card-base {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-base:hover {
  box-shadow: 0 8px 30px -6px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* ── Divider with primary accent ──────────────────────────────────────────── */
.divider-primary {
  height: 2px;
  width: 2.5rem;
  background-color: var(--color-primary);
  border-radius: 9999px;
}

/* ── Prose styles for static page content (WYSIWYG output) ───────────────── */
.prose {
  color: #374151;
  line-height: 1.8;
  font-size: 1rem;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: #111827;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.prose h1 {
  font-size: 2rem;
}
.prose h2 {
  font-size: 1.5rem;
}
.prose h3 {
  font-size: 1.25rem;
}
.prose h4 {
  font-size: 1.1rem;
}
.prose p {
  margin-bottom: 1.25em;
}
.prose ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}
.prose ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}
.prose li {
  margin-bottom: 0.4em;
}
.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover {
  opacity: 0.75;
}
.prose strong {
  font-weight: 700;
  color: #111827;
}
.prose em {
  font-style: italic;
}
.prose blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1.25em;
  color: #6b7280;
  margin: 2em 0;
  font-style: italic;
}
.prose img {
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
  margin: 2em 0;
}
.prose hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2.5em 0;
}
.prose code {
  font-size: 0.875em;
  background: #f3f4f6;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-family: monospace;
}

/* ── Scrollbar hide utility ───────────────────────────────────────────────── */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ── Fade edge for horizontal scroll containers ───────────────────────────── */
.fade-edges {
  mask-image: linear-gradient(
    to right,
    transparent 0,
    black 2rem,
    black calc(100% - 2rem),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    black 2rem,
    black calc(100% - 2rem),
    transparent 100%
  );
}

/* ── Skeleton loading animation ───────────────────────────────────────────── */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e9eaec 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Backdrop blur support ────────────────────────────────────────────────── */
.backdrop-blur-nav {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Premium card hover effects ───────────────────────────────────────────── */
.card-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.12);
}

/* ── Filter chip styling ──────────────────────────────────────────────────── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: color-mix(in srgb, var(--color-primary) 8%, white);
  border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-primary) 90%, black);
  transition: all 0.2s ease;
}
.filter-chip:hover {
  background: color-mix(in srgb, var(--color-primary) 12%, white);
  border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.filter-chip button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.filter-chip button:hover {
  opacity: 1;
}

/* ── Refined button styles ────────────────────────────────────────────────── */
.btn-refined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}
.btn-refined-primary {
  background: var(--color-primary);
  color: white;
}
.btn-refined-primary:hover {
  background: color-mix(in srgb, var(--color-primary) 85%, black);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--color-primary) 40%, transparent);
}
.btn-refined-secondary {
  background: white;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.btn-refined-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* ── Section heading styles ───────────────────────────────────────────────── */
.section-heading {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.section-subheading {
  font-size: 1rem;
  color: #6b7280;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* ── Page breadcrumb styling ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #9ca3af;
}
.breadcrumb a {
  color: #6b7280;
  transition: color 0.2s ease;
  text-decoration: none;
}
.breadcrumb a:hover {
  color: #111827;
}
.breadcrumb-separator {
  color: #d1d5db;
}

/* ── Mobile drawer/sheet ──────────────────────────────────────────────────── */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  animation: fadeIn 0.2s ease;
}
.mobile-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: white;
  border-radius: 1.5rem 1.5rem 0 0;
  z-index: 50;
  animation: slideUp 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ── Improved focus states ────────────────────────────────────────────────── */
.focus-ring {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--color-primary) 20%, transparent);
  border-color: var(--color-primary);
}

/* ── RTL support ──────────────────────────────────────────────────────────── */
[dir="rtl"] .breadcrumb-separator {
  transform: scaleX(-1);
}
[dir="rtl"] .filter-chip {
  flex-direction: row-reverse;
}
