:root {
  --accent: #004a87;          /* Bleu du logo TRELEC */
  --accent-ink: #003a6b;      /* Variante foncée pour les petits textes (lisibilité) */
  --bg: #f5f7fa;              /* Fond */
  --surface: #ffffff;
  --text: #1b1f26;
  --muted: #687080;
  --line: rgba(20,30,50,.1);
  --maxw: 980px;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--bg);
  line-height: 1.65;
}

/* Trame de points discrète */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(20,30,50,.09) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 60%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

main { flex: 1; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---------- Hero ---------- */
.hero { padding: 104px 0 96px; text-align: center; }

.logo {
  display: inline-flex; justify-content: center; align-items: center;
  padding: 22px 34px;
  margin-bottom: 64px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px -22px color-mix(in srgb, var(--accent) 55%, transparent);
}
.logo img { display: block; width: 270px; max-width: 100%; height: auto; }
.logo .fallback { display: none; align-items: center; gap: 14px; color: #12161d; }
.logo .mark { width: 48px; height: 48px; color: var(--accent); flex: none; }
.logo .name { font-size: 1.15rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }
.logo.no-img img { display: none; }
.logo.no-img .fallback { display: flex; }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .78rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .3; } }

h1 {
  font-size: clamp(2.1rem, 5.6vw, 4rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -.03em;
  max-width: 20ch;
  margin: 0 auto;
  text-wrap: balance;
}
h1 em {
  font-style: normal; font-weight: 600;
  background: linear-gradient(90deg, var(--accent-ink), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* Barre de progression décorative */
.progress {
  width: 180px; height: 3px; margin: 52px auto 0;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.progress span {
  display: block; width: 40%; height: 100%;
  background: var(--accent);
  border-radius: 3px;
  animation: load 2.4s ease-in-out infinite;
}
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- Sections empilées ---------- */
section.block { padding: 72px 0; border-top: 1px solid var(--line); }

.section-title {
  text-align: center;
  font-size: .95rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 30px;
}

.about p {
  max-width: 660px; margin: 0 auto;
  text-align: center;
  font-size: 1.15rem; font-weight: 300;
  color: var(--muted);
  text-wrap: pretty;
}
.about strong { color: var(--text); font-weight: 600; }
section.about { background: #eceff3; }   /* Fond légèrement grisé */
.about .intro { display: grid; gap: 16px; }
.about .intro p { max-width: none; margin: 0; text-align: left; }
.about h3 {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 300; letter-spacing: -.02em;
  margin-bottom: 26px;
}
.about h3 em { font-style: normal; font-weight: 600; color: var(--accent-ink); }
.about .cta { color: var(--text); font-weight: 500; }

/* Images sous « À propos » */
.gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 44px;
}
.gallery figure {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, #fff), color-mix(in srgb, var(--accent) 4%, #fff));
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -26px color-mix(in srgb, var(--accent) 60%, transparent);
}
.gallery img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s ease;
}
.gallery figure:hover img { transform: scale(1.04); }
/* Une seule image : centrée, proportions d'origine */
.gallery.single { grid-template-columns: 1fr; max-width: 460px; margin-left: auto; margin-right: auto; }
.gallery.single figure { aspect-ratio: 370 / 278; }
/* Emplacement vide tant que l'image n'est pas déposée */
.gallery figure.no-img img { display: none; }
.gallery figure.no-img::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 44px; height: 44px;
  opacity: .45;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Contact : cartes translucides */
.contact-grid { display: flex; justify-content: center; gap: 18px; }
.contact-grid > .contact-item { flex: 1 1 0; min-width: 0; max-width: 300px; }   /* Largeur max d'une carte : 1, 2 ou 3 cartes restent centrées */
.contact-item {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 34px 20px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(20,30,50,.04);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.contact-item:hover, .contact-item:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--accent) 55%, transparent);
  transform: translateY(-3px);
  outline: none;
}
.icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.icon svg { width: 20px; height: 20px; }
.label { font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.value { font-size: 1.08rem; font-weight: 500; word-break: break-word; line-height: 1.5; }

/* Lien externe sous les cartes contact */
.extra-link { margin-top: 32px; text-align: center; }
.extra-link a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  font-weight: 600; text-decoration: none;
  transition: background .25s, color .25s;
}
.extra-link a:hover, .extra-link a:focus-visible { background: var(--accent); color: #fff; outline: none; }
.extra-link svg { width: 16px; height: 16px; }

/* Liens Nos produits et Qualité sous le statut */
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.hero-links a {
  display: inline-flex; align-items: center;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600; text-decoration: none;
  transition: background .25s, color .25s;
}
.hero-links a:hover, .hero-links a:focus-visible { background: var(--surface); color: var(--accent-ink); outline: 2px solid var(--accent); outline-offset: 2px; }

/* Horaires (facultatif) */
.hours {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 36px;
  margin-top: 36px;
  font-size: .95rem;
}
.hours div { display: flex; gap: 12px; align-items: baseline; }
.hours dt { color: var(--muted); }
.hours dd { font-weight: 500; }

footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted);
  text-align: center;
}
footer hr { width: 60px; margin: 16px auto 12px; border: 0; border-top: 1px solid var(--line); }
footer .credit { font-size: .75rem; font-style: italic; opacity: .8; }

