/* ===== FIRSTRAVELLER - GLOBAL STYLES ===== */
/* Include this on EVERY page: <link rel="stylesheet" href="/assets/css/global.css"> */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ===== ROOT VARIABLES ===== */
:root {
  --cream: #FAF7F2;
  --sand: #E8DED0;
  --terracotta: #C4622D;
  --burnt: #8B3A1A;
  --forest: #2D4A3E;
  --sage: #5C7A6B;
  --gold: #D4A853;
  --midnight: #1A1F2E;
  --text: #2C2418;
  --light-text: #7A6F5E;
  
  /* Spacing (8px grid) */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-2xl: 64px;
  --spacing-3xl: 80px;
  
  /* Transitions */
  --transition-fast: 0.2s;
  --transition-normal: 0.3s;
  --transition-slow: 0.4s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 16px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--text);
  line-height: 1.2;
}

h1 {
  font-size: 48px;
  font-weight: 900;
}

h2 {
  font-size: 36px;
}

h3 {
  font-size: 24px;
}

h4 {
  font-size: 18px;
}

h5 {
  font-size: 16px;
}

h6 {
  font-size: 14px;
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--light-text);
}

a {
  color: var(--terracotta);
  text-decoration: none;
  transition: color var(--transition-normal);
}

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

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

/* ===== CONTAINERS ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

.container-small {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

/* ===== SECTIONS ===== */
section {
  padding: var(--spacing-2xl) 0;
}

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

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

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

.section-sand {
  background: var(--sand);
  color: var(--text);
}

/* ===== GRID LAYOUTS ===== */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

/* ===== FLEXBOX ===== */
.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

/* ===== BUTTONS ===== */
.btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
  background: var(--terracotta);
  color: white;
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--burnt);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(196, 98, 45, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  background: white;
  color: var(--terracotta);
  border: 1.5px solid var(--terracotta);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--terracotta);
  color: white;
  transform: translateY(-2px);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--terracotta);
  border: 1.5px solid var(--terracotta);
}

.btn-outline:hover:not(:disabled) {
  background: var(--terracotta);
  color: white;
  transform: translateY(-2px);
}

/* Button Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 32px;
  font-size: 16px;
}

.btn-block {
  display: block;
  width: 100%;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.form-group label .required {
  color: #dc2626;
}

input,
textarea,
select {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid rgba(196, 98, 45, 0.2);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition-normal);
  background: white;
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.1);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: 8px;
}

input.error,
textarea.error,
select.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C4622D' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.error-message {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.error-message.show {
  display: block;
}

.form-info {
  font-size: 12px;
  color: var(--light-text);
  margin-top: 4px;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 8px;
  padding: var(--spacing-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all var(--transition-normal) var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--text);
}

.card-text {
  font-size: 14px;
  color: var(--light-text);
  line-height: 1.6;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.animate-fade {
  animation: fadeIn 0.6s var(--ease) forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.6s var(--ease) forwards;
}

.animate-slide-right {
  animation: slideInRight 0.6s var(--ease) forwards;
}

.animate-scale {
  animation: scaleUp 0.6s var(--ease) forwards;
}

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

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

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

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

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

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

.text-white {
  color: white;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

/* Spacing */
.mt {
  margin-top: var(--spacing-md);
}

.mb {
  margin-bottom: var(--spacing-md);
}

.ml {
  margin-left: var(--spacing-md);
}

.mr {
  margin-right: var(--spacing-md);
}

.py {
  padding-top: var(--spacing-md);
  padding-bottom: var(--spacing-md);
}

.px {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

/* Visibility */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.invisible {
  visibility: hidden;
}

.opacity-50 {
  opacity: 0.5;
}

/* Borders & Colors */
.border-top {
  border-top: 1px solid rgba(196, 98, 45, 0.12);
}

.border-bottom {
  border-bottom: 1px solid rgba(196, 98, 45, 0.12);
}

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

.bg-dark {
  background: var(--midnight);
}

.bg-forest {
  background: var(--forest);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 28px;
  }

  .container {
    padding: 0 var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 20px;
  }

  section {
    padding: var(--spacing-xl) 0;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

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

  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 18px;
  }

  body {
    font-size: 14px;
  }

  .container {
    padding: 0 16px;
  }

  section {
    padding: var(--spacing-lg) 0;
  }

  .btn {
    padding: 8px 16px;
    font-size: 12px;
  }

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

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--terracotta);
  color: white;
  padding: 8px;
  z-index: 100;
}

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

/* ===== PRINT ===== */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }

  a {
    text-decoration: underline;
  }
}
