/* ============================================================
   LACHIMIE.FR — main.css
   Contenu : variables, reset, header, nav burger, logo,
             footer, blocs communs, tableaux, popup
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ============================================================
   TOKENS GLOBAUX
   ============================================================ */
:root {
  --ink:          #111827;
  --ink-light:    #4b5563;
  --ink-faint:    #9ca3af;
  --paper:        #ffffff;
  --paper-warm:   #fafaf8;
  --paper-tint:   #f3f4f6;
  --accent:       #f96400;
  --accent-glow:  rgba(249,100,0,.12);
  --accent-dark:  #c74f00;
  --science:      #1d5fa6;
  --science-lt:   #dbeafe;
  --green:        #166534;
  --green-lt:     #dcfce7;
  --red:          #991b1b;
  --red-lt:       #fee2e2;
  --gold:         #92400e;
  --gold-lt:      #fef3c7;
  --border:       #e5e7eb;
  --border-dark:  #d1d5db;
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow-xs:    0 1px 3px rgba(0,0,0,.07);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.08);
  --shadow-md:    0 6px 24px rgba(0,0,0,.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.14);
  --font-body:    'Merriweather', Georgia, serif;
  --font-ui:      'DM Sans', system-ui, sans-serif;
  --t:            .2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper-tint);
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--ink);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
header {
  display: flex;
  width: 100%;
  max-width: 100%;
  flex-flow: row wrap;
  margin: 0;
  box-sizing: border-box;
}

.menutop,
.menutop-emploi {
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: var(--paper);
  position: fixed;
  top: 0;
  left: 0;             /* ancrage explicite à gauche */
  width: 100%;
  max-width: 100%;     /* ne dépasse jamais l'écran */
  box-sizing: border-box;
  z-index: 200;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  overflow: hidden;    /* coupe tout dépassement interne */
}

.menutop         { height: 56px; }
.menutop-emploi  { height: 72px; }

/* Trait accent orange à gauche */
.menutop::before,
.menutop-emploi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}

/* ---- Logo bar ---- */
#barre-logo,
#barre-logo-top {
  background-image: url(https://www.lachimie.fr/graphisme/lachimie-logo-70.webp),
                    linear-gradient(135deg, #c8e024 0%, #9ab810 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: auto 46px, cover;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  border-bottom: 3px solid var(--accent);
  overflow: hidden;
}

/* Pas de texture sur fond clair */
#barre-logo::before,
#barre-logo-top::before { display: none; }

#barre-logo     { margin-top: 56px; height: 70px; }
#barre-logo-top { margin-top: 72px; height: 76px; }

/* ---- Navigation items ---- */
.header {
  width: 100%;
  padding: 0 16px;
}

.header ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
  flex-wrap: wrap;
}

.header li a {
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-light);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
  white-space: nowrap;
  display: block;
}

.header li a:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

#lienEmploi a {
  background: var(--accent);
  color: #fff !important;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
}

#lienEmploi a:hover {
  background: var(--accent-dark) !important;
  color: #fff !important;
}

/* ---- Bouton flash CTA ---- */
button.flash {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .04em;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  height: 38px;
  padding: 0 16px;
  position: fixed;
  top: 9px;
  right: 16px;
  z-index: 210;
  cursor: pointer;
  transition: background var(--t), transform var(--t);
  box-shadow: 0 2px 10px rgba(249,100,0,.3);
}

button.flash:hover { background: var(--accent-dark); transform: translateY(-1px); }
button.flash a { color: #fff; text-decoration: none; }

/* ---- Burger mobile ---- */
.header .menu-btn { display: none; }

.header .menu-icon {
  cursor: pointer;
  display: none;
  padding: 16px 8px;
  position: absolute;
  right: 16px;
  top: 4px;
  user-select: none;
}

.header .menu-icon .navicon {
  background: var(--ink);
  display: block;
  height: 2px;
  width: 22px;
  border-radius: 2px;
  position: relative;
  transition: background .2s ease-out;
}

.header .menu-icon .navicon::before,
.header .menu-icon .navicon::after {
  background: var(--ink);
  content: '';
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  position: absolute;
  transition: .2s ease-out;
}

.header .menu-icon .navicon::before { top:  6px; }
.header .menu-icon .navicon::after  { top: -6px; }

.header .menu-btn:checked ~ .menu         { max-height: 420px; }
.header .menu-btn:checked ~ .menu-icon .navicon { background: transparent; }
.header .menu-btn:checked ~ .menu-icon .navicon::before { transform: rotate(-45deg); top: 0; }
.header .menu-btn:checked ~ .menu-icon .navicon::after  { transform: rotate(45deg);  top: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
footer { margin-top: 40px; }

.barre-grise {
  background: var(--ink);
  color: #d1d5db;
  padding: 40px 5% 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  font-family: var(--font-ui);
  font-size: .84rem;
}

.barre-grise a {
  color: #9ca3af;
  text-decoration: none;
  display: block;
  line-height: 2.1;
  transition: color var(--t);
}

.barre-grise a:hover { color: var(--accent); text-decoration: none; }

.footer-title {
  font-weight: 700;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #fff;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.footer-brand {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -.01em;
}

.footer-brand span { color: var(--accent); }

.footer-copy {
  font-size: .76rem;
  color: #6b7280;
  margin-bottom: 10px;
}

.social-link {
  display: flex !important;
  align-items: center;
  gap: 8px;
  line-height: 1 !important;
  margin: 10px 0;
}

.social-link img { opacity: .8; border-radius: 4px; }
.social-link:hover img { opacity: 1; }

/* Newsletter */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.newsletter-form input[type="email"] {
  font-family: var(--font-ui);
  font-size: .83rem;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
  color: #fff;
  outline: none;
  transition: border-color var(--t);
}

.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,.35); }
.newsletter-form input[type="email"]:focus        { border-color: var(--accent); }

