/* ============================================================
   🌊 THÈME POSÉIDON — Chroniques des profondeurs
   Couleurs principales :
   - Jaune or : #FFD700
   - Bleu pétrole : #0d1b2a / #1b263b
   - Gris anthracite : #0b0f14 / #1a2230
   - Blanc doux : #f9f9f9
============================================================ */

/* ============================================================
   🔹 BASE GLOBALE
============================================================ */
:root {
    --gold: #FFD700;
    --blue-dark: #0d1b2a;
    --blue-mid: #1b263b;
    --gray-dark: #0b0f14;
    --gray-soft: #1a2230;
    --text-main: #333;
    --text-light: #e5e5e5;
    --bg-light: #f4f4f4;
    --bg-article: #fff;
    --transition: 0.3s ease;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ============================================================
   🧭 HEADER
============================================================ */
header {
    position: relative;
    height: 220px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    background: url('../img/banner-image.webp') top center/cover no-repeat;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

header h1 {
    font-size: 2em;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
}

header p {
    font-size: 1em;
    margin-top: 5px;
}

header nav {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

header nav a {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    transition: color var(--transition);
}

header nav a:hover {
    color: var(--gold);
}

/* Responsive */
@media (max-width: 768px) {
    header { height: auto; padding: 20px 10px; }
    header h1 { font-size: 1.6em; }
    header p, header nav a { font-size: 0.9em; }
}

/* ============================================================
   📚 GRILLE DES RÉCITS
============================================================ */
#recits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recit-card {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  aspect-ratio: 9 / 11;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: inherit;
    /* ✅ Fallback pour les navigateurs qui ne gèrent pas aspect-ratio */
  min-height: 260px;
}

.recit-card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.recit-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    padding: 12px 8px;
    border-top: 2px solid var(--gold);
}

/* ============================================================
   🧾 PAGE D’UN RÉCIT
============================================================ */
article {
    max-width: 800px;
    margin: 40px auto;
    padding: 25px;
    background: var(--bg-article);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-size: 1.1em;
}

/* Titres hiérarchiques */
article h1 {
    font-size: 2em;
    font-weight: 700;
    color: #fff;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);

    /* 🌅 Dégradé doré principal */
    background: linear-gradient(135deg, #b89600 0%, #ffd700 100%);
    
    /* 🪨 Texture réelle en transparence */
    background-image:
        linear-gradient(135deg, #b89600 0%, #ffd700 100%),
        url('../img/texture/rock-texture.webp');
    background-size: cover;
    background-blend-mode: overlay;
    
    filter: contrast(1.1) brightness(1.05);
}




article h2 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--blue-mid);
    border-left: 5px solid var(--gold);
    background: rgba(255,215,0,0.1);
    padding: 10px 15px;
    border-radius: 6px;
    margin: 25px 0 15px;
    text-transform: uppercase;
}

/* --- H3 : Sous-sections (jours, parties, etc.) --- */
article h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: #222222; /* Doré légèrement orangé */
    background: rgba(255, 215, 0, 0.1); /* Fond doux doré */
    padding: 10px 14px;
    border-left: 4px solid #b87d00;
    border-radius: 6px;
    margin-top: 30px;
    margin-bottom: 15px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

/* Effet au survol (utile si clicable ou juste pour dynamisme) */
article h3:hover {
    background: rgba(255, 215, 0, 0.15);
    transform: translateX(2px);
}

/* 🌙 Version dark mode */
body.dark-mode article h3 {
    color: #ffb84d; /* Doré chaud plus clair */
    background: rgba(255, 184, 77, 0.08);
    border-left: 4px solid #ffb84d;
}


/* Figures */
figure {
    margin: 25px auto;
    text-align: center;
    background: rgba(0,0,0,0.03);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 8px;
}

figure figcaption {
    font-style: italic;
    font-size: 0.9em;
    color: #555;
}

/* ============================================================
   ⚓ FOOTER
============================================================ */
footer {
    text-align: center;
    margin: 30px 0;
    font-size: 0.9em;
    color: #555;
}

/* ============================================================
   🔘 BOUTON DE SWITCH (thème clair/sombre)
============================================================ */
#theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: var(--blue-mid);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: background var(--transition), transform var(--transition);
}

