/* =========================
   UnCrochet — simple, clean, reusable
   ========================= */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5b6470;
  --border: #e7e7ea;

  /* Accent (joli, féminin, efficace) */
  --accent: #c0265a;
  --accent-2: #8b1d47;
  --accent-soft: rgba(192, 38, 90, 0.10);

  /* Layout */
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --max: 980px;
}

/* Reset léger */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.65;
  background:
    /* soft veil + subtle vignette above the photo */
    linear-gradient(180deg, rgba(248, 250, 242, 0.88) 0%, rgba(248, 250, 242, 0.72) 55%, rgba(248, 250, 242, 0.84) 100%),
    radial-gradient(1100px 700px at 50% 0%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.0) 60%),
    var(--bg) url('/images/assets/background.jpg') center / cover no-repeat;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Liens */
a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; color: var(--accent-2); }

/* Headings */
h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem 0;
}
h1 { font-size: clamp(2rem, 2.6vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2vw, 1.8rem); }
h3 { font-size: 1.2rem; }

h1, h2, h3 {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
}

/* Paragraphs */
p { margin: 0 0 1rem 0; color: var(--text); }
p:last-child { margin-bottom: 0; }

/* Conteneur global (tu utilises main/section/article) */
main, .main, section, article {
  max-width: var(--max);
  margin: 2.25rem auto;
  padding: 0 1.25rem;
}

/* =========================
   Header / Nav
   ========================= */
header {
  position: static;
  z-index: 20;
  background: #f8faf2;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

header .site-logo-link {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  justify-content: center;
}

.site-logo {
  width: min(420px, 80vw);
  height: auto;
  display: block;
}

/* Menu categories (sous le header) */
.category-menu {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.25rem 1.25rem 0.9rem 1.25rem;
}

nav ul,
.category-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  justify-content: center;
}

nav li { margin: 0; }

nav a {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

nav a.selected {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(192, 38, 90, 0.22);
}

/* Tag pills under cards / item pages */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0.6rem 0 0 0;
}

.tag-list a {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
}

.tag-list a:hover {
  color: var(--accent);
  border-color: rgba(192, 38, 90, 0.22);
  text-decoration: none;
}

/* =========================
   Home hero (le h1 + p après le header)
   ========================= */
/* Sur ta page index, tu as: header, h1, p, section... */
body > h1,
body > p {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.25rem;
}

body > p {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 70ch;
}

/* =========================
   Hero (image d'en-tête)
   ========================= */
.hero {
  position: relative;
  width: 100%;
  margin: 0 0 1.25rem 0;
  overflow: hidden;
  background: #f7f7f8;
}

.hero img {
  width: 100%;
  height: 42vh;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.hero-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.25rem;
}

.hero-title h1 {
  margin: 0;
  padding: 0.55rem 1.1rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

/* =========================
   Sections & Cards (articles list)
   ========================= */
section > h2 {
  margin-top: 2.2rem;
  margin-bottom: 1.2rem;
}

/* Pour les listes d'articles (index/section/tag details) */
section article,
body > article,
main article,
.main article,
section > article,
article.card {
  margin: 1rem auto;
  width: 100%;
  padding: 1.2rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

section article:hover,
body > article:hover,
section > article:hover,
article.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(192, 38, 90, 0.22);
}

/* Titres d’articles */
article h3 a {
  color: var(--text);
  text-decoration: none;
}
article h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Description des articles */
article p {
  color: var(--muted);
}

/* =========================
   Content pages (makeItemHTML / makePageHTML)
   ========================= */
article h1 {
  margin-bottom: 1rem;
}

article .content-body,
article .content {
  margin-top: 1rem;
}

/* Publish .contentBody sort souvent du HTML standard */
article img {
  max-width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
}

article blockquote {
  margin: 1.2rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  background: #f3f4f6;
  padding: 0.18rem 0.35rem;
  border-radius: 8px;
  border: 1px solid #e6e7eb;
}

article pre {
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid #e6e7eb;
  background: #0b1020;
  color: #e5e7eb;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
article pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

/* =========================
   Footer
   ========================= */
footer {
  text-align: center;
  padding: 1.25rem 2.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  background: #f8faf2;
  margin-top: auto;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 640px) {
  nav a {
    padding: 0.5rem 0.75rem;
    font-size: 0.92rem;
  }

  main, section, article {
    margin: 1.6rem auto;
    padding: 0 1rem;
  }

  section article,
  section > article,
  body > article {
    padding: 1rem 1rem;
  }
}

@media (min-width: 768px) {
  .hero img {
    height: 33vh;
    max-height: 520px;
  }
}
