/* ========================================================================
   Maine Lakes Chamber -- Design System
   Premium brand identity for the Maine Lakes Region
   ======================================================================== */

/* --- CSS Custom Properties --- */
:root {
  /* Brand Colors */
  --navy: #1e2d4f;
  --navy-deep: #141f38;
  --navy-light: #2a3f6b;
  --forest: #2d6a4f;
  --forest-light: #40916c;
  --sage: #8ba888;
  --sage-light: #b4ccb0;
  --sage-pale: #e8f0e6;
  --gold: #c5943a;
  --gold-light: #d4a843;
  --gold-pale: #f5ecd3;
  --lake: #3a7ca5;
  --lake-light: #5b9bd5;
  --lake-pale: #e3f0f9;
  --cream: #faf9f6;
  --cream-warm: #f5f3ee;
  --white: #ffffff;
  --slate: #4a5568;
  --slate-light: #718096;
  --slate-pale: #a0aec0;
  --charcoal: #2d3748;
  --border: #e5e7eb;
  --border-light: #f0f1f3;

  /* Semantic Colors */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-inverse: var(--white);
  --bg-primary: var(--white);
  --bg-card: var(--white);
  --bg-dark: var(--navy);
  --bg-accent: var(--forest);
  --accent: var(--gold);
  --link: var(--forest);
  --link-hover: var(--navy);
  --success: #2f7d5c;
  --warning: var(--gold);
  --error: #c53030;
  --info: var(--lake);

  /* Status badges */
  --status-active: #2f7d5c;
  --status-active-bg: #e6f4ed;
  --status-grace: var(--gold);
  --status-grace-bg: var(--gold-pale);
  --status-lapsed: var(--error);
  --status-lapsed-bg: #fed7d7;
  --status-application: var(--lake);
  --status-application-bg: var(--lake-pale);
  --status-prospect: var(--slate-light);
  --status-prospect-bg: #edf2f7;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Font Sizes -- fluid scale */
  --text-xs: clamp(0.7rem, 0.66rem + 0.2vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.74rem + 0.3vw, 0.875rem);
  --text-base: clamp(0.9rem, 0.84rem + 0.3vw, 1rem);
  --text-lg: clamp(1rem, 0.92rem + 0.4vw, 1.125rem);
  --text-xl: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --text-2xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-3xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  --text-4xl: clamp(1.875rem, 1.4rem + 2.4vw, 2.5rem);
  --text-5xl: clamp(2.25rem, 1.6rem + 3.2vw, 3.25rem);
  --text-hero: clamp(2.5rem, 1.5rem + 5vw, 4.5rem);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-section: clamp(3rem, 2rem + 5vw, 6rem);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl: 1400px;
  --sidebar-width: 280px;

  /* Borders & Radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-2xl: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(30, 45, 79, 0.04);
  --shadow-sm: 0 1px 3px rgba(30, 45, 79, 0.06), 0 1px 2px rgba(30, 45, 79, 0.04);
  --shadow-md: 0 4px 6px rgba(30, 45, 79, 0.05), 0 2px 4px rgba(30, 45, 79, 0.04);
  --shadow-lg: 0 10px 15px rgba(30, 45, 79, 0.06), 0 4px 6px rgba(30, 45, 79, 0.04);
  --shadow-xl: 0 20px 25px rgba(30, 45, 79, 0.08), 0 10px 10px rgba(30, 45, 79, 0.03);
  --shadow-card: 0 1px 3px rgba(30, 45, 79, 0.06), 0 1px 2px rgba(30, 45, 79, 0.04);
  --shadow-card-hover: 0 10px 25px rgba(30, 45, 79, 0.1), 0 4px 10px rgba(30, 45, 79, 0.05);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-toast: 600;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover);
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--navy);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--navy);
  margin-top: var(--space-sm);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin-top: var(--space-md);
  line-height: 1.6;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: var(--container-md);
}

.container-wide {
  max-width: var(--container-2xl);
}

.section {
  padding: var(--space-section) 0;
}

.section-dark {
  background-color: var(--cream-warm, #f5f3ee);
  color: var(--charcoal, #1f2937);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--navy);
}

.section-dark .section-label {
  color: var(--forest);
}

.section-dark .section-subtitle {
  color: var(--slate);
}

.section-accent {
  background-color: #f0f5f1;
  color: var(--charcoal, #1f2937);
}

.section-cream {
  background-color: var(--cream-warm);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-auto-sm {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--transition-base);
}

.nav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.nav-logo img {
  height: 48px;
  width: auto;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--navy);
  line-height: 1.1;
}

.nav-logo-text small {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--navy);
  background: var(--cream-warm);
}

.nav-link.active {
  font-weight: 600;
}

.nav-cta {
  margin-left: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--forest);
  color: var(--white) !important;
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.nav-cta:hover {
  background: var(--forest-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
  color: var(--white) !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: var(--space-md) var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: var(--space-xs);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: var(--space-md);
  }

  .nav-cta {
    margin-left: 0;
    width: 100%;
    text-align: center;
    padding: var(--space-md);
  }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: center;
  background: linear-gradient(145deg, #eef2f7 0%, #e8f0ec 50%, #f0f5f1 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232d6a4f' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-lg);
  width: 100%;
}

.hero-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  color: var(--navy);
  max-width: 800px;
  line-height: 1.08;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.4s forwards;
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: var(--slate);
  max-width: 560px;
  margin-top: var(--space-lg);
  line-height: 1.6;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.6s forwards;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.8s forwards;
}

.hero-wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: 2px solid transparent;
  line-height: 1.4;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-deep);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 168, 67, 0.35);
  color: var(--navy-deep);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: rgba(30, 45, 79, 0.25);
}

.btn-secondary:hover {
  background: rgba(30, 45, 79, 0.05);
  border-color: rgba(30, 45, 79, 0.4);
  color: var(--navy);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  background: var(--cream-warm);
  color: var(--navy);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: var(--text-base);
}

.btn-dark {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}

.btn-dark:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
  color: var(--cream);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 45, 79, 0.25);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
  border-color: var(--border);
}

.card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--cream-warm);
}

.card-body {
  padding: var(--space-lg);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--navy);
  margin-bottom: var(--space-sm);
}

.card-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Member/Business Card */
.member-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.member-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
  border-color: var(--gold);
}

