:root {
  --font-header: 'Lora', serif;
  --font-body: 'Manrope', sans-serif;
  --color-bg: #0A192F;
  --color-surface: #172A46;
  --color-text: #CCD6F6;
  --color-text-header: #FFFFFF;
  --color-border: #2A4D6F;
  --color-accent: #64FFDA;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-header);
  color: var(--color-text-header);
  margin: 0;
}


.main-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 80vh;
}

.logo img {
  height: 40px;
  width: auto;
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-header);
}

.main-nav a:hover {
  color: var(--color-accent);
}


.breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.breadcrumb a {
  opacity: 0.7;
}

.breadcrumb a:hover {
  opacity: 1;
  color: var(--color-accent);
}

.breadcrumb-separator {
  margin: 0 0.5rem;
  opacity: 0.5;
}


/* --- LAYOUT GRID ACCUEIL --- */
.main-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}


@media (min-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr 350px;
    align-items: start;
  }

  .banner-module,
  .forum-section {
    grid-column: 1 / -1;
  }
}


.banner-module {
  background-color: var(--color-surface);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  border: 1px solid var(--color-border);
  background-image: linear-gradient(to bottom right, var(--color-surface), #f8fafc);
}

.banner-title {
  font-size: 2.5rem;
  margin-top: 1rem;
}

.banner-image[src]:not([src=""]) {
  display: block;
  margin: 0 auto;
  max-height: 300px;
}

.forum-section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.forum-section>a {
  display: block;
  padding: 1.5rem;
  background-color: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--color-border);
}

.forum-header {
  font-size: 1.4rem;
  font-weight: 600;
}

.forum-section>a:hover .forum-header {
  color: var(--color-accent);
}


.forum-item {
  display: grid;
  grid-template-columns: 60px 1fr 140px 100px 180px;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.forum-item:last-child {
  border-bottom: none;
}

.forum-item:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

.forum-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}

.forum-subject {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text-header);
  line-height: 1.3;
}

.forum-subject:hover {
  color: var(--color-accent);
}

.forum-author,
.forum-messages,
.forum-last-message {
  font-size: 0.85rem;
  opacity: 0.8;
}

.forum-messages {
  background: var(--color-bg);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  text-align: center;
  width: fit-content;
  margin: 0 auto;
}

/* --- PAGE PROFILE --- */
.profile-header {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-bg);
}

.profile-info h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.profile-meta {
  color: var(--color-text);
  opacity: 0.7;
  font-size: 0.95rem;
  margin: 0;
}


.module-title {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}


.thread-list>div {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thread-list>div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.comment-date {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text);
  opacity: 0.6;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.comment-thread-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.comment-thread-title a {
  font-weight: 700;
  color: var(--color-text-header);
}

.comment-thread-title a:hover {
  color: var(--color-accent);
}

.comment {
  background-color: var(--color-bg);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--color-text);
  border-left: 4px solid var(--color-accent);
  font-style: italic;
}


.sidebar-module {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.stats-list li:last-child {
  border-bottom: none;
}

.stats-list span:first-child {
  color: var(--color-text);
  opacity: 0.8;
}

.stats-list span:last-child {
  font-weight: 700;
  color: var(--color-text-header);
}

/* --- PAGE THREAD (Ajout spécifique) --- */

.thread-header {
  text-align: center;
  padding-bottom: 2rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
}

.thread-header h1 {
  font-size: 2.2rem;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.thread-meta {
  color: var(--color-text);
  opacity: 0.7;
  font-size: 0.95rem;
}

.thread-meta a {
  font-weight: 700;
  color: var(--color-accent);
}

.post-list {
  max-width: 900px;
  margin: 0 auto;
}

.post-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2rem;
  align-items: start;
}

.post-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: sticky;
  top: 100px;
}

.post-author .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-surface);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  margin-bottom: 0.5rem;
}

.author-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text-header);
  word-break: break-word;
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
  overflow-wrap: break-word;
}

.post-date {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
  margin-bottom: 1rem;
  font-weight: 700;
}

.post-separator {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3rem 0;
  opacity: 0.3;
}

/* --- FOOTER --- */

.main-footer {
  margin-top: auto;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--color-text);
  opacity: 0.8;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-separator {
  display: none;
}


/* --- RESPONSIVE --- */

@media (max-width: 900px) {
  .main-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .content-wrapper {
    padding: 1rem;
  }


  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }


  .forum-item {
    grid-template-columns: 50px 1fr;
    grid-template-areas: "avatar subject" "avatar meta";
    gap: 0.5rem 1rem;
    padding: 1rem;
  }

  .forum-avatar {
    grid-area: avatar;
    width: 42px;
    height: 42px;
  }

  .forum-subject {
    grid-area: subject;
    font-size: 1rem;
  }

  .forum-author,
  .forum-messages,
  .forum-last-message {
    grid-area: meta;
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 4px;
  }

  .forum-messages {
    margin: 0 10px 0 0;
    font-size: 0.75rem;
  }

  .forum-last-message {
    display: block;
    text-align: left;
    white-space: normal;
  }

  /* Responsive pour Thread page */
  .post-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .post-author {
    flex-direction: row;
    position: static;
    gap: 1rem;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
  }

  .post-author .avatar {
    width: 50px;
    height: 50px;
    margin-bottom: 0;
  }

  .thread-header h1 {
    font-size: 1.6rem;
  }
}