/*
 * Charte Hikube pour ideas.hikube.cloud (Fider).
 * Source de vérité : ce fichier, appliqué depuis l'admin de Fider (fider/README.md).
 * Référence visuelle : hikube-web.hidora, la nouvelle version du site : fond brun
 * très sombre, grille de 96px et lueur verte, Archivo pour le texte, IBM Plex Mono
 * pour les étiquettes et les chiffres, vert #38ba6a, angles de 2px.
 *
 * Fider colore son interface par variables sur body[data-theme="light|dark"] et par
 * des utilitaires aux valeurs figées par thème. Les deux thèmes reçoivent ici la même
 * palette, et le sélecteur de thème est masqué.
 */

/* Polices servies par ideas.hikube.cloud même (/fonts/hikube/, routé vers la
   roadmap) : la CSP de Fider n'accepte que font-src 'self' data:. */
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/hikube/Archivo-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/hikube/IBMPlexMono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/hikube/IBMPlexMono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

body[data-theme="light"],
body[data-theme="dark"] {
  color-scheme: dark;

  /* Variables de Fider : « white » = surfaces, « gray-50 » = fond, « gray-900 » = texte.
     Valeurs reprises des jetons de hikube-web (--base, --panel, --line, --ink…). */
  --colors-white: #1f1a16;
  --colors-black: #f7f4f0;
  --colors-gray-50: #16120f;
  --colors-gray-100: #1f1a16;
  --colors-gray-200: #2a231d;
  --colors-gray-300: #362e28;
  --colors-gray-400: #4a4038;
  --colors-gray-500: #6b6158;
  --colors-gray-600: #8a7f76;
  --colors-gray-700: #a99e95;
  --colors-gray-800: #dcd7d1;
  --colors-gray-900: #f7f4f0;

  --primary-color: #38ba6a;
  --primary-color-light: #46c476;
  --primary-color-dark: #28904e;

  --colors-blue-50: #11263a;
  --colors-blue-100: #11263a;
  --colors-blue-200: #001a33;
  --colors-blue-300: #00306a;
  --colors-blue-400: #0440a3;
  --colors-blue-500: #124edb;
  --colors-blue-600: #3669ff;
  --colors-blue-700: #7091ff;
  --colors-blue-800: #b0c1ff;
  --colors-blue-900: #e0e4ff;
  --colors-green-50: #10281a;
  --colors-green-100: #10281a;
  --colors-green-200: #14532d;
  --colors-green-300: #1e6b3c;
  --colors-green-400: #28904e;
  --colors-green-500: #38ba6a;
  --colors-green-600: #46c476;
  --colors-green-700: #86efac;
  --colors-green-800: #bbf7d0;
  --colors-green-900: #dcfce7;
  --colors-yellow-50: #2b1d0c;
  --colors-yellow-100: #2b1d0c;
  --colors-yellow-200: #5a3a13;
  --colors-yellow-300: #7a4f19;
  --colors-yellow-400: #a86e24;
  --colors-yellow-500: #d08a2c;
  --colors-yellow-600: #e0a04c;
  --colors-yellow-700: #ebb872;
  --colors-yellow-800: #f3d3a4;
  --colors-yellow-900: #fae9cf;
  --colors-red-50: #2e1712;
  --colors-red-100: #2e1712;
  --colors-red-200: #5c2a21;
  --colors-red-300: #7e3a2d;
  --colors-red-400: #a64d3c;
  --colors-red-500: #c8665a;
  --colors-red-600: #d9807a;
  --colors-red-700: #e8a19b;
  --colors-red-800: #f2c6c1;
  --colors-red-900: #f9e3e0;

  /* Fond : la grille de 96px et la lueur verte du héros de hikube-web. */
  background-color: #16120f !important;
  background-image:
    radial-gradient(90% 55% at 88% 0%, rgba(56, 186, 106, 0.14), transparent 68%),
    linear-gradient(to right, rgba(54, 46, 40, 0.45) 1px, transparent 1px),
    linear-gradient(rgba(54, 46, 40, 0.45) 1px, transparent 1px) !important;
  background-size: 100% 900px, 96px 96px, 96px 96px !important;
  background-repeat: no-repeat, repeat, repeat !important;
  color: #f7f4f0;
  caret-color: #38ba6a;
  scrollbar-color: #362e28 #16120f;
}

body,
input,
button,
textarea,
select {
  font-family: 'Archivo', system-ui, sans-serif !important;
}

/* Les conteneurs de page laissent voir le fond. */
.page,
#p-home,
.p-show-post {
  background: transparent !important;
}

