/* =========================================================
 * Jeyber content styles
 * Typography and code formatting for ordinary Grav pages.
 * Blog/listing-specific selectors are intentionally absent.
 * ========================================================= */

.article-post {
  color: #2f3437;
  font-size: 15.7px;
  line-height: 1.82;
  font-weight: 400;
}

.article-post p {
  margin: 0 0 1.15rem;
}

.article-post ul,
.article-post ol {
  margin: 0 0 1.2rem;
  padding-left: 1.35rem;
}

.article-post li {
  margin-bottom: .4rem;
  line-height: 1.75;
}

.article-post h2 {
  margin: 2rem 0 .9rem;
  color: #1f2529;
  font-size: 1.8rem;
  line-height: 1.28;
  font-weight: 700;
}

body:not(.has-subtle-page-background) .jeyber-default-page-section .article-post > h2:first-child {
  margin-top: 1.25rem;
}

body.has-subtle-page-background .jeyber-default-page-section .article-post > h2:first-child {
  margin-top: 0;
}

.article-post h3 {
  margin: 1.65rem 0 .75rem;
  color: #232a2f;
  font-size: 1.42rem;
  line-height: 1.34;
  font-weight: 700;
}

.article-post h4 {
  margin: 1.35rem 0 .6rem;
  color: #2a3136;
  font-size: 1.12rem;
  line-height: 1.4;
  font-weight: 700;
}

.article-post p a,
.article-post li a,
.article-post blockquote a,
.article-post td a {
  color: #2f567b;
  font-weight: 600;
  text-decoration: none;
  transition: color .18s ease;
}

.article-post p a:visited,
.article-post li a:visited,
.article-post blockquote a:visited,
.article-post td a:visited {
  color: #4b6985;
}

.article-post p a:hover,
.article-post li a:hover,
.article-post blockquote a:hover,
.article-post td a:hover,
.article-post p a:focus-visible,
.article-post li a:focus-visible,
.article-post blockquote a:focus-visible,
.article-post td a:focus-visible {
  color: #1f405d;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-post strong {
  color: #1f2529;
  font-weight: 700;
}

.article-post blockquote {
  position: relative;
  margin: 1.4rem 0;
  padding: .95rem 1.15rem;
  border-left: 3px solid rgba(47, 86, 123, .28);
  background: #f7f9fb;
  color: #3c454b;
  font-size: .98em;
  line-height: 1.75;
}

.article-post blockquote::before,
.article-post blockquote::after,
.article-post blockquote p::before,
.article-post blockquote p::after {
  content: none;
  display: none;
}

.article-post blockquote p:last-child {
  margin-bottom: 0;
}

.article-post blockquote cite {
  display: block;
  margin-top: .7rem;
  color: #66737d;
  font-size: .95em;
  font-style: normal;
}

.article-post table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: .97em;
}

.article-post th,
.article-post td {
  padding: .65rem .8rem;
  border: 1px solid #dbe2e8;
  text-align: left;
  vertical-align: top;
}

.article-post th {
  background: #f6f8fa;
  color: #24303a;
  font-weight: 600;
}

.article-post img {
  max-width: 100%;
  height: auto;
  margin: 1.2rem 0;
  border-radius: 6px;
}

.article-post hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid #e1e6eb;
}

/* Inline code. */
.article-post :not(pre) > code {
  padding: .14em .4em;
  border: 1px solid #d9e0e6;
  border-radius: 4px;
  background: #f3f5f7;
  color: #7a2331;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .92em;
  line-height: 1;
  white-space: break-spaces;
}

.article-post a code {
  color: inherit;
}

/* Multiline code blocks. */
.article-post pre,
.article-post .highlight pre {
  max-height: 420px;
  margin: 1.25rem 0;
  padding: 1rem 1.1rem 1.35rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d8e0e7;
  border-left: 4px solid #9db1c3;
  border-radius: 8px;
  background: #f6f8fa;
  box-shadow: none;
  line-height: 1.68;
  scrollbar-color: #9db1c3 #eef3f7;
  scrollbar-width: thin;
  tab-size: 2;
}