.newsletter-form input[type="submit"] {
  font-family: var(--font-ui);
  font-size: .8rem;
  font-weight: 700;
  padding: 9px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t);
  letter-spacing: .04em;
}

.newsletter-form input[type="submit"]:hover { background: var(--accent-dark); }

/* ============================================================
   TABLEAUX
   ============================================================ */
.table {
  border-collapse: collapse;
  margin: 12px auto 12px 0;
  width: auto;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-ui);
  font-size: .9rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.table th {
  background: var(--science);
  color: #fff;
  padding: 10px 14px;
  border: 1px solid #bfd4eb;
  text-align: center;
  font-weight: 600;
  letter-spacing: .03em;
  font-size: .88rem;
  white-space: nowrap;
}

.table td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
  line-height: 1.5;
}

.table tbody tr:nth-child(even) { background: #dbeafe; }
.table tbody tr:hover           { background: #bfdbfe; transition: background .15s ease; }

.tableauSimple {
  border-collapse: collapse;
  margin: 8px auto;
  width: 90%;
  border: 1px solid var(--science);
  text-align: center;
  font-family: var(--font-ui);
  font-size: .9rem;
}

.tableauSimple th {
  background: #dbeafe;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid #999;
}

.tableauSimple td {
  border: 1px solid #999;
  padding: 7px 12px;
}

/* ============================================================
   POPUP (head-2.php)
   ============================================================ */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,16,30,.72);
  z-index: 9999;
  animation: fadeIn .28s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.popup-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.popup-container {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 390px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp .36s cubic-bezier(.22,.68,0,1.2);
  overflow: hidden;
}

.popup-container::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(90deg, #bad61f 0%, #087200 50%, var(--science) 100%);
}

.popup-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  background: var(--paper-tint);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), transform var(--t), color var(--t);
  z-index: 10;
}

.popup-close:hover { background: #ffe5e5; transform: rotate(90deg); color: var(--red); }

.popup-content { padding: 28px 24px 24px; text-align: center; }

.popup-image {
  width: 100%; max-width: 210px; height: auto;
  margin: 0 auto 18px; display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.popup-title {
  font-family: var(--font-ui);
  font-size: 17px; font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px; line-height: 1.4;
}

.popup-description {
  font-family: var(--font-body);
  font-size: 14px; font-style: italic;
  color: var(--ink-light);
  margin: 0 0 22px; line-height: 1.65;
}

.popup-button {
  display: inline-block;
  background: linear-gradient(135deg, #1db800 0%, #087200 100%);
  color: #fff; text-decoration: none;
  padding: 13px 32px;
  border-radius: 100px;
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 700;
  letter-spacing: .03em;
  transition: transform var(--t), box-shadow var(--t);
  box-shadow: 0 4px 16px rgba(8,114,0,.28);
}

.popup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(8,114,0,.38);
  color: #fff; text-decoration: none;
}

/* ============================================================
   ANIMATIONS COMMUNES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

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

/* ============================================================
   BARRE PROMO
   ============================================================ */
.barre-promo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 10px 16px;
  border: 1px solid #b8d970;
  border-radius: var(--radius);
  background: #f9fdf0;
  margin: 8px auto;
  max-width: 1160px;
  box-sizing: border-box;
}

.barre-promo .bottom1 { font-size: 1.1rem; font-weight: 700; }

.barre-promo a {
  display: inline-block;
  padding: 10px 22px;
  background: #087200;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: .9rem;
  transition: background var(--t);
}

.barre-promo a:hover { background: var(--accent); }
.barre-promo img     { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); }

.image-clignote { animation: clignoter 2.5s infinite ease-out; }

@keyframes clignoter {
  0%, 100% { opacity: 1; }
  40%       { opacity: 0; }
}

/* ============================================================
   RESPONSIVE MOBILE — éléments communs
   ============================================================ */
@media (max-width: 850px) {

  /* Nav */
  .menutop, .menutop-emploi { height: auto; min-height: 50px; flex-wrap: wrap; }
  .header { padding: 0; }
  .header .menu-icon { display: inline-block; }

  .header ul.menu {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease-out;
    width: 100%;
    background: var(--paper);
    border-top: 1px solid var(--border);
    padding: 0;
  }

  .header li { border-bottom: 1px solid var(--border); }
  .header li a { padding: 12px 20px; font-size: .85rem; border-radius: 0; text-align: left; }
  #lienEmploi a { border-radius: 0; }

  #barre-logo     { margin-top: 50px; height: 60px; background-size: auto 36px; }
  #barre-logo-top { margin-top: 50px; height: 60px; background-size: auto 36px; }

  /* Footer */
  .barre-grise { grid-template-columns: 1fr; gap: 24px; padding: 28px 20px; }

  /* Tableaux */
  .table thead { display: none; }
  .table, .table tbody, .table td, .table tr { display: block; width: auto; box-sizing: border-box; }
  .table tr { margin-bottom: 12px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-xs); }
  .table td { display: block; text-align: right; background: #dbeafe; border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .table td::before { content: attr(data-label); color: var(--science); float: left; font-size: .85rem; font-weight: 600; }
  .table td:last-child { border-bottom: none; }

  /* Popup */
  .popup-container { border-radius: var(--radius); }
  .popup-content   { padding: 22px 18px 20px; }
  .popup-image     { max-width: 180px; }

  /* Barre promo */
  .barre-promo { flex-direction: column; text-align: center; }
}

@media (min-width: 851px) {
  .header .menu-icon { display: none; }
  .header ul.menu    { max-height: none !important; overflow: visible; }
  .sousmenu          { display: none; }
}
