@import url("https://fonts.googleapis.com/css2?family=Six+Caps&family=Source+Serif+Pro:wght@400;600&display=swap");

:root {
  /* -- Couleurs -- */
  --color-ocean-dark: #004d40;
  --color-paper: #fffaf0;
  --color-paper-darker: #f0e6d8;
  --color-text-dark: #3e2723;
  --color-text-subtle: #8d6e63;
  --color-accent-brass: #ffab91;
  --color-accent-red: #ff7043;
  --color-wave-base: #4db6ac;
  --color-wave-1-rgba: rgba(77, 182, 172, 0.7);
  --color-wave-2-rgba: rgba(77, 182, 172, 0.5);
  --color-wave-3-rgba: rgba(77, 182, 172, 0.3);
  --color-black-transparent-shadow: rgba(0, 0, 0, 0.2);
  --color-black-transparent-border: rgba(0, 0, 0, 0.1);
  --color-black-transparent-hover: rgba(0, 0, 0, 0.1);

  /* -- Typographie -- */
  --font-headings: "Six Caps", sans-serif;
  --font-body: "Source Serif Pro", serif;
}

/* --- Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-ocean-dark);
  font-family: var(--font-body);
  color: var(--color-text-dark);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden; /* Évite le scroll horizontal à cause des vagues */
}

/* Modification pour centrer le contenu sans toucher au HTML */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 200px 24px;
  position: relative;
  z-index: 2;
  min-height: 80vh;
}

a {
  color: var(--color-accent-red);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: underline;
}

/* --- Fond Animé (Vagues) --- */
.ocean-background {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  height: 20vh;
  pointer-events: none;
}
.waves {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 100px;
  max-height: 150px;
}
.waves use:nth-child(1) { fill: var(--color-wave-1-rgba); }
.waves use:nth-child(2) { fill: var(--color-wave-2-rgba); }
.waves use:nth-child(3) { fill: var(--color-wave-3-rgba); }
.waves use:nth-child(4) { fill: var(--color-wave-base); }

.parallax > use {
  animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}
.parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }

@keyframes move-forever {
  0% { transform: translate3d(-90px, 0, 0); }
  100% { transform: translate3d(85px, 0, 0); }
}

/* --- Header --- */
.site-header {
  background-color: var(--color-paper-darker);
  padding: 16px 0;
  box-shadow: 0 2px 5px var(--color-black-transparent-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo-link {
  font-family: var(--font-headings);
  font-size: 2rem;
  color: var(--color-text-dark);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  height: 40px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-link {
  font-family: var(--font-headings);
  letter-spacing: 1px;
  font-size: 1.5rem;
  color: var(--color-text-subtle);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.nav-link.active,
.nav-link:hover {
  color: var(--color-text-dark);
  border-bottom-color: var(--color-accent-brass);
  text-decoration: none;
}

/* --- Breadcrumbs (Fil d'Ariane) --- */
/* Ces éléments sont direct dans le body/main selon ton DOM */
.breadcrumb-item {
  font-family: var(--font-headings);
  font-size: 1.2rem;
  color: var(--color-text-subtle);
  display: inline-block;
  margin-bottom: 16px;
}
.breadcrumb-separator {
  margin: 0 8px;
  color: var(--color-text-subtle);
  font-family: var(--font-headings);
}
a.breadcrumb-item:hover {
  color: var(--color-accent-red);
}

/* --- Typography Titles --- */
.page-title {
  font-family: var(--font-headings);
  font-size: 3rem;
  letter-spacing: 2px;
  text-align: left;
  margin-bottom: 32px;
  margin-top: 16px;
  color: var(--color-paper);
  text-shadow: 2px 2px 0px var(--color-black-transparent-shadow);
  line-height: 1.1;
}

/* --- Forum Layout (Accueil) --- */
.hero-banner {
  padding: 8px;
  background-color: var(--color-paper);
  border: 1px solid var(--color-text-dark);
  margin-bottom: 48px;
  box-shadow: 0 4px 10px var(--color-black-transparent-shadow);
}
.banner-image {
  width: 100%;
  height: auto;
  display: block;
  min-height: 100px; /* Au cas où l'image est vide */
  background: var(--color-paper-darker);
}

.forum-section {
  background-color: var(--color-paper);
  border: 1px solid var(--color-black-transparent-border);
  margin-bottom: 40px;
  padding: 0;
  box-shadow: 0 5px 15px var(--color-black-transparent-shadow);
}

.forum-header {
  font-family: var(--font-headings);
  font-size: 2rem;
  background-color: var(--color-paper-darker);
  padding: 12px 24px;
  margin: 0;
  color: var(--color-text-dark);
  border-bottom: 1px solid var(--color-black-transparent-border);
  letter-spacing: 1px;
  display: block; /* Pour le lien qui enveloppe le h2 */
}
a:hover .forum-header {
    color: var(--color-accent-red);
}

/* Adaptation au DOM: div.forum-item contenant img, a, span, span, span */
.forum-item {
  display: grid;
  /* Avatar | Sujet | Auteur | Messages | Date */
  grid-template-columns: 60px 1fr 140px 100px 180px;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-paper-darker);
  transition: background-color 0.2s ease;
}

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

.forum-item:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

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

.forum-subject {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text-dark);
  line-height: 1.3;
}

.forum-author {
  font-size: 0.95rem;
}
.forum-author a {
  color: var(--color-text-dark);
  font-weight: 600;
}

.forum-messages {
  font-size: 0.9rem;
  color: var(--color-text-subtle);
  text-align: center;
  background: var(--color-paper-darker);
  padding: 4px 8px;
  border-radius: 4px;
}

.forum-last-message {
  font-size: 0.85rem;
  color: var(--color-text-subtle);
  text-align: right;
  font-style: italic;
}

/* --- Page Thread (Sujet) --- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-item {
  display: flex;
  gap: 24px;
  padding: 24px;
  background-color: var(--color-paper);
  border: 1px solid var(--color-black-transparent-border);
  box-shadow: 0 2px 5px var(--color-black-transparent-shadow);
}

.post-author {
  flex: 0 0 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-right: 16px;
  border-right: 1px solid var(--color-paper-darker);
}

.post-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--color-accent-brass);
  margin-bottom: 12px;
  padding: 2px;
  background: var(--color-paper);
}

.author-name {
  font-family: var(--font-headings);
  font-size: 1.4rem;
  color: var(--color-text-dark);
  word-break: break-word;
}

.post-content {
  flex-grow: 1;
  font-size: 1.05rem;
}
.post-content p {
    margin-bottom: 16px;
}
.post-content iframe {
    max-width: 100%;
    box-shadow: 0 4px 8px var(--color-black-transparent-shadow);
}

/* --- Page User (Profil) --- */
.profile-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: flex-start;
}

.profile-sidebar {
  background-color: var(--color-paper);
  padding: 32px;
  border: 1px solid var(--color-text-dark);
  text-align: center;
  box-shadow: 0 4px 10px var(--color-black-transparent-shadow);
}

.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid var(--color-accent-brass);
  margin-bottom: 24px;
  object-fit: cover;
}

