/*
 * Meridian Land Counsel - Shared Styles
 * Common CSS used across all pages
 * Extracted from inline styles to reduce duplication and improve maintainability
 */

/* ===== CSS Variables ===== */
:root {
  /* Light Mode Colors (Default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f3f0;
  --bg-tertiary: #fafafa;
  --text-primary: #1a1f2e;
  --text-secondary: #4a5c6a;
  --text-tertiary: #64748b;
  --border-color: rgba(26, 31, 46, 0.12);
  --border-accent: rgba(26, 31, 46, 0.2);

  /* Accent Colors */
  --copper: #b87855;
  --sage: #738c7e;
  --sandstone: #d4c5b3;
  --forest: #3d4f42;

  /* Legacy color names for compatibility */
  --charcoal: var(--text-primary);
  --stone: var(--bg-secondary);
  --slate: var(--text-secondary);
  --white: var(--bg-primary);

  /* Spacing Scale */
  --max-width: 1280px;
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-2xl: 64px;
  --spacing-3xl: 96px;
  --spacing-4xl: 128px;

  /* Design Tokens */
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(26, 31, 46, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 31, 46, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 31, 46, 0.12);
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #232936;
  --text-primary: #e8eaed;
  --text-secondary: #b8bec5;
  --text-tertiary: #8a9199;
  --border-color: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(255, 255, 255, 0.2);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ===== Reset & Base Styles ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: Sylfaen, Georgia, 'Times New Roman', serif;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.005em;
}

h4 {
  font-size: 20px;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1em 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  margin: 0 0 1em 0;
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

/* ===== Images ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Layout Utilities ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ===== Header Component ===== */
header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--spacing-md) 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.8;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sage), var(--forest));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.back-link {
  font-weight: 500;
  display: inline-block;
  margin-bottom: 16px;
  color: var(--copper);
}

.back-link:hover {
  text-decoration: underline;
}

/* ===== Navigation ===== */
nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

nav a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--copper);
  text-decoration: none;
}

@media (max-width: 768px) {
  nav {
    display: none;
  }
}

/* ===== Footer Component ===== */
footer {
  background: var(--charcoal);
  color: white;
  padding: var(--spacing-2xl) 0 var(--spacing-lg);
  margin-top: var(--spacing-4xl);
  transition: background-color 0.3s ease;
}

[data-theme="dark"] footer {
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
}

footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-2xl);
}

footer h3 {
  font-size: 18px;
  margin-bottom: var(--spacing-md);
  color: var(--copper);
}

footer p {
  margin: 0 0 var(--spacing-sm) 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.6;
}

[data-theme="dark"] footer p {
  color: var(--text-secondary);
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--copper);
}

[data-theme="dark"] footer a {
  color: var(--text-secondary);
}

[data-theme="dark"] footer a:hover {
  color: var(--copper);
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer li {
  margin-bottom: var(--spacing-sm);
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] footer li {
  color: var(--text-secondary);
}

.footer-bottom {
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .footer-bottom {
  border-top-color: var(--border-color);
  color: var(--text-tertiary);
}

/* ===== Main Content ===== */
main {
  background: var(--bg-primary);
  min-height: 60vh;
  transition: background-color 0.3s ease;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary {
  background: var(--copper);
  color: white;
}

.btn-primary:hover {
  background: #a66a4a;
}

.btn-secondary {
  background: transparent;
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

/* ===== Form Elements ===== */
input, textarea, select {
  font-family: inherit;
  font-size: 16px;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s ease, background-color 0.3s ease;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--copper);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ===== Utility Classes ===== */
.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-xxs { margin-top: 4px; }
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

/* ===== Special Utility Classes for Legal Pages ===== */
.last-updated {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 32px;
  font-style: italic;
}

.notice {
  background: #fff3cd;
  border-left: 4px solid var(--copper);
  padding: 16px;
  margin: 24px 0;
}

[data-theme="dark"] .notice {
  background: rgba(184, 120, 85, 0.1);
  border-left-color: var(--copper);
}

.notice strong {
  display: block;
  margin-bottom: 8px;
}

/* ===== Contact Section Utility Classes ===== */
.contact-info {
  font-size: 14px;
  color: var(--slate);
}

.office-address {
  color: var(--charcoal);
}

.link-copper {
  color: var(--copper);
}

.text-small {
  font-size: 12px;
}
