/* ============================================
   GLOBAL.CSS - Avec Ceux-Ci - Blog Cuisine
   Version 5.1 - 2026
   Variables, reset, typographie, utilitaires
   PAS de styles header/footer/nav/hamburger ici
============================================ */

/* ---- VARIABLES CSS ---- */
:root {
  --color-brand:       #78350f;
  --color-accent:      #fbbf24;
  --color-danger:      #dc2626;
  --color-brand-dark:  #5c2d0e;
  --color-brand-mid:   #92400e;
  --color-bg:          #fff;
  --color-bg-soft:     #fffbeb;
  --color-bg-pale:     #fef3c7;
  --color-text:        #1c0a00;
  --color-text-mid:    #5c3d1e;
  --color-text-light:  #92400e;
  --color-text-muted:  #a07a50;
  --color-border:      #fde68a;
  --color-border-mid:  #f0e0c8;
  --font-system:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --radius-sm:         6px;
  --radius-md:         10px;
  --radius-lg:         16px;
  --shadow-sm:         0 2px 8px rgba(120, 53, 15, 0.08);
  --shadow-md:         0 8px 24px rgba(120, 53, 15, 0.12);
  --shadow-lg:         0 16px 48px rgba(120, 53, 15, 0.16);
  --max-width:         1200px;
  --gutter:            24px;
}

/* ---- RESET ET BASE ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-system);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img,
video,
iframe,
embed,
object,
canvas,
svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

img {
  display: block;
}

a {
  color: var(--color-brand);
  transition: color 0.2s ease;
}

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

p {
  margin: 0 0 1em;
  line-height: 1.7;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

button {
  font-family: var(--font-system);
}

input,
textarea,
select {
  font-family: var(--font-system);
}

/* ---- TABLES RESPONSIVE ---- */
table {
  max-width: 100%;
  width: 100%;
  border-collapse: collapse;
}

.table-responsive,
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* ---- CONTENEUR ---- */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  width: 100%;
}

/* ---- TYPOGRAPHIE GLOBALE ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-system);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-brand);
  margin: 0 0 0.75em;
}

/* Sur fond sombre, les titres doivent être blancs */
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: #fff;
}

/* ---- LIENS ---- */
a:hover {
  color: var(--color-danger);
}

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

/* ---- LISTES UTILITAIRES ---- */
.list-clean {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---- UTILITAIRES 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: 0;
}

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ---- CLASSES UTILITAIRES ---- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }

.w-full  { width: 100%; }
.h-auto  { height: auto; }

.flex         { display: flex; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* ---- ANIMATIONS CSS GLOBALES ---- */
@keyframes slide-up {
  from {
    transform: translateY(20px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes pulse-border {
  0%   { border-color: var(--color-accent); }
  50%  { border-color: var(--color-brand); }
  100% { border-color: var(--color-accent); }
}

/* ---- TRANSITIONS GLOBALES ---- */
a,
button {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* ---- TEXTE LONG ---- */
.prose,
article,
.article-content {
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

pre,
code {
  overflow-x: auto;
  max-width: 100%;
  font-family: 'Courier New', Courier, monospace;
}

/* ---- SCROLLBAR CUSTOM (Webkit) ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background-color: var(--color-bg-soft);
}
::-webkit-scrollbar-thumb {
  background-color: var(--color-accent);
  border-radius: 3px;
}

/* ---- RESPONSIVE ANTI-OVERFLOW GLOBAL ---- */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid,
  [class*='grid'] {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}