/* ============================================================
   Rouge Bleu - Unified Stylesheet
   Chauffage & Sanitaire
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;900&display=swap');

/* ============================================================
   1. CSS Custom Properties
   ============================================================ */
:root {
  --bg-color: #ffffff;
  --text-color: #171717;
  --text-muted: #4a4a4a;
  --primary-color: #D32F2F;
  --primary-hover: #b71c1c;
  --secondary-color: #1976D2;
  --secondary-hover: #1565c0;
  --surface-color: #f9f9f9;
  --border-color: #e5e5e5;
  --font-main: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --radius-bento: 24px;
  --radius-inner: 16px;
  --radius-btn: 8px;
  --transition-speed: 0.3s;
  --shadow-bento: 0 4px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.1);
}

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

/* ============================================================
   3. Body & Grain Texture
   ============================================================ */
body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Full-page grain texture overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Element-level grain texture class */
.bg-grain {
  position: relative;
}

.bg-grain::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Subtle craftsmanship grain for nav / sections */
.bg-texture::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   4. Typography
   ============================================================ */
.font-outfit {
  font-family: 'Outfit', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-color);
  letter-spacing: -0.02em;
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover, a:focus {
  color: var(--primary-color);
}

/* ============================================================
   5. Layout Utilities
   ============================================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

.section {
  padding: 4rem 0;
}

/* ============================================================
   6. Header & Navigation
   ============================================================ */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-logo .rouge { color: var(--primary-color); }
.brand-logo .bleu { color: var(--secondary-color); }

/* --- Nav Styles --- */
nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

nav a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 0.25rem;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--secondary-color);
  transition: width var(--transition-speed) ease;
}

nav a:hover::after, nav a:focus::after {
  width: 100%;
}

nav a.active::after {
  width: 100%;
  background-color: var(--primary-color);
}

/* ============================================================
   7. Hero Section
   ============================================================ */
.hero {
  text-align: center;
  padding: 6rem 2rem;
  background: linear-gradient(145deg, rgba(211,47,47,0.03) 0%, rgba(25,118,210,0.03) 100%);
  border-radius: var(--radius-bento);
  margin: 2rem auto;
  border: 1px solid var(--border-color);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-inline: auto;
}

.hero p {
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto 2.5rem auto;
}

/* ============================================================
   8. Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: none;
  font-size: 1rem;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(211, 47, 47, 0.25);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: #ffffff;
}

.btn-secondary:hover, .btn-secondary:focus {
  background-color: var(--secondary-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(25, 118, 210, 0.25);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--text-color);
  color: var(--text-color);
}

.btn-outline:hover, .btn-outline:focus {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ============================================================
   9. Bento Grid System
   ============================================================ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 1.5rem;
}

.bento-item {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-bento);
  padding: 2.5rem;
  box-shadow: var(--shadow-bento);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.bento-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(25, 118, 210, 0.3);
}

.bento-item.accent-rouge:hover {
  border-color: rgba(211, 47, 47, 0.3);
}

/* Bento Sizing Classes */
.bento-col-4 { grid-column: span 12; }
.bento-col-6 { grid-column: span 12; }
.bento-col-8 { grid-column: span 12; }
.bento-col-12 { grid-column: span 12; }
.bento-row-2 { grid-row: span 1; }

@media (min-width: 768px) {
  .bento-col-4 { grid-column: span 6; }
  .bento-col-6 { grid-column: span 6; }
  .bento-col-8 { grid-column: span 8; }
}

@media (min-width: 1024px) {
  .bento-col-4 { grid-column: span 4; }
  .bento-row-2 { grid-row: span 2; }
}

/* Media & Images inside Bento */
.bento-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

.bento-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bento-item.has-bg .bento-content {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 2rem;
  border-radius: var(--radius-inner);
  margin: auto 0 0 0;
  flex-grow: 0;
}

/* ============================================================
   10. Iconography & Badges
   ============================================================ */
.icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.icon-wrapper.bleu {
  background-color: rgba(25, 118, 210, 0.1);
  color: var(--secondary-color);
}

.icon-wrapper.rouge {
  background-color: rgba(211, 47, 47, 0.1);
  color: var(--primary-color);
}

.icon-wrapper svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
}

.badge.bleu {
  color: var(--secondary-color);
  border-color: rgba(25, 118, 210, 0.2);
  background-color: rgba(25, 118, 210, 0.05);
}

.badge.rouge {
  color: var(--primary-color);
  border-color: rgba(211, 47, 47, 0.2);
  background-color: rgba(211, 47, 47, 0.05);
}

/* ============================================================
   11. Footer Styles
   ============================================================ */
footer {
  background-color: var(--surface-color);
  padding: 4rem 2rem 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
}

.footer-col h4 {
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  color: var(--text-muted);
}

.footer-col a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================================
   12. Artisan Card Styles (Local Pages)
   ============================================================ */
.artisan-card {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-bento);
  overflow: hidden;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
}

.artisan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.artisan-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.artisan-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.artisan-info h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.artisan-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.artisan-info .stars {
  display: flex;
  gap: 2px;
  color: #FBBF24;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.artisan-info .stars .empty {
  color: var(--border-color);
}

/* ============================================================
   13. Scroll Reveal Animation
   ============================================================ */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   14. Custom Scrollbar
   ============================================================ */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ============================================================
   15. Highlight & Accent Utilities
   ============================================================ */
.text-highlight-rouge { color: var(--primary-color); }
.text-highlight-bleu { color: var(--secondary-color); }
