/* styles.css : CSS optimisé pour SEO, responsive, mobile-first, accessibilité - Thème Miyazaki */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&family=Pacifico&display=swap');

:root {
  --main-color: #2c3e50;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --bg: #f9f3e9;
  --forest-green: #27ae60;
  --forest-dark: #145a32;
  --warm-brown: #8b4513;
  --earthy: #795548;
  --spirit-red: #c0392b;
  --kodama-white: #ecf0f1;
  --text: #34495e;
  --font-main: 'Nunito', sans-serif;
  --font-accent: 'Pacifico', cursive;
}
html { font-size: 100%; box-sizing: border-box; scroll-behavior: smooth; }

/* Animation de nuages flottants */
@keyframes float {
  0% { transform: translateY(0px) translateX(0px); }
  50% { transform: translateY(-15px) translateX(10px); }
  100% { transform: translateY(0px) translateX(0px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

body {
  margin: 0; 
  padding: 0; 
  font-family: var(--font-main); 
  background: var(--bg) url('miyazaki-theme/subtle-pattern.svg'); 
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}
header, nav, main, footer { display: block; }

/* Header style Totoro & Mononoke */
header {
  background: linear-gradient(to bottom, var(--forest-green) 0%, var(--forest-dark) 100%);
  color: var(--kodama-white);
  padding: 2.5rem 0.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-bottom: 3px solid var(--warm-brown);
}

/* Esprits de la forêt dans l'en-tête */
header::before, header::after {
  content: '';
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
}

header::before {
  width: 150px;
  height: 100px;
  background-image: url('miyazaki-theme/kodama-spirit.svg');
  opacity: 0.9;
  top: 20px;
  left: 5%;
  animation: float 8s ease-in-out infinite;
}

header::after {
  width: 180px;
  height: 120px;
  background-image: url('miyazaki-theme/forest-spirit.svg');
  opacity: 0.85;
  top: 40px;
  right: 5%;
  animation: float 10s ease-in-out infinite 1s;
}
/* Navigation style Totoro & Mononoke */
nav {
  background: var(--warm-brown);
  padding: 0.8rem 0;
  text-align: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

nav::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 5px;
  background: url('miyazaki-theme/tree-line.svg') repeat-x;
  background-size: 40px 5px;
}

.breadcrumb {
  background: rgba(255, 245, 235, 0.8);
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  border-bottom: 2px solid var(--earthy);
  border-top: 1px solid var(--accent-light);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.breadcrumb li:not(:last-child)::after {
  content: '✿';
  margin: 0 0.5rem;
  color: var(--accent);
}
/* Liens de navigation style Miyazaki */
nav a { 
  color: white; 
  margin: 0 1.2rem; 
  text-decoration: none; 
  font-weight: 600; 
  position: relative;
  transition: all 0.3s ease;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-light);
  transition: width 0.3s ease;
}

nav a:focus, nav a:hover { 
  color: var(--accent-light);
  background: rgba(255,255,255,0.1);
}

nav a:focus::after, nav a:hover::after {
  width: 100%;
}

/* Contenu principal style Totoro & Mononoke */
main { 
  max-width: 800px; 
  margin: 2rem auto; 
  padding: 2rem; 
  background: rgba(255,250,240,0.92);
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.12);
  position: relative;
  z-index: 5;
  animation: fadeIn 0.8s ease-out;
  border: 2px solid var(--earthy);
}

main::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 20px;
  width: 60px;
  height: 60px;
  background-image: url('miyazaki-theme/acorn.svg');
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 2;
}
/* Titres style Totoro & Mononoke */
h1 { 
  font-family: var(--font-accent); 
  font-size: 2.5rem; 
  margin-top: 0; 
  color: var(--kodama-white);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  position: relative;
  z-index: 2;
  letter-spacing: 1px;
}

h2 { 
  font-size: 1.8rem; 
  color: var(--warm-brown); 
  border-bottom: 3px solid var(--forest-green);
  padding-bottom: 0.5rem;
  display: inline-block;
  margin-bottom: 1.2rem;
  font-weight: 700;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--forest-green), var(--accent), var(--forest-green));
  border-radius: 3px;
}