.member-card-img {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cream-warm) 0%, var(--sage-pale) 100%);
  padding: var(--space-lg);
}

.member-card-img img {
  max-height: 100%;
  max-width: 200px;
  object-fit: contain;
}

.member-card-img .placeholder {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--sage);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
}

.member-card-body {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.member-card-industry {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sage);
  margin-bottom: var(--space-xs);
}

.member-card-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--navy);
}

.member-card-town {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.member-card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: var(--space-sm);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  font-size: var(--text-sm);
}

/* --- Town Card --- */
.town-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  transition: all var(--transition-base);
}

.town-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.3) 60%, transparent 100%);
  z-index: 1;
  transition: all var(--transition-base);
}

.town-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.town-card:hover::before {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.4) 60%, transparent 100%);
}

.town-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.town-card:hover img {
  transform: scale(1.05);
}

.town-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-xl);
  z-index: 2;
}

.town-card-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--navy);
}

.town-card-meta {
  font-size: var(--text-sm);
  color: var(--slate);
  margin-top: var(--space-xs);
}

/* --- Forms --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-sm);
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--lake);
  box-shadow: 0 0 0 3px var(--lake-pale);
}

.form-input::placeholder {
  color: var(--slate-pale);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--forest);
}

/* --- Badges / Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.7em;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-active {
  background: var(--status-active-bg);
  color: var(--status-active);
}

.badge-grace {
  background: var(--status-grace-bg);
  color: #8b6914;
}

.badge-lapsed {
  background: var(--status-lapsed-bg);
  color: var(--status-lapsed);
}

.badge-application {
  background: var(--status-application-bg);
  color: #2b6cb0;
}

.badge-prospect {
  background: var(--status-prospect-bg);
  color: var(--status-prospect);
}

.badge-gold {
  background: var(--gold-pale);
  color: #8b6914;
}

.badge-featured {
  background: var(--gold);
  color: var(--navy-deep);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.6em;
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--cream-warm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.tag-active {
  background: var(--forest);
  color: var(--white);
  border-color: var(--forest);
}

/* --- Search --- */
.search-bar {
  position: relative;
  max-width: 600px;
  width: 100%;
}

.search-bar input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  font-size: var(--text-base);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--white);
  transition: all var(--transition-fast);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--lake);
  box-shadow: 0 0 0 4px var(--lake-pale);
}

.search-bar .search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-pale);
  pointer-events: none;
}

.search-bar-hero input {
  padding: 1.25rem 1.5rem 1.25rem 3.5rem;
  font-size: var(--text-lg);
  border: none;
  box-shadow: var(--shadow-lg);
}

.search-bar-hero input:focus {
  box-shadow: var(--shadow-xl);
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-md) 0;
}

.filter-btn {
  padding: 0.4rem 1rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.filter-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--cream);
}

/* --- Calendar --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-header {
  padding: var(--space-sm);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--cream);
}

.calendar-day {
  min-height: 100px;
  padding: var(--space-sm);
  background: var(--white);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calendar-day:hover {
  background: var(--cream);
}

.calendar-day-number {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.calendar-day.today .calendar-day-number {
  color: var(--white);
  background: var(--gold);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-event {
  margin-top: 2px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.calendar-event.category-community { background: var(--lake-pale); color: #2b6cb0; }
.calendar-event.category-business { background: var(--gold-pale); color: #8b6914; }
.calendar-event.category-arts { background: #fde8e8; color: #c53030; }
.calendar-event.category-outdoor { background: var(--status-active-bg); color: var(--status-active); }
.calendar-event.category-food { background: #fef5e7; color: #b7791f; }

/* --- Stats / Metrics --- */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border-light);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--navy);
  margin-top: var(--space-xs);
  line-height: 1.1;
}

