/* Project 400 v1.1.13 — readable wide news posts, additive to v1.1.12.
   Never change article hero/gallery presentation, homepage, event posters, or site.css.
   Customizer controls global defaults; explicitly wide Framix layouts remain wide. */
body.single-post {
  --darcis-reader-width: 950px;
  --darcis-reader-font-desktop: 19px;
  --darcis-reader-font-mobile: 18px;
}

/* Includes the native single-post template and native Darcis article blocks in Framix. */
body.single-post #main .darcis-article-body {
  width: 100%;
  max-width: min(100%, var(--darcis-reader-width)) !important;
  margin-inline: auto;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

/* Some saved Framix documents set a narrow container independently of the
   story itself. Expand the standard one-column article shell, but leave
   intentional multi-column and explicit article-wide layouts alone. */
body.single-post #main .framix-article-content-container:not(.has-left-sidebar):not(.has-right-sidebar):not(.framix-article-wide) {
  width: min(calc(100% - 2rem), var(--darcis-reader-width)) !important;
  max-width: min(100%, var(--darcis-reader-width)) !important;
  margin-inline: auto;
  min-width: 0;
}
body.single-post #main .framix-article-content-container:not(.has-left-sidebar):not(.has-right-sidebar) > .darcis-article-body {
  width: 100% !important;
}

/* Respect a saved Framix article-specific "Widen article reading area" choice. */
body.single-post #main .framix-article-content-container.framix-article-wide .darcis-article-body {
  max-width: min(100%, 1050px) !important;
}

/* Framix side columns must not steal width from the reading column. The existing
   plugin controls sidebar stacking; this adjusts its default reading width. */
body.single-post #main .framix-article-content-container:is(.has-left-sidebar,.has-right-sidebar):not(.framix-article-wide) {
  --framix-reading-width: var(--darcis-reader-width) !important;
  /* Reserve real gutter space for optional sidebars on a large screen. */
  width: min(1520px, calc(100% - 2rem)) !important;
  max-width: 1520px !important;
}
/* At intermediate desktop sizes, avoid squeezing sidebars into narrow rails. */
@media (min-width: 701px) and (max-width: 1360px) {
  body.single-post #main .framix-article-content-container:is(.has-left-sidebar,.has-right-sidebar):not(.framix-article-wide) > .framix-article-native-sidebar {
    grid-column: 2 !important;
    grid-row: auto !important;
    margin: 20px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

body.single-post #main :is(.darcis-article-body,.framix-article-reading) :is(p,li) {
  font-size: var(--darcis-reader-font-desktop) !important;
  line-height: 1.75 !important;
  letter-spacing: 0;
  overflow-wrap: break-word;
}
body.single-post #main :is(.darcis-article-body,.framix-article-reading) p {
  margin-block: 0 1.25em;
}
body.single-post #main :is(.darcis-article-body,.framix-article-reading) :is(h2,h3,h4) {
  line-height: 1.28;
  overflow-wrap: break-word;
}
body.single-post #main :is(.darcis-article-body,.framix-article-reading) :is(img,video,iframe,figure) {
  max-width: 100%;
}
body.single-post #main :is(.darcis-article-body,.framix-article-reading) :is(pre,table) {
  max-width: 100%;
  overflow-x: auto;
}

/* Article body may fill its parent, but not the viewport edges. The site's
   existing .container provides the standard desktop and phone margins. */
@media (max-width: 760px) {
  body.single-post #main .darcis-article-body { max-width: 100% !important; }
  body.single-post #main :is(.darcis-article-body,.framix-article-reading) :is(p,li) {
    font-size: var(--darcis-reader-font-mobile) !important;
    line-height: 1.7 !important;
  }
  body.single-post #main :is(.darcis-article-body,.framix-article-reading) p {
    margin-bottom: 1.2em;
  }
  body.single-post #main .framix-article-content-container:is(.has-left-sidebar,.has-right-sidebar) {
    width: calc(100% - 2rem);
    max-width: 100%;
  }
}
