/* ============================================================
   HOMETABLE — Master Stylesheet
   styles.css
   
   How to use: Add this to every page:
   <link rel="stylesheet" href="styles.css">
   
   Table of contents:
   1.  Fonts
   2.  CSS Custom Properties (tokens)
   3.  Reset & Base
   4.  Typography
   5.  Layout & Grid
   6.  Buttons
   7.  Form Elements
   8.  Cards
   9.  Badges & Pills
   10. Navigation
   11. Hero / Split layout
   12. Page textures & overlays
   13. Dividers
   14. Animations & Transitions
   15. Utility classes
   16. Responsive breakpoints
   ============================================================ */


/* ── 1. FONTS ── */
/* Add this <link> in your <head> before styles.css:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,300;1,9..144,400;1,9..144,500&family=Lora:ital,wght@0,400;0,500;1,400;1,500&family=Inter:wght@300;400;500&display=swap" rel="stylesheet">
*/


/* ── 2. CSS CUSTOM PROPERTIES (design tokens) ── */
:root {

  /* Forest greens — the brand colour */
  --green-900: #141f14;
  --green-800: #1e2e1e;
  --green-700: #2d4a2d;
  --green-600: #3a5c3a;
  --green-500: #4a7a4a;
  --green-400: #6a9e6a;
  --green-300: #8cbd8c;
  --green-200: #b0ceb0;
  --green-100: #d8ead8;
  --green-50:  #f0f6f0;

  /* Warm paper — the background palette */
  --paper:      #f7f2e8;
  --paper-mid:  #f0e9d8;
  --paper-dark: #e6dcc8;
  --paper-deep: #d8cebc;

  /* Ink — text colours */
  --ink:        #1c1a15;
  --ink-mid:    #3d3a32;
  --ink-light:  #7a7060;
  --ink-faint:  #b0a890;

  /* Amber — sale/accent/highlight */
  --amber:       #b86e10;
  --amber-warm:  #d4890a;
  --amber-light: #f0c060;
  --amber-bg:    #fdf3dc;

  /* White */
  --white: #ffffff;

  /* Typography */
  --font-serif: 'Fraunces', Georgia, serif;
  --font-lora:  'Lora', Georgia, serif;
  --font-sans:  'Inter', sans-serif;

  /* Spacing scale */
  --space-1:  0.25rem;   /*  4px */
  --space-2:  0.5rem;    /*  8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */

  /* Border radius */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(28, 26, 21, 0.08);
  --shadow-md:  0 4px 16px rgba(28, 26, 21, 0.10);
  --shadow-lg:  0 8px 32px rgba(28, 26, 21, 0.12);
  --shadow-green: 0 4px 16px rgba(42, 90, 42, 0.22);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.2s ease;
  --transition-slow:   0.35s ease;

  /* Container widths */
  --container-sm:  640px;
  --container-md:  780px;
  --container-lg:  1080px;
  --container-xl:  1280px;
}



/* ── BRAND LOGO (canonical) ──────────────────────────────────────────────
   The hometable logo is a 5-path hand-drawn tree SVG.
   Always use one of these two versions — never substitute another icon.

   DARK version  → use when logo sits on a WHITE or PAPER background
                   (icon container background: var(--green-700) or var(--green-800))

   LIGHT version → use when logo sits on a DARK/GREEN background
                   (icon container background: var(--white) or rgba(white))

   Standard icon container:
     width: 36–38px, height: 36–38px
     background: var(--green-700)   [or white for light contexts]
     border-radius: var(--radius-md) or 10px

   See styleguide.html › Navigation section for live examples.
   ─────────────────────────────────────────────────────────────────────── */

/* ── 3. 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-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--green-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--green-700);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}


/* ── 4. TYPOGRAPHY ── */

/* Display / Hero headings — Fraunces serif */
.ht-display {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.ht-display em {
  font-style: italic;
  color: var(--green-600);
  font-weight: 300;
}

/* Page headings */
h1, .ht-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h2, .ht-h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h3, .ht-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

h4, .ht-h4 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

/* Body text */
p, .ht-body {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink-mid);
}

/* Italic body — Lora */
.ht-body-italic {
  font-family: var(--font-lora);
  font-size: 1rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink-light);
}

/* Small / label text */
.ht-small {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-light);
  line-height: 1.5;
}

/* Eyebrow / kicker label */
.ht-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-500);
}

/* Pull quote */
.ht-pullquote {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
  color: var(--ink);
  border-left: 3px solid var(--green-300);
  padding-left: var(--space-6);
}

/* Serif italic accent (inline use) */
em.ht-accent {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--green-600);
}


/* ── 5. LAYOUT & GRID ── */

