/* ============================================================
   GUIDE THERMIQUE — main.css
   Variables, reset, utilitaires globaux
   ============================================================ */


/* ─────────────────────────────────────────────
   1. VARIABLES CSS
   ───────────────────────────────────────────── */
:root {
  /* Couleurs */
  --color-primary:         #1B2A4A;
  --color-accent:          #E8720C;
  --color-accent-dark:     #C45E08;
  --color-white:           #FFFFFF;
  --color-bg:              #FFFFFF;
  --color-bg-alt:          #F5F5F5;
  --color-bg-gradient-from: #f5f3ff;   /* violet-50 */
  --color-bg-gradient-mid:  #ffffff;
  --color-bg-gradient-to:   #f0f9ff;   /* sky-50 */
  --color-text:            #555555;
  --color-text-heading:    #1B2A4A;
  --color-border:          #E5E5E5;
  --color-border-light:    rgba(229, 231, 235, 1);
  --color-gray-300:        rgba(209, 213, 219, 0.7);
  --color-gray-500:        #6B7280;
  --color-gray-600:        #4B5563;
  --color-gray-700:        #374151;
  --color-gray-900:        #111827;

  /* Typo — Inter uniquement */
  --font-family:     'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs:         0.75rem;    /* 12px */
  --text-sm:         0.875rem;   /* 14px */
  --text-base:       1rem;       /* 16px */
  --text-lg:         1.125rem;   /* 18px */
  --text-xl:         1.25rem;    /* 20px */
  --text-2xl:        1.5rem;     /* 24px */
  --text-4xl:        2.25rem;    /* 36px */
  --text-6xl:        3.75rem;    /* 60px */

  /* Font weights */
  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;

  /* Line heights */
  --lh-tight:  1.1;
  --lh-snug:   1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;

  /* Espacements */
  --max-width:        1280px;
  --max-width-prose:  768px;
  --section-padding:  5rem;       /* padding vertical entre sections */
  --section-padding-sm: 2.5rem;

  /* Cards */
  --card-radius:       1rem;      /* rounded-2xl */
  --card-radius-lg:    1.5rem;    /* rounded-3xl */
  --card-shadow:       0 1px 2px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --card-shadow-lg:    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* Séparateurs style comparateur-ia */
  --separator-color:          rgba(209, 213, 219, 0.7);
  --separator-text-size:      0.75rem;
  --separator-text-size-sm:   0.6875rem;  /* 11px */
  --separator-letter-spacing: 0.22em;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Z-index */
  --z-header:  50;
  --z-modal:   100;
  --z-tooltip: 200;
}


/* ─────────────────────────────────────────────
   2. RESET
   ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Fond dégradé page entière — inspiré comparateur-ia */
body.gt-home {
  background-image: linear-gradient(
    to bottom,
    var(--color-bg-gradient-from),
    var(--color-bg-gradient-mid) 40%,
    var(--color-bg-gradient-to)
  );
  background-attachment: fixed;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

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

table {
  border-collapse: collapse;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* ─────────────────────────────────────────────
   3. TYPOGRAPHIE DE BASE
   ───────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--color-text-heading);
}

h1 { font-size: var(--text-4xl); font-weight: var(--fw-extrabold); line-height: var(--lh-tight); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

@media (min-width: 768px) {
  h1 { font-size: var(--text-6xl); }
  h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
}

p {
  line-height: var(--lh-relaxed);
  color: var(--color-text);
}

strong {
  font-weight: var(--fw-semibold);
  color: var(--color-text-heading);
}

/* Contenu WordPress éditeur */
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.entry-content p {
  margin-bottom: 1.25rem;
}

.entry-content ul,
.entry-content ol {
  list-style: revert;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.entry-content ul li,
.entry-content ol li {
  margin-bottom: 0.4rem;
}

.entry-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-gray-600);
  font-style: italic;
}

.entry-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-content a:hover {
  color: var(--color-accent-dark);
}

.entry-content img {
  border-radius: 0.5rem;
  margin: 1.5rem auto;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: var(--text-sm);
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--color-border);
  padding: 0.625rem 0.875rem;
  text-align: left;
}

.entry-content th {
  background: var(--color-bg-alt);
  font-weight: var(--fw-semibold);
  color: var(--color-text-heading);
}


/* ─────────────────────────────────────────────
   4. LAYOUT — UTILITAIRES
   ───────────────────────────────────────────── */

