/* VACO Engineering - Ion Exchange Section */
/* Tailwind-compatible styles for static HTML pages */

/* ===== FONT IMPORT ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== BASE STYLES ===== */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #0F172A;
  background-color: #F8FAFC;
}

/* ===== LAYOUT ===== */
.vaco-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.vaco-header {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.vaco-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.vaco-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #0F172A;
}

.vaco-logo img {
  height: 40px;
  width: auto;
}

.vaco-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.vaco-logo-company {
  font-size: 1rem;
  font-weight: 700;
  color: #0F172A;
}

.vaco-logo-section {
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 400;
}

/* Navigation */
.vaco-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.vaco-nav a {
  padding: 0.5rem 1rem;
  color: #64748B;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
}

.vaco-nav a:hover {
  color: #2563EB;
  background: rgba(37, 99, 235, 0.05);
}

.vaco-nav a.active {
  color: #2563EB;
  background: rgba(37, 99, 235, 0.1);
}

/* Mobile menu toggle */
.vaco-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #0F172A;
}

.vaco-menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* Main content */
.vaco-main {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* Content with sidebar layout */
.vaco-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Sidebar */
.vaco-sidebar {
  position: sticky;
  top: 88px;
  background: #FFFFFF;
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.vaco-sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #E2E8F0;
}

.vaco-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.vaco-sidebar-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #64748B;
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.vaco-sidebar-nav a:hover {
  color: #2563EB;
  background: rgba(37, 99, 235, 0.05);
  border-left-color: #60A5FA;
}

.vaco-sidebar-nav a.active {
  color: #2563EB;
  background: rgba(37, 99, 235, 0.1);
  border-left-color: #2563EB;
  font-weight: 500;
}

/* Sidebar topic badge */
.vaco-sidebar-topic {
  margin-top: 1.25rem;
  padding: 0.875rem;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.vaco-sidebar-topic__label {
  color: #B45309;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.vaco-sidebar-topic__title {
  display: block;
  color: #92400E;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.vaco-sidebar-topic__title:hover {
  color: #78350F;
  text-decoration: underline;
}

.vaco-sidebar-topic__desc {
  color: #78716C;
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.4;
}

/* Content area */
.vaco-content {
  background: #FFFFFF;
  border-radius: 0.75rem;
  padding: 2rem 2.5rem;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  max-width: 900px;
  animation: fadeIn 0.3s ease-out;
}

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

/* Footer - matching vaco-eng.ru style */
.vaco-footer {
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  padding: 3rem 1.5rem;
  margin-top: auto;
}

.vaco-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.vaco-footer-company h3 {
  font-weight: 700;
  font-size: 1.125rem;
  color: #0F172A;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.vaco-footer-company p {
  color: #64748B;
  font-size: 0.875rem;
  max-width: 24rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.vaco-footer-company .vaco-footer-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid #E2E8F0;
  border-radius: 0.375rem;
  color: #0F172A;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 1rem;
}

.vaco-footer-company .vaco-footer-btn:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.vaco-footer-copyright {
  color: #94A3B8;
  font-size: 0.75rem;
  margin-top: 1rem;
}

.vaco-footer-contacts h4 {
  font-weight: 600;
  font-size: 1rem;
  color: #0F172A;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.vaco-footer-contacts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vaco-footer-contacts li {
  color: #475569;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.vaco-footer-contacts a {
  color: #475569;
  text-decoration: none;
  transition: color 0.15s ease;
}

.vaco-footer-contacts a:hover {
  color: #2563EB;
}

/* Legacy footer links - keep for compatibility */
.vaco-footer-links {
  display: flex;
  gap: 1.5rem;
}

.vaco-footer-links a {
  color: #64748B;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

.vaco-footer-links a:hover {
  color: #2563EB;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: #0F172A;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #E2E8F0;
}

h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #E2E8F0;
}

h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #1E3A5F;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 4px solid #2563EB;
}

h4 {
  font-size: 1.125rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #0F172A;
  background: transparent;
}

h5 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #1E40AF;
}

h6 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  color: #64748B;
}

p {
  margin-bottom: 1rem;
}

/* ===== LINKS ===== */
a {
  color: #2563EB;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #1D4ED8;
  text-decoration: underline;
}

/* ===== LISTS ===== */
ul, ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

ul > li {
  list-style-type: disc;
}

ul > li::marker {
  color: #2563EB;
}

ol > li::marker {
  color: #2563EB;
  font-weight: 600;
}