h3 { 
  font-size: 1.3rem; 
  color: var(--earthy);
  position: relative;
  padding-left: 1.8rem;
  font-weight: 600;
}

h3::before {
  content: '🍃';
  position: absolute;
  left: 0;
  top: 0.2rem;
  font-size: 1.2rem;
  color: var(--forest-green);
}

/* Images style Totoro & Mononoke */
img { 
  max-width: 100%; 
  height: auto; 
  display: block; 
  border-radius: 8px; 
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 1.5rem auto;
  border: 4px solid var(--earthy);
  position: relative;
}

img::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  background-image: url('miyazaki-theme/soot-sprite.svg');
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 3;
}

img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

/* Articles style Totoro & Mononoke */
article { 
  margin-bottom: 3rem; 
  position: relative;
  padding: 1.5rem;
  border-radius: 8px;
  transition: transform 0.3s ease;
  background: rgba(255, 248, 240, 0.5);
  border-left: 3px solid var(--forest-green);
}

article::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  width: 40px;
  height: 40px;
  background-image: url('miyazaki-theme/totoro-mini.svg');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.85;
  transform: rotate(-5deg);
}

article:nth-child(2n)::before {
  background-image: url('miyazaki-theme/kodama-mini.svg');
  left: auto;
  right: -15px;
}
/* Footer style Totoro & Mononoke */
footer {
  background: linear-gradient(to top, var(--forest-dark) 0%, var(--warm-brown) 100%);
  color: var(--kodama-white);
  text-align: center;
  padding: 2rem 0.5rem 1.5rem;
  font-size: 1rem;
  position: relative;
  margin-top: 4rem;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
}

footer::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: url('miyazaki-theme/forest-silhouette.svg') repeat-x bottom;
  background-size: auto 20px;
}

footer a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

footer a:hover {
  color: white;
}

footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: white;
  transition: width 0.3s ease;
}

footer a:hover::after {
  width: 100%;
}

/* Éléments décoratifs supplémentaires */
body::before, body::after {
  content: '';
  position: fixed;
  width: 200px;
  height: 200px;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
  opacity: 0.15;
}

body::before {
  bottom: 50px;
  left: -50px;
  background-image: url('miyazaki-theme/totoro-silhouette.svg');
  animation: float 15s ease-in-out infinite;
}

body::after {
  top: 100px;
  right: -70px;
  background-image: url('miyazaki-theme/spirited-silhouette.svg');
  animation: float 18s ease-in-out infinite 2s;
}
/* Styles pour les listes */
ul, ol {
  padding-left: 1.5rem;
}

ul li {
  position: relative;
  padding-left: 0.5rem;
  margin-bottom: 0.8rem;
  list-style-type: none;
}

ul li::before {
  content: '•';
  color: var(--accent);
  font-size: 1.2em;
  position: absolute;
  left: -1rem;
  top: -0.1rem;
}

/* Styles pour les paragraphes */
p {
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

/* Styles pour les liens dans le contenu */
main a {
  color: var(--deep-blue);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
  transition: all 0.3s ease;
  padding: 0 0.2rem;
}

main a:hover {
  background-color: rgba(247, 127, 0, 0.1);
  border-bottom: 1px solid var(--accent);
}

/* Adaptation pour les appareils mobiles */
@media (max-width: 768px) {
  main { 
    padding: 1.5rem; 
    margin: 1rem;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  header::before, header::after,
  body::before, body::after {
    display: none;
  }
  
  article::before {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  main { 
    padding: 1rem; 
    margin: 0.5rem;
  }
  h1 { font-size: 1.8rem; }
  nav a { 
    margin: 0 0.5rem;
    font-size: 0.9rem;
  }
  
  .breadcrumb {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* Styles pour le sélecteur de langue */
.language-selector {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.lang-btn {
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
  background: var(--accent);
  color: var(--main-color);
  font-weight: bold;
}

@media (max-width: 480px) {
  .language-selector {
    flex-wrap: wrap;
  }
}
