/* =========================================================
   POSM Central Help
   POSMSoftware.com-inspired Material for MkDocs theme
   ========================================================= */

:root {
  --posm-orange: #f47e28;
  --posm-orange-dark: #dc681c;
  --posm-maroon: #641e1a;
  --posm-purple: #624b78;
  --posm-dark-gray: #53565a;
  --posm-page-gray: #868a8f;
  --posm-medium-gray: #bcbebe;
  --posm-light-gray: #cfd1ce;
  --posm-pale-gray: #dfe0de;
  --posm-text: #2a2a2a;
  --posm-muted-text: #3b3f44;
  --posm-white: #ffffff;

  --md-primary-fg-color: var(--posm-dark-gray);
  --md-primary-fg-color--light: #686d72;
  --md-primary-fg-color--dark: #3e4347;

  --md-accent-fg-color: var(--posm-orange);
  --md-typeset-a-color: var(--posm-maroon);
}

/* ---------- General typography ---------- */

body,
input,
button,
textarea,
select {
  font-family: "Overpass", system-ui, -apple-system, "Segoe UI",
    Helvetica, Arial, sans-serif;
}

.md-typeset {
  color: var(--posm-text);
  font-size: 0.82rem;
  line-height: 1.7;
}

.md-typeset p {
  color: var(--posm-muted-text);
}

/* ---------- Top header ---------- */

.md-header {
  background-color: var(--posm-dark-gray);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.md-header__title {
  font-weight: 700;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  width: auto;
  height: 2rem;
}

/* ---------- Top navigation tabs ---------- */

.md-tabs {
  background-color: var(--posm-orange);
}

.md-tabs__link {
  color: var(--posm-white);
  font-weight: 600;
  opacity: 1;
}

.md-tabs__link:hover,
.md-tabs__link--active {
  color: var(--posm-white);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Page background ---------- */

.md-main {
  background-color: var(--posm-page-gray);
}

.md-main__inner {
  margin-top: 1.2rem;
}

/* Main content sheet */
.md-content__inner {
  background-color: var(--posm-light-gray);
  border-radius: 14px;
  padding: 1.5rem 1.7rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
}

/* Remove automatic top spacing before first heading */
.md-content__inner::before {
  display: none;
}

/* ---------- Headings ---------- */

.md-typeset h1 {
  color: var(--posm-maroon);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}

.md-typeset h2 {
  color: var(--posm-orange);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1.8rem;
}

.md-typeset h3 {
  color: var(--posm-purple);
  font-weight: 700;
}

.md-typeset h4 {
  color: var(--posm-maroon);
  font-weight: 700;
}

/* ---------- Links ---------- */

.md-typeset a {
  color: var(--posm-maroon);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.md-typeset a:hover {
  color: var(--posm-orange);
}

/* ---------- Left navigation ---------- */

.md-sidebar--primary .md-sidebar__scrollwrap {
  background-color: var(--posm-light-gray);
  border-radius: 12px;
  padding: 0.5rem;
}

.md-nav__title {
  color: var(--posm-maroon);
  font-weight: 700;
}

.md-nav__link {
  color: var(--posm-text);
}

.md-nav__link:hover {
  color: var(--posm-orange);
}

.md-nav__link--active {
  color: var(--posm-orange) !important;
  font-weight: 700;
}

/* ---------- Right table of contents ---------- */

.md-sidebar--secondary .md-sidebar__scrollwrap {
  background-color: var(--posm-pale-gray);
  border-radius: 12px;
  padding: 0.5rem;
}

/* ---------- Search ---------- */

.md-search__form {
  background-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.md-search__form:hover {
  background-color: rgba(255, 255, 255, 0.22);
}

/* ---------- Images and screenshots ---------- */

.md-typeset img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2rem auto;
  border-radius: 12px;
}

.posm-screenshot {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* ---------- POSM-style content cards ---------- */

.posm-card {
  background-color: var(--posm-medium-gray);
  border-radius: 14px;
  padding: 1.1rem;
  margin: 1.2rem 0;
}

.posm-card-light {
  background-color: var(--posm-light-gray);
  border-radius: 14px;
  padding: 1.1rem;
  margin: 1.2rem 0;
}

.posm-card-white {
  background-color: var(--posm-white);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}

/* ---------- Buttons ---------- */

.posm-button {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  background-color: var(--posm-orange);
  color: var(--posm-white) !important;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12);
}

.posm-button:hover {
  background-color: var(--posm-orange-dark);
  color: var(--posm-white) !important;
}

.posm-button-secondary {
  display: inline-block;
  padding: 0.65rem 1rem;
  background-color: var(--posm-dark-gray);
  color: var(--posm-white) !important;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none !important;
}

/* ---------- Admonitions / notice boxes ---------- */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 12px;
  box-shadow: none;
}

.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: var(--posm-purple);
}

.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: var(--posm-orange);
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-color: var(--posm-maroon);
}