/* Surfaces du navigateur */
::selection {
  background: #38ba6a;
  color: #000;
}
:focus-visible {
  outline: 2px solid #38ba6a !important;
  outline-offset: 2px;
}
a {
  color: #38ba6a;
  text-underline-offset: 3px;
}
a:hover {
  color: #46c476;
}
::placeholder {
  color: #8a7f76 !important;
}

/* Un seul thème, pas de mention « powered by ». */
.c-themeswitcher,
.c-powered,
.p-show-post__powered-by-mobile {
  display: none !important;
}

/* ---------------------------------------------------------------- En-tête */
#c-header {
  background-color: rgba(22, 18, 15, 0.9) !important;
  border-bottom: 1px solid #362e28;
  backdrop-filter: blur(8px);
}
.c-header__container,
.c-header__row {
  background: transparent !important;
}
.c-header__brand h1,
.c-header__brand .text-header {
  font-weight: 600 !important;
  font-size: 1.25rem !important;
  letter-spacing: -0.01em;
  color: #f7f4f0 !important;
}
#c-header .c-header__nav-link {
  font-size: 0.94rem;
  font-weight: 400;
  color: rgba(247, 244, 240, 0.85) !important;
}
#c-header .c-header__nav-link:hover {
  color: #f7f4f0 !important;
}
#c-header .c-header__nav-link--active {
  color: #f7f4f0 !important;
  box-shadow: 0 2px 0 0 #38ba6a;
}

