/*
 * SPDX-FileCopyrightText: 2026 Open Health Technology Foundation contributors
 * SPDX-License-Identifier: CC-BY-SA-4.0
 *
 * OHTF palette and landing-page styles on top of the Zensical modern variant.
 * Colour tokens live here only; change the brand by editing :root below.
 *
 * Brand: Surgical Green (#0D4A3B) and its tint scale, mixed with white in
 * sRGB. No accent colours have been chosen yet, so do not add any; use the
 * tints, white, and black at low opacity for depth.
 */

:root {
  --ohtf-surgical-green: #0d4a3b;
  --ohtf-surgical-green-100: #0d4a3b;
  --ohtf-surgical-green-80: #3d6e62;
  --ohtf-surgical-green-60: #6e9289;
  --ohtf-surgical-green-40: #9eb7b1;
  --ohtf-surgical-green-20: #cfdbd8;
  --ohtf-surgical-green-10: #e7edeb;
}

/* Zensical palette hooks for `primary: custom` / `accent: custom`. */
[data-md-color-scheme="default"][data-md-color-primary="custom"] {
  --md-primary-fg-color: var(--ohtf-surgical-green);
  --md-primary-fg-color--light: var(--ohtf-surgical-green-80);
  --md-primary-fg-color--dark: var(--ohtf-surgical-green);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);
  --md-typeset-a-color: var(--ohtf-surgical-green);
}

[data-md-color-scheme="default"][data-md-color-accent="custom"] {
  --md-accent-fg-color: var(--ohtf-surgical-green-80);
  --md-accent-fg-color--transparent: rgba(13, 74, 59, 0.1);
  --md-accent-bg-color: #ffffff;
  --md-accent-bg-color--light: rgba(255, 255, 255, 0.7);
}

[data-md-color-scheme="slate"][data-md-color-primary="custom"] {
  --md-primary-fg-color: var(--ohtf-surgical-green);
  --md-primary-fg-color--light: var(--ohtf-surgical-green-80);
  --md-primary-fg-color--dark: var(--ohtf-surgical-green);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);
  --md-typeset-a-color: var(--ohtf-surgical-green-40);
}

[data-md-color-scheme="slate"][data-md-color-accent="custom"] {
  --md-accent-fg-color: var(--ohtf-surgical-green-20);
  --md-accent-fg-color--transparent: rgba(158, 183, 177, 0.12);
  --md-accent-bg-color: var(--ohtf-surgical-green);
  --md-accent-bg-color--light: rgba(13, 74, 59, 0.7);
}

/* ---------------------------------------------------------------------------
 * Landing page (overrides/home.html)
 * ------------------------------------------------------------------------ */

/* The landing page has no sidebars (see home.html), so use a readable measure. */
.md-content.ohtf-home {
  max-width: none;
}

.ohtf-home .md-content__inner {
  margin-top: 0;
  padding-top: 0;
}

/* The hero carries the page heading, so hide the Markdown H1 and the page
   action buttons that sit beside it. */
.ohtf-home .md-content__inner > h1,
.ohtf-home .md-content__inner > .md-content__button {
  display: none;
}

.ohtf-hero {
  background-color: var(--ohtf-surgical-green);
  color: #ffffff;
  /* A faint grid of component blocks, echoing the mark. Decorative only. */
  background-image:
    linear-gradient(rgba(207, 219, 216, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 219, 216, 0.07) 1px, transparent 1px);
  background-size: 2rem 2rem;
}

.ohtf-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding: 3.5rem 0.8rem 3.75rem;
}

.ohtf-hero__eyebrow {
  margin: 0 0 1rem;
  color: var(--ohtf-surgical-green-20);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ohtf-hero h1 {
  margin: 0 0 1.25rem;
  color: #ffffff;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
}

.ohtf-hero__lead {
  max-width: 34rem;
  margin: 0 0 2rem;
  color: var(--ohtf-surgical-green-10);
  font-size: 0.95rem;
  line-height: 1.6;
}

.ohtf-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ohtf-hero .md-button {
  margin: 0;
  min-height: 44px;
  padding: 0.65rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 0.3rem;
  color: #ffffff;
  font-size: 0.8rem;
}

.ohtf-hero .md-button--primary {
  border-color: var(--ohtf-surgical-green-10);
  background-color: var(--ohtf-surgical-green-10);
  color: var(--ohtf-surgical-green);
}

.ohtf-hero .md-button:hover,
.ohtf-hero .md-button:focus-visible {
  border-color: #ffffff;
  background-color: #ffffff;
  color: var(--ohtf-surgical-green);
}

.ohtf-hero .md-button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.ohtf-hero__code {
  margin: 0;
}

.ohtf-terminal {
  overflow: hidden;
  border: 1px solid rgba(207, 219, 216, 0.25);
  border-radius: 0.5rem;
  /* Surgical Green deepened with black, not a new green. */
  background-color: var(--ohtf-surgical-green);
  background-image: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25));
}

.ohtf-terminal__bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(207, 219, 216, 0.15);
}

.ohtf-terminal__bar span {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background-color: rgba(207, 219, 216, 0.3);
}

.ohtf-terminal__body {
  margin: 0;
  padding: 1rem 1.2rem 1.2rem;
  overflow-x: auto;
  color: #ffffff;
  font-family: var(--md-code-font-family, monospace);
  font-size: 0.72rem;
  line-height: 1.7;
}

.ohtf-terminal__body code {
  background: none;
  color: inherit;
  font-size: inherit;
  padding: 0;
}

