/*
  Theme: Farm to Table – Australian Farmers Markets
  Design System: Brutalism with Adaptive Typography
  Color Scheme: Gradient
  Animation: Smooth Transitions
*/

/* -------------------------------------------------- */
/* 1. VARIABLES & SETUP
/* -------------------------------------------------- */

:root {
  /* Fonts */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Colors */
  --color-text: #222222;
  --color-text-light: #f8fafc; /* slate-50 */
  --color-text-muted: #64748b; /* slate-500 */

  --color-background: #fafaf9; /* stone-50 */
  --color-background-dark: #1c1917; /* stone-900 */
  
  --color-primary: #166534; /* green-800 */
  --color-secondary: #0f766e; /* teal-700 */

  --color-accent-yellow: #facc15; /* yellow-400 */
  --color-accent-orange: #f97316; /* orange-500 */
  
  --color-border: #1c1917; /* stone-900 */
  --border-width: 4px;
  
  /* Transitions */
  --transition-fast: all 0.2s ease-in-out;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* -------------------------------------------------- */
/* 2. BASE & TYPOGRAPHY
/* -------------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-background);
  overflow-x: hidden;
}

/* Base Typography */
p {
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: var(--transition-fast);
}

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

/* Adaptive Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

h1 { font-size: clamp(2.75rem, 5vw + 1rem, 5rem); }
h2 { font-size: clamp(2.25rem, 4vw + 1rem, 3.75rem); }
h3 { font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem); }
h4 { font-size: clamp(1.25rem, 2vw + 0.5rem, 1.75rem); }

/* -------------------------------------------------- */
/* 3. GLOBAL COMPONENTS
/* -------------------------------------------------- */

/* --- Buttons --- */
.btn, button, input[type='submit'] {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0.75rem 2rem;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  will-change: transform;
}

.btn:hover, button:hover, input[type='submit']:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
}

.btn:active, button:active, input[type='submit']:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 10px -5px rgba(0, 0, 0, 0.4);
}

/* --- Forms --- */
.form-input, input[type="text"], input[type="email"], textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 1rem;
    border: var(--border-width) solid var(--color-border);
    background-color: transparent;
    transition: var(--transition-fast);
    width: 100%;
}

.form-input:focus, input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent-yellow);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.4);
}

/* Override for dark contact form */
#contact .form-input, #contact input, #contact textarea {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--color-text-light);
}

#contact .form-input:focus, #contact input:focus, #contact textarea:focus {
    border-color: var(--color-accent-yellow);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: none; /* Tailwind focus ring is enough */
}

/* --- Cards --- */
.card {
  display: flex;
  flex-direction: column;
  align-items: center; /* Center content horizontally */
  text-align: center;
  background-color: #fff;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.card .card-image {
  height: 16rem; /* 256px */
  width: 100%;
  overflow: hidden;
}

.card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Tailwind group-hover handles this, but this is a solid fallback */
.card:hover .card-image img {
  transform: scale(1.08);
}

.card .card-content {
  padding: 1.5rem;
  width: 100%;
  flex-grow: 1; /* Allows card content to take available space */
}

/* -------------------------------------------------- */
/* 4. LAYOUT & SECTIONS
/* -------------------------------------------------- */

/* --- Header --- */
header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Hero Section --- */
#hero {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

#hero h1, #hero p {
  color: var(--color-text-light); /* Enforce white text */
}

/* --- Other Pages (Privacy, Terms, Success) --- */
.page-content-wrapper {
    padding: 120px 1.5rem 80px 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}
.page-content-wrapper h1 {
    margin-bottom: 2rem;
    text-align: center;
}
.page-content-wrapper p,
.page-content-wrapper ul {
    margin-bottom: 1.5rem;
}
.page-content-wrapper ul {
    list-style-position: inside;
    list-style-type: disc;
}

/* --- Success Page --- */
.success-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-text-light);
}
.success-page-container h1 {
    color: var(--color-text-light);
    text-shadow: 2px 2px 5px rgba(0,0,0,0.4);
}
.success-page-container .success-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    color: var(--color-accent-yellow);
}
.success-page-container a {
    margin-top: 2rem;
    background: var(--color-accent-yellow);
    color: var(--color-text);
    padding: 1rem 2.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* --- Footer --- */
footer a {
  text-decoration: none;
  color: #d6d3d1; /* stone-300 */
}

footer a:hover {
  color: var(--color-accent-yellow);
  text-decoration: underline;
}

/* -------------------------------------------------- */
/* 5. ANIMATIONS
/* -------------------------------------------------- */

/* --- Scroll-triggered Animations --- */
[data-animate] {
  opacity: 1;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
  transition-delay: 0.1s;
}

[data-animate].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delay */
[data-animate]:nth-child(2) { transition-delay: 0.2s; }
[data-animate]:nth-child(3) { transition-delay: 0.3s; }
[data-animate]:nth-child(4) { transition-delay: 0.4s; }