/* ==========================================================================
  SEMANSTYLE.CSS - Feuille de style "Classless" pour la semaine S1
  Objectif : Rendre le HTML beau UNIQUEMENT si les balises sont bien choisies.
  Aucune classe n'est requise (ni autorisée !).
   ========================================================================== 
*/

:root {
  --bg: #fff;
  --text: #1e293b;
  --primary: #200f76;
  --primary-hover: #115e59;
  --accent: #f59e0b;
  --muted: #64748b;
  --border: #cbd5e1;
  --bg-alt: #f8fafc;
  --code-bg: #f1f5f9;
  --bg-card: #fff;

  --muted-foreground: oklch(70.9% 0.01 56.259);
}

/* Support du Mode Sombre Automatique selon le système */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-card: #000;
    --bg: #010101;
    --text: #f1f5f9;
    --primary: #3cafce;
    --primary-hover: #5eead4;
    --accent: #fbbf24;
    --muted: #94a3b8;
    --border: #3b3b3b89;
    --bg-alt: #1e293b;
    --code-bg: #1e293b;
  }
}

/* Mise en page globale */
body {
  font-family: "inter", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  max-width: 650px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* En-tête globale du site */
header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Barre de navigation native */
nav ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
  display: flex;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  transition: color 0.2s ease;
}

nav a:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

/* Hiérarchie des titres */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.025em;
}
h2 {
  font-size: 1.85rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
h3 {
  font-size: 1.4rem;
}

p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 18px;
  text-wrap: pretty;
}

/* Éléments de structure et blocs */
figure {
  padding: 0;
  margin: 0;
}

section {
  margin-bottom: 3.5rem;
}

article {
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.info {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.card {
  display: flex;
  background-color: var(--bg-card);
  align-items: start;
  gap: 1rem;
}

.card .metadata {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card .metadata p {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.card .media img {
  width: 100%;
  height: auto;
  border-radius: 0.4rem;
}

.card .media {
  width: 270px;
}

.card h3 {
  font-size: 1rem;
  margin: 0;
}

.card a {
  text-decoration: none;
}

.card p {
  margin: 0;
}

.references p {
  font-size: 0.9rem;
}

article header {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

aside {
  border-left: 2px solid var(--muted-foreground);
  color: var(--muted-foreground);
  font-style: italic;
  padding: 1.25rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}

/* Pied de page */
footer {
  margin-top: 5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

/* Citations sémantiques */
blockquote {
  border-left: 2px solid var(--primary);
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  font-style: italic;
  color: var(--muted);
  background: var(--bg-alt);
  border-radius: 0 4px 4px 0;
}

/* Liens génériques */
a {
  color: var(--primary);
  text-decoration: underline;
}
a:hover {
  color: var(--primary-hover);
}

/* Code et blocs techniques */
pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  background: var(--code-bg);
  border-radius: 4px;
}

code {
  padding: 0.2rem 0.4rem;
  color: var(--primary);
}

pre {
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

/* Listes */
ul,
ol {
  padding-left: 1.75rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Formulaires et Form Controls sémantiques */
form {
  border-radius: 10px;
}

fieldset {
  border-radius: 8px;
  border: none;
  margin-bottom: 1.5rem;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

legend {
  color: var(--muted-foreground);
  margin: 0;
  padding: 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 1.25rem;
  display: none;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* Les boutons natifs deviennent cliquables et stylisés */
button,
input[type="submit"] {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 1rem;
  display: inline-block;
}

button:hover,
input[type="submit"]:hover {
  background: var(--primary-hover);
}

button:active,
input[type="submit"]:active {
  transform: scale(0.98);
}

#contact h2 {
  font-size: 1rem;
  border: none;
}
