/* ============================================
   Carré Fertile — Design système
   Direction : terreux, organique, guide de terrain
   Typo : Bitter (titres slab), Karla (corps humaniste)
   Palette OKLCH : verts profonds, terre, crème chaud
   ============================================ */

/* --- Reset --- */

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

/* --- Tokens --- */

:root {
  /* Couleurs OKLCH — palette terreux/organique */
  --vert-profond: oklch(0.35 0.08 148);
  --vert-feuille: oklch(0.55 0.1 148);
  --vert-tendre: oklch(0.82 0.06 148);
  --vert-pale: oklch(0.93 0.03 148);
  --terre: oklch(0.42 0.06 55);
  --terre-claire: oklch(0.65 0.05 55);
  --ocre: oklch(0.7 0.08 75);
  --creme: oklch(0.97 0.008 90);
  --creme-fonce: oklch(0.93 0.01 90);
  --surface: oklch(0.995 0.005 90);
  --texte: oklch(0.25 0.015 55);
  --texte-doux: oklch(0.45 0.01 55);

  /* Typographie */
  --font-titre: "Bitter", Georgia, serif;
  --font-corps: "Karla", system-ui, sans-serif;

  /* Échelle de tailles fluides */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --text-3xl: clamp(1.85rem, 1.4rem + 1.5vw, 2.75rem);

  /* Espacement (4pt scale) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Layout */
  --container-max: 880px;
  --container-narrow: 600px;
  --container-padding: var(--space-lg);
}

/* --- Base --- */

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

body {
  font-family: var(--font-corps);
  font-weight: 400;
  color: var(--texte);
  background-color: var(--creme);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* --- Typographie --- */

h1, h2, h3, h4 {
  font-family: var(--font-titre);
  font-weight: 700;
  color: var(--vert-profond);
  line-height: 1.25;
}

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

p {
  margin-bottom: var(--space-md);
  max-width: 65ch;
}

a {
  color: var(--vert-feuille);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-sm);
}

strong {
  font-weight: 700;
  color: var(--vert-profond);
}

/* --- Container --- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* --- Header --- */

.site-header {
  padding: var(--space-md) 0;
  background-color: var(--surface);
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--vert-profond);
}

.logo-img {
  display: block;
  border-radius: 4px;
}

.logo-text {
  font-family: var(--font-titre);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.nav-link {
  font-family: var(--font-corps);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--texte-doux);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--vert-profond);
}

.nav-link--cta {
  color: var(--surface);
  background-color: var(--vert-profond);
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--text-base);
}

.nav-link--cta:hover {
  background-color: var(--terre);
  color: var(--surface);
}

/* --- Divider fine ligne terre --- */

.divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--terre-claire),
    transparent
  );
  margin: var(--space-3xl) auto;
  max-width: 200px;
}

/* --- Hero --- */

.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
}

.hero__layout {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-xl);
  align-items: flex-start;
}

.hero__content h1 {
  margin-bottom: var(--space-md);
  max-width: 16ch;
}

.hero__intro {
  font-size: var(--text-lg);
  color: var(--texte-doux);
  margin-bottom: var(--space-xl);
  max-width: 42ch;
}

.hero__visual {
  flex-shrink: 0;
}

.hero__logo {
  display: block;
  border-radius: 8px;
}

@media (min-width: 640px) {
  .hero__layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2xl);
  }

  .hero__content {
    flex: 1;
  }
}

/* --- Boutons --- */

.btn {
  display: inline-block;
  font-family: var(--font-corps);
  font-weight: 700;
  font-size: var(--text-base);
  text-decoration: none;
  padding: 14px var(--space-xl);
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  line-height: 1;
}

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

.btn--primary {
  background-color: var(--vert-profond);
  color: var(--creme);
}

.btn--primary:hover {
  background-color: var(--terre);
  color: var(--creme);
}

.btn--secondary {
  background-color: transparent;
  color: var(--vert-profond);
  box-shadow: inset 0 0 0 2px var(--vert-profond);
}

.btn--secondary:hover {
  background-color: var(--vert-profond);
  color: var(--creme);
}

.btn--small {
  font-size: var(--text-sm);
  padding: 10px var(--space-lg);
}

/* --- Sections --- */

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

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

.section--green {
  background-color: var(--vert-pale);
}

/* --- Features (points forts) --- */

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.feature {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.feature__marker {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background-color: var(--vert-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.feature__body h3 {
  margin-bottom: var(--space-xs);
  font-size: var(--text-lg);
}

.feature__body p {
  font-size: var(--text-sm);
  color: var(--texte-doux);
  margin-bottom: 0;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
  }

  .feature {
    flex-direction: column;
  }
}

/* --- Product highlight --- */

.product-highlight {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.product-highlight__content {
  flex: 1;
}

.product-highlight__label {
  display: inline-block;
  font-family: var(--font-corps);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terre);
  margin-bottom: var(--space-sm);
}

.product-highlight__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}

.product-highlight__desc {
  color: var(--texte-doux);
  margin-bottom: var(--space-lg);
}

.product-highlight__price {
  font-family: var(--font-titre);
  font-size: var(--text-2xl);
  color: var(--vert-profond);
  margin-bottom: var(--space-lg);
}

.product-highlight__price small {
  font-size: var(--text-sm);
  font-family: var(--font-corps);
  color: var(--texte-doux);
  font-weight: 400;
}

@media (min-width: 640px) {
  .product-highlight {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-2xl);
  }
}

