/* ==========================================================================
   TIC Consulting — Site statique
   Design clair & épuré · Full-width · Inter
   ========================================================================== */

/* --- Base ---------------------------------------------------------------- */
:root {
  --ink:        #0f172a;
  --text:       #334155;
  --muted:      #64748b;
  --light:      #94a3b8;
  --line:       #e2e8f0;
  --line-soft:  #f1f5f9;
  --bg:         #ffffff;
  --bg-soft:    #f8fafc;
  --accent:     #2563eb;
  --accent-dark:#1d4ed8;
  --header-h:   64px;
  --radius:     4px;
  --shadow:     0 1px 8px rgba(0,0,0,.06);
  --ease:       cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #cbd5e1; color: var(--ink); }

img { max-width: 100%; height: auto; border-radius: var(--radius); }

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-dark); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: .5rem 1rem;
  z-index: 2000;
}
.skip-link:focus { left: 0; color: #fff; }

/* --- Typographie ---------------------------------------------------------- */
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
  margin: 0 0 .5em;
}

.page-head h1, .notfound h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.035em;
  padding: .75em 0 0;
  margin-bottom: 1rem;
}

.content h2 { font-size: 1.35rem; margin: 1.75em 0 .5em; }
.content h3 { font-size: 1.15rem; margin: 1.5em 0 .4em; }
.content h4 { font-size: 1.05rem; font-weight: 600; color: #475569; margin: 1.4em 0 .4em; }

.content p { margin: 0 0 1.1em; }
.content a { text-decoration: underline; text-underline-offset: 2px; }
.content ul, .content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.content li { margin-bottom: .35em; }
.content strong { color: var(--ink); }
.content hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }

/* Images flottantes (héritage du contenu Joomla) */
.content .float-left,
.content .float-right {
  max-width: 42%;
  margin-bottom: 1em;
}
.content .float-left  { float: left;  margin-right: 1.5em; }
.content .float-right { float: right; margin-left: 1.5em; }
.content::after { content: ""; display: table; clear: both; }

/* Vidéo responsive */
.video-embed {
  position: relative;
  width: min(100%, 720px);
  aspect-ratio: 16 / 9;
  margin: 1.5em 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Structure ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { display: block; min-height: 55vh; padding-bottom: 3rem; }

.page, .page-head { display: block; }

.content { max-width: 820px; }

.intro { margin-bottom: 2rem; }
.intro p { margin: 0 0 .75em; }

.back-link { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .95rem; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s ease;
}
.site-header.scrolled { box-shadow: var(--shadow); }

.header-inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 34px; width: auto; border-radius: 0; }

.site-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin-left: auto;
}

.site-nav a {
  color: #475569;
  font-size: .9rem;
  font-weight: 500;
  padding: .45rem .9rem;
  border-radius: 6px;
  transition: background .2s ease, color .2s ease;
}
.site-nav a:hover { color: var(--ink); background: var(--line-soft); }
.site-nav a.active { color: var(--accent); background: #eff6ff; }

/* Bouton menu mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #475569;
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sélecteur de langue */
.lang-switch { position: relative; flex-shrink: 0; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .7rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475569;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.lang-btn:hover { border-color: #cbd5e1; color: var(--ink); }
.lang-btn .chev {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #94a3b8;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: .4rem;
  display: none;
  z-index: 1001;
}
.lang-switch.open .lang-menu { display: block; }

.lang-menu a {
  display: block;
  padding: .45rem .7rem;
  color: #475569;
  font-size: .88rem;
  border-radius: 5px;
}
.lang-menu a:hover { background: var(--line-soft); color: var(--ink); }
.lang-menu a.current { color: var(--accent); font-weight: 600; }
.lang-menu a.current::after { content: " ✓"; }

/* --- Grilles (hubs) -------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.75rem;
  margin-top: 1rem;
}

.grid-item {
  display: block;
  color: var(--text);
}
.grid-item:hover { color: var(--text); }

.gi-img {
  display: block;
  margin-bottom: .9rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--line-soft);
}
.gi-img img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform .5s var(--ease);
}
.grid-item:hover .gi-img img { transform: scale(1.03); }

.grid-item h2 {
  font-size: 1.05rem;
  margin: 0 0 .35em;
  transition: color .2s ease;
}
.grid-item:hover h2 { color: var(--accent); }

.grid-item p {
  margin: 0 0 .6em;
  font-size: .9rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grid-item .more {
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
}

.grid-portfolio .gi-img img { aspect-ratio: 16 / 10; }

/* --- Contact -------------------------------------------------------------- */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  margin-top: 1rem;
}

.contact-info p { margin: 0 0 .5em; }
.contact-info .ci-name { font-size: 1.1rem; }

.contact-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: #475569;
}
.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .6rem .8rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.hp { position: absolute; left: -9999px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.6rem;
  background: var(--accent);
  color: #fff !important;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

.form-note {
  margin-top: 1rem;
  padding: .75rem 1rem;
  border-radius: 6px;
  font-size: .9rem;
}
.form-note.ok  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.form-note.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* --- 404 ------------------------------------------------------------------ */
.notfound { text-align: center; padding: 4rem 1.5rem; }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-inner p { margin: 0; font-size: .85rem; color: var(--light); }
.footer-tag { font-size: .8rem !important; }

/* --- Retour en haut ------------------------------------------------------- */
.back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted) !important;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, border-color .2s ease, color .2s ease;
}
.back-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { border-color: var(--accent); color: var(--accent) !important; }

/* --- Animations (progressives, sans JS tout reste visible) ---------------- */
html.js .grid-item,
html.js .page-head,
html.js .content {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
html.js .grid-item.qa-visible,
html.js .page-head.qa-visible,
html.js .content.qa-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .grid-item,
  html.js .page-head,
  html.js .content { opacity: 1 !important; transform: none !important; transition: none !important; }
  .gi-img img, .btn, .back-top { transition: none !important; }
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 991px) {
  :root { --header-h: 58px; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1.25rem; }

  .nav-toggle { display: flex; }
  .lang-switch { margin-left: 0; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: .75rem;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s var(--ease), visibility .25s;
  }
  .site-nav.open { opacity: 1; transform: translateY(0); visibility: visible; }
  .site-nav a { padding: .75rem 1rem; font-size: 1rem; border-radius: 8px; }

  .header-inner { gap: .6rem; }
  .brand { order: 1; }
  .nav-toggle { order: 2; }
  .lang-switch { order: 3; }
}

@media (max-width: 767px) {
  body { font-size: 16px; }

  .grid { grid-template-columns: 1fr; }

  .contact-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .content .float-left,
  .content .float-right {
    float: none;
    max-width: 100%;
    margin: 0 0 1em;
  }

  .footer-inner { flex-direction: column; text-align: center; }

  .back-top { bottom: 1rem; right: 1rem; width: 36px; height: 36px; }
}

@media print {
  body { padding-top: 0; }
  .site-header, .site-footer, .back-top, .nav-toggle { display: none; }
}