#theme-toggle:hover {
    background: var(--gold);
    color: var(--blue-mid);
    transform: scale(1.1);
}

/* ============================================================
   🌙 MODE SOMBRE — Poséidon Deep
============================================================ */
body.dark-mode {
    background: var(--gray-dark);
    color: var(--text-light);
}

/* Header */
body.dark-mode header::after { background: rgba(0,0,0,0.7); }

/* Articles */
body.dark-mode article {
    background: var(--gray-soft);
    color: #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

body.dark-mode article h1 {
    background: linear-gradient(135deg, var(--blue-mid), var(--gold));
}

body.dark-mode article h2 {
    color: var(--gold);
    background: rgba(255,215,0,0.08);
    border-left-color: var(--gold);
}

body.dark-mode article h3 {
    color: #eee;
    background: rgba(255,255,255,0.05);
    border-left-color: var(--gold);
}

/* Figures */
body.dark-mode figure {
    background: rgba(255,255,255,0.05);
}

body.dark-mode figure figcaption {
    color: #bbb;
}

/* Footer */
body.dark-mode footer { color: #aaa; }

/* Toggle */
body.dark-mode #theme-toggle {
    background: var(--gold);
    color: var(--gray-dark);
}

/* ============================================================
   🏠 PAGE D’ACCUEIL
============================================================ */
.intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(145deg, var(--blue-dark), var(--blue-mid));
    color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-bottom: 40px;
}

.intro-text {
    flex: 1 1 55%;
    padding: 40px 30px;
}

.intro-text h2 {
    font-size: 1.8em;
    color: var(--gold);
    margin-bottom: 20px;
}

.intro-image {
    flex: 1 1 40%;
    height: 320px;
    background-size: cover;
    background-position: center;
    border-radius: 0 10px 10px 0;
    filter: brightness(0.9) contrast(1.1);
    opacity: 0;
    animation: fadeInImage 1.2s ease-in-out forwards;
}

@keyframes fadeInImage {
    from { opacity: 0; transform: scale(1.02); }
    to { opacity: 1; transform: scale(1); }
}


