/*
 * 75 Soft Challenge - Global Styles
 * Vanilla CSS conversion from Tailwind + Shadcn
 */

/* ========================================
   CSS VARIABLES (from Tailwind config)
   ======================================== */
:root {
  /* Core Colors - HSL format */
  --background: 0 0% 100%;
  --foreground: 30 5% 15%;

  --card: 0 0% 100%;
  --card-foreground: 30 5% 15%;

  --popover: 0 0% 100%;
  --popover-foreground: 30 5% 15%;

  /* Soft sage green accent */
  --primary: 150 25% 35%;
  --primary-foreground: 0 0% 100%;

  --secondary: 30 10% 96%;
  --secondary-foreground: 30 5% 15%;

  --muted: 30 10% 96%;
  --muted-foreground: 30 5% 45%;

  /* Dusty rose for highlights */
  --accent: 350 30% 85%;
  --accent-foreground: 350 30% 25%;

  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;

  --border: 30 15% 90%;
  --input: 30 15% 90%;
  --ring: 150 25% 35%;

  --radius: 0.75rem;

  /* Custom tokens */
  --sage: 150 25% 35%;
  --sage-light: 150 20% 95%;
  --sage-dark: 150 30% 25%;
  --rose: 350 30% 85%;
  --rose-dark: 350 35% 45%;
  --cream: 40 30% 97%;
  --warm-gray: 30 5% 45%;
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

h1 {
  font-size: 1.875rem; /* 30px */
  line-height: 1.1;
}

h2 {
  font-size: 1.5rem; /* 24px */
  line-height: 1.25;
}

h3 {
  font-size: 1.25rem; /* 20px */
  line-height: 1.3;
}

h4 {
  font-size: 1.125rem; /* 18px */
}

p {
  line-height: 1.75;
  font-size: 1rem;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Medium screens (768px+) */
@media (min-width: 768px) {
  h1 {
    font-size: 2.25rem; /* 36px */
  }
  
  h2 {
    font-size: 1.875rem; /* 30px */
  }
  
  h3 {
    font-size: 1.5rem; /* 24px */
  }
  
  h4 {
    font-size: 1.25rem; /* 20px */
  }
  
  p {
    font-size: 1.125rem;
  }
}

/* Large screens (1024px+) */
@media (min-width: 1024px) {
  h1 {
    font-size: 3rem; /* 48px */
  }
}

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

/* Container - centered with max-width */
.container {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.container-article {
  max-width: 56rem; /* 896px - max-w-4xl */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.container-wide {
  max-width: 72rem; /* 1152px - max-w-6xl */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-article,
  .container-wide {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-article,
  .container-wide {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

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

.flex-1 {
  flex: 1 1 0%;
}

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

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Grid Utilities */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ========================================
   SPACING UTILITIES
   ======================================== */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.mt-20 { margin-top: 5rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }

.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

.pt-4 { padding-top: 1rem; }
.pt-8 { padding-top: 2rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }

.pl-4 { padding-left: 1rem; }
.pl-6 { padding-left: 1.5rem; }

/* ========================================
   TEXT UTILITIES
   ======================================== */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.font-serif { font-family: 'Playfair Display', Georgia, serif; }
.font-sans { font-family: 'Source Sans 3', system-ui, sans-serif; }

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

.leading-relaxed { line-height: 1.625; }
.leading-snug { line-height: 1.375; }
.leading-tight { line-height: 1.25; }

.tracking-tight { letter-spacing: -0.025em; }

.text-balance { text-wrap: balance; }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }

.underline { text-decoration: underline; }
.underline-offset-4 { text-underline-offset: 4px; }

/* Text Colors */
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-secondary-foreground { color: hsl(var(--secondary-foreground)); }
.text-accent-foreground { color: hsl(var(--accent-foreground)); }
.text-white { color: #fff; }

/* ========================================
   BACKGROUND UTILITIES
   ======================================== */
.bg-background { background-color: hsl(var(--background)); }
.bg-foreground { background-color: hsl(var(--foreground)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-accent { background-color: hsl(var(--accent)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-cream { background-color: hsl(var(--cream)); }
.bg-sage-light { background-color: hsl(var(--sage-light)); }
.bg-white { background-color: #fff; }
.bg-transparent { background-color: transparent; }

/* ========================================
   BORDER UTILITIES
   ======================================== */
.border { border: 1px solid hsl(var(--border)); }
.border-t { border-top: 1px solid hsl(var(--border)); }
.border-b { border-bottom: 1px solid hsl(var(--border)); }
.border-l { border-left: 1px solid hsl(var(--border)); }
.border-r { border-right: 1px solid hsl(var(--border)); }

.border-none { border: none; }
.border-0 { border-width: 0; }
.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }

.border-border { border-color: hsl(var(--border)); }
.border-primary { border-color: hsl(var(--primary)); }
.border-transparent { border-color: transparent; }

.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: calc(var(--radius) - 4px); }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.rounded-lg { border-radius: var(--radius); }
.rounded-xl { border-radius: 1rem; }
.rounded-2xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.rounded-none { border-radius: 0; }

/* ========================================
   LAYOUT
   ======================================== */
.min-h-screen { min-height: 100vh; }
.min-h-0 { min-height: 0; }

.w-full { width: 100%; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }

.h-16 { height: 4rem; }
.h-20 { height: 5rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

.inset-0 { inset: 0; }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* ========================================
   DISPLAY UTILITIES
   ======================================== */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:h-20 { height: 5rem; }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex; }
  .lg\:block { display: block; }
  .lg\:hidden { display: none; }
}

/* ========================================
   EFFECTS & TRANSITIONS
   ======================================== */
.shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.shadow-none { box-shadow: none; }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

.cursor-pointer { cursor: pointer; }

/* Backdrop blur for header */
.backdrop-blur-sm { backdrop-filter: blur(4px); }

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

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes accordion-down {
  from { height: 0; }
  to { height: var(--accordion-height); }
}

@keyframes accordion-up {
  from { height: var(--accordion-height); }
  to { height: 0; }
}

.animate-fade-in {
  animation: fade-in 0.5s ease-out forwards;
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

/* ========================================
   ARTICLE CONTENT STYLES
   ======================================== */
.article-content {
  max-width: 48rem; /* max-w-3xl */
  margin-left: auto;
  margin-right: auto;
}

.article-content p {
  margin-bottom: 1.5rem;
  color: hsl(var(--muted-foreground));
}

.article-content h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  scroll-margin-top: 6rem;
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  scroll-margin-top: 6rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: hsl(var(--muted-foreground));
}

.article-content ul {
  list-style-type: disc;
}

.article-content ol {
  list-style-type: decimal;
}

.article-content li {
  line-height: 1.75;
  margin-bottom: 0.5rem;
}

.article-content li::marker {
  color: hsl(var(--primary));
}

.article-content blockquote {
  border-left: 4px solid hsl(var(--primary) / 0.3);
  padding-left: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  font-style: italic;
  color: hsl(var(--muted-foreground));
}

.article-content img {
  border-radius: var(--radius);
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.article-content table {
  width: 100%;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-collapse: collapse;
}

.article-content th {
  background-color: hsl(var(--secondary));
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  border-bottom: 1px solid hsl(var(--border));
}

.article-content td {
  padding: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.article-content a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: hsl(var(--primary) / 0.4);
}

.article-content a:hover {
  text-decoration-color: hsl(var(--primary));
}

/* ========================================
   LIST STYLES
   ======================================== */
.list-disc { list-style-type: disc; }
.list-decimal { list-style-type: decimal; }
.list-none { list-style-type: none; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

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

/* Focus states */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px hsl(var(--ring)); }
.focus-visible\:outline-none:focus-visible { outline: none; }
.focus-visible\:ring-2:focus-visible { box-shadow: 0 0 0 2px hsl(var(--ring)); }

/* Hover states */
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:text-primary:hover { color: hsl(var(--primary)); }
.hover\:bg-secondary:hover { background-color: hsl(var(--secondary)); }
.hover\:bg-sage-light:hover { background-color: hsl(var(--sage-light)); }

/* Aspect ratio */
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-square { aspect-ratio: 1 / 1; }

/* Object fit */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-center { object-position: center; }

/* Pointer events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Selection */
.select-none { user-select: none; }

/* ========================================
   RESPONSIVE IMAGE WRAPPER
   ======================================== */
.responsive-img-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.responsive-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* YouTube embed responsive */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
}
