/* ===================================================
   KUDSHIBA — blog-post.css
   Pages d'articles de blog
   =================================================== */
.ordinal {
    font-size: 0.6em;
    vertical-align: super;
}
/* ========== CONTENEUR PRINCIPAL ========== */
.post-container {
  width: min(1400px, 92vw);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

/* ========== EN-TÊTE ARTICLE ========== */
.post-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.post-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.4rem;
}

.post-header .post-subtitle {
  font-size: 1.4rem;
  font-weight: 400;
  color: #000;
  text-align: center;
  margin: 0 0 0.3rem;
}

.post-date {
  font-size: 0.95rem;
  color: #888;
  font-style: italic;
  margin: 0;
}

/* ========== TEXTE ========== */
.post-container p {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #333;
  text-align: justify;
  margin: 1.2rem 0;
}

/* ========== FOOTER ========== */
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.footer-links a {
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 600;
  color: #000000;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: #000000;
  transform: translateY(-2px);
}

.footer-links span {
  color: #000000;
}

/* ========== IMAGE AVEC LÉGENDE AU SURVOL ========== */
.blog-photo {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  margin: 2rem 0;
}

.blog-photo img {
  width: 100%;
  display: block;
  border-radius: 6px;
  margin: 0;
}

.blog-photo figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.7rem 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;            /* ne gêne pas le clic */
}


.blog-photo:hover figcaption {
  opacity: 1;
}


/* ======= Images qu'on veut limiter en hauteur ======= */
.blog-photo--h400 img { max-height: 400px; object-fit: contain; }
.blog-photo--h520 img { max-height: 520px; object-fit: contain; }
.blog-photo--h650 img { max-height: 650px; object-fit: contain; }
.blog-photo--h800 img { max-height: 800px; object-fit: contain; }

/* Pour les images en mode "contain" + max-height :
   on fait en sorte que la figure prenne la largeur réelle de l'image */
.blog-photo--h400,
.blog-photo--h520,
.blog-photo--h650,
.blog-photo--h800 {
  width: fit-content;     /* la figure (figcaption) s'ajuste à l'image */
  max-width: 100%;        /* ne dépasse jamais la colonne */
  margin-left: auto;      /* centrage */
  margin-right: auto;
}

/* ========== IMAGE TAILLE RÉELLE (cartes, schémas) ========== */
.blog-photo--natural img {
  width: auto;                     /* taille réelle, pas étirée */
  max-width: 100%;                 /* ne dépasse pas le conteneur */
  margin: 0 auto;                  /* centrée */
}

/* ========== DEUX PHOTOS CÔTE À CÔTE ========== */
.blog-photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 0;
  justify-self: center;
}

.blog-photo-pair .blog-photo {
  margin: 0;                        /* annule la marge individuelle */
  justify-self: center;
  width: 100%;
  height: 100%;
}

.blog-photo-pair .blog-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* remplit la cellule en recadrant si nécessaire */
}

.photo-metadata p {
    text-align: center;
    font-size: 0.85rem;
    padding: 15px 25px;
    margin: 2px 0;
}

.photo-metadata-text {
    text-align: center;
    font-style: italic;
    margin: 12px 0;
}

/* ========== 3 PHOTOS CÔTE À CÔTE ========== */
.blog-photo-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 2rem 0;
}

/* On enlève la marge par défaut des figures à l’intérieur */
.blog-photo-trio .blog-photo {
  margin: 0;
}

/* Les images remplissent la “case” */
.blog-photo-trio .blog-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* remplit en recadrant si nécessaire */
  display: block;
}

