/* ===========================
   CSS Design System
   ChickenSite - Farm Website
   =========================== */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  min-height: 100vh;
  line-height: 1.6;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Custom Properties --- */
:root {
  /* Colors */
  --color-cream: #F5F0E8;
  --color-green: #4A6741;
  --color-green-dark: #3A5331;
  --color-green-light: #5A7D4F;
  --color-red: #8B2E2E;
  --color-red-dark: #6E2424;
  --color-red-light: #A63C3C;
  --color-brown: #6B4C2A;
  --color-brown-light: #8A6840;
  --color-white: #FFFFFF;
  --color-text: #2C2C2C;
  --color-text-light: #555555;
  --color-border: #D6CFC4;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Font sizes (mobile-first) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --container-max: 1200px;
  --header-height: 70px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* --- Google Fonts --- */
/* Loaded via <link> in HTML head */

/* --- Base Typography --- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-cream);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-green);
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

small {
  font-size: var(--text-sm);
}

p {
  margin-bottom: var(--space-md);
}

/* Tablet breakpoint */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-4xl);
  }

  h2 {
    font-size: var(--text-3xl);
  }

  h3 {
    font-size: var(--text-2xl);
  }

  h4 {
    font-size: var(--text-xl);
  }
}

/* Desktop breakpoint */
@media (min-width: 1024px) {
  :root {
    --text-4xl: 2.75rem;
    --text-3xl: 2.25rem;
  }
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-xl);
  }
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-wrapper > main {
  flex: 1;
}

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

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

.grid-4 {
  grid-template-columns: 1fr;
}

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

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

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

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* --- Flexbox Helpers --- */
.flex {
  display: flex;
}

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

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

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

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

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

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

/* --- Header --- */
.site-header {
  background-color: var(--color-white);
  border-bottom: 2px solid var(--color-green);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-green);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-logo:hover {
  color: var(--color-green-dark);
}

/* --- Footer --- */
.site-footer {
  background-color: var(--color-green);
  color: var(--color-cream);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}

.site-footer .container {
  text-align: center;
}

.footer-name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.footer-tagline {
  font-size: var(--text-sm);
  opacity: 0.85;
  margin-bottom: var(--space-md);
}

.footer-copyright {
  font-size: var(--text-xs);
  opacity: 0.7;
}

/* --- Section Spacing --- */
.section {
  padding: var(--space-2xl) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-3xl) 0;
  }
}

/* --- Home: Eggs Price Section --- */
.price-content {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.price-content h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
}

.price-amount {
  display: inline-block;
  color: var(--color-brown);
  white-space: nowrap;
}

.price-tagline {
  color: var(--color-text-light);
  font-size: var(--text-lg);
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
}

.price-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.price-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 768px) {
  .price-content h1 {
    font-size: var(--text-4xl);
  }
}

/* --- Visually Hidden (accessibility) --- */
.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;
}

/* ===========================
   Order / Contact Form
   =========================== */
.farm-contact h2 {
  margin-bottom: var(--space-sm);
}

.contact-intro {
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
  max-width: 600px;
}

.contact-form {
  max-width: 560px;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: var(--color-white);
  color: var(--color-text);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
  border-color: var(--color-red);
}

.form-error {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-red);
  margin-top: var(--space-xs);
  min-height: 1.25em;
}

.btn-submit {
  display: inline-block;
  padding: var(--space-sm) var(--space-xl);
  background-color: var(--color-red);
  color: var(--color-white);
  font-weight: 600;
  font-size: var(--text-base);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-submit:hover {
  background-color: var(--color-red-dark);
}

.btn-submit:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 2px;
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-success {
  max-width: 560px;
  padding: var(--space-lg);
  background-color: rgba(74, 103, 65, 0.1);
  border: 1px solid var(--color-green);
  border-radius: 8px;
  color: var(--color-green-dark);
  font-weight: 500;
  text-align: center;
}

.form-success p {
  margin-bottom: 0;
}