/* ---------- Tables ---------- */

.md-typeset__table {
  width: 100%;
}

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background-color: var(--posm-dark-gray);
  color: var(--posm-white);
  font-weight: 700;
}

.md-typeset table:not([class]) tr:nth-child(even) {
  background-color: var(--posm-pale-gray);
}

/* ---------- Code ---------- */

.md-typeset code {
  border-radius: 4px;
}

/* ---------- Footer ---------- */

.md-footer {
  background-color: var(--posm-dark-gray);
}

.md-footer-meta {
  background-color: #45494d;
}

/* ---------- Mobile ---------- */

@media screen and (max-width: 76.234375em) {
  .md-main {
    background-color: var(--posm-page-gray);
  }

  .md-content__inner {
    border-radius: 12px;
  }
}

@media screen and (max-width: 44.984375em) {
  .md-main__inner {
    margin-top: 0.5rem;
  }

  .md-content__inner {
    padding: 1rem;
    margin: 0 0.5rem 1rem;
  }

  .md-typeset {
    font-size: 0.78rem;
  }

  .md-typeset h1 {
    font-size: 1.65rem;
  }
}

/* POSM support PIN form */
.posm-support-pin {
  max-width: 520px;
  margin: 1.25rem 0;
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--posm-light-gray, #cfd1ce);
}

.posm-support-pin form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.posm-support-pin input {
  width: 180px;
  max-width: 100%;
  padding: 0.7rem;
  border: 1px solid #868a8f;
  border-radius: 6px;
  background: #ffffff;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 0.2rem;
}

.posm-support-pin button {
  width: fit-content;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--posm-orange, #f47e28);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.posm-support-pin button:hover {
  filter: brightness(0.92);
}

/* POSM screenshot thumbnail gallery */
.posm-image-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 1.25rem 0;
}

.posm-image-gallery a {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(83, 86, 90, 0.35);
  border-radius: 8px;
  background: #ffffff;
}

.posm-image-gallery img {
  display: block;
  width: 100%;
  height: 170px;
  margin: 0;
  object-fit: cover;
  object-position: top;
  cursor: zoom-in;
}

@media screen and (max-width: 800px) {
  .posm-image-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 500px) {
  .posm-image-gallery {
    grid-template-columns: 1fr;
  }

  .posm-image-gallery img {
    height: auto;
  }
}

.posm-featured-gallery img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 8px;
  cursor: zoom-in;
}

.posm-gallery-hidden {
  display: none;
}

/* Make documentation screenshots clearly clickable */
.md-typeset img {
  cursor: zoom-in;
  border-radius: 8px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.md-typeset img:hover {
  opacity: 0.96;
  transform: scale(1.005);
}

/* Allow large screenshots to use most of the lightbox window */
.gslide-image img {
  max-width: 96vw !important;
  max-height: 94vh !important;
  width: auto;
  height: auto;
  object-fit: contain;
}