/**
 * @file
 * Homepage styles ported from legacy edge.gbci.org (yoda theme).
 */

/* Google Fonts - Lato
 *
 * Deliberately without the 300 weight. The legacy site only ever served Lato in
 * 400, 700 and 900, so its `font-weight: 300` declarations fell back to the 400
 * face. Loading a real Lato Light here made the same markup render in visibly
 * thinner, lighter glyphs even though the computed font-weight matched. */
@import url("https://fonts.googleapis.com/css?family=Lato:400,700,900");

/* Several sections below break out of the centred container to full viewport
 * width using 100vw. 100vw includes the classic vertical scrollbar, so those
 * sections end up a scrollbar-width wider than the visible area and the page
 * gains a horizontal scrollbar. Clip the extra on the root element: unlike
 * `hidden` it does not turn the root into a scroll container, so the
 * sticky-top header keeps working. */
html {
  overflow-x: hidden; /* fallback for browsers without `clip` */
  overflow-x: clip;
}

/* Base typography
 *
 * Bootstrap 5 ships a different base than the Bootstrap 3 the legacy theme was
 * built on: #212529 instead of #333 and a 1.5 line-height instead of 1.428571.
 * Body copy therefore sat looser and slightly off-colour across every page.
 * Both are read from custom properties, so overriding them here covers
 * everything the base theme derives from them. */
:root {
  --bs-body-color: #333;
  --bs-body-line-height: 1.428571429;
}

body {
  font-family: 'Lato', sans-serif;
  font-size: 16px;
  font-weight: 300;
  background: #F7FEFF;
  /* Guard against wide content (tables, embeds) pushing the layout out. */
  max-width: 100%;
}

p, div {
  font-family: 'Lato', sans-serif;
}

/* Bootstrap 5 Reboot declares `font-weight: bolder` for bold text. `bolder` is
 * relative, and against the 300 body weight above it resolves to 400 — so every
 * <strong> and <b> on the site rendered at normal weight. Bootstrap 3 used an
 * absolute `bold`, which is what the legacy pages show. */
b, strong {
  font-weight: 700;
}

/* Legacy heading scale. Bootstrap 5 sizes headings with responsive calc() and a
 * 1.2 line-height; the legacy theme used fixed sizes at 1.1. */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  line-height: 1.1;
}

/* Legacy page headings are pure black, while body copy and lower headings are
 * #333. Banner headings stay white via their own, more specific rules. */
h1 {
  font-size: 38px;
  color: #000;
}

h2 {
  font-size: 32px;
}

h3 {
  font-size: 24px;
}

h4 {
  font-size: 18px;
}

/* Bootstrap 5 sizes small at 0.875em, the legacy theme at 85%. */
small,
.small {
  font-size: 85%;
}

/* Bootstrap 5 buttons are 16px with a 6px radius; the Bootstrap 3 buttons on the
 * legacy site were 14px with 4px. The variables are declared on .btn itself, so
 * they have to be overridden there rather than on :root. The user form buttons
 * keep their own sizes through more specific rules in pages.css. */
.btn {
  --bs-btn-font-size: 14px;
  --bs-btn-line-height: 1.428571429;
  --bs-btn-border-radius: 4px;
}

a {
  color: #1D5D8B;
  text-decoration: none;
}

a:hover {
  color: #144466;
}

/* Main container padding */
.main-container {
  padding-top: 30px;
}

.main-container .row {
  max-width: 960px;
  margin: auto;
}

/* Spacing utilities */
.padding-1 {
  padding-top: 30px;
  padding-bottom: 60px;
}

.margin-1 {
  margin-bottom: 30px;
}

.txt-center {
  text-align: center;
}

/* Lead text. Bootstrap 3 used 21px at weight 200; Bootstrap 5 uses 1.25rem/300. */
p.lead,
.lead {
  font-size: 21px;
  font-weight: 200;
  line-height: 1.4;
}

/* Full-width grey background sections */
.full-grey-wrap {
  background: #f2f2f2;
  padding: 0 15px;
  /* Break out of container to full width */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

/* Image banners (parallax-style) */
.image-banner {
  background-repeat: no-repeat;
  position: relative;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  min-height: 350px;
  display: flex;
  align-items: center;
  /* Break out of container to full width */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

@media only screen and (max-width: 768px) {
  .image-banner {
    background-attachment: scroll;
    background-position: right;
  }
}

/* Homepage banner */
#banner-homepage {
  background-repeat: no-repeat;
  padding: 20px;
  min-height: 320px;
  position: relative;
  background-attachment: fixed;
  background-size: cover;
  background-position: top;
  /* Same 15px gap as .bannerimage below — this id also carries that class, and
   * an id outranks it, so the value has to be repeated here. */
  margin-bottom: 15px;
  display: flex;
}

#banner-homepage h1 {
  color: #fff;
  font-size: 44px;
  margin-top: 45px;
  text-shadow: 2px 2px black;
  font-weight: 400;
}

