/* appat-peche.css */

/* --- Début : Réinitialisation et Box Sizing Global --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Variables CSS --- */
:root {
  --background-main: #F4F1E9;
  --background-content: #FFFFFF;
  --text-color: #333333;
  --header-footer-bg: #4A6B4C;
  --nav-bg: #6E8B6E;
  --nav-text: #FFFFFF;
  --heading-color: #795548;
  --accent-color: #8BC34A;
  --border-color: #D7CCC8;
  --conclusion-bg: #E8F5E9;
  --conclusion-border: #4A6B4C;
  --recipe-bg: #FAF8F0;
  --link-color: #5D8B50;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* --- Styles Généraux du Corps --- */
body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-main);
  color: var(--text-color);
  line-height: 1.7;
  overflow-x: hidden; /* Empêche le scroll horizontal sur le body */
}

/* --- Header --- */
header {
  background-color: var(--header-footer-bg);
  padding: 15px 20px;
  box-shadow: 0 2px 5px var(--shadow-color);
}

.header-container {
  max-width: 1280px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 15px;
}

.logo {
  max-height: 70px;
  display: block;
  flex-shrink: 0;
}

.header-promo-image {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 1;
  /* Width/height from HTML attributes provide initial hint */
}

.ads-header {
  flex-shrink: 0;
  width: 338px; /* Default size */
  height: 280px; /* Default size */
  max-width: 100%; /* Allow shrinking */
  display: flex;
  align-items: center;
  justify-content: center;
}
.ads-header ins.adsbygoogle {
    display: inline-block;
    /* Dimensions are often set inline or by AdSense */
    max-width: 100%; /* Ensure it doesn't overflow its container */
    height: auto; /* Adjust height if width shrinks */
}

