/* Wrapped in @layer components so Tailwind v4 utilities (in @layer utilities)
   reliably override these hand-written styles — e.g. `class="input pl-9"`.
   Unlayered CSS would otherwise beat every utility in v4. */
@layer components {
/* Craftplan Style Guide - CSS Variables */
:root {
  /* Brand — the single source of truth is the @theme ramp in
     assets/css/app.src.css; this alias just spares hand-written CSS from
     repeating the step number. */
  --color-brand: var(--color-brand-500); /* #E8604C */

  /* Neutral palette (zinc) */
  --background: #fafafa;      /* zinc-50 */
  --foreground: #27272a;      /* zinc-800 */
  --muted: #52525b;           /* zinc-600 */
  --subtle: #71717a;          /* zinc-500 */
  --border: #d4d4d8;          /* zinc-300 */
  --border-subtle: #e4e4e7;   /* zinc-200 */
  --card: #ffffff;
  /* Indigo stays the admin action colour — `.btn` is admin-only (the one
     public call site uses `.btn secondary`, which reads the zinc tokens
     above). The public surface uses the brand ramp directly. */
  --accent: #4f46e5;          /* indigo-600 */
  --accent-hover: #6366f1;    /* indigo-500 */
  --accent-active: #4338ca;   /* indigo-700 */
  --accent-foreground: #ffffff;

  /* Radius - Style guide uses rounded-md (6px) as primary */
  --radius: 6px;
  --radius-lg: 8px;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Link reset lives in assets/css/app.src.css @layer base so Tailwind
   utilities (underline, hover:text-*, …) can still override it in v4. */

/* Navigation Links */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: #18181b; /* zinc-900 */
  background: rgba(228, 228, 231, 0.5); /* zinc-200/50 */
}

.nav-link-active {
  background: rgba(228, 228, 231, 0.7); /* zinc-200/70 */
  color: #18181b; /* zinc-900 */
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0 0.5rem;
  background: #f4f4f5; /* zinc-100 */
  color: #3f3f46; /* zinc-700 */
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.25rem;
  text-transform: capitalize;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  height: 2.25rem; /* h-9 */
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-foreground);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn:active {
  background: var(--accent-active);
  border-color: var(--accent-active);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--border), 0 0 0 3px white;
}

.btn.secondary {
  background: rgba(228, 228, 231, 0.5); /* zinc-200/50 */
  color: var(--foreground);
  border-color: var(--border);
}

.btn.secondary:hover {
  background: #e4e4e7; /* zinc-200 */
  color: #27272a; /* zinc-800 */
}

/* Form inputs */
.input {
  display: block;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: border-color 0.15s ease;
}

.input::placeholder {
  color: #a1a1aa; /* zinc-400 */
}

.input:focus {
  border-color: #a1a1aa; /* zinc-400 */
  outline: none;
}

/* Tables */
table {
  border-collapse: collapse;
}

th,
td {
  padding: 0.6rem 0.35rem;
}

thead tr {
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: rgba(228, 228, 231, 0.4); /* zinc-200/40 */
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(228, 228, 231, 0.5); /* zinc-200/50 */
  color: var(--foreground);
  font-weight: 500;
  font-size: 0.875rem;
  transition: background 0.15s ease;
}

.pill:hover {
  background: #e4e4e7; /* zinc-200 */
}

.pill strong {
  color: var(--foreground);
}

/* Sidebar */
.sidebar {
  background: rgba(250, 250, 250, 0.9); /* zinc-50/90 */
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 16rem; /* w-64 */
  /* dvh tracks the visible viewport, so the bottom user section stays
     on-screen on mobile when the URL bar is showing. */
  height: 100vh;
  height: 100dvh;
  border-right: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 40;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-label {
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--subtle);
}

/* Main content with sidebar */
.main-with-sidebar {
  margin-left: 16rem; /* w-64 */
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-with-sidebar {
    margin-left: 0;
  }
}

/* Mobile header */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 3.5rem;
  background: rgba(250, 250, 250, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 1023px) {
  .mobile-header {
    display: flex;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 27, 0.5); /* zinc-900/50 */
  z-index: 35;
}

.sidebar-overlay.open {
  display: block;
}

/* Force filter panel visible on desktop */
@media (min-width: 1024px) {
  .filter-panel {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Landing page — only the bits Tailwind can't express ──────────── */

/* Decorative hop/grain hero banner in the landing hero. Edge-weighted
   2000×360 SVG with a deliberately clear center band for the headline —
   served from /static/img, sized to cover. No mask: the artwork carries
   its own edge-to-center fade. */
.hop-pattern {
  background-image: url("../img/hero.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Rotate fallback-monogram colors so adjacent brewery cards differ.
   Tailwind has no nth-child variant out of the box. */
.brewery-mono { background: #18181b; }
.brewery-card:nth-child(3n+1) .brewery-mono { background: var(--color-brand); }
.brewery-card:nth-child(3n+3) .brewery-mono { background: #3f3f46; }
} /* end @layer components */