.ht-container {
  width: 100%;
  max-width: var(--container-lg);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.ht-container--sm  { max-width: var(--container-sm); }
.ht-container--md  { max-width: var(--container-md); }
.ht-container--xl  { max-width: var(--container-xl); }

/* Split layout — used on login page */
.ht-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.ht-split__image {
  position: relative;
  overflow: hidden;
}

.ht-split__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ht-split__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(26, 46, 26, 0.2) 0%,
    rgba(26, 46, 26, 0.05) 50%,
    transparent 100%
  );
  pointer-events: none;
}

.ht-split__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-12) var(--space-10);
  background: var(--paper);
  position: relative;
}

/* Content page layout */
.ht-page {
  max-width: var(--container-md);
  margin: 0 auto;
  padding: var(--space-20) var(--space-10) var(--space-20);
}


/* ── 6. BUTTONS ── */

/* Base button reset */
.ht-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base),
              transform var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.ht-btn:active {
  transform: scale(0.98);
}

/* Primary — forest green fill */
.ht-btn--primary {
  background: var(--green-700);
  color: var(--white);
  border-color: var(--green-700);
}

.ht-btn--primary:hover {
  background: var(--green-600);
  border-color: var(--green-600);
  box-shadow: var(--shadow-green);
  color: var(--white);
}

/* Secondary — outlined */
.ht-btn--secondary {
  background: transparent;
  color: var(--green-700);
  border-color: var(--green-400);
}

.ht-btn--secondary:hover {
  background: var(--green-50);
  border-color: var(--green-600);
  color: var(--green-700);
}

/* Ghost — paper background */
.ht-btn--ghost {
  background: var(--white);
  color: var(--ink);
  border-color: var(--paper-dark);
}

.ht-btn--ghost:hover {
  border-color: var(--green-400);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

/* Google OAuth button */
.ht-btn--google {
  background: var(--white);
  color: var(--ink);
  border-color: var(--paper-dark);
  width: 100%;
}

.ht-btn--google:hover {
  border-color: var(--green-400);
  box-shadow: 0 2px 12px rgba(90, 140, 90, 0.12);
  color: var(--ink);
}

/* Sizes */
.ht-btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
}

.ht-btn--lg {
  padding: 1rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-xl);
}

.ht-btn--full {
  width: 100%;
}


/* ── 7. FORM ELEMENTS ── */

.ht-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.ht-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

.ht-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1.5px solid var(--paper-dark);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base);
  -webkit-appearance: none;
}

.ht-input::placeholder {
  color: var(--ink-faint);
}

.ht-input:hover {
  border-color: var(--green-300);
}

.ht-input:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(90, 160, 90, 0.1);
}

.ht-input--error {
  border-color: #c0392b;
}

.ht-input--error:focus {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.ht-field-hint {
  font-size: 0.75rem;
  color: var(--ink-light);
}

.ht-field-error {
  font-size: 0.75rem;
  color: #c0392b;
}

/* Form divider */
.ht-form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.ht-form-divider::before,
.ht-form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--paper-dark);
}

.ht-form-divider span {
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
}


/* ── 8. CARDS ── */

.ht-card {
  background: var(--white);
  border: 1.5px solid var(--paper-dark);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-6);
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base);
}

.ht-card:hover {
  border-color: var(--green-200);
  box-shadow: var(--shadow-sm);
}

/* Recipe card */
.ht-card--recipe {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-5);
}

.ht-card--recipe__thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--paper-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.ht-card--recipe__title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}

.ht-card--recipe__meta {
  font-size: 0.75rem;
  color: var(--ink-light);
}

/* Dark card — used for callouts */
.ht-card--dark {
  background: var(--green-800);
  border-color: var(--green-700);
  color: var(--white);
}

/* Paper card — slightly off-white */
.ht-card--paper {
  background: var(--paper-mid);
  border-color: var(--paper-dark);
}


/* ── 9. BADGES & PILLS ── */

.ht-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Green — pantry / success */
.ht-badge--green {
  background: var(--green-100);
  color: var(--green-700);
}

/* Amber — sale / deal */
.ht-badge--amber {
  background: var(--amber-bg);
  color: var(--amber);
}

/* Neutral — tags */
.ht-badge--neutral {
  background: var(--paper-dark);
  color: var(--ink-mid);
}

/* Feature pills row */
.ht-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ht-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.75rem;
  background: var(--paper-mid);
  border: 1px solid var(--paper-dark);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-mid);
}

.ht-pill__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-500);
  flex-shrink: 0;
}


/* ── 10. NAVIGATION ── */

.ht-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.ht-nav__link {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-light);
  letter-spacing: 0.03em;
  transition: color var(--transition-fast);
}

.ht-nav__link:hover {
  color: var(--ink);
}

.ht-nav__link--active {
  color: var(--green-600);
  font-weight: 500;
}

