/*
  Page typography + markdown elements.
*/

.page-title{
  display:flex;
  align-items:center;
  gap: 10px;
  margin: 0 0 14px 0;
}
.page-title h1{
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.4px;
}
.page-title-icon{
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  opacity: .95;
}
.page-title-icon img{ width: 22px; height: 22px; object-fit: contain; }
.page-title-icon svg{ width: 22px; height: 22px; }

.page-body{
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  opacity: .92;
}
.page-body p{ margin: 10px 0; }

.page-body h2{
  margin: 28px 0 12px 0;
  font-size: 16px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.page-body h3{
  margin: 18px 0 10px 0;
  font-size: 14px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.page-body a{
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(52,211,153,0.55);
  text-underline-offset: 3px;
}
.page-body a:hover{
  text-decoration-color: rgba(52,211,153,0.85);
}

.page-body code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: var(--codeBg);
  border: 1px solid var(--codeBorder);
  padding: 2px 6px;
  border-radius: 8px;
  color: inherit;
}

/* Inline icon / image macro (e.g. [[icon:idea|h=18]]) */
.inline-media{
  display: inline-block;
  height: 1em;
  width: auto;
  vertical-align: middle;
  margin: 0 0.35em;
}
.inline-media-link{ text-decoration: none; }

.page-body pre{
  background: rgba(2,6,23,0.62);
  border: 1px solid rgba(148,163,184,0.18);
  color: rgba(241,245,249,0.94);
  border-radius: var(--radius);
  padding: 14px;
  overflow:auto;
}
html[data-theme="light"] .page-body pre{
  background: #0b1220;
  border: 1px solid rgba(2,6,23,0.12);
  color: #e8ecff;
}
.page-body pre code{
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

/* Tables */
.page-body table{
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
}
.page-body th, .page-body td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border2);
}
.page-body th{
  text-align:left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  opacity: .85;
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] .page-body th{ background: rgba(2,6,23,0.03); }
.page-body tr:last-child td{ border-bottom: none; }

/* Blockquotes */
.page-body blockquote{
  margin: 14px 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(52,211,153,0.55);
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  color: var(--text);
}
html[data-theme="light"] .page-body blockquote{ background: rgba(2,6,23,0.03); }


/* Callout widget */
.callout{
  margin: 14px 0;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
html[data-theme="light"] .callout{ background: rgba(2,6,23,0.03); }

.callout-inner{
  display: flex;
  gap: 12px;
  padding: 12px;
  align-items: flex-start;
}

.callout-icon{
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
}

.callout-icon img{
  width: 56px;
  height: 56px;
  display: block;
}

.callout-content{ min-width: 0; flex: 1; }

.callout-title{
  padding: 0;
  font-size: 12px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  opacity: .9;
  margin: 0 0 6px 0;
}

.callout-body{
  padding: 0;
  opacity: .92;
}
.callout-body > :first-child{ margin-top: 0; }
.callout-body > :last-child{ margin-bottom: 0; }

/* Variants */
.callout.note{ border-left: 3px solid rgba(52,211,153,0.55); }
.callout.tip{ border-left: 3px solid rgba(56,189,248,0.55); }
.callout.warning{ border-left: 3px solid rgba(251,191,36,0.6); }
.callout.error{
  border-left: 3px solid rgba(239,68,68,0.75);
  background: rgba(239,68,68,0.06);
}
html[data-theme="light"] .callout.error{
  background: rgba(239,68,68,0.08);
}

/* Header image (front matter: header / headerImage / header_image) */
.page-header{
  margin: -26px -26px 16px -26px;
  border-radius: var(--radius) var(--radius) 14px 14px;
  overflow: hidden;
  border: 1px solid var(--border2);
  box-shadow: var(--shadow2);
}
.page-header img{
  width: 100%;
  height: var(--header-h, auto);
  display: block;
  object-fit: var(--header-fit, cover);
  object-position: var(--header-pos, center);
}

/* Single image widget */
.wimage{
  margin: 14px 0;
}
.wimage-media{
  width: var(--wimage-w, 100%);
  max-width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow2);
  background: rgba(255,255,255,0.02);
}
.wimage img{
  width: 100%;
  height: var(--wimage-h, auto);
  display: block;
  object-fit: var(--wimage-fit, contain);
}
.wimage-link{ display:block; color: inherit; text-decoration: none; }
.wimage-cap{
  font-size: 12px;
  opacity: .75;
  margin-top: 8px;
}

.wimage.align-center .wimage-media{ margin-left: auto; margin-right: auto; }
.wimage.align-left .wimage-media{ float:left; margin: 6px 16px 10px 0; }
.wimage.align-right .wimage-media{ float:right; margin: 6px 0 10px 16px; }
.wimage::after{ content:""; display:block; clear:both; }

@media (max-width: 780px){
  .wimage.align-left .wimage-media,
  .wimage.align-right .wimage-media{
    float: none;
    margin: 0 auto 10px auto;
  }
}

/*
 * When images are rendered using the ``image`` macro with an explicit width
 * (e.g. width: 20% or 40%), the inline style applied to the wrapper
 * element can cause very narrow thumbnails on small screens.  On
 * narrow viewports we want images to take up the full available
 * width so that they remain legible.  We override both the width on
 * the wrapper and the underlying img element here.  See issue raised
 * by mobile users where pictures appeared tiny on phones.
 */
@media (max-width: 900px){
  .wimage-media{
    width: 100% !important;
    max-width: 100% !important;
  }
  .wimage-media img{
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
  }
  /* remove floats and extra margins on all image alignments */
  .wimage-media,
  .wimage{
    float: none !important;
  }
}

/*
 * Adjust header margins on mobile.  The default desktop styling uses
 * large negative margins to make the header bleed outside the
 * cardʼs padding; on phones this creates horizontal overflow and
 * causes the header to stick out of the card.  Here we reduce the
 * negative margins so that the header aligns with the card edges
 * defined by the reduced padding in mobile mode.  See discussion in
 * https://github.com/excedereo/wiki.velora/issues/?? (user report).
 */
@media (max-width: 860px){
  .page-header{
    margin-left: -16px;
    margin-right: -16px;
  }
}
