/* ABOUTME: Custom styles for the OpenDLP docs site using Sortition Foundation branding */
/* ABOUTME: Overrides GOV.UK Frontend defaults with Sortition colour palette */

:root {
  --sortition-hot-pink: rgb(228, 15, 125);
  --sortition-white: #ffffff;
  --sortition-black: #000000;
  --sortition-dark-grey: #473d3d;
  --sortition-purple-red: #730045;
  --sortition-blood-red: #910d3f;
  --sortition-scarlet-red: #c7003a;
  --sortition-red: #ff0026;
  --sortition-burnt-orange: #fe5734;
  --sortition-buttermilk: #ffe2ae;
  --sortition-saffron-yellow: #fda135;
  --sortition-sap-green: #70a311;
  --sortition-woad-blue: #548eb4;
}

/* Override GOV.UK font-face declarations to prevent 404s on GDS Transport fonts.
   The site falls back to the system sans-serif stack defined in the GOV.UK font family. */
@font-face {
  font-family: "GDS Transport";
  font-style: normal;
  font-weight: 300;
  src: local("Arial");
}

@font-face {
  font-family: "GDS Transport";
  font-style: normal;
  font-weight: normal;
  src: local("Arial");
}

@font-face {
  font-family: "GDS Transport";
  font-style: normal;
  font-weight: bold;
  src: local("Arial");
}

/* Header branding */
.govuk-header {
  background: var(--sortition-white);
  border-bottom: none;
}

/* Flex layout for header container so logo and nav sit side by side */
.govuk-header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.govuk-header__logo {
  display: flex;
  align-items: center;
  float: none;
  width: auto;
  flex-shrink: 0;
  gap: 12px;
}

.govuk-header__content {
  float: none;
}

.govuk-header__logotype-text {
  font-weight: 700;
  white-space: nowrap;
}

.govuk-header__link:link,
.govuk-header__link:visited {
  color: var(--sortition-black);
}

.govuk-header__link:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: .1em;
  color: var(--sortition-burnt-orange);
}

.header-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo-link:hover {
  text-decoration: none;
}

.header-logo {
  height: 40px;
  width: auto;
}

/* On narrow viewports, stack header rows and let menu sit below the logo */
@media (max-width: 48.0525em) {
  .govuk-header__container {
    flex-wrap: wrap;
  }

  .govuk-header__content {
    position: static;
    width: 100%;
    padding-top: 5px;
  }

  .govuk-header__menu-button {
    position: static;
    display: inline-block;
    float: none;
  }
}

/* Hide mobile nav close button on desktop */
.govuk-header__navigation-close {
  display: none;
}

/* Orange accent bar between header and content */
.header-accent-bar {
  background: var(--sortition-white);
}

.header-accent-bar__line {
  border: 0;
  border-top: 4px solid var(--sortition-burnt-orange);
  margin: 0;
}

/* Mobile menu button colour fix for white header */
.govuk-header__menu-button {
  color: var(--sortition-black);
}

.govuk-header__menu-button:hover {
  color: var(--sortition-burnt-orange);
}

/* Focus styles using saffron yellow */
.govuk-skip-link:focus,
a:focus,
.govuk-header__link:focus,
.govuk-footer__link:focus,
.govuk-link:focus {
  outline: 3px solid var(--sortition-saffron-yellow);
  outline-offset: 0;
  background-color: var(--sortition-saffron-yellow);
  color: var(--sortition-black);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Hero section */
.hero-section {
  background: var(--sortition-burnt-orange);
  margin: 0 calc(-1 * var(--govuk-gutter-half, 15px));
  padding-left: var(--govuk-gutter-half, 15px);
  padding-right: var(--govuk-gutter-half, 15px);
}

/* Prevent horizontal overflow on mobile */
html, body {
  overflow-x: hidden;
}

.hero-section__title {
  color: var(--sortition-white);
  margin-bottom: 20px;
}

.hero-section__description {
  color: var(--sortition-white);
  max-width: 40em;
}

/* Feature cards */
.feature-card {
  border-top: 4px solid var(--sortition-burnt-orange);
  padding-top: 15px;
  margin-bottom: 30px;
}

/* Footer */
.govuk-footer {
  border-top: 1px solid #b1b4b6;
}

/* Markdown content styling within govuk-body containers */
.govuk-body h2 {
  font-family: "GDS Transport", arial, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.25;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.govuk-body h3 {
  font-family: "GDS Transport", arial, sans-serif;
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.3;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
}

.govuk-body p {
  margin-bottom: 1em;
}

.govuk-body ul,
.govuk-body ol {
  margin-bottom: 1em;
  padding-left: 20px;
}

.govuk-body li {
  margin-bottom: 0.5em;
}

.govuk-body a {
  color: #1d70b8;
}

.govuk-body a:visited {
  color: #4c2c92;
}

.govuk-body strong {
  font-weight: 700;
}

.govuk-body hr {
  border: 0;
  border-top: 1px solid #b1b4b6;
  margin: 2em 0;
}