/* ---------- Tablette & mobile : images les unes sous les autres ---------- */
@media (max-width: 900px) {
  .gallery { grid-template-columns: 1fr; max-width: 560px; margin-left: auto; margin-right: auto; }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 64px 0 64px; }
  .logo { padding: 18px 24px; margin-bottom: 44px; }
  section.block { padding: 52px 0; }
  .contact-grid { flex-direction: column; align-items: center; gap: 12px; }
  .contact-grid > .contact-item { width: 100%; max-width: 420px; }
  .gallery { gap: 10px; margin-top: 32px; }
  .gallery figure { border-radius: 12px; }
  .contact-item { flex-direction: row; text-align: left; padding: 18px 20px; gap: 16px; }
  .contact-item .txt { display: flex; flex-direction: column; }
  .hours { flex-direction: column; align-items: center; gap: 8px; }
  .hours div { flex-direction: column; align-items: center; gap: 0; }
}
@media (min-width: 721px) {
  .contact-item .txt { display: contents; }
}

/* ---------- Bandeau logo (pages intérieures) ---------- */
.topbar { padding: 28px 0 0; }
.topbar__logo { display: inline-block; border-radius: 8px; }
.topbar__logo img { display: block; width: 180px; height: auto; }
.topbar__logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

/* Fil d'Ariane sous le logo */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 16px; list-style: none; font-size: .9rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.breadcrumb a { color: var(--accent-ink); text-decoration: none; }
.breadcrumb a:hover, .breadcrumb a:focus-visible { text-decoration: underline; outline: none; }

/* ---------- Page Nos produits ---------- */
.page-produits__intro { padding: 56px 0 64px; text-align: center; }
.page-produits__intro p { margin-top: 18px; font-size: 1.1rem; font-weight: 300; color: var(--muted); }

.page-produits__sommaire ul {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: 36px;
  list-style: none;
}
.page-produits__sommaire a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-ink);
  font-size: .9rem; font-weight: 500; text-decoration: none;
  transition: background .25s, color .25s, border-color .25s;
}
.page-produits__sommaire a:hover, .page-produits__sommaire a:focus-visible {
  background: var(--accent); border-color: var(--accent); color: #fff; outline: none;
}

.page-produits__famille, .page-produits__sommaire { scroll-margin-top: 16px; }

/* Lien de retour au sommaire en fin de famille */
.page-produits__retour { margin-top: 28px; text-align: right; font-size: .9rem; }
.page-produits__retour a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.page-produits__retour a:hover, .page-produits__retour a:focus-visible { text-decoration: underline; outline: none; }

/* Défilement doux vers les ancres, sauf animations réduites */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.page-produits__famille h3 { margin: 40px 0 14px; font-size: 1.15rem; font-weight: 600; }
.page-produits__famille .section-title + h3 { margin-top: 0; }

.produits {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
  list-style: none;
}
.produits li { display: flex; }
.produit {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(20,30,50,.04);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.produit:hover, .produit:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--accent) 55%, transparent);
  transform: translateY(-3px);
  outline: none;
}
.produit__nom { font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.produit__carac { font-size: .9rem; line-height: 1.5; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.produit__fiche { margin-top: auto; padding-top: 4px; font-size: .9rem; font-weight: 600; color: var(--accent-ink); }
.produit__format { display: block; margin-top: 2px; font-size: .85rem; font-weight: 400; color: var(--muted); white-space: nowrap; }

@media (max-width: 720px) {
  .page-produits__intro { padding: 40px 0 48px; }
}

/* ---------- Page Qualité / RSE ---------- */
.page-qualite__intro { padding: 56px 0 64px; }
.page-qualite__intro h1 { text-align: center; }
.page-qualite__texte { max-width: 660px; margin: 32px auto 0; font-size: 1.1rem; font-weight: 300; color: var(--muted); }
.page-qualite__texte ul { margin: 8px 0 0 1.25em; }
.page-qualite__image { max-width: 573px; margin: 40px auto 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.page-qualite__image img { display: block; width: 100%; height: auto; }

.documents {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
  list-style: none;
}
.documents li { display: flex; }
.document {
  display: block;
  width: 100%;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.45;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.document:hover, .document:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--accent) 55%, transparent);
  transform: translateY(-3px);
  outline: none;
}
.document__nom { font-weight: 600; color: var(--accent-ink); overflow-wrap: anywhere; }
.document__format { display: block; margin-top: 4px; font-size: .85rem; color: var(--muted); white-space: nowrap; }

@media (max-width: 720px) {
  .page-qualite__intro { padding: 40px 0 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
