/**
 * Porter Base Styles
 * Version: 1.0
 * Last updated: 2025-12-08
 *
 * Foundation styles for Porter brand implementation
 * Requires: porter-design-tokens.css
 */

/* ========================================
   GOOGLE FONTS IMPORT
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ========================================
   RESET & BASE
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-body);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
  background-color: var(--color-background);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  text-transform: none; /* Sentence case per brand guide */
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-snug);
}

h3 {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-snug);
}

h4 {
  font-size: var(--font-size-h4);
  line-height: var(--line-height-normal);
}

p {
  margin-bottom: var(--space-3);
  max-width: 75ch; /* Optimal reading length */
}

.lead {
  font-size: var(--font-size-body-large);
  color: var(--color-text-secondary);
}

.small {
  font-size: var(--font-size-body-small);
}

/* ========================================
   LINKS
   ======================================== */

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

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

a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body);
  line-height: 1;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-normal);
  min-height: 48px;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 74, 47, 0.2);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: calc(1rem - 2px) calc(2rem - 2px);
}

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

.btn:focus-visible {
  outline: 3px solid rgba(201, 105, 65, 0.5);
  outline-offset: 2px;
}

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

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

.section-alt {
  background-color: var(--color-surface);
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: all var(--transition-normal);
}

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

/* ========================================
   FORMS
   ======================================== */

label {
  display: block;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-body-small);
  margin-bottom: var(--space-1);
  color: var(--color-text-primary);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus {
  outline: none;
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 0 3px rgba(201, 105, 65, 0.1);
  padding: calc(0.75rem - 1px) calc(1rem - 1px);
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-secondary);
}

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

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

.bg-white {
  background-color: var(--color-surface);
}

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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