/*
Theme Name: Earth & Hand - Wabi-Sabi
Theme URI: https://earthandhand.com
Author: Earth & Hand Studio
Author URI: https://earthandhand.com
Description: A handcrafted WordPress theme for ceramic artisans. Embracing wabi-sabi philosophy - finding beauty in imperfection, honoring slow craft, and celebrating the marks of the maker. Features elegant typography, organic animations, and a warm, earthy color palette.
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: earth-and-hand
Tags: ceramics, artisan, wabi-sabi, handmade, minimal, responsive, woocommerce-ready
*/

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  /* Colors - Wabi-Sabi Palette */
  --color-ink: #1a1a1a;
  --color-charcoal: #4a4a48;
  --color-cream: #f7f5f2;
  --color-rice-paper: #ebe8e3;
  --color-withered-tea: #8b7355;
  --color-mouse-grey: #9ca6a2;
  --color-clay: #a67c52;
  --color-ink-green: #5a6b5d;
  
  /* Opacity variants */
  --color-text-primary: rgba(0, 0, 0, 0.87);
  --color-text-secondary: rgba(0, 0, 0, 0.6);
  --color-text-hint: rgba(0, 0, 0, 0.38);
  --color-divider: rgba(0, 0, 0, 0.12);
  
  /* Typography */
  --font-serif: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 6rem;
  
  /* Container */
  --container-max: 1200px;
  --container-padding: 1.5rem;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-primary);
  background-color: var(--color-cream);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-ink);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.375rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1.5rem;
}

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lists */
ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

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

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

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

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

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Flex */
.flex {
  display: flex;
}

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

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

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

.gap-4 {
  gap: 1rem;
}

.gap-8 {
  gap: 2rem;
}

/* ========================================
   COMPONENTS
   ======================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-primary {
  background-color: var(--color-ink);
  color: var(--color-cream);
}

.btn-primary:hover {
  background-color: var(--color-charcoal);
  color: var(--color-cream);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-divider);
}

.btn-outline:hover {
  border-color: var(--color-withered-tea);
  color: var(--color-withered-tea);
}

/* Cards */
.card {
  background: #fff;
  overflow: hidden;
}

.card-image {
  aspect-ratio: 1;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-image img {
  transform: scale(1.03);
}

.card-content {
  padding: var(--spacing-md);
}

/* Links with underline animation */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width var(--transition-normal);
}

.link-underline:hover::after {
  width: 100%;
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.75rem 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-divider);
  outline: none;
  transition: border-color var(--transition-normal);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--color-ink);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-hint);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.1em; }

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

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

/* Grayscale filter for images */
.img-grayscale {
  filter: grayscale(100%);
  transition: filter var(--transition-slow);
}

.img-grayscale:hover {
  filter: grayscale(0%);
}

/* Screen reader only */
.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;
}

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

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.005); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-breathe {
  animation: breathe 10s ease-in-out infinite;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 768px) {
  :root {
    --container-padding: 2rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --container-padding: 3rem;
  }
}
