/* Variables CSS - Couleurs du logo */
:root {
  --primary-color: #c9a8a3;      /* Rose pâle/beige rosé */
  --secondary-color: #7b9a99;    /* Vert sauge */
  --text-color: #333333;
  --text-light: #666666;
  --bg-color: #ffffff;
  --bg-light: #f8f8f8;
  --border-color: #e0e0e0;
  --link-color: #7b9a99;
  --link-hover: #5a7978;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #d4b5af;
    --secondary-color: #8eadac;
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --bg-color: #1a1a1a;
    --bg-light: #2a2a2a;
    --border-color: #404040;
    --link-color: #8eadac;
    --link-hover: #a8c5c4;
  }
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--bg-color);
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.3;
  margin-bottom: 1rem;
  margin-top: 2rem;
  font-weight: 600;
  color: var(--secondary-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background-color: var(--bg-light);
  border-bottom: 3px solid var(--primary-color);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 50px;
  width: auto;
}

.site-title {
  font-size: 1.8rem;
  color: var(--secondary-color);
  margin: 0;
  font-weight: 700;
}

/* Navigation */
nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-color);
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
}

nav a:hover,
nav a.active {
  border-bottom-color: var(--primary-color);
  text-decoration: none;
}

/* Main Content */
main {
  min-height: 70vh;
  padding: 0 0 3rem 0;
  position: relative;
  z-index: 1;
  background-color: var(--bg-color);
}

/* Articles List */
.article-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.article-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  background-color: var(--bg-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.article-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.article-title a {
  color: var(--secondary-color);
}

.article-meta {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.article-meta span {
  margin-right: 1rem;
}

.article-excerpt {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.read-more {
  display: inline-block;
  color: var(--link-color);
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Single Article */
.article-header {
  margin-bottom: 0;
  padding: 2rem 0 1.5rem 0;
  border-bottom: 2px solid var(--primary-color);
  background-color: var(--bg-color);
}

.article-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  overflow: auto;
}

.article-header-inner::after {
  content: "";
  display: table;
  clear: both;
}

.article-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  align-items: start;
}

.article-toc {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 1.5rem;
  background-color: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.article-toc h3 {
  margin-top: 0;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.article-toc nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}

.article-toc nav li {
  margin-bottom: 0.8rem;
}

.article-toc nav a {
  color: var(--text-color);
  font-size: 0.95rem;
  border: none;
  padding: 0;
  display: block;
  line-height: 1.4;
}

.article-toc nav a:hover {
  color: var(--link-color);
}

.article-content {
  margin-bottom: 4rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 2rem 0;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-light);
}

.article-content ul,
.article-content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  background-color: var(--primary-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  transition: opacity 0.2s ease;
}

.tag:hover {
  opacity: 0.8;
  text-decoration: none;
}

/* Predications Table */
.predications-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  background-color: var(--bg-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.predications-table thead {
  background-color: var(--bg-light);
  border-bottom: 2px solid var(--primary-color);
}

.predications-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--secondary-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.predications-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.predications-table tbody tr:hover {
  background-color: var(--bg-light);
}

.predications-table tbody tr:last-child td {
  border-bottom: none;
}

.predications-table a:hover {
  text-decoration: none;
  color: var(--link-hover);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-light);
}

.pagination .active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Search */
.search-container {
  margin-bottom: 3rem;
}

#pagefind-search {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.pagefind-ui__search-input {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.pagefind-ui__search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Comments Section */
.comments-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid var(--border-color);
}

.comments-section h2 {
  margin-top: 0;
  margin-bottom: 2rem;
}

/* Footer */
footer {
  background-color: var(--bg-light);
  border-top: 3px solid var(--secondary-color);
  padding: 2rem 0;
  margin-top: 4rem;
  color: var(--text-light);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  text-align: center;
}

footer a {
  color: var(--text-light);
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-light);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.sidebar h3 {
  margin-top: 0;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 0.8rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .article-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-toc {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }

  .header-content {
    flex-direction: column;
    text-align: center;
  }

  nav ul {
    justify-content: center;
    gap: 1rem;
  }

  .article-card {
    padding: 1.5rem;
  }

  .article-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .container,
  .container-wide {
    padding: 0 15px;
  }

  /* Table responsive sur mobile */
  .predications-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .predications-table th,
  .predications-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }

  .predications-table th:first-child,
  .predications-table td:first-child {
    display: none;
  }
}

@media (max-width: 480px) {
  nav ul {
    gap: 0.5rem;
  }

  nav a {
    font-size: 0.9rem;
  }

  .logo {
    height: 40px;
  }

  .site-title {
    font-size: 1.5rem;
  }

  .article-list {
    grid-template-columns: 1fr;
  }
}