.stat-change {
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

/* --- Footer --- */
.footer {
  background: var(--navy);
  color: var(--sage-light);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-2xl);
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand img {
  height: 56px;
  margin-bottom: var(--space-md);
  filter: brightness(0) invert(1);
}

.footer-brand p {
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 320px;
}

.footer-heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: var(--space-md);
}

.footer-links a {
  display: block;
  padding: var(--space-xs) 0;
  font-size: var(--text-sm);
  color: var(--sage-light);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  max-width: var(--container-xl);
  margin: var(--space-2xl) auto 0;
  padding: var(--space-lg) var(--space-lg) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--text-xs);
  color: var(--slate-light);
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
}

.footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--sage-light);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--gold);
  color: var(--navy);
}

/* --- Page Header --- */
.page-header {
  background: linear-gradient(135deg, #f0f5f1 0%, #e8f0ec 50%, #eef2f7 100%);
  padding: var(--space-4xl) 0 var(--space-3xl);
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.page-header .section-label {
  color: var(--forest);
}

.page-header h1 {
  color: var(--navy);
  margin-top: var(--space-sm);
}

.page-header p {
  color: var(--slate);
  margin-top: var(--space-md);
  font-size: var(--text-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  justify-content: center;
}

.breadcrumb a {
  color: var(--slate);
}

.breadcrumb a:hover {
  color: var(--forest);
}

.breadcrumb .separator {
  color: var(--text-muted);
}

/* --- Dashboard Layout --- */
.dashboard-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.dashboard-sidebar {
  background: var(--navy);
  padding: var(--space-lg);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.dashboard-sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-lg);
}

.dashboard-sidebar-logo img {
  height: 40px;
  filter: brightness(0) invert(1);
}

.dashboard-sidebar-logo span {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--white);
}

.dashboard-nav-group {
  margin-bottom: var(--space-lg);
}

.dashboard-nav-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-light);
  padding: 0 var(--space-md);
  margin-bottom: var(--space-sm);
}

.dashboard-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--sage-light);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.dashboard-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.dashboard-nav-link.active {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
}

.dashboard-main {
  padding: var(--space-xl) var(--space-2xl);
  background: var(--cream);
  overflow-y: auto;
}

@media (max-width: 900px) {
  .dashboard-sidebar {
    display: none;
  }
  .dashboard-main {
    padding: var(--space-md);
  }
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.dashboard-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--navy);
}

/* --- Animations --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger children animation */
.stagger > * {
  opacity: 0;
  animation: fadeUp 0.5s var(--ease-out) forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.1s; }
.stagger > *:nth-child(2) { animation-delay: 0.15s; }
.stagger > *:nth-child(3) { animation-delay: 0.2s; }
.stagger > *:nth-child(4) { animation-delay: 0.25s; }
.stagger > *:nth-child(5) { animation-delay: 0.3s; }
.stagger > *:nth-child(6) { animation-delay: 0.35s; }
.stagger > *:nth-child(7) { animation-delay: 0.4s; }
.stagger > *:nth-child(8) { animation-delay: 0.45s; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

/* Open Graph card for social sharing */
.og-card {
  max-width: 1200px;
  aspect-ratio: 1200/630;
  background: linear-gradient(135deg, var(--navy) 0%, var(--forest) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--white);
  text-align: center;
  padding: 60px;
}

/* --- Print --- */
@media print {
  .nav,
  .footer,
  .nav-toggle,
  .btn,
  .search-bar,
  .filter-bar {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .hero {
    min-height: auto;
    background: none;
    color: black;
    padding: 20px 0;
  }

  .hero-title,
  .hero-subtitle {
    color: black;
  }
}

/* --- Leaflet Map Overrides --- */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  font-family: var(--font-body) !important;
}

.leaflet-popup-content {
  font-size: var(--text-sm) !important;
  margin: 12px 16px !important;
}

/* --- Toast / Notification --- */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  background: var(--navy);
  color: var(--white);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  z-index: var(--z-toast);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--error);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 31, 56, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* --- Loading States --- */
.skeleton {
  background: linear-gradient(90deg, var(--cream-warm) 25%, var(--cream) 50%, var(--cream-warm) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--navy);
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto var(--space-lg);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
}

.tab {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--navy);
}

.tab.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* --- Accordion --- */
.accordion-item {
  border-bottom: 1px solid var(--border-light);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
}

.accordion-trigger::after {
  content: '+';
  font-size: var(--text-xl);
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.accordion-item.open .accordion-trigger::after {
  content: '-';
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-item.open .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding-bottom: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}
