/* CrafterMath Global Styles */
/* Cozy craft aesthetic foundation for all pages */

:root {
  /* Shared craft neutrals - warm grays and creams */
  --craft-cream: #faf8f5;
  --craft-paper: #fefcf5;
  --craft-border: #d4c4b0;
  --craft-border-hover: #c4b4a0;

  /* Shared text colors */
  --craft-text-dark: #5d4e37;
  --craft-text-medium: #6b5d4f;
  --craft-text-muted: #8b7355;
  --craft-text-light: #8b6a52;

  /* Shared shadows (brown-tinted) */
  --craft-shadow-sm: 0 2px 8px rgba(139, 106, 82, 0.1), 0 0 0 1px rgba(139, 106, 82, 0.05);
  --craft-shadow-md: 0 4px 12px rgba(139, 106, 82, 0.15), 0 0 0 1px rgba(139, 106, 82, 0.08);
  --craft-shadow-lg: 0 8px 20px rgba(139, 106, 82, 0.2);

  /* Homepage: Indigo accents */
  --home-primary: #6366f1;
  --home-primary-hover: #4f46e5;
  --home-primary-light: #e0e7ff;

  /* Calculator themes - set per page */
  --calc-primary: #8b6a52; /* brown - envelope calculator default */
  --calc-primary-light: #fef3e2;
  --calc-accent: #e8d4b8;
}

/* Cardstock paper texture background */
body {
  background:
    linear-gradient(135deg, rgba(245, 237, 224, 0.3) 0%, rgba(255, 250, 240, 0.2) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(139, 106, 82, 0.03) 0px,
      rgba(139, 106, 82, 0.03) 1px,
      transparent 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(139, 106, 82, 0.03) 0px,
      rgba(139, 106, 82, 0.03) 1px,
      transparent 1px,
      transparent 2px
    ),
    var(--craft-cream);
  background-attachment: fixed;
  color: var(--craft-text-medium);
}

/* Skip to main content link (accessibility) */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1rem 1.5rem;
  background: var(--craft-text-dark);
  color: white;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}

.skip-to-main:focus {
  left: 0;
  top: 0;
}

/* Craft paper cards */
.craft-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(254, 252, 245, 0.95) 100%),
    var(--calc-primary-light);
  box-shadow: var(--craft-shadow-sm);
  border: 1px solid var(--calc-accent);
  transition: all 0.2s ease;
}

.craft-card:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(254, 252, 245, 0.9) 100%),
    var(--calc-primary-light);
  box-shadow: var(--craft-shadow-md);
  transform: translateY(-1px);
}

/* Warm accent backgrounds */
.accent-bg {
  background: linear-gradient(135deg, var(--calc-primary-light) 0%, var(--calc-primary-light) 100%);
  border-color: var(--calc-accent);
}

.result-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(245, 242, 237, 0.8) 100%),
    var(--calc-primary-light);
  border: 1px solid var(--calc-accent);
}

/* Button styling */
.craft-button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(254, 253, 251, 0.98) 100%),
    var(--calc-primary-light);
  border: 1.5px solid var(--calc-accent);
  transition: all 0.2s ease;
}

.craft-button:hover {
  background:
    linear-gradient(135deg, rgba(254, 249, 242, 0.9) 0%, rgba(253, 246, 237, 0.95) 100%),
    var(--calc-primary-light);
  border-color: var(--calc-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(139, 106, 82, 0.15);
}

.craft-button:active {
  transform: translateY(0);
}

.craft-button:focus-visible {
  outline: 2px solid var(--calc-primary);
  outline-offset: 2px;
}

/* Enhanced focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--calc-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Form inputs with craft styling */
input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  transition: border-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(139, 106, 82, 0.1);
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .no-print {
    display: none !important;
  }

  .print-block {
    display: block !important;
  }
}

/* Improved link accessibility */
a {
  color: inherit;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--craft-text-dark);
}

/* Headings with craft colors */
h1, h2, h3, h4, h5, h6 {
  color: var(--craft-text-dark);
}

/* Mobile improvements */
@media (max-width: 768px) {
  /* Ensure touch targets are at least 44x44px */
  button,
  a.craft-button,
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }
}
