/* ============================================================
   styles.css — Global styles, design tokens, layout
   The Way I Learned to Eat Well — Richard D. Edwards
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  /* Colours */
  --color-bg:          #f9f6f0;
  --color-surface:     #ffffff;
  --color-primary:     #1b3a2d;
  --color-text:        #1c1c1c;
  --color-text-muted:  #6b7280;
  --color-accent:      #c4a35a;
  --color-border:      #e5e0d8;

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

  /* Font sizes */
  --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;
  --text-5xl:   3rem;

  /* Spacing scale */
  --space-1:    0.25rem;
  --space-2:    0.5rem;
  --space-3:    0.75rem;
  --space-4:    1rem;
  --space-6:    1.5rem;
  --space-8:    2rem;
  --space-12:   3rem;
  --space-16:   4rem;
  --space-24:   6rem;

  /* Layout */
  --max-width:        1200px;
  --content-width:    720px;
  --border-radius:    8px;
  --border-radius-lg: 16px;

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

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text);
  max-width: var(--content-width);
}

blockquote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-primary);
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
}

.section-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: block;
  margin-bottom: var(--space-3);
}

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

.container--narrow {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-24) 0;
}

.section--alt {
  background-color: var(--color-surface);
}

.section--dark {
  background-color: var(--color-primary);
  color: #ffffff;
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: #ffffff;
}

.section--dark p {
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   Grid & Flex helpers
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.text-center p {
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   Horizontal Rule / Divider
   ============================================================ */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-16) 0;
}

hr.accent {
  border-color: var(--color-accent);
  width: 60px;
  border-top-width: 2px;
}

/* ============================================================
   Responsive Breakpoints
   ============================================================ */

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

/* Desktop */
@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }
}

/* Wide */
@media (min-width: 1280px) {
  .container {
    padding: 0 var(--space-12);
  }
}

/* Mobile stacks */
@media (max-width: 767px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .section {
    padding: var(--space-16) 0;
  }

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