/* Page width */
body {
  max-width: 1200px;
  margin: 3rem auto;
}

/* Blockquote */
blockquote {
  border-left: 4px solid #a9a9a9;
  margin: 1em 0;
  padding: 0.5em 1em;
  color: #ebe9e9;
  background-color: #392f61;
  font-style: italic;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

blockquote blockquote {
  border-left-color: #808080;
}

/* Tables (desktop default) */
table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  background-color: #392f61;
}

th, td {
  border: 1px solid #a9a9a9;
  padding: 0.5em;
  text-align: left;
}

th {
  background-color: #392f61;
  color: #f79558;
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: #392f61;
}

/* -------- Medium Zoom -------- */

/* Overlay always full screen */
.medium-zoom-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9998 !important;
  background: rgba(0, 0, 0, 0.85) !important;
}

/* Root fix while zoom is open: remove theme layout effects */
html.mz-root-open,
html.mz-root-open body {
  animation: none !important;
  transform: none !important;
  filter: none !important;
}

/* Hide decoration layer during zoom (optional but keeps things stable) */
html.mz-root-open body::before {
  display: none !important;
  content: none !important;
}

/* Fix white blank image (theme filter conflict) */
body.medium-zoom--opened .medium-zoom-image--opened,
body.medium-zoom--opened .medium-zoom-image--open,
body.medium-zoom--opened .medium-zoom-image {
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 9999 !important;
}

/* Fix global img margin affecting the zoomed clone */
body.medium-zoom--opened .medium-zoom-image--opened,
body.medium-zoom--opened .medium-zoom-image--open {
  margin: 0 !important;
}

/* Center zoom image + support pan and scale */
body.medium-zoom--opened img.medium-zoom-image.mz-fixed {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;

  width: auto !important;
  height: auto !important;

  --mz-scale: 1;
  --mz-x: 0px;
  --mz-y: 0px;

  max-width: 95vw !important;
  max-height: 95vh !important;

  margin: 0 !important;
  transform: translate(
      calc(-50% + var(--mz-x)),
      calc(-50% + var(--mz-y))
    )
    scale(var(--mz-scale)) !important;
}

/* When zoom > 1, allow bigger than viewport and drag */
body.medium-zoom--opened img.medium-zoom-image.mz-fixed.mz-pan {
  max-width: none !important;
  max-height: none !important;

  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

body.medium-zoom--opened img.medium-zoom-image.mz-fixed.mz-pan:active {
  cursor: grabbing;
}

/* Toggle button */
.mz-zoom-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

/* -------- Inline code (markdown `like this`) -------- */
/* Do NOT touch Rouge code blocks (.highlight / pre) */
:not(pre) > code:not([class]),
p code,
li code,
blockquote code,
td code {
  display: inline !important;
  padding: 0.1em 0.3em !important;
  margin: 0 !important;

  font-size: 0.95em !important;
  line-height: 1.2 !important;
  border-radius: 4px !important;

  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  transform: none !important;

  background: rgba(127, 127, 127, 0.18) !important;
}

/* Safety: never override Rouge highlighting blocks */
.highlight code,
.highlight pre,
pre code {
  background: initial;
  text-shadow: initial;
  box-shadow: initial;
  filter: initial;
  -webkit-filter: initial;
  transform: initial;
}

/* -------- Mobile table scrolling (works with your JS wrapper) -------- */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important; /* prevent whole page sideways scroll */
  }

  .table-scroll {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Let table be wider than screen so the wrapper can scroll */
  .table-scroll > table {
    width: max-content !important;
    min-width: 100% !important;
  }

  .table-scroll th,
  .table-scroll td {
    white-space: nowrap;
  }
}