/* Sections */
.philosophie, .objectif {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.philosophie h3, .objectif h3 {
    color: var(--blue-mid);
    border-left: 4px solid var(--gold);
    padding-left: 10px;
}

/* Bouton CTA */
.cta {
    display: inline-block;
    margin-top: 20px;
    background: var(--blue-mid);
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: bold;
    transition: all var(--transition);
}

.cta:hover {
    background: var(--gold);
    color: var(--blue-mid);
}

/* Accueil Dark Mode */
body.dark-mode .intro {
    background: linear-gradient(145deg, var(--gray-soft), var(--blue-mid));
}

body.dark-mode .philosophie,
body.dark-mode .objectif {
    background: var(--gray-soft);
    color: #ddd;
    box-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

body.dark-mode .philosophie h3,
body.dark-mode .objectif h3 {
    color: var(--gold);
}

body.dark-mode .cta {
    background: var(--gold);
    color: var(--gray-dark);
}

body.dark-mode .cta:hover {
    background: var(--blue-mid);
    color: var(--gold);
}

/* Responsive */
@media (max-width: 768px) {
    .intro { flex-direction: column; }
    .intro-image { width: 100%; height: 200px; }
}

.aparte {
    font-family: "Courier New", monospace;
    font-size: 0.95em;
    font-style: italic;
    background: #f7f7f7;
    border-left: 5px solid #FFD700;
    border-radius: 8px;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: background 0.3s ease, color 0.3s ease;
}

/* 🌙 Version dark mode */
body.dark-mode .aparte {
    background: #1e1e1e;
    color: #ddd;
    border-left: 5px solid #FFD700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
/* --- Ajustements responsive pour iPhone & petits écrans --- */
@media (max-width: 768px) {
  #theme-toggle {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    bottom: 25px;
    right: 20px;
  }

  #dive-widget {
    width: 70vw; /* occupe 70% de la largeur */
    font-size: 1.2em;
    bottom: 25px;
    right: 15vw; /* centré horizontalement par rapport au bouton */
    padding: 12px 18px;
    border-width: 2px;
  }
}
/* === Bouton "Retour aux récits" === */
.recit-page a[href="/recits"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f4c400, #d4a700);
  color: #111;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  margin: 25px 0;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.recit-page a[href="/recits"]::before {
  content: "";
  font-weight: bold;
  transition: transform 0.3s ease;
}

.recit-page a[href="/recits"]:hover {
  background: linear-gradient(135deg, #ffd84d, #e0b300);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.recit-page a[href="/recits"]:hover::before {
  transform: translateX(-3px);
}

/* Mode sombre */
body.dark-mode .recit-page a[href="/recits"] {
  background: linear-gradient(135deg, #d4a700, #b48a00);
  color: #fff;
  box-shadow: 0 3px 6px rgba(255, 255, 255, 0.05);
}

body.dark-mode .recit-page a[href="/recits"]:hover {
  background: linear-gradient(135deg, #ffd84d, #d4a700);
  color: #000;
}
#diveProfile {
  width: 100%;
  height: 100px;
  background: rgba(0, 255, 0, 0.05);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 6px;
  margin-top: 10px;
}
/* ===============================
   🔗 STYLE DES LIENS INTERNES
   =============================== */

/* Style de base */
a.internal-link {
  color: #FFD700; /* Jaune signature */
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 215, 0, 0.4);
  transition: all 0.3s ease;
}

/* Effet au survol */
a.internal-link:hover {
  color: #ffea80; /* Jaune plus clair au hover */
  border-bottom: 1px solid #FFD700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

/* Version dark mode */
body.dark-mode a.internal-link {
  color: #ffcc33;
  border-bottom: 1px dashed rgba(255, 204, 51, 0.4);
}

body.dark-mode a.internal-link:hover {
  color: #fff59d;
  border-bottom: 1px solid #ffcc33;
  text-shadow: 0 0 6px rgba(255, 204, 51, 0.7);
}

/* ============================================================
   📱 OPTIMISATIONS MOBILES — RÉCITS
   ============================================================ */
@media (max-width: 768px) {
  /* Confort général sur petits écrans */
  main {
    margin: 20px auto;
    padding: 0 12px;
  }

  /* Grille des récits : une carte par ligne, bien centrée */
  #recits-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .recit-card {
    max-width: 480px;
    margin: 0 auto;
    /*aspect-ratio: 4 / 5;*/
  }

  .recit-overlay {
    font-size: 1rem;
    padding: 10px 6px;
  }

  /* Page d’un récit : lecture confortable */
  .recit-page {
    padding: 10px 6px;
  }

  .recit-page h1 {
    font-size: 1.6em;
    padding: 10px 12px;
  }

  .recit-page p {
    font-size: 0.98em;
    line-height: 1.6;
  }
}

/* Supprimer le widget de plongée */
#dive-widget {
    display: none !important;
}
/* ============================================================
   📚 PAGE RÉFÉRENCES
============================================================ */

.ref-title {
    text-align: center;
    font-size: 2.2em;
    color: var(--gold);
    margin-bottom: 40px;
}

.references-list {
    display: flex;
    flex-direction: column;
    gap: 35px;
    max-width: 900px;
    margin: 0 auto;
}

/* bloc principal */
.ref-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 25px;
    background: var(--bg-article);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    align-items: center;
}

/* image */
.ref-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* infos */
.ref-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ref-name {
    font-size: 1.4em;
    margin: 0;
}

.ref-topic {
    font-weight: 600;
    opacity: .8;
    margin: 0;
}

.ref-desc {
    line-height: 1.5;
    margin: 0;
}

.ref-btn {
    margin-top: 10px;
    display: inline-block;
    width: fit-content;
}

/* 📱 VERSION MOBILE */
@media (max-width: 768px) {
    .ref-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .ref-img img {
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }
}
/* 🌙 Mode sombre — Références */
body.dark-mode .ref-item {
    background: #1b263b; /* ton bleu foncé cohérent */
    color: #f5f5f5;      /* texte clair lisible */
}

body.dark-mode .ref-info p,
body.dark-mode .ref-info .ref-topic {
    color: #e0e0e0;
}

body.dark-mode .ref-name {
    color: #FFD700; /* gold pour le titre */
}

body.dark-mode .ref-btn {
    background: linear-gradient(135deg, #b89600, #ffd700);
    color: #222;
}
body.dark-mode .ref-item {
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
