/* styles.css - Shared base: tokens, reset, typography, nav, buttons, footer
 * Owns: CSS variables, global reset, site-nav, .btn variants, .site-footer, shared utilities
 * Does NOT own: page-specific layouts (home.css, insights.css, contact.css)
 */

:root {
  --bg: #FAF8F5;
  --bg-deep: #F0EBE3;
  --fg: #1A1A1A;
  --fg-muted: #5C5C5C;
  --accent: #2D5016;
  --accent-light: #4A7A2E;
  --accent-bg: #E8F0E0;
  --warm: #8B6914;
  --gold: #C8922A;
  --display: 'Playfair Display', Georgia, serif;
  --body: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.7;
  font-size: 17px;
  letter-spacing: 0.3px;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.5px;
}

/* ── Navigation ─────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
}

.nav-brand svg,
.mobile-nav-brand svg {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.mobile-nav-brand {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .nav-brand svg,
  .mobile-nav-brand svg {
    height: 32px;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-fast);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.nav-active:not(.nav-cta) {
  color: var(--fg);
}

.nav-links a.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 9px 20px;
  border-radius: 6px;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-links a.nav-cta:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 80, 22, 0.2);
}

.nav-links a.nav-cta::after {
  display: none;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 32px;
  border-radius: 7px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  letter-spacing: 0.2px;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 12px 32px rgba(45, 80, 22, 0.25);
}

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

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.88rem;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Section label utility ───────────────────────────────────── */
.section-label {
  font-family: var(--body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

/* ── Form error utility ──────────────────────────────────────── */
.form-error {
  font-size: 0.875rem;
  color: #c0392b;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #fdf0ed;
  border-radius: 6px;
  border-left: 3px solid #c0392b;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  padding: 48px 24px;
  background: var(--fg);
  color: #fff;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-loc {
  font-size: 0.85rem;
  opacity: 0.6;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
  line-height: 0;
}

.footer-icon:hover {
  color: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
}

.footer-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-icons {
    gap: 20px;
  }

  .footer-icon svg {
    width: 24px;
    height: 24px;
  }
}

/* ── Mobile Navigation ──────────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  /* Override blanket transition from animations.css — only animate background */
  transition: background var(--transition-fast) !important;
  -webkit-tap-highlight-color: transparent;
}

.nav-hamburger:hover {
  background: var(--bg-deep);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
  /* Prevent any inherited animation from hiding bars */
  opacity: 1;
  visibility: visible;
}

.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 26, 26, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
}

.mobile-nav-overlay.active .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.mobile-nav-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  color: var(--fg-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mobile-nav-close:hover {
  background: var(--bg-deep);
  color: var(--fg);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 4px;
  flex: 1;
}

.mobile-nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 8px;
  transition: background var(--transition-fast), color var(--transition-fast);
  letter-spacing: 0.2px;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.nav-active {
  background: var(--bg-deep);
  color: var(--fg);
}

.mobile-nav-links a.nav-active {
  font-weight: 600;
}

.mobile-nav-cta {
  margin: 0 24px 24px;
}

.mobile-nav-cta a {
  display: block;
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.mobile-nav-cta a:hover {
  background: var(--accent-light);
}

/* Show hamburger / hide desktop nav on mobile */
@media (max-width: 768px) {
  .nav-hamburger {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
  }

  .nav-links {
    display: none !important;
  }
}
