/* ==========================================================================
  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: #ffffff;
  --text: #1e293b;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --accent: #f59e0b;
  --muted: #64748b;
  --border: #cbd5e1;
  --bg-alt: #f8fafc;
  --code-bg: #f1f5f9;
}

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

/* Mise en page globale */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  max-width: 850px;
  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;
}

/* Éléments de structure et blocs */
section {
  margin-bottom: 3.5rem;
}

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

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

aside {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  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: 4px 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: .2rem .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 {
  background: var(--bg-alt);
  padding: 2rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 2rem 0;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg);
}

legend {
  font-weight: 700;
  padding: 0 0.75rem;
  color: var(--primary);
}

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

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);
}