.bannerimage {
  background-repeat: no-repeat;
  padding: 20px;
  min-height: 350px;
  position: relative;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  /* The legacy stylesheet also pulled the banner up by 20px here, but its
   * wrapper chain (.main-container padding plus the region offset) still left
   * the following section 15px *below* the banner. We have no such wrapper, so
   * the raw negative margin let the first content section overlap the banner by
   * 20px. State the gap the legacy site actually rendered. */
  margin-bottom: 15px;
  display: flex;
  /* Break out of container to full width */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

.bannerimage h1 {
  color: #fff;
  font-size: 44px;
  text-shadow: 2px 2px black;
  font-weight: 400;
}

.bannertext {
  text-align: center;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.bannertext h1 {
  text-transform: uppercase;
  color: white;
  font-weight: 300;
  font-size: 45px;
}

.bannertext p {
  font-size: 30px;
  color: white;
  max-width: 650px;
  text-shadow: 2px 2px black;
  margin: 0 auto;
}

@media only screen and (max-width: 500px) {
  .bannertext p {
    font-size: 20px;
  }
}

@media only screen and (max-width: 1200px) {
  .bannerimage,
  #banner-homepage {
    background-size: cover;
    background-attachment: scroll;
  }
}

/* Icon grid (guiding section) */
.guiding-row {
  float: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  clear: both;
}

.guiding {
  flex: 0 0 25%;
  max-width: 25%;
  padding-left: 15px;
  padding-right: 15px;
  text-align: center;
  padding-bottom: 20px;
}

@media only screen and (max-width: 768px) {
  .guiding {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media only screen and (max-width: 500px) {
  .guiding {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.guiding img.principles {
  float: none;
  margin-right: 0;
  margin-top: 20px;
  max-width: 80px;
}

p.guide {
  font-size: 16px;
  overflow: hidden;
}

/* Buttons
 *
 * The Bootstrap 5 base theme aliases `.button` onto its `.btn` component via
 * `a.button, .button { ... }`, which outranks a bare `.button` selector and
 * repaints the legacy blue button in Bootstrap's default light grey. Match that
 * specificity and reset the Bootstrap custom properties so hover/focus states
 * follow the legacy palette too. */
a.button,
.button {
  --bs-btn-color: #fff;
  --bs-btn-bg: #1D5D8B;
  --bs-btn-border-color: #1D5D8B;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #144466;
  --bs-btn-hover-border-color: #144466;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #144466;
  --bs-btn-active-border-color: #144466;
  --bs-btn-padding-y: 10px;
  --bs-btn-padding-x: 16px;
  --bs-btn-font-size: 18px;
  --bs-btn-font-weight: 300;
  --bs-btn-border-radius: 6px;
  background-color: #1D5D8B;
  border: 0 none #1D5D8B;
  color: #fff;
  padding: 10px 16px;
  font-size: 18px;
  /* Inherited from the body on the legacy site, not Bootstrap's 400. */
  font-weight: 300;
  line-height: 1.33;
  border-radius: 6px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

a.button:hover,
a.button:focus,
.button:hover,
.button:focus {
  text-decoration: none;
  color: #fff;
  background-color: #144466;
  border-color: #144466;
}

@media only screen and (max-width: 736px) {
  a.button,
  .button {
    display: block;
  }
}

.btn-primary {
  color: white;
  background-color: #1D5D8B;
  border-color: #1D5D8B;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #144466 !important;
  border-color: #144466 !important;
}

/* Counter section */
.counter {
  padding: 10px;
  display: inline-block;
  width: 150px;
}

.count-title {
  margin-top: 10px;
  margin-bottom: 0;
  text-align: center;
}

.count-text {
  margin-top: 10px;
  margin-bottom: 0;
  text-align: center;
}

/* Articles section */
.articles {
  margin-left: auto;
  margin-right: auto;
  max-width: 800px;
}

.articles-grid,
.articles-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.articles-grid > li,
.articles-grid ul > li {
  flex: 0 0 calc(33.333% - 20px);
  max-width: calc(33.333% - 20px);
}

@media only screen and (max-width: 768px) {
  .articles-grid > li,
  .articles-grid ul > li {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.articles-grid img {
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

.articles-grid .views-field-title a {
  color: #000;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.articles-grid .views-field-title a:hover {
  text-decoration: underline;
}

.articles-grid .views-field-field-published-on {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

/* Page header with blue underline */
.page-header {
  border-bottom: none;
  padding-bottom: 20px;
  padding-top: 15px;
  margin: 10px 0 30px;
  font-weight: 300;
  position: relative;
}

.page-header:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: #1D5D8B;
}

/* Bootstrap 3 compatibility: col-sm-offset-* mapped to Bootstrap 5 offset-sm-* */
.col-sm-offset-1 {
  margin-left: 8.33333333%;
}

.col-sm-offset-2 {
  margin-left: 16.66666667%;
}

.col-sm-offset-3 {
  margin-left: 25%;
}

/* Bootstrap 3 col-sm-* compatibility (flex-based) */
.col-sm-8 {
  flex: 0 0 auto;
  width: 66.66666667%;
}

.col-sm-10 {
  flex: 0 0 auto;
  width: 83.33333333%;
}

/* Views and content */
.field-item.even > img {
  margin-bottom: 20px;
  margin-top: 20px;
}

.field-content > a {
  color: black;
}

.field-content img:hover {
  opacity: .8;
}

.views-field.views-field-created {
  font-size: 12px;
}

/* Responsive iframes */
iframe {
  max-width: 100%;
}

.navbar-collapse {
  max-height: 340px;
  padding-right: 15px;
  padding-left: 15px;
}