/* --- Newsletter form --- */

.newsletter-block {
  max-width: var(--container-narrow);
}

.newsletter-block h2 {
  margin-bottom: var(--space-sm);
}

.newsletter-block > p {
  color: var(--texte-doux);
  margin-bottom: var(--space-lg);
}

.newsletter-block .input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.newsletter-block input[type="email"] {
  width: 100%;
  padding: 14px var(--space-md);
  font-family: var(--font-corps);
  font-size: var(--text-base);
  border: 2px solid var(--creme-fonce);
  border-radius: 4px;
  background: var(--surface);
  color: var(--texte);
  outline: none;
  transition: border-color 0.15s ease;
}

.newsletter-block input[type="email"]:focus {
  border-color: var(--vert-feuille);
}

.newsletter-block input[type="email"]::placeholder {
  color: var(--terre-claire);
}

.newsletter-block .form-note {
  font-size: var(--text-sm);
  color: var(--texte-doux);
  margin-top: var(--space-sm);
}

.newsletter-block .form-error {
  font-size: var(--text-sm);
  color: oklch(0.5 0.15 25);
  margin-bottom: var(--space-md);
}

.newsletter-block input[type="submit"] {
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 480px) {
  .newsletter-block .input-group {
    flex-direction: row;
  }

  .newsletter-block input[type="email"] {
    flex: 1;
  }
}

/* --- Guide page --- */

.guide-page {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.guide-page h1 {
  margin-bottom: var(--space-md);
}

.guide-page__intro {
  font-size: var(--text-lg);
  color: var(--texte-doux);
  margin-bottom: var(--space-2xl);
  max-width: 50ch;
}

.guide-page h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.guide-page ul {
  list-style: none;
  padding-left: 0;
}

.guide-page ul li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--texte-doux);
}

.guide-page ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 8px;
  height: 8px;
  background-color: var(--vert-tendre);
  border-radius: 50%;
}

.guide-purchase {
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  background-color: var(--surface);
  border-radius: 8px;
}

.guide-purchase__price {
  font-family: var(--font-titre);
  font-size: var(--text-2xl);
  color: var(--vert-profond);
  margin-bottom: var(--space-sm);
}

.guide-purchase__note {
  font-size: var(--text-sm);
  color: var(--texte-doux);
  margin-bottom: var(--space-lg);
}

/* --- Article body (Markdown rendered) --- */

.article-body h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.article-body h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.article-body p {
  color: var(--texte);
  line-height: 1.8;
}

.article-body ul,
.article-body ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.article-body li {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.article-body strong {
  color: var(--vert-profond);
}

.article-body hr {
  border: none;
  height: 1px;
  background: var(--creme-fonce);
  margin: var(--space-2xl) 0;
}

.article-body em {
  color: var(--texte-doux);
}

/* --- Article CTA --- */

.article-cta {
  padding: var(--space-2xl) 0 var(--space-xl);
}

.article-cta h2 {
  margin-bottom: var(--space-sm);
}

.article-cta p {
  color: var(--texte-doux);
  margin-bottom: var(--space-lg);
}

.article-cta .btn {
  margin-top: var(--space-sm);
}

/* --- Article preview (index) --- */

.article-preview {
  margin-bottom: var(--space-2xl);
}

.article-preview h2 {
  margin-bottom: var(--space-sm);
}

.article-preview h2 a {
  text-decoration: none;
}

.article-preview h2 a:hover {
  text-decoration: underline;
}

.article-preview p {
  color: var(--texte-doux);
  margin-bottom: var(--space-sm);
}

.article-preview__link {
  font-weight: 600;
  font-size: var(--text-sm);
}

/* --- Merci page --- */

.merci {
  text-align: center;
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.merci h1 {
  margin-bottom: var(--space-md);
}

.merci p {
  margin-left: auto;
  margin-right: auto;
  color: var(--texte-doux);
}

.merci .btn {
  margin-top: var(--space-lg);
}

/* --- Guides list --- */

.guides-list__title {
  margin-bottom: var(--space-2xl);
}

/* --- Footer --- */

.site-footer {
  background-color: var(--vert-profond);
  color: var(--vert-tendre);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-4xl);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-name {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--creme);
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--vert-tendre);
  margin-bottom: 0;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--vert-tendre);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--creme);
}

.footer-copy {
  font-size: 0.75rem;
  color: oklch(0.55 0.04 148);
}

.footer-copy p {
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .site-footer .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .footer-copy {
    text-align: right;
  }
}

/* --- Mobile header --- */

@media (max-width: 480px) {
  :root {
    --container-padding: var(--space-md);
  }

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

  .nav-link:not(.nav-link--cta) {
    display: none;
  }
}