/* Responsive: sur tablette, 2 colonnes (2 + 1) */
@media (max-width: 900px) {
  .blog-photo-trio {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive: sur mobile, 1 colonne */
@media (max-width: 600px) {
  .blog-photo-trio {
    grid-template-columns: 1fr;
  }
}


/* ========== LIGHTBOX - Photo plein écran ========== */
/* Permet de "voir" l'image si elle dépasse quand on zoome */
.lightbox-overlay {
  position: fixed;
  overflow: auto;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
  cursor: zoom-in;
}

/* Bouton fermer */
/* Bouton fermer — même style que +/-/1:1 mais rouge */
.lightbox-close {
  background: rgba(180, 0, 0, 0.35);
  border-color: rgba(255, 100, 100, 0.4);
}
.lightbox-close:hover {
  background: rgba(200, 0, 0, 0.55);
  border-color: rgba(255, 100, 100, 0.6);
}

/* Légende dans la lightbox */
.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #ccc;
  font-size: 0.9rem;
}

/* Zone controls en haut à droite */
.lightbox-controls{
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 1100;
  /* Zone transparente comme tu veux */
  background: transparent;
}

/* Boutons +/-/reset */
.lightbox-btn{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.25); /* quasi transparent */
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.05s ease;
}

.lightbox-btn:hover{
  background: rgba(0,0,0,0.40);
  border-color: rgba(255,255,255,0.55);
}

.lightbox-btn:active{
  transform: scale(0.98);
}

/* Le reset un peu plus petit */
.lightbox-btn[data-action="reset"]{
  font-size: 0.95rem;
  font-weight: 700;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 52px;
  height: 52px;

  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);

  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);

  color: #fff;
  font-size: 2rem;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background 0.2s ease;
}

.lightbox-nav:hover {
  background: rgba(0,0,0,0.45);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Curseur zoom-in sur les images du blog */
.blog-photo img {
  cursor: zoom-in;
}

/* ========== BOUTON RETOUR EN HAUT ========== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8e8e8;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background 0.2s ease;
  z-index: 200;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #d0d0d0;
}

/* ========== À VOIR AUSSI ========== */
.related-section {
  width: min(1400px, 92vw);
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}

.related-section h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.related-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

.related-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-card__image {
  padding: 0.6rem;
}

.related-card__image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin: 0;
}

.related-card__body {
  padding: 0.4rem 0.6rem 0.8rem;
  text-align: center;
}

.related-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  color: #1a1a1a;
}

.related-card__date {
  font-size: 0.8rem;
  font-style: italic;
  color: #888;
  margin: 0 0 0.2rem;
}

.related-card__subtitle {
  font-size: 0.85rem;
  color: #555;
  margin: 0;
}

/* === lien HREF === */
.post-container a {
    color: inherit;
    border-bottom: 1px dotted #999;
    text-decoration: none;
}

.post-container a:hover {
    border-bottom: 1px solid #555;
}

/* === métriques === */
.trek-progress {
    margin: 2rem 0;
}

.trek-progress-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.trek-progress-bar {
    height: 18px;
    background: #d9d9d9;
    border-radius: 20px;
    overflow: hidden;
}

.trek-progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        #2e7d32,
        #66bb6a
    );
}

.trek-progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 600;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.metric-card {
    background: #f8f8f8;
    border: 1px solid #dcdcdc;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: 0.2s;
}

.metric-card:hover {
    transform: translateY(-3px);
}

.metric-icon {
    font-size: 2rem;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: bold;
}

.metric-label {
    color: #666;
}

.difficulty {
    text-align: center;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: bold;
}

.difficulty-easy {
    background: #e8f5e9;
    color: #2e7d32;
}

.difficulty-medium {
    background: #fff3e0;
    color: #ef6c00;
}

.difficulty-hard {
    background: #ffebee;
    color: #c62828;
}

.gr30-progress {
    width: 100%;
    height: 18px;
    background: #e5e5e5;
    border-radius: 20px;
    overflow: hidden;
    margin: 0.3rem 0;
}

.gr30-progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        #4caf50 0%,
        #8bc34a 100%
    );
    border-radius: 20px;
    transition: width 0.5s ease;
}

.gr30-progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.metric-text {
    text-align: center;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  .post-container {
    padding: 1rem 1rem 3rem;
  }

  .post-title {
    font-size: 1.7rem;
  }

  .post-subtitle {
    font-size: 1.15rem;
  }

  /* Légende toujours visible sur mobile (pas de hover) */
}

/* ========== RESPONSIVE — À VOIR AUSSI ========== */
@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Mobile : empilées verticalement */
@media (max-width: 768px) {
  .blog-photo-pair {
    grid-template-columns: 1fr;
  }
}
