/* assets/style.css */

:root {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] {
  --bg: #020617;
  --bg-card: #0f172a;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border: #1e293b;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.15);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 23, 42, 0.02);
}

:root[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand h1 {
  font-size: 1.25rem;
  margin: 0;
}

.brand svg path {
  fill: var(--accent);
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* BOUTONS */

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--accent-soft);
}

/* LANG SWITCH */

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.lang-switch a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
}

.lang-switch a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* MAIN */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 1.5rem auto 2rem;
  padding: 0 1rem;
  flex: 1;
}

.intro {
  margin-bottom: 1rem;
}

/* PANNEAU DE FILTRES */

.filters-panel {
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 220px;
}

.filter-item label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

#search {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

#categoryFilter {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
}

/* SEPARATEUR */

hr {
  border: none;
  border-bottom: 1px solid var(--border);
  margin: 0.75rem 0 1rem;
}

/* CARDS */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.grid.single {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
}

.card h2,
.card h3 {
  font-size: 1rem;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  min-height: 2.4em;
}

.meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.meta .label {
  font-weight: 600;
  margin-right: 0.25rem;
}

.meta .comment {
  margin-top: 0.25rem;
  font-style: italic;
}

.meta .category {
  font-weight: 600;
}

/* Boutons alignés en bas */

.buttons {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card .buttons {
  margin-top: auto;
}

/* EMPTY STATE */

.empty {
  margin: 2rem 0;
  text-align: center;
  color: var(--text-muted);
}

/* FOOTER */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* UTIL */

.hidden {
  display: none !important;
}

/* RESPONSIVE */

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }
}