ul ul, ol ol, ul ol, ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* ===== TABLES - Clean Scientific Style ===== */
table {
  width: auto;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.5rem auto;
  font-size: 0.9rem;
  background: transparent;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
  background: transparent;
}

th {
  font-weight: 600;
  color: #111;
  border-bottom: 1px solid #333;
}

td {
  color: #333;
}

tr:last-child td {
  border-bottom: none;
}

/* Center text in cells */
th.C, td.C, .C {
  text-align: center;
}

/* Right-align text */
th.R, td.R, .R {
  text-align: right;
}

/* Blue highlighted cells - text only */
.fondbleu2 {
  color: #1565C0;
  font-weight: 600;
}

/* Blue header cells (th or td with fondbleu class) */
th.fondbleu, td.fondbleu {
  font-weight: 600;
  color: #1565C0;
  border-bottom: 1px solid #333;
}

/* Yellow info cells in tables */
td.fondjaune {
  background: #FFFDE7;
  border-left: 3px solid #FFC107;
  padding: 0.5rem 0.75rem;
}

/* All table variants - same clean style */
table.fondbleu, table.bordgris, table.seconde, table.sans, table.main, table.center70 {
  background: transparent;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
}

table.fondbleu th, table.seconde th, table.sans th {
  background: transparent;
  border-bottom: 1px solid #333;
}

/* Full grid for bordgris */
table.bordgris {
  border: 1px solid #999;
}

table.bordgris th, table.bordgris td {
  border: 1px solid #ccc;
}

table.bordgris th {
  border-bottom: 2px solid #333;
  background: #f5f5f5;
  font-weight: bold;
}

/* Centered table width variants */
table[width="75%"], table[width="80%"], table[width="90%"], table[width="70%"], table[width="50%"] {
  margin-left: auto;
  margin-right: auto;
}

table.center70 {
  width: 70%;
  margin-left: auto;
  margin-right: auto;
}

/* Dark blue text for special cells */
.bleufonce {
  font-weight: 600;
  color: #1565C0;
}

/* Blue text */
.bleugras {
  color: #1565C0;
  font-weight: 600;
}

/* Image-only tables (gallery style) - no borders */
table.gallery, table.images {
  border: none;
  background: transparent;
}

table.gallery td, table.images td {
  border: none;
  text-align: center;
  padding: 0.5rem;
  font-style: italic;
  color: #666;
  font-size: 0.85rem;
}

/* Timeline / Chronology table - only with explicit .timeline class */
table.timeline {
  width: 100%;
  border: none;
  box-shadow: none;
  background: transparent;
  border-collapse: separate;
  border-spacing: 0;
}

table.timeline tr {
  background: transparent;
}

table.timeline th {
  background: transparent;
  border: none;
  border-bottom: none;
  color: #2563EB;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 1rem 1.5rem 1rem 0;
  vertical-align: top;
  white-space: nowrap;
  width: 120px;
  position: relative;
}

table.timeline th::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  top: 1.15rem;
  width: 10px;
  height: 10px;
  background: #2563EB;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

table.timeline td {
  background: transparent;
  border: none;
  border-left: 2px solid #E2E8F0;
  padding: 0.875rem 0 1.5rem 1.5rem;
  vertical-align: top;
  color: #334155;
  line-height: 1.6;
}

table.timeline tr:hover td {
  background: transparent;
  border-left-color: #2563EB;
}

table.timeline tr:last-child td {
  border-bottom: none;
  padding-bottom: 0.5rem;
}

caption {
  padding: 0.5rem;
  font-style: italic;
  color: #64748B;
  font-size: 0.875rem;
  caption-side: bottom;
}

/* ===== IMAGES ===== */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

