/*
 * Feuille de style principale pour HuileEssentielle.net
 * Palette de couleurs inspirée de la Provence : lavande douce, vert olive, jaune tournesol et crème.
 * Typographies choisies pour une lecture agréable et un rendu élégant.
 * Ce fichier est chargé de manière asynchrone afin de ne pas bloquer le rendu initial des pages.
 */

:root {
  --color-background: #F8F8F8;
  --color-surface: #FFFFFF;
  --color-primary: #556B2F; /* vert olive profond */
  --color-secondary: #E6E6FA; /* lavande très claire */
  --color-accent: #FFC300; /* jaune tournesol */
  --color-text: #333333;
  --color-muted: #666666;
  --font-body: 'Lato', sans-serif;
  --font-heading: 'Merriweather', serif;
  --max-width: 1200px;
}

/* Réinitialisation simple */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.7;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text);
  font-size: 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-accent);
  text-decoration: underline;
}

header {
  background-color: var(--color-surface);
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-primary);
}

.logo img {
  width: 40px;
  height: 40px;
  margin-right: 0.5rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav li {
  position: relative;
}

nav a {
  font-weight: 500;
  color: var(--color-text);
  font-size: 1rem;
}

nav a:hover {
  color: var(--color-primary);
}

/* Mobile navigation */
#menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

#menu-toggle span {
  height: 3px;
  width: 25px;
  background-color: var(--color-text);
  margin: 4px 0;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-surface);
    border: 1px solid #e0e0e0;
    padding: 1rem;
    display: none;
  }
  nav.open ul {
    display: flex;
  }
  #menu-toggle {
    display: flex;
  }
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: row;
  gap: 2rem;
}

/* Content area and sidebar */
.content {
  flex: 3;
}

aside {
  flex: 1;
  background-color: var(--color-secondary);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

@media (max-width: 900px) {
  main {
    flex-direction: column;
  }
  aside {
    order: 0;
    margin-top: 2rem;
  }
}

/* Hero section */
.hero {
  position: relative;
  background-image: url('../images/hero-background.webp');
  background-size: cover;
  background-position: center;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-surface);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 2rem;
}

.hero h1 {
  color: var(--color-surface);
  font-size: 2.5rem;
}

.search-bar {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
}

/* Grid of oil cards */
.oil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.oil-card {
  background-color: var(--color-surface);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.oil-card:hover {
  transform: translateY(-4px);
}

.oil-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.oil-card h3 {
  padding: 1rem;
  font-size: 1.25rem;
  color: var(--color-primary);
}

.oil-card p {
  padding: 0 1rem 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--color-primary);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.2s ease;
  margin: 0.5rem 0;
}

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

/* Footer */
footer {
  background-color: var(--color-primary);
  color: #fff;
  padding: 2rem 0;
  text-align: center;
}

footer a {
  color: #fff;
  margin: 0 0.5rem;
}

/* Article page styles */
article img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

article section {
  margin-bottom: 2rem;
}

article h2 {
  margin-top: 1.5rem;
  font-size: 2rem;
}

article h3 {
  margin-top: 1rem;
  font-size: 1.5rem;
}

blockquote {
  padding: 1rem;
  background-color: var(--color-secondary);
  border-left: 4px solid var(--color-primary);
  margin: 1.5rem 0;
  font-style: italic;
}

code {
  background-color: #eee;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}

/* FAQ and structured lists */
details {
  margin-bottom: 1rem;
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

/* Ad placeholder styling */
.ad-placeholder {
  display: block;
  background-color: #f0f0f0;
  border: 1px dashed #ccc;
  color: #888;
  text-align: center;
  padding: 1rem;
  margin: 1rem 0;
  font-size: 0.85rem;
}