/*
 Theme Name:   Divi Design System Child
 Template:     Divi
 Description:  Child theme for Divi using custom design system.
 Version:      1.0.0
*/

/* Your custom CSS starts below this line */

/*
 Theme Name:   Divi Child – Design System
 Template:     Divi
 Description:  Child theme implementing custom design system tokens + typography + buttons.
*/

/* -------------------------------------------------
   1) Design Tokens (CSS Variables)
   ------------------------------------------------- */

:root {
  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Colors - brand / semantic */
  --color-primary: #007AFF;
  --color-success: #30D158;
  --color-error:   #FF3B30;
  --color-warning: #FF9500;
  --color-yellow:  #FFCC00;

  /* Gray scale */
  --gray-900: #1D1D1F;
  --gray-800: #424245;
  --gray-700: #6E6E73;
  --gray-600: #86868B;
  --gray-500: #98989D;
  --gray-400: #A1A1A6;
  --gray-300: #D2D2D7;
  --gray-200: #E8E8ED;
  --gray-100: #F5F5F7;

  /* Shadows */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-large:  0 10px 15px rgba(0, 0, 0, 0.1);

  /* Typography scale */
  --font-family-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Type sizes (approx. from your doc) */
  --font-display: 72px;
  --font-headline: 40px;
  --font-title: 28px;
  --font-body: 18px;
  --font-caption: 14px;

  /* Line heights */
  --lh-tight: 1.1;
  --lh-snug: 1.2;
  --lh-normal: 1.4;
  --lh-relaxed: 1.5;

  /* Animation */
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.2s var(--ease-smooth);
  --transition-normal: 0.3s var(--ease-smooth);
  --transition-slow: 0.4s var(--ease-smooth);
}

/* -------------------------------------------------
   2) Base Typography & Body
   ------------------------------------------------- */

body {
  font-family: var(--font-family-sans);
  font-size: var(--font-body);
  line-height: var(--lh-relaxed);
  color: var(--gray-900);
  background-color: #ffffff;
}

/* Let Divi handle base link styling; subtle tweak for system feel */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: #0040A8; /* darker primary for hover */
}

/* Headings – mapped to your type scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-sans);
  font-weight: 600;
  color: var(--gray-900);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

h1 {
  font-size: var(--font-headline);
  line-height: var(--lh-snug);
}

h2 {
  font-size: var(--font-title);
  line-height: var(--lh-snug);
}

h3 {
  font-size: 22px;
  line-height: var(--lh-normal);
}

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

h5 {
  font-size: 18px;
  line-height: var(--lh-normal);
}

h6 {
  font-size: 16px;
  line-height: var(--lh-normal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Paragraphs */
p {
  margin-top: 0;
  margin-bottom: var(--space-md);
  color: var(--gray-800);
}

/* Utilities: text alignment & weight */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-light    { font-weight: 300; }
.text-regular  { font-weight: 400; }
.text-medium   { font-weight: 500; }
.text-semibold { font-weight: 600; }

.text-underline { text-decoration: underline; }
.text-mono      { font-family: var(--font-family-mono); }

/* -------------------------------------------------
   3) Button System
   ------------------------------------------------- */

/* Base button style – apply to:
   - Divi Button modules via a custom class "btn"
   - Links or <button> elements in content
*/

.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 0 16px;
  min-height: 44px;

  font-family: var(--font-family-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;

  border-radius: var(--radius-lg);
  border: 1px solid transparent;

  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;

  transition:
    background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-normal);
}

/* Primary button – solid */
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-subtle);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #005FCC;
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.btn-primary:active {
  background-color: #0040A8;
  box-shadow: none;
  transform: translateY(0);
}

/* Secondary button – outline */
.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #F5F5F7;
  color: #005FCC;
}

/* Success / Warning / Error variants */
.btn-success {
  background-color: var(--color-success);
  color: #ffffff;
}

.btn-success:hover,
.btn-success:focus {
  background-color: #1FA545;
}

.btn-warning {
  background-color: var(--color-warning);
  color: #ffffff;
}

.btn-warning:hover,
.btn-warning:focus {
  background-color: #E68000;
}

.btn-error {
  background-color: var(--color-error);
  color: #ffffff;
}

.btn-error:hover,
.btn-error:focus {
  background-color: #D92B24;
}

/* Text-only button (link style) */
.btn-text {
  background-color: transparent;
  border-color: transparent;
  color: var(--color-primary);
  padding-left: 0;
  padding-right: 0;
  min-height: auto;
}

.btn-text:hover,
.btn-text:focus {
  text-decoration: underline;
  color: #0040A8;
}

/* Sizes */
.btn-large {
  padding: 0 20px;
  min-height: 52px;
  font-size: 18px;
}

.btn-small {
  padding: 0 12px;
  min-height: 36px;
  font-size: 14px;
}

/* Disabled state */
.btn[disabled],
button.btn:disabled,
a.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

/* -------------------------------------------------
   4) Basic spacing helpers (optional, small set)
   ------------------------------------------------- */

.margin-top-lg    { margin-top: var(--space-lg); }
.margin-bottom-lg { margin-bottom: var(--space-lg); }
.margin-top-md    { margin-top: var(--space-md); }
.margin-bottom-md { margin-bottom: var(--space-md); }