/* Wordmark */
.ht-wordmark {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.ht-wordmark__icon {
  width: 36px;
  height: 36px;
  background: var(--green-700);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ht-wordmark__icon--light {
  background: var(--white);
}

.ht-wordmark__text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--green-700);
  letter-spacing: -0.01em;
}

.ht-wordmark__text--light {
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}


/* ── 11. HERO / SPLIT OVERLAYS ── */

.ht-hero-caption {
  position: absolute;
  bottom: var(--space-12);
  left: var(--space-10);
  right: var(--space-10);
  z-index: 2;
}

.ht-hero-caption h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 400;
  color: var(--white);
  text-shadow: 0 2px 12px rgba(26, 46, 26, 0.5);
  margin-bottom: var(--space-3);
}

.ht-hero-caption h1 em {
  font-style: italic;
  font-weight: 300;
}

.ht-hero-caption p {
  font-size: 0.9rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}


/* ── 12. PAGE TEXTURES & OVERLAYS ── */

/* Subtle wood-grain paper texture */
.ht-texture {
  position: relative;
}

.ht-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      88deg,
      transparent,
      transparent 6px,
      rgba(180, 155, 100, 0.04) 6px,
      rgba(180, 155, 100, 0.04) 7px
    ),
    repeating-linear-gradient(
      92deg,
      transparent,
      transparent 14px,
      rgba(140, 110, 60, 0.03) 14px,
      rgba(140, 110, 60, 0.03) 15px
    );
  pointer-events: none;
  z-index: 0;
}

/* Film grain overlay (apply to body or page wrapper) */
.ht-grain::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  opacity: 0.55;
}


/* ── 13. DIVIDERS ── */

.ht-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

.ht-divider::before,
.ht-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--paper-dark);
}

/* Simple ruled line */
.ht-rule {
  border: none;
  border-top: 1px solid var(--paper-dark);
  margin: var(--space-8) 0;
}

.ht-rule--light {
  border-top-color: var(--paper-mid);
}


/* ── 14. ANIMATIONS & TRANSITIONS ── */

@keyframes ht-fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ht-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ht-slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.ht-animate-fadeup {
  opacity: 0;
  animation: ht-fadeUp 0.6s ease forwards;
}

/* Stagger helpers */
.ht-delay-1 { animation-delay: 0.08s; }
.ht-delay-2 { animation-delay: 0.16s; }
.ht-delay-3 { animation-delay: 0.24s; }
.ht-delay-4 { animation-delay: 0.32s; }
.ht-delay-5 { animation-delay: 0.40s; }
.ht-delay-6 { animation-delay: 0.48s; }


/* ── 15. UTILITY CLASSES ── */

/* Spacing */
.ht-mt-4  { margin-top: var(--space-4); }
.ht-mt-6  { margin-top: var(--space-6); }
.ht-mt-8  { margin-top: var(--space-8); }
.ht-mt-12 { margin-top: var(--space-12); }
.ht-mb-4  { margin-bottom: var(--space-4); }
.ht-mb-6  { margin-bottom: var(--space-6); }
.ht-mb-8  { margin-bottom: var(--space-8); }

/* Text alignment */
.ht-text-center { text-align: center; }
.ht-text-right  { text-align: right; }

/* Colour helpers */
.ht-text-green  { color: var(--green-600); }
.ht-text-amber  { color: var(--amber); }
.ht-text-muted  { color: var(--ink-light); }
.ht-text-faint  { color: var(--ink-faint); }
.ht-text-white  { color: var(--white); }

/* Display */
.ht-flex        { display: flex; }
.ht-flex-center { display: flex; align-items: center; justify-content: center; }
.ht-gap-2       { gap: var(--space-2); }
.ht-gap-3       { gap: var(--space-3); }
.ht-gap-4       { gap: var(--space-4); }

/* Visibility */
.ht-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;
}


/* ── 16. RESPONSIVE BREAKPOINTS ── */

/* Tablet — 860px and below */
@media (max-width: 860px) {
  .ht-split {
    grid-template-columns: 1fr;
  }

  .ht-split__image {
    min-height: 45vh;
  }

  .ht-page {
    padding: var(--space-12) var(--space-6) var(--space-16);
  }

  .ht-split__panel {
    padding: var(--space-8) var(--space-6);
  }
}

/* Mobile — 600px and below */
@media (max-width: 600px) {
  .ht-page {
    padding: var(--space-8) var(--space-4) var(--space-12);
  }

  .ht-hero-caption {
    left: var(--space-6);
    right: var(--space-6);
    bottom: var(--space-8);
  }

  .ht-container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  h1, .ht-h1 {
    font-size: 1.8rem;
  }
}

/* Print */
@media print {
  body { background: white; }
  .ht-grain::after,
  .ht-texture::before { display: none; }
  .ht-card--dark {
    background: #1e2e1e !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
