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

/* === Affiliate product box === */
.product-box {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: linear-gradient(135deg, #fffdf5 0%, #faf7e8 100%);
  border: 1px solid #e8dfa8;
  border-left: 5px solid var(--color-accent);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(85, 107, 47, 0.08);
}

.product-box-body {
  flex: 1;
  min-width: 0;
}

.product-box-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-primary);
  background: rgba(85, 107, 47, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.product-box h3,
.product-box .product-title {
  font-family: var(--font-heading), Georgia, serif;
  font-size: 1.15rem;
  color: var(--color-primary);
  margin: 0.25rem 0 0.5rem;
  line-height: 1.3;
}

.product-box ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.92rem;
  color: var(--color-text);
}

.product-box ul li {
  padding: 0.15rem 0 0.15rem 1.3rem;
  position: relative;
  line-height: 1.5;
}

.product-box ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
}

.product-box .stars {
  color: #f5a623;
  font-size: 0.95rem;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.product-box .stars span {
  color: var(--color-muted);
  font-size: 0.82rem;
  margin-left: 0.4rem;
  letter-spacing: 0;
}

.product-box .btn-buy {
  display: inline-block;
  background-color: #FF9900; /* Amazon orange */
  color: #111;
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border-radius: 6px;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid #e88a00;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.product-box .btn-buy:hover,
.product-box .btn-buy:focus {
  background-color: #ffb733;
  color: #111;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.product-box .btn-buy-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.4rem;
  font-weight: 400;
}

@media (max-width: 600px) {
  .product-box {
    flex-direction: column;
    text-align: left;
    padding: 1rem;
  }
  .product-box .btn-buy {
    width: 100%;
    text-align: center;
  }
}

/* Compact in-article CTA */
.cta-inline {
  background: #f4f6ec;
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.2rem;
  border-radius: 6px;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.cta-inline strong {
  color: var(--color-primary);
}

.cta-inline a.btn-buy {
  display: inline-block;
  background-color: #FF9900;
  color: #111;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-decoration: none;
  margin-left: 0.5rem;
  border: 1px solid #e88a00;
  font-size: 0.92rem;
  white-space: nowrap;
}

.cta-inline a.btn-buy:hover {
  background-color: #ffb733;
  text-decoration: none;
}

/* === FAQ accordions === */
.faq details {
  background: var(--color-surface);
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  padding: 0;
  overflow: hidden;
}

.faq details[open] {
  border-color: var(--color-primary);
}

.faq summary {
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--color-primary);
  background: #fafafa;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--color-primary);
  font-weight: 400;
}

.faq details[open] summary::after { content: "−"; }

.faq details p {
  padding: 0.5rem 1rem 1rem;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* === Subtle affiliate disclosure (footnote) === */
.affiliate-asterisk {
  font-size: 0.7em;
  color: var(--color-muted);
  vertical-align: super;
  margin-left: 2px;
  text-decoration: none;
  font-weight: 400;
}

.affiliate-asterisk:hover {
  color: var(--color-accent);
}

.affiliate-disclosure {
  font-size: 0.78rem;
  color: var(--color-muted);
  font-style: italic;
  text-align: center;
  padding: 0.75rem 1rem 0;
  margin: 0;
  line-height: 1.5;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.affiliate-disclosure a {
  color: var(--color-muted);
  text-decoration: underline;
}

/* === Homepage buying guide section === */
.buying-guide {
  background: #fffdf5;
  border: 1px solid #f0e8b8;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.buying-guide h2 {
  margin-top: 0;
}

.buying-guide ul {
  padding-left: 1.2rem;
  margin: 1rem 0;
}

.buying-guide ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* === Related oils section === */
.related-oils {
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.related-oils h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.related-grid a {
  display: block;
  background: var(--color-surface);
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.related-grid a:hover {
  border-color: var(--color-primary);
  background: #fafafa;
  text-decoration: none;
  transform: translateY(-2px);
}