.ohtf-terminal__prompt {
  color: var(--ohtf-surgical-green-40);
  user-select: none;
}

.ohtf-terminal__out {
  color: var(--ohtf-surgical-green-20);
  font-style: italic;
}

.ohtf-hero__code figcaption {
  margin-top: 0.75rem;
  color: var(--ohtf-surgical-green-20);
  font-size: 0.65rem;
  text-align: left;
}

.ohtf-hero__code figcaption a {
  color: #ffffff;
}

@media screen and (max-width: 59.984375em) {
  .ohtf-hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 2.25rem 0.8rem 2.5rem;
  }

  .ohtf-hero h1 {
    font-size: 1.6rem;
  }

  .ohtf-hero__lead {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
  }
}

/* Keep the longest terminal line on screen at phone widths. */
@media screen and (max-width: 29.984375em) {
  .ohtf-terminal__body {
    padding: 0.8rem 0.8rem 1rem;
    font-size: 0.6rem;
  }
}

/* ---------------------------------------------------------------------------
 * Landing page body sections (Markdown in docs/index.md)
 * ------------------------------------------------------------------------ */

.ohtf-home .md-typeset h2 {
  margin-top: 2.5rem;
  font-weight: 700;
}

/* Statement of belief directly under the hero. */
.md-typeset .ohtf-belief {
  margin: 2rem 0 1.5rem;
  padding-left: 1.1rem;
  border-left: 4px solid var(--ohtf-surgical-green);
}

.md-typeset .ohtf-belief p {
  margin: 0;
  color: var(--md-default-fg-color);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

[data-md-color-scheme="slate"] .md-typeset .ohtf-belief {
  border-left-color: var(--ohtf-surgical-green-40);
}

/* Criteria list: two-column definition layout, not cards. */
.md-typeset .ohtf-criteria {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 2.5rem;
}

.md-typeset .ohtf-criteria dl {
  margin: 0;
}

.md-typeset .ohtf-criteria dt {
  margin-top: 1rem;
  font-weight: 700;
}

.md-typeset .ohtf-criteria dd {
  margin: 0.25rem 0 0;
  color: var(--md-default-fg-color--light);
}

@media screen and (max-width: 44.984375em) {
  .md-typeset .ohtf-criteria {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Numbered "how it works" steps. */
.md-typeset ol.ohtf-steps {
  counter-reset: ohtf-step;
  margin-left: 0;
  padding-left: 0;
  list-style: none;
}

.md-typeset ol.ohtf-steps > li {
  position: relative;
  min-height: 1.8rem;
  margin: 0 0 1rem;
  padding-left: 2.8rem;
  counter-increment: ohtf-step;
}

.md-typeset ol.ohtf-steps > li::before {
  content: counter(ohtf-step);
  position: absolute;
  top: -0.1rem;
  left: 0;
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 50%;
  background-color: var(--ohtf-surgical-green);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-typeset ol.ohtf-steps > li::before {
  background-color: var(--ohtf-surgical-green-40);
  color: var(--ohtf-surgical-green);
}

/* Advisers grid (overrides/advisers.html). Selectors include the element
   names so they outrank the theme's list rules. */
.md-typeset ul.ohtf-advisers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 1.75rem 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.md-typeset .ohtf-advisers__heading {
  margin-top: 2.5rem;
}

/* Two across on phones, so a headshot never fills the whole screen. */
@media screen and (max-width: 29.9375em) {
  .md-typeset ul.ohtf-advisers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.md-typeset ul.ohtf-advisers > li.ohtf-adviser {
  margin: 0;
}

.md-typeset .ohtf-adviser__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.2rem;
  background-color: var(--ohtf-surgical-green-10);
}

.md-typeset .ohtf-adviser__name {
  margin: 0.75rem 0 0.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

.md-typeset .ohtf-adviser__role {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--md-default-fg-color--light);
}

/* In-page buttons (for example the Digital PEWS calls to action). The
   theme's default secondary button is low-contrast grey; outline it in
   the brand green instead. The hero has its own button styles above. */
.md-content .md-typeset .md-button:not(.md-button--primary) {
  border: 2px solid var(--ohtf-surgical-green);
  background-color: transparent;
  color: var(--ohtf-surgical-green);
}

.md-content .md-typeset .md-button:not(.md-button--primary):hover,
.md-content .md-typeset .md-button:not(.md-button--primary):focus-visible {
  background-color: var(--ohtf-surgical-green-10);
}

[data-md-color-scheme="slate"] .md-content .md-typeset .md-button:not(.md-button--primary) {
  border-color: var(--ohtf-surgical-green-40);
  color: var(--ohtf-surgical-green-20);
}

[data-md-color-scheme="slate"] .md-content .md-typeset .md-button:not(.md-button--primary):hover,
[data-md-color-scheme="slate"] .md-content .md-typeset .md-button:not(.md-button--primary):focus-visible {
  background-color: rgba(158, 183, 177, 0.15);
}

/* Product screenshots in page content. */
.md-typeset figure.ohtf-screenshot {
  margin: 0 0 1.5rem;
}

.md-typeset figure.ohtf-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
}

.md-typeset figure.ohtf-screenshot figcaption {
  max-width: none;
  margin-top: 0.5rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.7rem;
  font-style: normal;
}

/* Two-column fact tables (Key facts, company details) are written with an
   empty Markdown header row; hide it rather than show a blank band. */
.md-typeset table:not([class]) thead tr:has(th:empty) {
  display: none;
}
