/* ==========================================================================
   Lemex Global – main stylesheet
   1. Design tokens  2. Base  3. Layout  4. Components  5. Sections
   6. Responsive
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */
:root {
  /* Brand palette (taken from the Lemex logo) */
  --color-green-900: #0b4016;
  --color-green-700: #0b6b2e;
  --color-green-600: #2a8546;
  --color-green-500: #43a047;
  --color-amber-500: #e29040;
  --color-brown-800: #712800;
  --color-white: #ffffff;
  --color-ink-900: #17261b;

  /* Semantic colours (light theme) */
  --bg: #fbfcf8;
  --surface: #eef5ea;
  --text: var(--color-ink-900);
  --text-muted: #4a5c4e;
  --border: #d5e2d0;
  --primary: var(--color-green-700);
  --primary-hover: var(--color-green-600);
  --on-primary: var(--color-white);
  --band: var(--color-green-900);
  --on-band: #f3f8ee;

  /* Header and footer always stay white so the logo keeps its contrast */
  --chrome-bg: var(--color-white);
  --chrome-text: var(--color-ink-900);

  /* Typography */
  --font-heading: "Bricolage Grotesque", Georgia, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape and spacing */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 999px;
  --space-section: 84px;
  --container: 1160px;
  --shadow-soft: 0 12px 28px rgb(11 64 22 / 18%);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a11;
    --surface: #15251a;
    --text: #e8f0e6;
    --text-muted: #a5b7a8;
    --border: #264030;
    --primary: var(--color-green-500);
    --primary-hover: #5cb860;
    --on-primary: #08200e;
    color-scheme: dark;
  }
}

/* 2. Base ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(88px + env(safe-area-inset-top, 0px));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5em; font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 700; }

p { margin: 0; }
img { max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--color-amber-500);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
}
.skip-link:focus { top: 12px; }

/* 3. Layout -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding-block: var(--space-section); }
.section--alt { background: var(--surface); }

.section__intro { max-width: 640px; margin-bottom: 44px; }
.section__intro p { margin-top: 16px; color: var(--text-muted); }

/* 4. Components ---------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font: 600 1rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn:hover,
.btn:focus-visible { background: var(--primary-hover); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
}
.btn--ghost:hover,
.btn--ghost:focus-visible { background: var(--surface); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--chrome-bg);
  border-bottom: 3px solid var(--color-green-500);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.logo img { display: block; height: 46px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--chrome-text);
  font-weight: 500;
}
.site-nav a { text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--color-brown-800); }
.site-nav .btn { background: var(--color-green-700); color: var(--color-white); }
.site-nav .btn:hover,
.site-nav .btn:focus-visible { background: var(--color-green-600); color: var(--color-white); }

/* Footer */
.site-footer {
  padding-block: 48px 24px;
  background: var(--chrome-bg);
  color: var(--chrome-text);
  font-size: 0.95rem;
  border-top: 3px solid var(--color-green-500);
}
.site-footer__grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 40px; }
.site-footer h2 { margin-bottom: 12px; font-size: 1.05rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 6px 0; }
.site-footer a { text-underline-offset: 3px; }
.site-footer a:hover { color: var(--color-brown-800); }
.site-footer__copy {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--color-green-500);
  font-size: 0.9rem;
}

/* Contact details */
.contact-card { font-style: normal; }
.contact-card p + p { margin-top: 10px; }

/* 5. Sections ------------------------------------------------------------ */
/* Hero */
.hero { padding-block: 72px 80px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: center;
}
.hero__lede { max-width: 34em; margin: 22px 0 32px; color: var(--text-muted); font-size: 1.2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__media {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgb(11 64 22 / 22%);
}
.hero__media img { display: block; width: 100%; height: auto; }

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tile:hover,
.tile:focus-within { transform: translateY(-4px); box-shadow: var(--shadow-soft); }

.tile__img { display: block; width: 100%; height: 340px; object-fit: cover; background: var(--surface); }

.tile__body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 26px; }
.tile__body p { color: var(--text-muted); font-size: 1rem; }

/* The whole tile is clickable through the link's stretched ::after */
.tile__link {
  align-self: flex-start;
  margin-top: 6px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.tile__link::after { content: ""; position: absolute; inset: 0; }
.tile__link span { margin-left: 4px; }
.tile__link:focus-visible { outline: none; }
.tile:has(.tile__link:focus-visible) { outline: 3px solid var(--color-amber-500); outline-offset: 3px; }

/* Markets */
.regions { display: flex; flex-wrap: wrap; gap: 14px; }
.regions li {
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font: 700 1.4rem var(--font-heading);
}
.regions, .features { margin-block: 0; padding: 0; list-style: none; }
.regions { margin-bottom: 36px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.features li { padding: 4px 0 4px 20px; border-left: 4px solid var(--color-amber-500); }
.features h3 { margin-bottom: 6px; font-size: 1.25rem; }
.features p { color: var(--text-muted); }

/* Contact */
.contact__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; }
.contact__text { max-width: 30em; margin-top: 16px; color: var(--text-muted); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__field { display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; font-weight: 500; }
.form__field--full { grid-column: 1 / -1; }
.form input,
.form select,
.form textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

/* Product pages */
.breadcrumb { padding-block: 20px 0; color: var(--text-muted); font-size: 0.95rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; }
.breadcrumb a { text-underline-offset: 3px; }

.product-hero { padding-block: 32px 72px; }
.product-hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.product-hero__media { margin: 0; overflow: hidden; border-radius: var(--radius-lg); box-shadow: 0 20px 50px rgb(11 64 22 / 22%); background: var(--surface); }
.product-hero__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 30px; padding: 0; list-style: none; }
.facts li { padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font-weight: 600; font-size: 0.95rem; }

.prose { max-width: 760px; }
.prose p + p { margin-top: 16px; }
.prose h2 { margin-bottom: 20px; }

.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.benefits li { padding: 24px; border: 1px solid var(--border); border-top: 5px solid var(--color-amber-500); border-radius: var(--radius-md); background: var(--bg); }
.benefits h3 { margin-bottom: 8px; font-size: 1.2rem; }
.benefits p { color: var(--text-muted); font-size: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 10px 20px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); font-weight: 500; }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; }
.data-table th,
.data-table td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--primary); font-weight: 600; }
.data-table tr:last-child > * { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.table-scroll + .note, .note { margin-top: 14px; color: var(--text-muted); font-size: 0.9rem; }
.stack > * + * { margin-top: 40px; }

.cta-band { padding-block: 64px; background: var(--band); color: var(--on-band); }
.cta-band .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-band p { max-width: 34em; margin-top: 10px; color: #c4d6c2; }
.cta-band .btn { background: var(--color-amber-500); color: #2b1200; }
.cta-band .btn:hover,
.cta-band .btn:focus-visible { background: #f0a458; }

/* 6. Responsive ---------------------------------------------------------- */
@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 860px) {
  :root { --space-section: 60px; }
  .hero { padding-top: 40px; }
  .features,
  .contact__grid,
  .form { grid-template-columns: 1fr; }
  .site-nav a:not(.btn) { display: none; }
}

@media (max-width: 480px) {
  .container { padding-inline: 16px; }
  .logo img { height: 38px; }
  .site-nav .btn { padding: 11px 18px; font-size: 0.95rem; }
}

@media (max-width: 1000px) {
  .product-hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .product-hero__media { max-width: 560px; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .tile__img { height: 320px; }
  .data-table th, .data-table td { padding: 10px 12px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile, .btn { transition: none; }
}

/* Utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
