/**
 * BienHabillé — Typography CSS
 * Corps de texte, titres, liens, listes, entry content
 *
 * @package BienHabille
 */

/* ============================================================
   BASE
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--bh-font);
  font-size: var(--bh-text-base);
  font-weight: 400;
  color: var(--bh-black);
  background: var(--bh-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TITRES
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--bh-font);
  font-weight: 700;
  color: var(--bh-black);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--bh-space-4);
}

h1 { font-size: var(--bh-text-3xl); }
h2 { font-size: var(--bh-text-2xl); }
h3 { font-size: var(--bh-text-xl); }
h4 { font-size: var(--bh-text-lg); }
h5 { font-size: var(--bh-text-md); }
h6 { font-size: var(--bh-text-base); }

/* ============================================================
   CORPS DE TEXTE
   ============================================================ */

p {
  margin: 0 0 var(--bh-space-4);
  line-height: 1.65;
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: 700;
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--bh-text-xs);
}

/* ============================================================
   LIENS
   ============================================================ */

a {
  color: var(--bh-black);
  text-decoration: none;
  transition: color var(--bh-transition);
}

a:hover {
  color: var(--bh-gray-text);
}

a:focus-visible {
  outline: 2px solid var(--bh-black);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   LISTES
   ============================================================ */

ul, ol {
  margin: 0 0 var(--bh-space-4);
  padding-left: var(--bh-space-6);
}

li {
  margin-bottom: var(--bh-space-2);
  line-height: 1.6;
}

/* ============================================================
   ENTRY CONTENT — Pages / Articles
   ============================================================ */

.bh-entry-content {
  max-width: 720px;
  margin: 0 auto;
}

.bh-entry-content h2 {
  margin-top: var(--bh-space-10);
  margin-bottom: var(--bh-space-4);
  font-size: var(--bh-text-xl);
}

.bh-entry-content h3 {
  margin-top: var(--bh-space-8);
  margin-bottom: var(--bh-space-3);
  font-size: var(--bh-text-lg);
}

.bh-entry-content p {
  font-size: var(--bh-text-base);
  line-height: 1.7;
  color: var(--bh-black);
}

.bh-entry-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bh-entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--bh-radius-md);
  margin: var(--bh-space-6) 0;
}

.bh-entry-content blockquote {
  border-left: 3px solid var(--bh-black);
  padding: var(--bh-space-4) var(--bh-space-6);
  margin: var(--bh-space-6) 0;
  background: var(--bh-beige-light);
  border-radius: 0 var(--bh-radius-md) var(--bh-radius-md) 0;
}

.bh-entry-content blockquote p {
  font-size: var(--bh-text-md);
  font-style: italic;
  font-weight: 500;
  margin: 0;
}

.bh-entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--bh-space-6) 0;
  font-size: var(--bh-text-sm);
}

.bh-entry-content th,
.bh-entry-content td {
  padding: var(--bh-space-3) var(--bh-space-4);
  border: 1px solid var(--bh-gray-mid);
  text-align: left;
}

.bh-entry-content th {
  background: var(--bh-beige-light);
  font-weight: 700;
}

/* ============================================================
   UTILITAIRES TEXTE
   ============================================================ */

.bh-text-xs     { font-size: var(--bh-text-xs); }
.bh-text-sm     { font-size: var(--bh-text-sm); }
.bh-text-base   { font-size: var(--bh-text-base); }
.bh-text-md     { font-size: var(--bh-text-md); }
.bh-text-lg     { font-size: var(--bh-text-lg); }
.bh-text-center { text-align: center; }
.bh-text-right  { text-align: right; }
.bh-text-bold   { font-weight: 700; }
.bh-text-muted  { color: var(--bh-gray-text); }
.bh-text-red    { color: var(--bh-red); }
.bh-text-green  { color: var(--bh-green); }

/* ============================================================
   FORMULAIRES
   ============================================================ */

input,
textarea,
select {
  font-family: var(--bh-font);
  font-size: var(--bh-text-sm);
  color: var(--bh-black);
}

.bh-input {
  width: 100%;
  height: 48px;
  background: var(--bh-gray-light);
  border: 1px solid transparent;
  border-radius: var(--bh-radius-md);
  padding: 0 var(--bh-space-4);
  font-family: var(--bh-font);
  font-size: var(--bh-text-sm);
  color: var(--bh-black);
  outline: none;
  transition: border-color var(--bh-transition), background var(--bh-transition);
}

.bh-input:focus {
  border-color: var(--bh-black);
  background: var(--bh-white);
}

.bh-input::placeholder {
  color: var(--bh-gray-text);
}

.bh-label {
  display: block;
  font-size: var(--bh-text-sm);
  font-weight: 600;
  color: var(--bh-black);
  margin-bottom: var(--bh-space-2);
}

.bh-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--bh-space-2);
  margin-bottom: var(--bh-space-4);
}

.bh-field-error {
  font-size: var(--bh-text-xs);
  color: var(--bh-red);
  margin-top: var(--bh-space-1);
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bh-skip-link {
  position: absolute;
  top: -100px;
  left: var(--bh-space-4);
  z-index: 9999;
  padding: var(--bh-space-3) var(--bh-space-5);
  background: var(--bh-black);
  color: var(--bh-white);
  font-size: var(--bh-text-sm);
  font-weight: 700;
  border-radius: var(--bh-radius-md);
  transition: top var(--bh-transition);
}

.bh-skip-link:focus {
  top: var(--bh-space-4);
  color: var(--bh-white);
}

/* ============================================================
   SPINNERS / LOADERS
   ============================================================ */

.bh-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--bh-gray-mid);
  border-top-color: var(--bh-black);
  border-radius: 50%;
  animation: bh-spin 0.6s linear infinite;
  flex-shrink: 0;
}

.bh-spinner--white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: var(--bh-white);
}

@keyframes bh-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   404 PAGE
   ============================================================ */

.bh-404 {
  padding: var(--bh-space-20) var(--bh-space-8);
}

.bh-404__inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.bh-404__number {
  font-size: clamp(80px, 15vw, 160px);
  font-weight: 700;
  color: var(--bh-beige-dark);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 0;
}

.bh-404__title {
  font-size: var(--bh-text-2xl);
  font-weight: 700;
  color: var(--bh-black);
  margin-bottom: var(--bh-space-4);
}

.bh-404__desc {
  font-size: var(--bh-text-base);
  color: var(--bh-gray-text);
  margin-bottom: var(--bh-space-8);
}

.bh-404__btn {
  display: inline-flex;
  width: auto;
  padding: var(--bh-space-4) var(--bh-space-8);
  margin-bottom: var(--bh-space-12);
}

.bh-404__products-title {
  font-size: var(--bh-text-xl);
  font-weight: 700;
  color: var(--bh-black);
  margin-bottom: var(--bh-space-6);
  text-align: left;
}

/* ============================================================
   CONTENEUR GLOBAL
   ============================================================ */

.bh-container {
  max-width: var(--bh-container);
  margin: 0 auto;
  padding: 0 var(--bh-space-8);
}

@media (max-width: 767px) {
  .bh-container {
    padding: 0 var(--bh-space-4);
  }
}