/* Container principal */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Container étroit pour le texte (articles, hero) */
.container-prose {
  width: 100%;
  max-width: var(--max-width-prose);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Section wrapper */
.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

.section-sm {
  padding-top: var(--section-padding-sm);
  padding-bottom: var(--section-padding-sm);
}

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Flex helpers */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }


/* ─────────────────────────────────────────────
   5. SÉPARATEUR DE SECTION
   Pattern signature : ——— TITRE UPPERCASE ———
   Inspiré de comparateur-ia.com
   ───────────────────────────────────────────── */
.section-separator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
}

.section-separator::before,
.section-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--separator-color);
}

.section-separator__label {
  margin: 0 1rem;
  font-size: var(--separator-text-size-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--separator-letter-spacing);
  color: var(--color-gray-500);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .section-separator__label {
    font-size: var(--separator-text-size);
  }
}

/* Version alternative avec un titre visible (H2/H3) */
.section-title-block {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title-block .section-separator {
  margin-bottom: 1rem;
}

.section-title-block h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: var(--fw-bold);
  color: var(--color-text-heading);
  margin-bottom: 0.75rem;
}

.section-title-block p {
  font-size: var(--text-base);
  color: var(--color-gray-600);
  max-width: 600px;
  margin: 0 auto;
}


/* ─────────────────────────────────────────────
   6. BOUTONS
   ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Bouton primaire — orange */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-white);
}

/* Bouton secondaire — outline bleu marine */
.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Bouton pill (arrondi complet) */
.btn-pill {
  border-radius: 9999px;
}

/* Bouton petit */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-xs);
}

/* Focus visible accessible */
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}


/* ─────────────────────────────────────────────
   7. BADGE / PILL
   ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-outline {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(167, 139, 250, 0.4); /* violet clair */
  color: var(--color-primary);
  backdrop-filter: blur(8px);
}

.badge-accent {
  background: rgba(232, 114, 12, 0.1);
  border: 1px solid rgba(232, 114, 12, 0.3);
  color: var(--color-accent);
}

.badge-primary {
  background: rgba(27, 42, 74, 0.08);
  border: 1px solid rgba(27, 42, 74, 0.2);
  color: var(--color-primary);
}


/* ─────────────────────────────────────────────
   8. CARDS — BASE
   ───────────────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--card-radius);
  border: 1px solid var(--color-border-light);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: box-shadow var(--transition-base),
              transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-lg {
  border-radius: var(--card-radius-lg);
  padding: 2rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
}

.card-hover {
  cursor: pointer;
}

.card-hover:hover {
  outline: 1px solid rgba(167, 139, 250, 0.5);
  box-shadow: var(--card-shadow-hover);
}


/* ─────────────────────────────────────────────
   9. FORMULAIRES
   ───────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-heading);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: var(--text-sm);
  font-family: var(--font-family);
  color: var(--color-text-heading);
  background: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(232, 114, 12, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}


/* ─────────────────────────────────────────────
   10. ACCESSIBILITÉ
   ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 0 0 0.5rem 0.5rem;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}


/* ─────────────────────────────────────────────
   11. UTILITAIRES DIVERS
   ───────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rounded     { border-radius: 0.375rem; }
.rounded-lg  { border-radius: 0.5rem; }
.rounded-xl  { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Séparateur horizontal simple */
hr.gt-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Texte gradient accent (pour titres) */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Overlay décoratif blur (blobs) */
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(48px);
  z-index: 0;
}

.blob-violet {
  background: rgba(196, 181, 253, 0.2);
}

.blob-sky {
  background: rgba(186, 230, 253, 0.2);
}

/* Glassmorphisme */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}


/* ─────────────────────────────────────────────
   12. WORDPRESS — ALIGNEMENTS & CAPTIONS
   ───────────────────────────────────────────── */
.alignleft  { float: left; margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem; margin-bottom: 1rem; }
.aligncenter { display: block; margin: 1.5rem auto; text-align: center; }
.alignwide  { width: 100%; }
.alignfull  { width: 100vw; margin-left: calc(50% - 50vw); }

.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  text-align: center;
  margin-top: 0.5rem;
}

/* Pagination */
.wp-pagenavi,
.navigation.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
  font-size: var(--text-sm);
}

.nav-links a,
.nav-links span,
.wp-pagenavi a,
.wp-pagenavi span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.625rem;
  border-radius: 0.375rem;
  border: 1px solid var(--color-border);
  color: var(--color-text-heading);
  font-weight: var(--fw-medium);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-links a:hover,
.wp-pagenavi a:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.nav-links .current,
.wp-pagenavi .current {
  background-color: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}
