/* CCPBioSim theme for pydata-sphinx-theme.
 */

:root {
  --ccp-teal: #1d7989;
  --ccp-teal-dark: #0e3b43;
  --ccp-sky: #27aadf;
  --ccp-sky-dark: #1998c8;
  --ccp-navy: #0f172a;
  --ccp-navy-deep: #001b4c;

  --pst-font-size-h1: 2.4rem;
  --pst-font-size-h2: 1.7rem;
  --pst-font-size-h3: 1.4rem;
}

html[data-theme="light"] {
  --pst-color-primary: var(--ccp-teal);
  --pst-color-secondary: var(--ccp-sky);
  --pst-color-accent: var(--ccp-sky);
  --pst-color-link: var(--ccp-teal);
  --pst-color-link-hover: var(--ccp-teal-dark);
  --pst-color-text-base: #171717;

  --sd-color-primary: var(--ccp-sky);
  --sd-color-primary-highlight: var(--ccp-sky-dark);
  --sd-color-primary-text: #fff;
}

html[data-theme="dark"] {
  --pst-color-primary: #4fb8ca;
  --pst-color-secondary: var(--ccp-sky);
  --pst-color-accent: var(--ccp-sky);
  --pst-color-link: #4fb8ca;
  --pst-color-link-hover: #8fd6e2;
  --pst-color-background: var(--ccp-navy);
  --pst-color-on-background: #16213a;
  --pst-color-surface: #1c2843;

  --sd-color-primary: var(--ccp-sky);
  --sd-color-primary-highlight: var(--ccp-sky-dark);
  --sd-color-primary-text: #fff;
}

/* Header bar: teal in both modes, like the website */

.bd-header {
  background-color: var(--ccp-teal) !important;
  box-shadow: none;
}

.bd-header,
.bd-header .navbar-nav .nav-link,
.bd-header .pst-navbar-icon,
.bd-header .navbar-brand p.title {
  color: #fff !important;
}

.bd-header .navbar-nav .nav-link:hover,
.bd-header .pst-navbar-icon:hover {
  color: #fff !important;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.bd-header .navbar-nav li.current > .nav-link {
  border-bottom-color: #fff;
}

/* The "More" menu holds header links that do not fit. Its button matches the
 * other header links, and the links inside it use the normal page colours, as
 * the menu itself is not teal. */

.bd-header .navbar-nav .dropdown-toggle {
  color: #fff !important;
}

.bd-header .dropdown-menu .nav-link {
  color: var(--pst-color-text-base) !important;
}

.bd-header .dropdown-menu .nav-link:hover {
  color: var(--pst-color-primary) !important;
}

.bd-header .search-button-field {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
}

.bd-header .search-button-field .kbd-shortcut__modifier,
.bd-header .search-button-field kbd {
  color: #fff;
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.5);
}

/* Navbar logo and project name */

.navbar-brand img {
  height: 2.6rem;
}

.navbar-brand p.title {
  font-weight: 700;
  padding-left: 0.75rem;
  margin-left: 0.25rem;
  border-left: 2px solid rgba(255, 255, 255, 0.5);
}

/* Left sidebar: hide the "Section Navigation" block on pages without
 * sub-pages, so only "On this page" shows. */

.sidebar-primary-item:has(> .bd-docs-nav .bd-toc-item:empty) {
  display: none;
}

/* Pages with a banner, such as the home page, use the full width on desktop.
 * The mobile menu is unaffected. */

@media (min-width: 960px) {
  .bd-container:has(.ccp-hero) .bd-sidebar-primary {
    display: none;
  }
}

/* Headings */

.bd-article h1 {
  font-weight: 700;
  color: var(--pst-color-primary);
}

.bd-article h2 {
  font-weight: 700;
  margin-top: 2.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--pst-color-border);
}

.bd-article h3 {
  font-weight: 700;
  color: var(--pst-color-primary);
}

/* Home page hero, from the ccpbiosim-hero directive: a dark navy panel like
 * the website's landing banner. */

.ccp-hero {
  color: #fff;
  background: radial-gradient(
      circle at 80% 20%,
      rgba(140, 60, 200, 0.25),
      transparent 45%
    ),
    linear-gradient(135deg, var(--ccp-navy) 0%, var(--ccp-navy-deep) 100%);
  border-radius: 1rem;
  padding: 2.5rem 2rem 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.ccp-hero img {
  max-width: 300px;
  width: 65%;
  margin-bottom: 1.25rem;
}

.ccp-hero p {
  color: #fff;
}

.ccp-hero .ccp-hero-tagline {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ccp-hero .ccp-hero-summary {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 40rem;
  margin: 0 auto 1.5rem;
}

.ccp-hero .ccp-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.ccp-hero .ccp-hero-buttons p {
  margin: 0;
}

.ccp-hero .sd-btn {
  font-size: 1.1rem;
  padding: 0.5rem 1.1rem;
}

.ccp-hero .sd-btn-outline-light {
  color: #fff !important;
  border-color: #fff !important;
}

.ccp-hero .sd-btn-outline-light:hover {
  color: var(--ccp-navy) !important;
  background-color: #fff !important;
}

/* A banner with light and dark logos has no navy panel, so it uses the page
 * colours and shows the logo for the current mode. */

.ccp-hero.ccp-hero-plain {
  color: var(--pst-color-text-base);
  background: none;
  padding-top: 1rem;
}

.ccp-hero.ccp-hero-plain p {
  color: var(--pst-color-text-base);
}

/* A page with a hero shows its title in the hero instead. */
.bd-article section:has(> .ccp-hero) > h1 {
  display: none;
}

/* Section cards */

.sd-card {
  border-radius: 0.75rem;
  border: 1px solid var(--pst-color-border);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.sd-card:hover {
  transform: translateY(-6px);
  border-color: var(--pst-color-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.sd-card-title {
  font-weight: 700;
  color: var(--pst-color-primary);
}

/* Previous/next page buttons */

.prev-next-area a {
  border: 1px solid var(--pst-color-border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.25s ease;
}

.prev-next-area a:hover {
  border-color: var(--pst-color-primary);
  text-decoration: none;
}

/* Footer: dark navy, like the website */

.bd-footer {
  color: #fff;
  background-color: var(--ccp-navy);
  border-top: none;
}

.bd-footer p,
.bd-footer a {
  color: #fff;
}
