/* =========================================
   PatronPerles — Shared Styles
   ========================================= */

:root {
  --bg: #fdf9f4;
  --bg2: #f5ede0;
  --bg3: #efe2d0;
  --card: #fffcf8;
  --accent: #e85d2f;
  --accent-dark: #c94e24;
  --accent2: #f5a623;
  --accent3: #4caf7d;
  --accent3-dark: #3a9668;
  --text: #2a1f14;
  --text2: #6b5744;
  --text3: #9e8470;
  --border: rgba(42,31,20,0.10);
  --border2: rgba(42,31,20,0.20);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 2px 12px rgba(42,31,20,0.08);
  --shadow-lg: 0 8px 32px rgba(42,31,20,0.14);
  --nav-h: 62px;
  --max-w: 1120px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: 'Fredoka', sans-serif; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 500; }
p { color: var(--text2); }

/* ---- Container ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ---- NAVIGATION ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(253,249,244,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 1rem;
}
.nav-logo {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent2);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--text2);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 50px;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--bg2); color: var(--accent); }
.nav-links a.active { background: rgba(232,93,47,0.1); color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.lang-switcher { display: flex; align-items: center; flex-shrink: 0; }
.lang-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 50px;
  padding: 6px 28px 6px 12px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b5744' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  max-width: 140px;
}
.lang-select:hover { border-color: var(--accent); color: var(--accent); }
.lang-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, transform .15s;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all .25s;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0;
  background: var(--bg);
  z-index: 190;
  padding: 1.5rem;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  text-decoration: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 12px 1rem;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.nav-drawer a:hover { background: var(--bg2); }
.nav-drawer .nav-cta {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 1rem;
  padding: 14px;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-right .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
}

/* ---- HERO ---- */
.hero {
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 50px;
  padding: 5px 16px;
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent3);
  flex-shrink: 0;
}
.hero h1 { margin-bottom: 1rem; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-sub {
  font-size: 1.1rem;
  color: var(--text2);
  max-width: 540px;
  margin: 0 auto 2rem;
  font-weight: 300;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.hero-stat strong {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.7rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.hero-stat span { font-size: 0.78rem; color: var(--text3); }

/* ---- SECTION HEADING ---- */
.section { padding: 3.5rem 1.5rem; max-width: var(--max-w); margin: 0 auto; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.section-title { margin-bottom: 0.4rem; }
.section-sub { color: var(--text2); font-size: 0.95rem; margin-bottom: 2rem; }

/* ---- CARDS ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { background: none; border: 1.5px solid var(--border2); color: var(--text2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(232,93,47,0.05); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ---- TOGGLE ---- */
.toggle {
  width: 38px;
  height: 22px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: left .2s;
}
.toggle.on { background: var(--accent3); border-color: var(--accent3); }
.toggle.on::after { left: 18px; }

/* ---- FILTER CHIPS ---- */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filter-chip {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  cursor: pointer;
  background: var(--bg);
  color: var(--text2);
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}
.filter-chip:hover { border-color: var(--accent2); }
.filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,93,47,0.07);
}

/* ---- AD PLACEHOLDERS ---- */
.ad-banner {
  background: var(--bg2);
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  color: var(--text3);
  font-size: 0.72rem;
  display: none; /* hidden by default — enable when AdSense is live */
}
.ad-banner.visible { display: block; }
.ad-728 { max-width: 728px; margin: 1.5rem auto; height: 90px; line-height: 78px; }
.ad-300 { width: 300px; height: 250px; line-height: 238px; margin: 0 auto 1rem; }
.ad-responsive { width: 100%; max-width: 970px; margin: 1.5rem auto; min-height: 90px; }

/* ---- AFFILIATION ---- */
.affil-section {
  padding: 1.75rem 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: none; /* hidden — enable when affiliate program is ready */
}
.affil-section.visible { display: block; }
.affil-inner { max-width: var(--max-w); margin: 0 auto; }
.affil-label { font-size: 0.75rem; color: var(--text3); margin-bottom: 1rem; text-align: center; letter-spacing: .04em; }
.affil-products { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: none; }
.affil-products::-webkit-scrollbar { display: none; }
.affil-product {
  flex-shrink: 0;
  width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.affil-product-img {
  width: 80px; height: 80px;
  background: var(--bg2);
  border-radius: 8px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.affil-product-name { font-size: 0.78rem; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.affil-product-price { font-size: 0.9rem; color: var(--accent); font-weight: 600; }
.affil-product-link {
  display: block;
  margin-top: 8px;
  background: var(--accent2);
  color: #fff;
  border-radius: 50px;
  padding: 6px;
  font-size: 0.73rem;
  text-decoration: none;
  font-weight: 500;
  transition: opacity .15s;
}
.affil-product-link:hover { opacity: 0.85; }

/* ---- BLOG CARDS ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-thumb {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
}
.blog-thumb-comparatif { background: linear-gradient(135deg, #fde8d8, #fcc9a0); }
.blog-thumb-galerie { background: linear-gradient(135deg, #d8f0e8, #a0e0c0); }
.blog-thumb-guide { background: linear-gradient(135deg, #d8e8fd, #a0c0f0); }
.blog-thumb-organisation { background: linear-gradient(135deg, #f8d8fd, #e0a0f0); }
.blog-thumb-tendances { background: linear-gradient(135deg, #fdfdd8, #f0e0a0); }
.blog-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.92);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .02em;
}
.blog-body { padding: 1.25rem; }
.blog-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.08rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.blog-excerpt { font-size: 0.84rem; color: var(--text2); line-height: 1.55; }
.blog-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: var(--text3);
}
.blog-meta span { display: flex; align-items: center; gap: 4px; }

/* ---- ARTICLE LAYOUT ---- */
.article-hero {
  padding: 3rem 1.5rem 2.5rem;
  max-width: 800px;
  margin: 0 auto;
}
.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text3);
  margin-bottom: 1.5rem;
}
.article-breadcrumb a { text-decoration: none; color: var(--text3); transition: color .15s; }
.article-breadcrumb a:hover { color: var(--accent); }
.article-breadcrumb span { color: var(--border2); }
.article-tag {
  display: inline-block;
  background: rgba(232,93,47,0.1);
  color: var(--accent);
  border-radius: 50px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 1rem;
}
.article-hero h1 { margin-bottom: 1rem; }
.article-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text3);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.article-meta span { display: flex; align-items: center; gap: 5px; }

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}
.article-body h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; color: var(--text); }
.article-body h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; color: var(--text); }
.article-body p { margin-bottom: 1rem; font-size: 0.95rem; line-height: 1.75; color: var(--text2); }
.article-body ul, .article-body ol { margin: 0 0 1rem 1.5rem; }
.article-body li { font-size: 0.95rem; color: var(--text2); margin-bottom: 0.4rem; line-height: 1.65; }
.article-body strong { color: var(--text); font-weight: 600; }