.profile-name {
  font-family: var(--font-headings);
  font-size: 3rem;
  color: var(--color-text-dark);
  margin: 0;
  line-height: 1;
}

.profile-rank {
  color: var(--color-text-subtle);
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  margin-top: 8px;
  margin-bottom: 24px;
}

.profile-divider {
  border: none;
  border-top: 1px solid var(--color-accent-brass);
  margin: 24px auto;
  width: 50%;
  opacity: 0.6;
}

.profile-stats-list {
  list-style: none;
  text-align: left;
  background: var(--color-paper-darker);
  padding: 24px;
  border-radius: 4px;
}
.profile-stats-list li {
  color: var(--color-text-subtle);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted var(--color-black-transparent-border);
  padding-bottom: 4px;
}
.profile-stats-list li:last-child {
  border-bottom: none;
}
.profile-stats-list li strong {
  color: var(--color-text-dark);
}

/* Contenu Principal Profil (Activité) */
.category-card {
  background-color: var(--color-paper);
  padding: 32px;
  border: 1px solid var(--color-text-dark);
  box-shadow: 0 4px 10px var(--color-black-transparent-shadow);
}

.category-card h2 {
  font-family: var(--font-headings);
  font-size: 2.2rem;
  border-bottom: 2px solid var(--color-accent-brass);
  padding-bottom: 8px;
  margin-bottom: 24px;
}

.thread-list h4 {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    color: var(--color-text-subtle);
    margin-top: 24px;
    margin-bottom: 16px;
    text-transform: uppercase;
}
.thread-list h4:first-child {
    margin-top: 0;
}

/* Style des items d'historique dans le profil */
.thread-list > div {
    padding: 16px;
    border-bottom: 1px solid var(--color-paper-darker);
    transition: background 0.2s;
}
.thread-list > div:hover {
    background: var(--color-paper-darker);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--color-accent-red);
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.comment-thread-title {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 4px 0 8px 0;
}
.comment-thread-title a {
    color: var(--color-text-dark);
}
.comment-thread-title a:hover {
    color: var(--color-accent-red);
}

.comment {
    font-style: italic;
    color: var(--color-text-subtle);
    border-left: 3px solid var(--color-accent-brass);
    padding-left: 12px;
    margin-top: 8px;
}


/* --- Footer --- */
.footer {
    /* Wrapper pour le footer fixe */
    margin-top: auto;
}
.site-footer {
  background-color: var(--color-paper-darker);
  border-top: 4px solid var(--color-accent-brass);
  padding: 32px 0;
  color: var(--color-text-dark);
  position: relative; 
  z-index: 10;
}
.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 48px;
}
.footer-column h4 {
  font-family: var(--font-headings);
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--color-accent-brass);
}
.footer-column a {
  color: var(--color-text-subtle);
  display: block;
  margin-bottom: 8px;
}
.footer-column p {
  color: var(--color-text-subtle);
  font-size: 0.9rem;
}

/* --- Media Queries (Responsiveness basique) --- */
@media (max-width: 768px) {
  /* Forum Item devient empilé sur mobile */
  .forum-item {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px;
  }
  .forum-author, .forum-messages, .forum-last-message {
    grid-column: 2;
    text-align: left;
  }
  .forum-avatar {
    grid-row: 1 / 4;
  }
  
  /* Profil Grid devient une colonne */
  .profile-grid {
    grid-template-columns: 1fr;
  }
  
  .post-item {
      flex-direction: column;
  }
  .post-author {
      border-right: none;
      border-bottom: 1px solid var(--color-paper-darker);
      padding-bottom: 16px;
      margin-bottom: 16px;
      width: 100%;
      flex-direction: row;
      gap: 16px;
      padding-right: 0;
  }
  .post-avatar {
      margin-bottom: 0;
      width: 60px;
      height: 60px;
  }
}