/* ============================================================================
   Bluegrass Maker Map — Design System
   ----------------------------------------------------------------------------
   A warm, editorial palette inspired by Kentucky's land and craft tradition.
   Two fonts: Fraunces (display, with character) + Inter (body, neutral).
   ============================================================================ */

:root {
  /* ── Color palette ─────────────────────────────────────────────────────── */
  --forest:    #1F3D2A;   /* Primary brand — deep bluegrass green */
  --moss:      #3F6B4A;   /* Secondary green */
  --sage:      #C5D4B8;   /* Light green tint for cards/tags */
  --rust:      #B85C3D;   /* Accent — for CTAs, highlights */
  --rust-soft: #F4E3DA;   /* Soft rust tint */
  --wheat:     #C9A96E;   /* Warm gold accent */
  --cream:     #FAF6EE;   /* Page background */
  --paper:     #FFFFFF;   /* Card surface */
  --sand:      #F0E9DA;   /* Subtle surface */
  --ink:       #1A1A1A;   /* Primary text */
  --ink-2:     #3A3A3A;   /* Secondary text */
  --muted:     #6B6B6B;   /* Tertiary text */
  --border:    #E5DDD0;   /* Hairline borders */
  --shadow-sm: 0 1px 2px rgba(31, 61, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(31, 61, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(31, 61, 42, 0.12);

  /* ── Typography ────────────────────────────────────────────────────────── */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── Layout ────────────────────────────────────────────────────────────── */
  --nav-h:    56px;
  --max-w:    1180px;
  --gutter:   20px;
  --radius:   12px;
  --radius-lg: 16px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ── Display type ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
}

/* ── Top navigation ────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--forest);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-brand span { color: var(--rust); }
.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 0.92rem;
}
.nav-link {
  color: var(--ink-2);
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: var(--forest); }
.nav-link.active {
  color: var(--forest);
  border-bottom-color: var(--rust);
}
.nav-mobile-toggle { display: none; }

@media (max-width: 720px) {
  .nav-inner { gap: 12px; }
  .nav-links { gap: 14px; font-size: 0.85rem; margin-left: auto; }
  .nav-link { padding: 4px 0; }
}

/* ── Page container ────────────────────────────────────────────────────────── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: 56px 0; }
.section-narrow { padding: 36px 0; }
@media (max-width: 720px) {
  .section { padding: 36px 0; }
  .section-narrow { padding: 24px 0; }
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.section-head h2 { margin: 6px 0 0; }
.section-head .more {
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
}
.section-head .more:hover { color: var(--forest); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--forest);
  color: var(--cream);
}
.btn-primary:hover { background: var(--moss); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--forest); color: var(--forest); }

/* ── Maker card (used in directory + featured) ─────────────────────────────── */
.maker-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.maker-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--moss);
}
.maker-card-img {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--sage) 0%, #B5C9A8 100%);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.maker-card-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.maker-card-img .placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 500;
  color: rgba(31, 61, 42, 0.32);
}
.maker-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.maker-card-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.maker-card-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.maker-card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
  max-height: 24px;
  overflow: hidden;
}
.tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--ink-2);
}
.tag.tag-forest { background: rgba(31, 61, 42, 0.08); color: var(--forest); }
.tag.tag-rust { background: var(--rust-soft); color: var(--rust); }

/* ── Market card ───────────────────────────────────────────────────────────── */
.market-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.market-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--moss);
}
.market-card-when {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--rust);
  margin-bottom: 8px;
}
.market-card-when.is-open { color: #1B5E20; }
.market-card-name {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.2;
  /* Clamp long names to 2 lines and reserve 2 lines of vertical space so
     every card in a row has the same height. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.market-card-loc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: auto;
}

/* ── Grid ──────────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 22px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .grid { gap: 16px; }
}

/* ── Search input ──────────────────────────────────────────────────────────── */
.search {
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 18px;
  gap: 10px;
  transition: border-color 0.18s;
}
.search:focus-within { border-color: var(--forest); }
.search svg { color: var(--muted); flex-shrink: 0; }
.search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 13px 0;
  outline: none;
  font-size: 0.95rem;
}
.search input::placeholder { color: var(--muted); }

/* ── Filter pills ──────────────────────────────────────────────────────────── */
.filter-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.filter-pill {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--ink-2);
  transition: all 0.15s;
}
.filter-pill:hover { border-color: var(--forest); color: var(--forest); }
.filter-pill.active {
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer {
  background: var(--forest);
  color: rgba(250, 246, 238, 0.8);
  padding: 48px 0 32px;
  margin-top: 80px;
  font-size: 0.88rem;
}
.footer .page { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--cream);
  margin-bottom: 6px;
}
.footer-tag {
  color: rgba(250, 246, 238, 0.6);
  font-size: 0.82rem;
  max-width: 320px;
}
.footer-links { display: flex; gap: 22px; }
.footer-links a:hover { color: var(--cream); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(250, 246, 238, 0.15);
  text-align: center;
  font-size: 0.78rem;
  color: rgba(250, 246, 238, 0.5);
}

/* ── Empty / loading states ────────────────────────────────────────────────── */
.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}
.empty h3 { color: var(--ink); margin-bottom: 8px; font-family: var(--font-display); }

/* ── Detail page layout ────────────────────────────────────────────────────── */
.detail {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}
.detail-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 600;
  margin-bottom: 12px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 16px;
}
.detail-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.detail-meta strong { color: var(--ink-2); font-weight: 500; }
.detail h2 {
  font-size: 1.4rem;
  margin: 36px 0 16px;
}
.detail p { margin-bottom: 16px; color: var(--ink-2); line-height: 1.7; }

.detail-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.detail-hero-photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  margin: 0 0 32px;
  background: linear-gradient(135deg, var(--sage), #B5C9A8);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.detail-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero-photo .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 5rem;
  color: rgba(31, 61, 42, 0.3);
}
.photo-credit {
  font-size: 0.74rem;
  color: var(--muted);
  font-style: italic;
  margin-top: -20px;
  margin-bottom: 32px;
  text-align: right;
}

.link-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 24px;
}
.link-row a {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 0.15s;
}
.link-row a:hover { border-color: var(--forest); color: var(--forest); }
.link-row a.primary {
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
}
.link-row a.primary:hover { background: var(--moss); border-color: var(--moss); }

.market-mini-list { display: flex; flex-direction: column; gap: 10px; }
.market-mini {
  display: block;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.market-mini:hover { border-color: var(--forest); transform: translateX(2px); }
.market-mini-name { font-weight: 600; font-size: 1rem; color: var(--ink); }
.market-mini-when { font-size: 0.85rem; color: var(--rust); margin-top: 3px; font-weight: 500; }

.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 24px; }
.crumbs a { color: var(--moss); }
.crumbs a:hover { color: var(--forest); text-decoration: underline; }