.art-highlight {
  background: var(--bg2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.art-highlight p { margin-bottom: 0; font-size: 0.9rem; }

.art-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  margin: 1.25rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.art-table th {
  background: var(--bg2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}
.art-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.art-table tr:last-child td { border-bottom: none; }
.art-table tr:nth-child(even) td { background: rgba(245,237,224,0.4); }

.art-affil {
  display: none; /* hidden — enable with affiliate program */
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text3);
}
.art-affil.visible { display: block; }

/* Article related */
.article-related {
  background: var(--bg2);
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
}
.article-related .container { max-width: 800px; }
.article-related h3 { font-size: 1.3rem; margin-bottom: 1.25rem; }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.55);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.footer-logo {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent2);
}
.footer-desc { font-size: 0.83rem; line-height: 1.65; }
.footer-col h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.footer-col li { font-size: 0.82rem; margin-bottom: 0.45rem; }
.footer-col a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color .15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.footer-bottom a { color: rgba(255,255,255,0.4); text-decoration: none; transition: color .15s; }
.footer-bottom a:hover { color: rgba(255,255,255,0.8); }

/* ---- MODELS GALLERY ---- */
.models-section { background: var(--bg2); padding: 3.5rem 1.5rem; }
.models-inner { max-width: var(--max-w); margin: 0 auto; }
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 1.25rem;
}
.model-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.model-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent2);
}
.model-preview {
  aspect-ratio: 1;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}
.model-preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.model-info { padding: 8px 10px 10px; }
.model-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.model-dims { font-size: 0.7rem; color: var(--text3); margin-top: 2px; }
.model-tag {
  display: inline-block;
  background: var(--bg2);
  border-radius: 50px;
  padding: 2px 8px;
  font-size: 0.65rem;
  color: var(--text3);
  margin-top: 5px;
}
.model-card.loaded .model-preview { font-size: 0; }

/* ---- UTILITY ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-inner > div:first-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  h1 { font-size: 1.9rem; }
  .hero-stats { gap: 1.5rem; }
  .blog-grid { grid-template-columns: 1fr; }
}

/* ---- PRINT ---- */
@media print {
  .site-nav, .site-footer, .affil-section, .models-section,
  .ad-banner, .tool-panel, .result-actions, .filter-row,
  .blog-section { display: none !important; }
  body { background: #fff; }
  .result-canvas-wrap { padding: 0; }
}
