/* Cracoviae — Habillage éditorial moderne pour les articles de la rubrique Cracovie */
.item-page > article {
  background: #fbf3e2;
  border: 1px solid #ebd9c2;
  border-radius: 14px;
  padding: 28px 34px 32px;
  box-shadow: 0 6px 24px rgba(70, 45, 25, 0.07);
  margin: 12px 0 36px;
}

.cr-back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #8e1f54 !important;
  text-decoration: none !important;
  background: #fffdfa;
  border: 1px solid #e4d0b5;
  padding: 5px 13px;
  border-radius: 20px;
  margin-bottom: 14px;
  transition: all 0.18s ease;
}

.cr-back-top:hover {
  background: #8e1f54;
  border-color: #8e1f54;
  color: #ffffff !important;
}

.item-page > article .article-header {
  border-bottom: 2px solid #f0e1cb;
  padding-bottom: 14px;
  margin-bottom: 22px;
}

.item-page > article .article-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: #7a1b47;
}

.item-page > article .article-title a {
  color: #7a1b47 !important;
  text-decoration: none !important;
}

.item-page > article .article-content {
  font-size: 15.5px;
  line-height: 1.75;
  color: #44352c;
}

.item-page > article .article-content p {
  margin: 0 0 16px;
  text-align: left;
}

.item-page > article .article-content p:empty {
  display: none;
}

.item-page > article .article-content h2,
.item-page > article .article-content h3,
.item-page > article .article-content h4 {
  color: #7a1b47;
  font-weight: 700;
  margin: 24px 0 12px;
  line-height: 1.35;
}

.item-page > article .article-content h2 { font-size: 21px; }
.item-page > article .article-content h3 { font-size: 18px; }
.item-page > article .article-content h4 { font-size: 16.5px; }

.item-page > article .article-content ul,
.item-page > article .article-content ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.item-page > article .article-content li {
  margin-bottom: 7px;
  line-height: 1.65;
}

.item-page > article .article-content ul li::marker {
  color: #8e1f54;
}

.item-page > article .article-content table:not(.cr-img-table) {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: #fffdfa;
  border: 1px solid #ebd9c2;
  border-radius: 8px;
  overflow: hidden;
  font-size: 14.5px;
}

.item-page > article .article-content table:not(.cr-img-table) th,
.item-page > article .article-content table:not(.cr-img-table) td {
  padding: 9px 12px;
  border: 1px solid #ebd9c2;
  text-align: left;
}

.item-page > article .article-content table:not(.cr-img-table) tr:nth-child(even) td {
  background: #fbf6ec;
}

.item-page > article .article-content a {
  color: #8e1f54;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.item-page > article .article-content a:hover {
  color: #5e1237;
}

/* Images dans le corps de l'article (taille maîtrisée, agrandissement en lightbox au clic) */
.item-page > article .article-content img:not(.leaflet-tile) {
  max-width: min(100%, 480px) !important;
  max-height: 340px !important;
  width: auto !important;
  height: auto !important;
  border-radius: 10px !important;
  border: 1px solid #e4d0b5 !important;
  box-shadow: 0 4px 14px rgba(70, 45, 25, 0.09);
  display: block;
  margin: 14px auto;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-page > article .article-content img:not(.leaflet-tile):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(70, 45, 25, 0.16);
}

/* Galeries et figures éditoriales réutilisables */
.cr-photos-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 740px;
  margin: 18px auto 24px;
}

.cr-photos-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px auto 24px;
}

.cr-photo-single {
  max-width: 440px;
  margin: 18px auto 20px;
}

.cr-photo-wide {
  max-width: 600px;
  margin: 16px auto 20px;
}

.cr-photos-2 figure,
.cr-photos-3 figure,
.cr-photo-single figure,
.cr-photo-wide figure {
  margin: 0;
}

.item-page > article .article-content .cr-photos-2 img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  object-fit: cover !important;
  margin: 0 !important;
}

.item-page > article .article-content .cr-photos-3 img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  object-fit: cover !important;
  margin: 0 !important;
}

.item-page > article .article-content .gallery-item img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.item-page > article .article-content .cr-photo-single img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: 300px !important;
  height: auto !important;
  margin: 0 !important;
}

.item-page > article .article-content .cr-photo-wide img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: 360px !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 !important;
}

.cr-photos-2 figcaption,
.cr-photos-3 figcaption,
.cr-photo-single figcaption,
.cr-photo-wide figcaption {
  text-align: center;
  font-size: 12.8px;
  color: #776253;
  margin-top: 6px;
  font-style: italic;
}

@media (max-width: 991px) {
  .cr-photos-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .cr-photos-2,
  .cr-photos-3 {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
}

/* Transformation responsive des anciens <table> d'images */
.item-page > article .article-content table.cr-img-table {
  width: 100% !important;
  border: none !important;
  border-collapse: collapse;
  margin: 20px 0 !important;
  background: transparent !important;
}

.item-page > article .article-content table.cr-img-table tbody,
.item-page > article .article-content table.cr-img-table tr {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  width: 100%;
}

.item-page > article .article-content table.cr-img-table tbody {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-page > article .article-content table.cr-img-table td {
  display: block;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.item-page > article .article-content table.cr-img-table td.cr-empty-td {
  display: none !important;
}

.item-page > article .article-content table.cr-img-table td img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: 300px !important;
  height: auto !important;
  margin: 0 !important;
  object-fit: cover;
}

/* Bandeau de fin d'article (retour + invitation visites guidées) */
.cr-article-cta {
  margin-top: 30px;
  padding: 20px 24px;
  background: #f3e4c7;
  border: 1px solid #e4cfa9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.cr-cta-text {
  font-size: 14.5px;
  color: #4b3a30;
  line-height: 1.5;
}

.cr-cta-text strong {
  color: #7a1b47;
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
}

.cr-cta-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cr-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fffdfa !important;
  color: #8e1f54 !important;
  border: 1.5px solid #8e1f54 !important;
  border-radius: 25px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.cr-btn-secondary:hover {
  background: #f8e8ef !important;
}

.cr-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #8e1f54 !important;
  color: #ffffff !important;
  border: 1.5px solid #8e1f54 !important;
  border-radius: 25px;
  padding: 8px 20px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 3px 10px rgba(142, 31, 84, 0.22);
  transition: all 0.2s ease;
}

.cr-btn-primary:hover {
  background: #731643 !important;
  transform: translateY(-1px);
}

/* Lightbox plein écran */
.cr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 12, 16, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cr-lightbox.is-open {
  display: flex;
}

.cr-lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

.cr-lb-close,
.cr-lb-prev,
.cr-lb-next {
  position: fixed;
  background: rgba(255, 253, 250, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
}

.cr-lb-close:hover,
.cr-lb-prev:hover,
.cr-lb-next:hover {
  background: #8e1f54;
}

.cr-lb-close { top: 18px; right: 20px; }
.cr-lb-prev  { left: 18px; top: 50%; transform: translateY(-50%); }
.cr-lb-next  { right: 18px; top: 50%; transform: translateY(-50%); }

@media (max-width: 767px) {
  .item-page > article {
    padding: 20px 18px 24px;
  }
  .item-page > article .article-title {
    font-size: 22px;
  }
  .item-page > article .article-content {
    font-size: 14.8px;
  }
  .item-page > article .article-content p {
    text-align: left;
  }
  .cr-article-cta {
    padding: 16px;
  }
}