.droite, img.droite {
  float: right;
  margin: 0 0 1rem 1.5rem;
  max-width: 40%;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.gauche, img.gauche {
  float: left;
  margin: 0 1.5rem 1rem 0;
  max-width: 40%;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ===== INFO BOXES ===== */
.fondjaune, .info-box {
  background: linear-gradient(to bottom right, #FFFBEB, #FEF3C7);
  border: 1px solid #FDE68A;
  border-left: 4px solid #F59E0B;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.note-box {
  background: linear-gradient(to bottom right, #EFF6FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  border-left: 4px solid #2563EB;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.warning-box {
  background: linear-gradient(to bottom right, #FEF2F2, #FECACA);
  border: 1px solid #FECACA;
  border-left: 4px solid #EF4444;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* Limits info box (yellow) */
.limits {
  background: #FFFDE7;
  border: 1px solid #FFF59D;
  border-left: 4px solid #FFC107;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* Small title inside limits */
.P5 {
  font-weight: 600;
  color: #F57C00;
  display: block;
  margin-bottom: 0.25rem;
}

/* ===== HORIZONTAL RULE ===== */
hr {
  border: none;
  height: 1px;
  background: #E2E8F0;
  margin: 2rem 0;
}

/* ===== SUB/SUPERSCRIPT ===== */
sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup { top: -0.5em; }
sub { bottom: -0.25em; }

/* ===== CODE & EQUATIONS ===== */
code, .equation {
  font-family: ui-monospace, 'SF Mono', Monaco, 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.875rem;
  background: #F1F5F9;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
}

.equation {
  color: #1E40AF;
  font-weight: 500;
  background: #EFF6FF;
}

/* ===== OLD CLASS MAPPINGS ===== */
.main {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.milieu, .center { text-align: center; }
.justif { text-align: justify; }
.pasjustif { text-align: left; }
.gras, .bold { font-weight: 600; }
.ital, .italic { font-style: italic; }
.bleu { color: #2563EB; }
.rouge { color: #EF4444; }
.vert { color: #10B981; }
.gris { color: #64748B; }
.pluspetit, .small { font-size: 0.875rem; }
.plusgrand, .large { font-size: 1.125rem; }
.indented { margin-left: 1.5rem; }
.bloc, .clear { clear: both; }

/* ===== BREADCRUMBS ===== */
.vaco-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748B;
  margin-bottom: 1.5rem;
}

.vaco-breadcrumbs a {
  color: #64748B;
}

.vaco-breadcrumbs a:hover {
  color: #2563EB;
}

.vaco-breadcrumbs .separator {
  color: #94A3B8;
}

/* ===== BACK TO TOP ===== */
.vaco-back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #2563EB;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  transition: all 0.15s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 50;
}

.vaco-back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.vaco-back-to-top:hover {
  background: #1D4ED8;
  transform: translateY(-2px);
  text-decoration: none;
}

/* ===== HIDE OLD ELEMENTS ===== */
#fleches,
div.update,
div.IXHome,
div.pied,
#Rubriques,
div#Rubriques,
.vaco-content > .vaco-sidebar {
  display: none !important;
}

/* Old sidebar in content - hide it */
.vaco-content .vaco-sidebar__title,
.vaco-content .vaco-sidebar__services,
.vaco-content .vaco-sidebar__contacts {
  display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .vaco-layout {
    grid-template-columns: 1fr;
  }

  .vaco-sidebar {
    position: static;
    margin-bottom: 1.5rem;
  }

  .vaco-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .vaco-sidebar-nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .vaco-sidebar-nav a:hover,
  .vaco-sidebar-nav a.active {
    border-left: none;
    border-bottom-color: #2563EB;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.125rem; }

  .vaco-header-inner {
    flex-wrap: wrap;
  }

  .vaco-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
    margin-top: 1rem;
  }

  .vaco-nav.open {
    display: flex;
  }

  .vaco-nav a {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .vaco-menu-toggle {
    display: block;
  }

  .vaco-main {
    padding: 1rem;
  }

  .vaco-content {
    padding: 1.25rem;
  }

  .droite, img.droite,
  .gauche, img.gauche {
    float: none;
    display: block;
    margin: 1rem auto;
    max-width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .vaco-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .vaco-footer-company p {
    max-width: 100%;
  }

  .vaco-footer-contacts ul {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* ===== PRINT ===== */
@media print {
  .vaco-header,
  .vaco-footer,
  .vaco-sidebar,
  .vaco-back-to-top {
    display: none;
  }

  .vaco-main {
    max-width: 100%;
    padding: 0;
  }

  .vaco-content {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  a { color: inherit; text-decoration: none; }
}

/* ===== HERO COVER IMAGE ===== */
.hero-cover-link {
  display: block;
  margin-bottom: 1.5rem;
}

.hero-cover {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ===== TOPIC BADGE - Compact side badge ===== */
.topic-badge {
  float: left;
  width: 180px;
  margin: 0 1.25rem 1rem 0;
  padding: 0.875rem 1rem;
  background: #FEFCE8;
  border: 1px solid #FDE047;
  border-left: 3px solid #EAB308;
  border-radius: 6px;
  font-size: 0.9rem;
}

.topic-badge__label {
  color: #A16207;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.375rem;
}

.topic-badge__title {
  display: block;
  color: #854D0E;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.topic-badge__title:hover {
  color: #713F12;
  text-decoration: underline;
}

.topic-badge__desc {
  color: #78716C;
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .topic-badge {
    float: none;
    width: 100%;
    margin: 0 0 1rem 0;
  }
}