.article-post pre code,
.article-post .highlight pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f2933;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .94em;
  line-height: 1.68;
  white-space: pre;
}

.article-post figure.highlight {
  margin: 1.25rem 0;
}

.article-post figure.highlight pre {
  margin: 0;
}

.article-post pre::-webkit-scrollbar,
.article-post .highlight pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.article-post pre::-webkit-scrollbar-track,
.article-post .highlight pre::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #eef3f7;
}

.article-post pre::-webkit-scrollbar-thumb,
.article-post .highlight pre::-webkit-scrollbar-thumb {
  border: 2px solid #eef3f7;
  border-radius: 999px;
  background: #9db1c3;
  box-shadow: none;
}

.article-post pre::-webkit-scrollbar-thumb:hover,
.article-post .highlight pre::-webkit-scrollbar-thumb:hover {
  background: #7f97aa;
}

.article-post pre::-webkit-scrollbar-corner,
.article-post .highlight pre::-webkit-scrollbar-corner {
  background: #eef3f7;
}

@media (max-width: 768px) {
  .article-post pre,
  .article-post .highlight pre {
    max-height: 320px;
  }
}

/* Per-page size, alignment and wrapping for the first content image. */
.article-post img.jeyber-lead-image {
  display: block;
  max-width: 100%;
  height: auto;
}

body.has-lead-image-size-480 .article-post img.jeyber-lead-image {
  width: min(100%, 480px);
}

body.has-lead-image-size-640 .article-post img.jeyber-lead-image {
  width: min(100%, 640px);
}

body.has-lead-image-size-750 .article-post img.jeyber-lead-image {
  width: min(100%, 750px);
}

body.has-lead-image-size-full .article-post img.jeyber-lead-image {
  width: 100%;
}

body.has-lead-image-align-left .article-post img.jeyber-lead-image {
  margin-right: auto;
  margin-left: 0;
}

body.has-lead-image-align-center .article-post img.jeyber-lead-image {
  margin-right: auto;
  margin-left: auto;
}

body.has-lead-image-align-right .article-post img.jeyber-lead-image {
  margin-right: 0;
  margin-left: auto;
}

body:is(.has-lead-image-layout-wrap-left, .has-lead-image-layout-wrap-right) .article-post::after {
  display: block;
  clear: both;
  content: "";
}