/* ------------------------------------------------------- Accueil : accroche */
.p-home__welcome-col {
  position: sticky;
  top: 2.5rem;
  align-self: start;
}
.p-home__welcome-body::before {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  margin-bottom: 1.75rem;
  background: #38ba6a;
}
.p-home__welcome-body p:first-child {
  font-size: clamp(2rem, 3.1vw, 3.25rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #f7f4f0;
  text-wrap: balance;
  margin-bottom: 1.5rem;
}
.p-home__welcome-body p + p {
  font-size: 1.06rem;
  line-height: 1.6;
  color: #a99e95;
  max-width: 34ch;
}

/* Proposer une idée */
.p-home__add-idea-btn {
  width: 100%;
  background: #1f1a16 !important;
  border: 1px solid #362e28 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  padding: 1.35rem 1.5rem !important;
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
}
.p-home__add-idea-btn:hover {
  border-color: #38ba6a !important;
  background: #2a231d !important;
}
.p-home__add-idea-btn span {
  font-size: 1.06rem;
  color: #a99e95;
}
.p-home__add-idea-btn svg {
  color: #38ba6a !important;
}

/* Filtres, tri : étiquettes en mono, comme sur hikube-web. */
.c-post-filter-btn,
.c-post-sort-btn {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-size: 0.73rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247, 244, 240, 0.85) !important;
  background: transparent !important;
  border: 1px solid #362e28 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}
.c-post-filter-btn:hover,
.c-post-sort-btn:hover {
  border-color: #38ba6a !important;
  color: #38ba6a !important;
}

/* --------------------------------------------------------- Liste des idées */
.c-posts-container__list {
  gap: 0 !important;
  border-top: 1px solid #362e28;
}
.c-posts-container__post {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #362e28 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1.75rem 0.75rem !important;
  transition: background-color 0.2s ease-out;
}
.c-posts-container__post-link:hover .c-posts-container__post {
  background: linear-gradient(90deg, rgba(56, 186, 106, 0.07), transparent 65%) !important;
}
.c-posts-container__post-title {
  font-size: 1.3rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: #f7f4f0 !important;
  transition: color 0.2s ease-out;
}
.c-posts-container__post-link:hover .c-posts-container__post-title {
  color: #38ba6a !important;
}
.c-posts-container__postdescription {
  font-size: 0.97rem;
  line-height: 1.55;
  color: #a99e95 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.c-posts-container__post-votes .text-2xl {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-weight: 500 !important;
  font-size: 1.5rem !important;
  font-variant-numeric: tabular-nums;
  color: #38ba6a !important;
}
.c-posts-container__post-votes span:not(.text-2xl),
.c-posts-container__post-comments {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-size: 0.73rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a99e95 !important;
}

/* Pastilles de statut : mono, angles de 2px, couleurs de hikube-web. Préfixées
   par body[data-theme] pour passer devant les utilitaires .bg-blue-100 & co. */
body[data-theme] div:has(> [class*="c-status-col--"]) {
  border-radius: 2px !important;
  padding: 0.2rem 0.6rem !important;
  border-width: 1px !important;
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
[class*="c-status-col--"] {
  font-size: 0.7rem !important;
  font-weight: 500;
  color: inherit !important;
}
body[data-theme] div:has(> .c-status-col--started) {
  background: rgba(208, 138, 44, 0.08) !important;
  border-color: rgba(208, 138, 44, 0.5) !important;
  color: #d08a2c !important;
}
body[data-theme] div:has(> .c-status-col--open) {
  background: transparent !important;
  border-color: #4a4038 !important;
  color: #a99e95 !important;
}
body[data-theme] div:has(> .c-status-col--planned) {
  background: #2a231d !important;
  border-color: #4a4038 !important;
  color: rgba(247, 244, 240, 0.85) !important;
}
body[data-theme] div:has(> .c-status-col--completed) {
  background: rgba(56, 186, 106, 0.08) !important;
  border-color: rgba(56, 186, 106, 0.5) !important;
  color: #38ba6a !important;
}
body[data-theme] div:has(> .c-status-col--declined) {
  background: rgba(200, 102, 90, 0.08) !important;
  border-color: rgba(200, 102, 90, 0.5) !important;
  color: #d9807a !important;
}
body[data-theme] div:has(> .c-status-col--duplicate) {
  background: transparent !important;
  border-color: #362e28 !important;
  color: #a99e95 !important;
}

/* ------------------------------------------------------------ Page d'une idée */
.p-show-post__post-card,
.c-votes-panel,
.c-comment-input-card,
.c-response-details__card,
.card {
  background: #1f1a16 !important;
  border: 1px solid #362e28 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}
.p-show-post__title {
  font-size: clamp(2rem, 3vw, 2.75rem) !important;
  font-weight: 600 !important;
  line-height: 1.05 !important;
  letter-spacing: -0.02em;
  color: #f7f4f0 !important;
  text-wrap: balance;
}
.p-show-post__description,
.c-markdown {
  color: #dcd7d1;
  line-height: 1.6;
}
.c-votes-panel__count-badge,
.p-show-post__discussion-count {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-variant-numeric: tabular-nums;
  background: #2a231d !important;
  color: #f7f4f0 !important;
  border-radius: 2px !important;
}
.p-show-post__vote-section .text-2xl {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-weight: 500 !important;
  font-variant-numeric: tabular-nums;
  color: #38ba6a !important;
}
.p-show-post__vote-section .text-lg {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a99e95 !important;
}
/* Fider sépare les actions par une barre bleue de 5px : un filet suffit. */
.p-show-post__actions {
  border-top: 1px solid #362e28 !important;
}
.c-action-button {
  border: 1px solid #362e28 !important;
  border-radius: 2px !important;
  background: transparent !important;
  color: #a99e95 !important;
}
.c-action-button:hover {
  border-color: rgba(247, 244, 240, 0.35) !important;
  color: #f7f4f0 !important;
}
.c-action-button--danger:hover {
  border-color: rgba(200, 102, 90, 0.6) !important;
  color: #d9807a !important;
}

/* ------------------------------------------------------------------ Boutons */
.c-button {
  border-radius: 2px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  box-shadow: none !important;
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out;
}
.c-button--primary {
  background-color: #38ba6a !important;
  border: 1px solid #38ba6a !important;
  color: #000000 !important;
}
.c-button--primary:hover {
  background-color: #46c476 !important;
  border-color: #46c476 !important;
}
.c-button--secondary,
.c-button--tertiary {
  background-color: transparent !important;
  border: 1px solid rgba(247, 244, 240, 0.35) !important;
  color: #f7f4f0 !important;
}
.c-button--secondary:hover,
.c-button--tertiary:hover {
  border-color: #f7f4f0 !important;
}

/* Vote : contour au repos, vert plein une fois voté. */
.p-show-post__vote-section .c-button--primary:not(:has(svg[fill="currentColor"])) {
  background-color: transparent !important;
  border: 1px solid rgba(247, 244, 240, 0.35) !important;
  color: #f7f4f0 !important;
}
.p-show-post__vote-section .c-button--primary:not(:has(svg[fill="currentColor"])):hover {
  border-color: #38ba6a !important;
  color: #38ba6a !important;
}
.p-show-post__vote-section .c-button--primary:has(svg[fill="currentColor"]) {
  background-color: #38ba6a !important;
  border-color: #38ba6a !important;
  color: #000000 !important;
}

/* ------------------------------------------------------------------- Champs */
.c-input,
input[type="text"],
input[type="email"],
textarea,
select {
  background-color: #1f1a16 !important;
  border: 1px solid #362e28 !important;
  border-radius: 2px !important;
  color: #f7f4f0 !important;
  box-shadow: none !important;
}
.c-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: #38ba6a !important;
  box-shadow: 0 0 0 3px rgba(56, 186, 106, 0.18) !important;
  outline: none !important;
}

/* ------------------------------------------------------ Utilitaires de Fider
   Leurs valeurs sont figées par thème (body[data-theme="light"] .bg-white { … }) ;
   elles sont ramenées ici à la palette ci-dessus. Liste relevée sur dev-67c52826. */
body[data-theme] .bg-blue-100 { background-color: var(--colors-blue-100) !important; }
body[data-theme] .bg-blue-50 { background-color: var(--colors-blue-50) !important; }
body[data-theme] .bg-gray-100 { background-color: var(--colors-gray-100) !important; }
body[data-theme] .bg-gray-200 { background-color: var(--colors-gray-200) !important; }
body[data-theme] .bg-gray-50 { background-color: var(--colors-gray-50) !important; }
body[data-theme] .bg-green-100 { background-color: var(--colors-green-100) !important; }
body[data-theme] .bg-green-200 { background-color: var(--colors-green-200) !important; }
body[data-theme] .bg-red-100 { background-color: var(--colors-red-100) !important; }
body[data-theme] .bg-white { background-color: var(--colors-white) !important; }
body[data-theme] .bg-yellow-100 { background-color: var(--colors-yellow-100) !important; }
body[data-theme] .bg-yellow-50 { background-color: var(--colors-yellow-50) !important; }
body[data-theme] .border-blue-200 { border-color: var(--colors-blue-200) !important; }
body[data-theme] .border-blue-400 { border-color: var(--colors-blue-400) !important; }
body[data-theme] .border-blue-500 { border-color: #38ba6a !important; }
body[data-theme] .border-gray-200 { border-color: var(--colors-gray-200) !important; }
body[data-theme] .border-gray-400 { border-color: var(--colors-gray-400) !important; }
body[data-theme] .border-gray-700 { border-color: var(--colors-gray-700) !important; }
body[data-theme] .border-green-400 { border-color: var(--colors-green-400) !important; }
body[data-theme] .border-red-300 { border-color: var(--colors-red-300) !important; }
body[data-theme] .border-yellow-400 { border-color: var(--colors-yellow-400) !important; }
body[data-theme] .border-yellow-500 { border-color: var(--colors-yellow-500) !important; }
body[data-theme] .text-blue-200 { color: var(--colors-blue-200) !important; }
body[data-theme] .text-blue-600 { color: var(--colors-blue-600) !important; }
body[data-theme] .text-blue-700 { color: var(--colors-blue-700) !important; }
body[data-theme] .text-blue-800 { color: var(--colors-blue-800) !important; }
body[data-theme] .text-gray-400 { color: var(--colors-gray-400) !important; }
body[data-theme] .text-gray-500 { color: var(--colors-gray-500) !important; }
body[data-theme] .text-gray-600 { color: var(--colors-gray-600) !important; }
body[data-theme] .text-gray-700 { color: var(--colors-gray-700) !important; }
body[data-theme] .text-gray-800 { color: var(--colors-gray-800) !important; }
body[data-theme] .text-gray-900 { color: var(--colors-gray-900) !important; }
body[data-theme] .text-green-500 { color: var(--colors-green-500) !important; }
body[data-theme] .text-green-600 { color: var(--colors-green-600) !important; }
body[data-theme] .text-green-700 { color: var(--colors-green-700) !important; }
body[data-theme] .text-green-800 { color: var(--colors-green-800) !important; }
body[data-theme] .text-red-500 { color: var(--colors-red-500) !important; }
body[data-theme] .text-red-600 { color: var(--colors-red-600) !important; }
body[data-theme] .text-red-700 { color: var(--colors-red-700) !important; }
body[data-theme] .text-red-800 { color: var(--colors-red-800) !important; }
body[data-theme] .text-white { color: #ffffff !important; }
body[data-theme] .text-yellow-500 { color: var(--colors-yellow-500) !important; }
body[data-theme] .text-yellow-800 { color: var(--colors-yellow-800) !important; }

/* ------------------------------------------------------------------ Mobile */
@media (max-width: 991px) {
  .p-home__welcome-col {
    position: static;
  }
  .p-home__welcome-body p:first-child {
    font-size: 2rem;
  }
}