/* Shared layout for every editorial detail page. */
.detail-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* CRECOPAX detail organisation, adapted to the CSE identity. */
.page-main.detail-page { padding-top: 0; background: #fff; }
.detail-page .detail-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 44px 0 60px;
  margin: 0 0 46px;
  background: #103b2c;
  color: white;
}
.detail-heading .detail-banner-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.detail-page .detail-heading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,rgba(9,35,26,.92),rgba(9,35,26,.65)); z-index: -1; }
.detail-heading-inner { width: min(1170px, calc(100% - 48px)); margin: auto; }
.detail-page .detail-heading h1 { max-width: 1000px; color: white; font-size: 32px; line-height: 1.4; font-weight: 700; margin: 18px 0 0; }
.detail-breadcrumb { font-size: 13px; line-height: 1.6; color: #e6eee9; }
.detail-breadcrumb a:hover { text-decoration: underline; }
.detail-page .detail-shell, .detail-page .detail-shell:has(> aside) { width: min(1170px, calc(100% - 48px)); grid-template-columns: minmax(0,2.35fr) minmax(0,1fr); gap: 44px; margin-bottom: 48px; }
.detail-page .detail-article { max-width: none; border: 0; border-radius: 0; overflow: visible; background: transparent; }
.detail-page .detail-cover { margin: 0 0 26px; height: 300px; border-radius: 12px; background: #f4f7f3; overflow: hidden; border: 1px solid var(--line); }
.detail-page .detail-cover img { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: center; }
.detail-page .detail-body { margin: 0 0 26px; }
.detail-page .detail-information { margin: 0 0 24px; }
.detail-page .detail-actions { margin: 0; }
.detail-sidebar { min-width: 0; padding: 25px; background: #f6f8f3; border: 1px solid var(--line); }
.detail-contact h2 { font-size: 19px; line-height: 1.5; margin: 18px 0 14px; }
.detail-contact p { font-size: 14px; line-height: 1.8; color: var(--muted); }
.detail-contact-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px; margin-top: 24px; background: var(--forest); color: #fff; font-size: 13px; font-weight: 700; }
.detail-contact-link:hover { background: #084d31; color: white; }
.detail-sidebar .recent-posts-aside { padding: 26px 0 0; margin: 30px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.detail-sidebar .recent-posts-aside h2 { font-size: 18px; }
.detail-sidebar .recent-post-card { grid-template-columns: 64px minmax(0,1fr); padding: 16px 0; background: transparent; border-radius: 0; }
.detail-sidebar .recent-post-card img { width: 64px; height: 56px; object-fit: cover; border-radius: 0; }
.detail-sidebar .detail-share { margin: 28px 0 0; padding: 24px 0 0; }
.detail-sidebar .share-links { gap: 7px; }
.detail-sidebar .share-links a, .detail-sidebar .share-links button { width: 38px; height: 38px; }
.detail-extra { width: min(1170px, calc(100% - 48px)); margin: 0 auto 48px; }
.detail-extra:empty { display: none; }
.detail-extra .publication-comments { margin: 0; max-width: 820px; }
@media(max-width:930px) {
  .detail-page .detail-shell, .detail-page .detail-shell:has(> aside) { gap: 26px; grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
  .detail-sidebar { padding: 18px; }
}
@media(max-width:700px) {
  .detail-heading-inner, .detail-page .detail-shell, .detail-page .detail-shell:has(> aside), .detail-extra { width: calc(100% - 32px); }
  .detail-page .detail-shell, .detail-page .detail-shell:has(> aside) { grid-template-columns: minmax(0,1fr); }
  .detail-page .detail-heading { padding: 28px 0 36px; margin-bottom: 30px; }
  .detail-page .detail-heading h1 { font-size: 26px; }
  .detail-sidebar { padding: 24px; }
  .detail-page .detail-cover { height: 220px; }
}
.detail-shell:has(> aside) { grid-template-columns: minmax(0, 1fr) 260px; }
.detail-article {
  min-width: 0;
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-heading { padding: clamp(22px, 4vw, 42px); }
.detail-heading h1 {
  margin: 12px 0 18px;
  font-family: var(--font-title);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.25;
  color: var(--ink);
}
.detail-heading .lead { font-size: 17px; line-height: 1.75; color: #526159; margin: 0; font-weight: 400; }
.detail-heading .training-meta, .detail-heading .publication-meta { margin: 22px 0 0; font-size: 14px; }
.detail-cover { margin: 0 clamp(22px, 4vw, 42px) 28px; background: #f3f6f1; border-radius: 8px; overflow: hidden; }
.detail-cover img { display: block; width: 100%; height: auto; max-height: 540px; object-fit: contain; }
.detail-share { margin: 0 clamp(22px, 4vw, 42px) 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.detail-share h2 { font-size: 16px; margin: 0 0 12px; }
.share-links { display: flex; flex-wrap: wrap; gap: 10px; }
.share-links a, .share-links button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--forest); background: white; font-size: 18px; cursor: pointer; }
.share-links a:hover, .share-links button:hover { background: var(--forest); color: white; }
.share-links :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.share-status { margin: 8px 0 0; font-size: 14px; }
.share-fallback { width: 100%; margin-top: 8px; }
.detail-body { margin: 0 clamp(22px, 4vw, 42px) 32px; }
.detail-body { text-align: justify; hyphens: auto; }
.detail-body p { text-align: justify !important; }
.detail-body :is(h1, h2, h3, h4, h5, h6) { text-align: left; }
.detail-information { margin: 0 clamp(22px, 4vw, 42px) 24px; }
.detail-information:empty { display: none; }
.profile-dialog { max-height: 90vh; overflow-y: auto; }
.profile-dialog-content { min-width: 0; }
.profile-biography { text-align: justify; hyphens: auto; }
.profile-biography p { font-size: inherit; text-align: justify !important; }
.profile-dialog-content .profile-biography strong { display: inline; color: inherit; margin: 0; }
.profile-dialog-content .profile-biography p {
  margin: 0 0 1.25em;
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  max-height: none;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}
.detail-actions { margin: 0 clamp(22px, 4vw, 42px); padding: 24px 0; border-top: 1px solid var(--line); font-size: 15px; }
.detail-article > .countdown-card, .detail-notice { margin: 0 clamp(22px, 4vw, 42px) 28px; }
.detail-notice { padding: 16px; background: #f3f6f1; border-left: 3px solid var(--forest); }
.detail-page .recent-posts-aside { position: static; }
@media (max-width: 900px) {
  .detail-shell:has(> aside) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 540px) {
  .detail-shell { width: calc(100% - 24px); }
  .detail-heading .lead { font-size: 16px; }
  .detail-cover img { height: auto; max-height: 360px; }
}