.article-post > .jeyber-lead-image-float {
  width: 44%;
  max-width: 480px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.article-post > .jeyber-lead-image-float--left {
  float: left;
  margin-right: 28px;
  margin-left: 0;
}

.article-post > .jeyber-lead-image-float--right {
  float: right;
  margin-right: 0;
  margin-left: 28px;
}

.article-post > .jeyber-lead-image-float img.jeyber-lead-image {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body.has-lead-image-size-640 .article-post > .jeyber-lead-image-float {
  max-width: 640px;
}

body.has-lead-image-size-750 .article-post > .jeyber-lead-image-float {
  max-width: 750px;
}

body.has-lead-image-size-full .article-post > .jeyber-lead-image-float {
  width: 100%;
  max-width: none;
}

body:is(.has-lead-image-layout-wrap-left, .has-lead-image-layout-wrap-right)
  .article-post > :is(h1, h2, h3, h4, h5, h6, hr, pre, table, .table-responsive) {
  clear: both;
}

/* The image remains at its Markdown position. Only the following text wraps. */
@media (min-width: 768px) {
  body:is(.has-lead-image-layout-wrap-left, .has-lead-image-layout-wrap-right)
    .jeyber-default-page-section .article-post > .jeyber-lead-image-float + :is(p, blockquote) {
    text-align: justify;
    text-align-last: start;
    text-justify: inter-word;
  }

  body:not(.has-subtle-page-background):not(.has-lead-image-layout-wrap-left):not(.has-lead-image-layout-wrap-right)
    .jeyber-default-page-section .article-post > :is(p, figure):first-child img:first-child,
  body:not(.has-subtle-page-background):not(.has-lead-image-layout-wrap-left):not(.has-lead-image-layout-wrap-right)
    .jeyber-default-page-section .article-post > img:first-child {
    margin-top: 0;
  }

  body.has-subtle-page-background:not(.has-lead-image-layout-wrap-left):not(.has-lead-image-layout-wrap-right)
    .jeyber-default-page-section .article-post > :is(p, figure):first-child img:first-child,
  body.has-subtle-page-background:not(.has-lead-image-layout-wrap-left):not(.has-lead-image-layout-wrap-right)
    .jeyber-default-page-section .article-post > img:first-child {
    margin-top: 8px;
  }
}

@media (max-width: 767px) {
  .article-post > .jeyber-lead-image-float,
  .article-post > .jeyber-lead-image-float--left,
  .article-post > .jeyber-lead-image-float--right {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px;
  }
}

/* Default page shell: unified geometry for ordinary and subtle backgrounds.
 * These rules are attached to templates/default.html.twig, not to body_classes.
 * Table-specific classes only style the article contents below. */
.content-container--page {
  width: min(calc(100% - 40px), 960px);
}

.jeyber-default-page-heading {
  padding-top: 32px;
  padding-bottom: 32px;
}

body.has-subtle-page-background .jeyber-default-page-heading {
  background: transparent;
}

.jeyber-default-page-heading h1 {
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.jeyber-default-page-section {
  padding-top: 0;
  padding-bottom: 48px;
}

/* Keep the visible content-to-footer gap equal to the section padding.
 * Default typography gives the final block its own bottom margin (tables use
 * 1.25rem), which otherwise adds roughly 16–20 px to the intended 48 px. */
.jeyber-default-page-section .article-post > :last-child,
.jeyber-default-page-section .article-post > :last-child > :last-child {
  margin-bottom: 0;
}

body.has-subtle-page-background .jeyber-default-page-section > .content-container {
  padding: 30px 40px;
  border: 1px solid rgba(209, 219, 225, .9);
  border-radius: 12px;
  background: rgba(255, 255, 255, .985);
  box-shadow: 0 14px 34px rgba(35, 48, 58, .075);
}

/* GVLK tables: internal table and Client Portal style copying only.
 * Body classes:
 * - table-left-page: column headings, edition names, keys and copy controls aligned left.
 * - table-center-page: column headings, keys and copy controls centered; edition names aligned left.
 * Rules are scoped to .gvlk-table, so other tables are not affected. */

:is(.table-left-page, .table-center-page) .article-post > :is(p, figure):first-child {
  margin-top: 0;
}

:is(.table-left-page, .table-center-page) .article-post > :is(p, figure):first-child img:first-child,
:is(.table-left-page, .table-center-page) .article-post > img:first-child {
  margin-top: 0;
  margin-bottom: 1.7rem;
}

:is(.table-left-page, .table-center-page) .article-post > br {
  display: none;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-section-title,
:is(.table-left-page, .table-center-page) .article-post h5 {
  margin: 1.75rem 0 .75rem;
  color: #1f2529;
  font-size: 1.28rem;
  line-height: 1.3;
  font-weight: 700;
  text-align: left;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-section-title:first-child,
:is(.table-left-page, .table-center-page) .article-post h5:first-child,
:is(.table-left-page, .table-center-page) .article-post > :is(p, figure):first-child + .gvlk-section-title,
:is(.table-left-page, .table-center-page) .article-post > :is(p, figure):first-child + h5 {
  margin-top: 0;
}

:is(.table-left-page, .table-center-page) .article-post .table-responsive {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-table {
  width: 100%;
  min-width: 760px;
  margin: 0 0 1.5rem;
  table-layout: fixed;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-table col:first-child {
  width: 52%;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-table col:last-child {
  width: 48%;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-table th,
:is(.table-left-page, .table-center-page) .article-post .gvlk-table td {
  padding-inline: 14px;
  vertical-align: middle;
}

/* Edition names stay aligned left in both variants. */
:is(.table-left-page, .table-center-page) .article-post .gvlk-table tbody td:first-child {
  text-align: left;
}

/* Header alignment follows the selected page variant. */
.table-left-page .article-post .gvlk-table thead th {
  text-align: left;
}

.table-center-page .article-post .gvlk-table thead th {
  text-align: center;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-table thead th {
  font-weight: 650;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* Left variant: key and copy control follow the left edge of the second column. */
.table-left-page .article-post .gvlk-table tbody td:last-child {
  text-align: left;
}

.table-left-page .article-post .gvlk-copy-wrap {
  justify-content: flex-start;
  text-align: left;
}

/* Center variant: only the key and copy control are centered. */
.table-center-page .article-post .gvlk-table tbody td:last-child {
  text-align: center;
}

.table-center-page .article-post .gvlk-copy-wrap {
  justify-content: center;
  text-align: center;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-key {
  display: inline-flex;
  min-height: 28px;
  padding: 3px 8px;
  align-items: center;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
  color: #374151;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .88em;
  line-height: 1.25;
  white-space: nowrap;
  user-select: all;
  cursor: text;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #74838c;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy i {
  display: block;
  line-height: 1;
  pointer-events: none;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy:focus,
:is(.table-left-page, .table-center-page) .article-post .gvlk-copy:focus:not(:focus-visible) {
  color: #74838c;
  background: transparent;
  outline: 0;
  box-shadow: none;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy:focus-visible {
  color: #d82f49;
  background: rgba(216, 47, 73, .08);
  outline: 2px solid rgba(216, 47, 73, .28);
  outline-offset: 2px;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy.is-copied {
  color: #276b50;
  background: #f1f8f3;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy.is-copy-error {
  color: #9c2639;
  background: #fff0f3;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy-feedback {
  min-height: 1.3em;
  color: #276b50;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy-feedback:empty {
  display: none;
}

:is(.table-left-page, .table-center-page) .article-post .gvlk-copy-feedback.is-error {
  color: #9c2639;
}

@media (hover: hover) and (pointer: fine) {
  :is(.table-left-page, .table-center-page) .article-post .gvlk-copy:hover,
  :is(.table-left-page, .table-center-page) .article-post .gvlk-copy:active {
    color: #d82f49;
    background: transparent;
  }

  :is(.table-left-page, .table-center-page) .article-post .gvlk-copy.is-copied:hover,
  :is(.table-left-page, .table-center-page) .article-post .gvlk-copy.is-copied:active {
    color: #276b50;
    background: #f1f8f3;
  }

  :is(.table-left-page, .table-center-page) .article-post .gvlk-copy.is-copy-error:hover,
  :is(.table-left-page, .table-center-page) .article-post .gvlk-copy.is-copy-error:active {
    color: #9c2639;
    background: #fff0f3;
  }
}

@media (max-width: 991px) {
  .jeyber-default-page-heading h1 {
    font-size: 34px;
  }
}

@media (max-width: 767px) {
  .content-container--page {
    width: min(calc(100% - 24px), 960px);
  }

  .jeyber-default-page-heading {
    padding-top: 24px;
    padding-bottom: 22px;
  }

  .jeyber-default-page-heading h1 {
    font-size: 32px;
  }

  .jeyber-default-page-section {
    padding-bottom: 32px;
  }

  body.has-subtle-page-background .jeyber-default-page-section > .content-container {
    padding: 24px 20px;
    border-radius: 10px;
  }

  :is(.table-left-page, .table-center-page) .article-post .gvlk-table {
    min-width: 700px;
  }
}
