/* ============================================================
   stop-bruxisme.ch — Feuille de style principale
   ============================================================ */

/* 1. Variables
   ------------------------------------------------------------ */
:root {
  /* Couleurs */
  --c-primary:       #1A7FA0;
  --c-primary-dark:  #0D5F7D;
  --c-accent:        #40B8D0;
  --c-heading:       #1C3144;
  --c-text:          #374151;
  --c-text-muted:    #6B7280;
  --c-bg:            #FFFFFF;
  --c-bg-soft:       #F0F8FB;
  --c-border:        #DDE9EF;
  --c-strong:        #0D5F7D;

  /* Typographie */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Source Sans 3', system-ui, -apple-system, sans-serif;

  /* Échelle typographique */
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;

  /* Layout */
  --content-width:   740px;
  --content-pad:     1.25rem;

  /* Progress bar */
  --progress-h:      3px;

  /* Effets */
  --radius:          8px;
  --transition:      0.2s ease;
  --shadow-sm:       0 1px 8px rgba(26, 127, 160, 0.07);
}


/* 2. Reset & base
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--transition);
}

a:hover {
  color: var(--c-primary-dark);
}


/* 3. Barre de progression de lecture
   ------------------------------------------------------------ */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: var(--progress-h);
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-accent) 100%);
  z-index: 1000;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
  will-change: width;
}


/* 4. Header
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.875rem var(--content-pad);
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-logo {
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  transition: opacity var(--transition);
}

.site-logo:hover {
  opacity: 0.8;
  color: inherit;
}

.logo-stop {
  color: var(--c-primary);
  font-weight: 700;
}

.logo-sep {
  color: var(--c-text-muted);
  font-weight: 400;
}

.logo-bruxisme {
  color: var(--c-heading);
  font-weight: 600;
}

.logo-tld {
  color: var(--c-text-muted);
  font-weight: 400;
  font-size: 0.82em;
  letter-spacing: 0;
}


/* 5. Main & article
   ------------------------------------------------------------ */
.site-main {
  padding: 2.5rem 0 5rem;
}

.article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}


/* Indicateur de temps de lecture */
.reading-time-wrapper {
  margin-bottom: 2rem;
}

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  font-family: var(--font-body);
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
}

.reading-time::before {
  content: "⏱";
  font-size: 0.8em;
}


/* 6. Contenu de l'article
   ------------------------------------------------------------ */

/* H1 */
.article-content h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--c-heading);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

/* H2 */
.article-content h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--c-heading);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  position: relative;
}

.article-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-border) 40%, transparent 100%);
}

/* H3 */
.article-content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--c-heading);
  line-height: 1.35;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* Paragraphes */
.article-content p {
  margin-bottom: 1.1rem;
}

/* Gras & italique */
.article-content strong {
  font-weight: 600;
  color: var(--c-strong);
}

.article-content em {
  font-style: italic;
}

/* Listes */
.article-content ul,
.article-content ol {
  margin: 1rem 0 1.25rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.4rem;
}

.article-content ul li::marker {
  color: var(--c-accent);
}

.article-content ol li::marker {
  color: var(--c-primary);
  font-weight: 600;
}

/* Liens dans l'article */
.article-content a {
  font-weight: 500;
}

/* Citation */
.article-content blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--c-bg-soft);
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--c-heading);
  line-height: 1.6;
}

.article-content blockquote p {
  margin-bottom: 0;
}

/* Images */
.article-content img {
  border-radius: var(--radius);
  margin: 2rem 0;
  width: 100%;
  box-shadow: 0 2px 12px rgba(28, 49, 68, 0.08);
}

/* Placeholder images (workflow @media) */
.article-content img[src="placeholder.jpg"] {
  background: var(--c-bg-soft);
  border: 2px dashed var(--c-border);
  min-height: 220px;
  object-fit: cover;
}

/* Encart "Pour aller plus loin" (liens sœurs) */
.article-content h2:last-of-type + p a,
.article-content p:last-of-type a {
  /* liens de maillage — pas de style spécifique,
     le style de lien par défaut est suffisant */
}

/* Séparateur */
.article-content hr {
  border: none;
  height: 1px;
  background: var(--c-border);
  margin: 2.5rem 0;
}


/* 7. Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-bg-soft);
  padding: 2rem var(--content-pad);
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.footer-copy {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  text-decoration-thickness: 1px;
}

.footer-links a:hover {
  color: var(--c-primary);
}


/* 8. Responsive — tablette & desktop
   ------------------------------------------------------------ */
@media (min-width: 600px) {
  :root {
    --content-pad: 2rem;
  }
}

@media (min-width: 768px) {
  .article-content h1 {
    font-size: var(--text-4xl);
  }

  .article-content h2 {
    font-size: var(--text-3xl);
  }

  .article-content p {
    font-size: var(--text-lg);
  }

  .article-content li {
    font-size: var(--text-lg);
  }

  .site-logo {
    font-size: var(--text-2xl);
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}


/* 9. Accessibilité
   ------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #progress-bar {
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
