
/* ============================================
   Catalogue 3D — style sombre noir/rouge
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0a0a0d;
  --bg-secondary: #14141a;
  --bg-card: #1a1a22;
  --bg-elevated: #22222c;
  --border: #2a2a35;
  --border-hover: #c41e3a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0aa;
  --text-muted: #6a6a75;
  --accent: #e11d3a;
  --accent-hover: #ff2d4a;
  --accent-glow: rgba(225, 29, 58, 0.25);
}

html, body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* === Header === */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(20, 20, 26, 0.95);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 17px;
}
.site-logo:hover { color: var(--text-primary); }

.logo-mark {
  background: var(--accent);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.site-header nav a {
  color: var(--text-secondary);
  font-size: 14px;
  margin-left: 24px;
}
.site-header nav a:hover { color: var(--text-primary); }

/* === Hero === */
.hero {
  text-align: center;
  padding: 48px 0 40px;
}
.hero h1 {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #c41e3a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto 32px;
}

/* === Search === */
.search-bar {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.search-bar.inline { margin: 16px 0 0; max-width: 100%; }

.search-bar input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
}
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-bar input::placeholder { color: var(--text-muted); }

#search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 10;
}
#search-results.active { display: block; }
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-elevated); }
.search-result img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.search-result-info { flex: 1; }
.search-result-info strong { display: block; font-size: 14px; }
.search-result-info span { font-size: 12px; color: var(--text-muted); }

/* === Themes grid === */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.theme-card {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.25s;
  color: var(--text-primary);
}
.theme-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px var(--accent-glow);
  color: var(--text-primary);
}

.theme-cover {
  aspect-ratio: 16/10;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elevated);
  position: relative;
}

.theme-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}
.theme-overlay h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}
.theme-overlay p {
  color: var(--text-secondary);
  font-size: 13px;
}

/* === Breadcrumb === */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-primary); }

/* === Theme page === */
.theme-header {
  margin-bottom: 32px;
}
.theme-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}
.theme-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  color: var(--text-primary);
  transition: all 0.2s;
}
.model-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--accent-glow);
}
.model-card.hidden { display: none; }

.model-thumb {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elevated);
  position: relative;
}
.badge-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.75);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
}

.model-title {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Model page === */
.model-page {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .model-page { grid-template-columns: 1fr; }
}

.gallery-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
}
.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-secondary);
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-img.main { opacity: 1; }

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.thumb-btn {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  padding: 0;
  transition: border-color 0.2s;
}
.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-btn.active { border-color: var(--accent); }
.thumb-btn:hover { border-color: var(--accent-hover); }

.model-info h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}
.model-theme {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 4px;
}
.model-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}
.mw-link {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
}
.mw-link:hover {
  color: var(--accent);
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.contact-card h2 {
  font-size: 18px;
  margin-bottom: 8px;
}
.contact-card > p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  margin-bottom: 14px;
}
.contact-form label span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}
.contact-form textarea { resize: vertical; }

.contact-form button {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}
.contact-form button:hover { background: var(--accent-hover); }

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* === Responsive === */
@media (max-width: 600px) {
  main { padding: 20px 16px 60px; }
  .hero h1 { font-size: 28px; }
  .themes-grid { grid-template-columns: 1fr; }
  .models-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .model-title { font-size: 12px; padding: 10px; }
  .site-header { padding: 12px 16px; }
}
