:root {
  --demia-primary: #1732cf;
  --demia-dark: #0f1f8a;
  --demia-medium: #0a1560;

  /* Override Bootstrap's primary color variables */
  --bs-primary: #1732cf;
  --bs-primary-rgb: 23, 50, 207;
}

/*
  Global anchor colors - exclude footer, account masthead, and buttons
*/
a:not(.account-masthead a):not(.site-footer a):not(.btn) {
  color: var(--demia-primary) !important;
}

a:not(.account-masthead a):not(.site-footer a):not(.btn):hover {
  color: var(--demia-dark) !important;
}

/*
  Account strip at the top 
*/

.account-masthead {
  background: var(--demia-medium);
  color: white;
}

.account-masthead a {
  color: white;
  font-weight: bold;
}

.account-masthead a:hover {
  color: #e0e0e0;
  text-decoration: underline;
}

.account-masthead .btn-link {
  color: white;
  font-weight: bold;
  text-decoration: none;
}

.account-masthead .btn-link:hover {
  color: #e0e0e0;
  text-decoration: underline;
}

/*
  Primary buttons - use purple color scheme
*/
.btn-primary {
  background-color: var(--demia-primary);
  border-color: var(--demia-primary);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--demia-dark);
  border-color: var(--demia-dark);
  color: white;
}

.btn-primary:active,
.btn-primary.active {
  background-color: var(--demia-medium);
  border-color: var(--demia-medium);
  color: white;
}


/* 
 White background navbar, homepage and main body.
*/

.main {
  background: white;
}

/*
  Make the main body push the footer down 
*/
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/*
  Ensure the page content grows to fill the available space,
  pushing the footer to the bottom.
  Target only the direct children of body to avoid affecting nested elements.
*/
body>.homepage,
body>.main,
body>[role="main"] {
  flex: 1 0 auto;
  width: 100%;
  background-color: white;
}

.homepage .hero {
  background: white;
}

.masthead {
  background: white;
}

/* Footer */

.site-footer {
  background: var(--demia-medium);
  color: white;
}

.site-footer a {
  color: white;
  font-weight: bold;
}

.site-footer a:hover {
  color: #e0e0e0;
  text-decoration: underline;
}

/*
  Search button
*/
.site-search .btn {
  background-color: var(--demia-primary);
  color: white;
  border: 1px solid var(--demia-primary);
}

.site-search .btn:hover {
  background-color: var(--demia-dark);
  border-color: var(--demia-dark);
  color: white;
}

/*
 Navigation buttons
*/
header.masthead .navbar .navbar-nav li a {
  color: var(--demia-primary) !important;
  font-weight: bold;
  background-color: transparent !important;
}

header.masthead .navbar .navbar-nav li a:hover {
  color: var(--demia-dark) !important;
  background-color: transparent !important;
}

header.masthead .navbar .navbar-nav li.active a {
  background-color: var(--demia-primary) !important;
  color: white !important;
  border-radius: 4px;
}

/*
  Search bar
*/
.homepage .module-search .search-form {
  background-color: var(--demia-primary);
}

.homepage .module-search .tags {
  background-color: var(--demia-dark);
}

.homepage .module-feeds {
  background: white;
  color: black;
  flex: 0 0 auto;
}