/* --- Navigation Rapide (Sticky) --- */
.nav-quick-links {
  background-color: var(--nav-bg);
  text-align: center;
  padding: 12px 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-quick-links a {
  color: var(--nav-text);
  text-decoration: none;
  margin: 0 12px;
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav-quick-links a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* --- Conteneur Principal (Flexbox) --- */
.main-container {
  display: flex;
  max-width: 1280px;
  margin: 30px auto;
  padding: 0 20px;
  gap: 30px;
  align-items: flex-start;
}

/* --- Sidebar --- */
.sidebar {
  width: 350px; /* Adjusted width based on previous discussion */
  flex-shrink: 0;
  position: sticky;
  top: 70px; /* Adjust if nav height changes */
  /*max-height: calc(100vh - 70px - 40px); /* Adjusted safety margin */
  /*overflow-y: auto;*/
  overflow-x: hidden; 
}

.ads-sidebar, .sidebar-widget {
  background-color: var(--background-content);
  padding: 5px;
  border-radius: 8px;
  box-shadow: 0 2px 5px var(--shadow-color);
  margin-bottom: 15px; /* Adjusted spacing */
  border: 1px solid var(--border-color);
}

.ads-sidebar ins.adsbygoogle {
  display: block;
  width: 338px;
  height: 280px;
  margin: 0 auto;
  max-width: 100%; /* Allow shrinking */
}

.sidebar-widget h3 {
    margin-top: 0;
    color: var(--heading-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    font-size: 1.2em;
}
.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}
.sidebar-widget ul li {
    margin-bottom: 8px;
}
.sidebar-widget ul li a {
    color: var(--link-color);
    text-decoration: none;
}
.sidebar-widget ul li a:hover {
    text-decoration: underline;
}

/* --- Contenu Principal --- */
.content {
  flex: 1;
  background-color: var(--background-content);
  padding: 35px;
  border-radius: 8px;
  box-shadow: 0 3px 8px var(--shadow-color);
  border: 1px solid var(--border-color);
  opacity: 0;
  animation: fadeInAnimation 0.8s ease-out forwards;
  animation-delay: 0.2s;
  min-width: 0; /* CRITICAL: Allows flex item to shrink below its content size */
  overflow-wrap: break-word; /* Helps break long words/URLs */
  word-wrap: break-word; /* Older browsers */
}

/* Animation d'Apparition */
@keyframes fadeInAnimation {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Titres --- */
h1, h2 {
  color: var(--heading-color);
  border-bottom: 2px solid var(--nav-bg);
  padding-bottom: 8px;
  margin-bottom: 25px;
}
h1 { font-size: 2.2em; }
h2 { font-size: 1.7em; margin-top: 40px; }
h3 { font-size: 1.3em; color: var(--heading-color); margin-top: 30px; margin-bottom: 15px; }

/* --- Paragraphes, Listes --- */
p, ul, ol, dl { font-size: 1em; margin-bottom: 20px; }
ul, ol { padding-left: 25px; }
ul li, ol li { margin-bottom: 10px; }
dl dt { font-weight: bold; color: var(--heading-color); margin-top: 15px; }
dl dd { margin-left: 20px; margin-bottom: 10px; }
strong, b { color: var(--text-color); font-weight: 700; }

/* --- Styles des Sections et Images Internes --- */
.content-section {
    background-color: #FCFCFC;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.content-section-image,
.content img { /* Target all images within .content more broadly */
  display: block;
  max-width: 100%; /* Ensures images don't overflow */
  height: auto;
  margin: 20px auto 25px auto;
  border-radius: 5px;
  box-shadow: 0 2px 4px var(--shadow-color);
}

/* --- Blocs Publicitaires DANS le Contenu --- */
.ads-content {
    text-align: center;
    margin: 30px auto;
    padding: 10px 0;
    max-width: 100%; /* Ensure container doesn't overflow */
    width: 100%; /* Take available width */
}
.ads-content ins.adsbygoogle {
    display: inline-block; /* AdSense standard */
    width: 728px; /* Default large size */
    height: 90px;  /* Default large size */
    max-width: 100%; /* CRITICAL for responsiveness */
    /* Height might need adjustment via JS or specific media query if width shrinks a lot */
}

/* --- Conclusion --- */
.conclusion {
  background-color: var(--conclusion-bg);
  padding: 25px;
  border-left: 5px solid var(--conclusion-border);
  font-style: italic;
  border-radius: 0 5px 5px 0;
  margin-top: 30px;
}

/* --- Footer --- */
footer {
  background-color: var(--header-footer-bg);
  color: #e0e0e0;
  padding: 25px 20px;
  text-align: center;
  font-size: 0.9em;
  margin-top: 40px;
}

/* Styles pour le conteneur principal du footer (peut rester inchangé ou utiliser flex/grid) */
.footer-container {
    /* Optionnel: utiliser flex pour mieux organiser verticalement */
    /* display: flex; */
    /* flex-direction: column; */
    /* align-items: center; */
    /* gap: 15px; */ /* Espace entre copyright, nav, info */
}

/* Styles pour la navigation principale du footer */
.footer-nav-main {
    margin-top: 10px; /* Espace après copyright */
    margin-bottom: 20px; /* Espace avant section info */
    line-height: 1.5; /* Pour espacer les lignes si elles wrappent */
}
.footer-nav-main a {
  color: var(--nav-text);
  margin: 0 5px; /* Léger ajustement marge */
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-nav-main a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* Styles pour la NOUVELLE section Information */
.footer-info-links {
    margin-top: 15px; /* Espace au-dessus */
}

.footer-info-links h4 {
    color: var(--accent-color); /* Utiliser une couleur d'accent */
    margin-bottom: 8px;
    font-size: 1.1em; /* Taille légèrement plus grande */
    text-transform: uppercase; /* Optionnel: mettre en majuscules */
    letter-spacing: 1px; /* Optionnel: espacer les lettres */
}

.footer-info-links ul {
    list-style: none; /* Enlever les puces */
    padding: 0;
    margin: 0;
}

.footer-info-links ul li {
    margin-bottom: 5px; /* Espace entre les liens */
}

.footer-info-links ul li a {
    color: var(--nav-text); /* Même couleur que les autres liens */
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-info-links ul li a:hover {
    color: var(--accent-color); /* Même effet de survol */
    text-decoration: underline; /* Souligner au survol pour distinction */
}
.footer-container nav a { color: var(--nav-text); margin: 0 10px; text-decoration: none; transition: color 0.3s ease; }
.footer-container nav a:hover { color: var(--accent-color); text-decoration: none; }

/* --- Effets Interactifs --- */
.interactive-element { transition: transform 0.3s ease-out, box-shadow 0.3s ease-out; }
.interactive-element:hover { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12); }

/* --- Bouton "Retour en Haut" --- */
#backToTopBtn {
  display: block; opacity: 0; visibility: hidden;
  position: fixed; bottom: 25px; right: 25px; z-index: 101;
  border: none; outline: none; background-color: var(--nav-bg); color: var(--nav-text);
  cursor: pointer; padding: 12px 15px; border-radius: 50%; font-size: 18px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: opacity 0.4s ease, visibility 0.4s ease, background-color 0.3s ease;
}
#backToTopBtn.show { opacity: 0.8; visibility: visible; }
#backToTopBtn:hover { background-color: var(--heading-color); opacity: 1; }

/* --- Highlight JS --- */
.highlight { animation: highlight-fade 1.5s ease-out; }
@keyframes highlight-fade { 0% { background-color: rgba(139, 195, 74, 0.3); } 100% { background-color: transparent; } }

/* ===================================================== */
/* --- MEDIA QUERIES POUR RESPONSIVE DESIGN --- */
/* ===================================================== */

/* --- Tablettes et Petits Laptops --- */
@media (max-width: 992px) {
  .main-container {
    flex-direction: column;
    padding: 0 15px;
  }

  .sidebar {
    width: 100%;
    margin-bottom: 30px;
    position: static;
    max-height: none;
    overflow-y: visible;
    padding: 0;
  }

  .ads-sidebar, .sidebar-widget {
      max-width: 500px; /* Optional max width on tablet */
      margin-left: auto;
      margin-right: auto;
      padding: 15px;
  }
  .ads-sidebar ins.adsbygoogle {
      margin: 0 auto;
      display: block;
  }

  .content {
    width: 100%; /* Explicitly set width */
    /* min-width: 0; /* Already set globally, but confirm */
  }
}

/* --- Petites Tablettes et Grands Smartphones --- */
@media (max-width: 768px) {
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.4em; }
    .content { padding: 25px; }
    .nav-quick-links a { margin: 0 8px; font-size: 0.9em; }

    .header-container { justify-content: center; }

    /* Sidebar elements take full width */
    .ads-sidebar, .sidebar-widget { max-width: 100%; }

    /* Adjust Ad sizes for smaller screens */
     .ads-header ins.adsbygoogle,
     .ads-sidebar ins.adsbygoogle,
     .ads-content ins.adsbygoogle {
         max-width: 100%;
         width: auto; /* Let AdSense decide or set specific smaller sizes */
         height: auto;
         /* Example smaller fixed size: */
         /* width: 336px; height: 280px; */
     }

     /* Specific adjustment for content ad */
     .ads-content ins.adsbygoogle {
         /* Ensure it doesn't force 728px width */
         width: 100%; /* Try forcing width 100% */
         max-width: 468px; /* Example max for this breakpoint */
         height: 60px; /* Example appropriate height */
     }
}

/* --- Smartphones --- */
@media (max-width: 600px) {
  .header-container { flex-direction: column; align-items: center; text-align: center; }
  .logo { margin-bottom: 15px; margin-right: 0; }
  .ads-header { margin-top: 10px; }
  .nav-quick-links { padding: 10px 5px; position: static; }
  .nav-quick-links a { display: inline-block; margin: 5px 5px; font-size: 0.85em; }

  .content { padding: 20px; }
  h1 { font-size: 1.6em; }
  h2 { font-size: 1.3em; }

  #backToTopBtn { bottom: 15px; right: 15px; padding: 10px 13px; font-size: 16px; }

  /* Further adjust Ad sizes */
  .ads-sidebar ins.adsbygoogle {
      width: 250px; height: 250px; max-width: 100%;
  }
  .ads-content ins.adsbygoogle {
      width: 300px; height: 250px; max-width: 100%; /* Common mobile ad size */
  }
}

/* --- Très Petits Écrans (< 480px) --- */
@media (max-width: 480px) {
    .main-container { padding: 0 10px; }
    .content { padding: 15px; }
    h1 { font-size: 1.4em; }
    h2 { font-size: 1.2em; margin-top: 30px; margin-bottom: 15px; }
    h3 { font-size: 1.1em; margin-bottom: 10px; }
    body { line-height: 1.6; font-size: 0.95em; }
    p, ul, ol, dl { margin-bottom: 15px; }
    .nav-quick-links a { font-size: 0.8em; margin: 5px 3px; }
    .content-section-image { margin: 15px auto 20px auto; }
    .header-promo-image { max-width: 300px; margin: 5px auto; }

  /* --- Gestion Finale Blocs Publicitaires et Contenu --- */
  .ads-sidebar, .sidebar-widget {
      width: 100%; max-width: 100%; padding: 10px;
      margin-left: 0; margin-right: 0; text-align: center; margin-bottom: 15px;
  }
  .ads-header, .ads-content {
      width: 100%; max-width: 100%; padding: 5px 0;
      margin-left: auto; margin-right: auto; text-align: center;
  }

  /* AdSense tags specific styles for small screens */
  .ads-header ins.adsbygoogle,
  .ads-sidebar ins.adsbygoogle,
  .ads-content ins.adsbygoogle {
      width: auto; max-width: 100%; height: auto;
      display: inline-block; margin: 0;
       /* Consider smaller fixed sizes if 'auto' doesn't work well */
       /* width: 300px; height: 100px; */
  }

   .ads-header { margin-top: 5px; margin-bottom: 5px; }
   .ads-content { margin: 20px auto; }
   #backToTopBtn { bottom: 10px; right: 10px; padding: 8px 11px; font-size: 14px; }

   /* Ensure text breaks correctly */
   .content, .content p, .content li, .content dd, .content dt {
       overflow-wrap: break-word;
       word-wrap: break-word;
       -webkit-hyphens: auto; /* Optional: Automatic hyphenation */
       -moz-hyphens: auto;
       hyphens: auto;
   }

   /* Ensure pre/code blocks don't overflow */
   .content pre, .content code {
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow-x: auto;
        max-width: 100%;
   }

   /* Ensure tables don't overflow */
   .content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
   }
}