/* ----- Standard pages: centered grid shell + single-column article ----- */

html.sidebar-on body.literary-front-page .wrapper.full-wrap.page-wrap,
html.sidebar-on body.page-template-default .wrapper.full-wrap.page-wrap,
html.sidebar-on body.page-template-template-sidebar-php .wrapper.full-wrap.page-wrap,
html.sidebar-on body.page-template-template-sidebar-left-php .wrapper.full-wrap.page-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 2rem;
  width: 100%;
  max-width: 910px;
  margin-left: auto;
  margin-right: auto;
  align-items: start;
}

html.sidebar-on.left body.literary-front-page .wrapper.full-wrap.page-wrap,
html.sidebar-on body.page-template-template-sidebar-left-php .wrapper.full-wrap.page-wrap {
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

html.sidebar-on body.literary-front-page .content,
html.sidebar-on body.page-template-default .content,
html.sidebar-on body.page-template-template-sidebar-php .content,
html.sidebar-on body.page-template-template-sidebar-left-php .content {
  min-width: 0;
  width: auto;
  float: none;
  text-align: left;
}

html.sidebar-on body.literary-front-page .sidebar,
html.sidebar-on body.page-template-default .sidebar,
html.sidebar-on body.page-template-template-sidebar-php .sidebar,
html.sidebar-on body.page-template-template-sidebar-left-php .sidebar {
  width: auto;
  max-width: none;
  float: none;
}

html.sidebar-on.left body.literary-front-page .sidebar,
html.sidebar-on body.page-template-template-sidebar-left-php .sidebar {
  padding-left: 0;
}

html.sidebar-on.left body.literary-front-page .content,
html.sidebar-on body.page-template-template-sidebar-left-php .content {
  text-align: left;
}

/* No sidebar: center content block */
html:not(.sidebar-on) body.literary-front-page .wrapper.full-wrap.page-wrap,
html:not(.sidebar-on) body.page-template-default .wrapper.full-wrap.page-wrap,
html:not(.sidebar-on) body.page-template-template-sidebar-php .wrapper.full-wrap.page-wrap,
html:not(.sidebar-on) body.page-template-template-sidebar-left-php .wrapper.full-wrap.page-wrap {
  justify-content: center;
}

html:not(.sidebar-on) body.literary-front-page .content,
html:not(.sidebar-on) body.page-template-default .content,
html:not(.sidebar-on) body.page-template-template-sidebar-php .content,
html:not(.sidebar-on) body.page-template-template-sidebar-left-php .content {
  flex: 0 1 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  float: none;
  width: 100%;
}

@media screen and (max-width: 59.9375em) {
  html.sidebar-on body.literary-front-page .wrapper.full-wrap.page-wrap,
  html.sidebar-on body.page-template-default .wrapper.full-wrap.page-wrap,
  html.sidebar-on body.page-template-template-sidebar-php .wrapper.full-wrap.page-wrap,
  html.sidebar-on body.page-template-template-sidebar-left-php .wrapper.full-wrap.page-wrap {
    display: flex;
    flex-direction: column;
    max-width: none;
    gap: 0;
  }

  html.sidebar-on body.literary-front-page .sidebar,
  html.sidebar-on body.page-template-default .sidebar,
  html.sidebar-on body.page-template-template-sidebar-php .sidebar,
  html.sidebar-on body.page-template-template-sidebar-left-php .sidebar {
    width: 100%;
    order: 2;
    padding-left: 0;
  }

  html.sidebar-on body.literary-front-page .content,
  html.sidebar-on body.page-template-default .content,
  html.sidebar-on body.page-template-template-sidebar-php .content,
  html.sidebar-on body.page-template-template-sidebar-left-php .content {
    order: 1;
  }
}

@media screen and (min-width: 60em) {
  body.literary-front-page .content,
  body.page-template-default .content {
    width: auto;
    float: none;
  }

  html.sidebar-on body.literary-front-page .content,
  html.sidebar-on body.page-template-default .content,
  html.sidebar-on body.page-template-template-sidebar-php .content,
  html.sidebar-on body.page-template-template-sidebar-left-php .content {
    width: auto;
    flex: none;
  }

  body.literary-front-page article,
  body.page-template-default article,
  body.page-template-template-sidebar-php article,
  body.page-template-template-sidebar-left-php article {
    display: block;
  }

  body.literary-front-page .post-content,
  body.page-template-default .post-content,
  body.page-template-template-sidebar-php .post-content,
  body.page-template-template-sidebar-left-php .post-content,
  body.literary-front-page .meta.top,
  body.page-template-default .meta.top,
  body.page-template-template-sidebar-php .meta.top,
  body.page-template-template-sidebar-left-php .meta.top,
  body.literary-front-page .meta.bottom,
  body.page-template-default .meta.bottom,
  body.page-template-template-sidebar-php .meta.bottom,
  body.page-template-template-sidebar-left-php .meta.bottom {
    float: none;
    width: 100%;
    padding-right: 0;
  }

  html.sidebar-on body.literary-front-page .post-content,
  html.sidebar-on body.page-template-default .post-content,
  html.sidebar-on body.page-template-template-sidebar-php .post-content,
  html.sidebar-on body.page-template-template-sidebar-left-php .post-content {
    width: 100%;
    max-width: none;
  }

  /* Articles without a meta column: undo responsive.css two-column float */
  html:not(.sidebar-on) article:not(:has(> .meta.top)) .post-content,
  html.sidebar-on article:not(:has(> .meta.top)) .post-content {
    float: none;
    width: 100%;
    padding-right: 0;
  }
}

@media screen and (min-width: 64em) {
  html.sidebar-on body.literary-front-page .wrapper.full-wrap.page-wrap,
  html.sidebar-on body.page-template-default .wrapper.full-wrap.page-wrap,
  html.sidebar-on body.page-template-template-sidebar-php .wrapper.full-wrap.page-wrap,
  html.sidebar-on body.page-template-template-sidebar-left-php .wrapper.full-wrap.page-wrap {
    max-width: 1200px;
  }
}

/* 404: centered single-column layout (matches standard pages without sidebar) */
html:not(.sidebar-on) body.error404 .wrapper.full-wrap.page-wrap {
  justify-content: center;
}

html:not(.sidebar-on) body.error404 .content {
  flex: 0 1 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  float: none;
  width: 100%;
}

/* 404: readable text inside .the-content (overrides theme-options .pnf white text) */
body.error404 .pnf .post-content,
body.error404 .pnf .post-content h1,
body.error404 .pnf .the-content,
body.error404 .pnf .the-content p {
  color: #363f48;
}

body.error404 .pnf .the-content {
  padding: 20px 30px 2.5em;
}

body.error404 .pnf .pnf-actions {
  margin: 1.5em 0;
}

body.error404 .pnf .searchform {
  margin: 2em auto 0;
  max-width: 24em;
}

body.error404 .pnf .searchform input.s {
  border: 1px solid #e1e1e1;
}

@media screen and (min-width: 60em) {
  body.error404 .content {
    float: left;
    width: 100%;
    margin-top: 20px;
  }

  body.error404 .post-content {
    float: none;
    width: 100%;
    padding-right: 0;
  }

  body.error404 article {
    display: block;
  }
}
