/***** CSS Reset *****/
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html, body {
  height: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/***** Globals *****/

:root {
  --primary-color: #1d5888;
  --secondary-color: #ff993b;
  --dark-color: #292929;
  --white-color: #e7e7e7;
  --off-white: #f5f5f5;
}

body {
  background-color: var(--off-white);
  color: var(--dark-color);
}

/***** Nav *****/

nav {
  background-color: var(--dark-color);
}

.navbar-nav {
  gap: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6,
.primary-color {
  color: var(--primary-color);
}

/***** Main *****/

.logo-img {
  max-width: 289.33px;
}

.hero-img {
  max-width: 75%;
}

.main-img-container {
  margin-top: 4rem;
}

.main-subheading {
  text-wrap: balance;
}

.cta-btn {
  border-color: var(--primary-color);
}

.cta-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

/***** Loan Calculator *****/

/* TODO: I'm not sure if this works as desired, everywhere.
* check my external monitor as well.
**/
main div.row:first-of-type {
  margin-bottom: 4rem;
}

.loan-form, .home-buying-power-form, .emergency-fund-form, .debt-to-income-form {
  background-color: rgb(231, 231, 231);
  border-radius: 2px;
  padding: .7rem !important;
}

.loan-form input {
  width: 100%;
  padding: .5rem;
}

.payment-title {
  text-align: center;
  font-size: 1.5rem;
  font-style: italic;
}

.table, .hbp-monthly-payments-section {
  margin-bottom: 6rem;
}

.monthly-payment, .emergency-fund-amount, .debt-to-income-ratio {
  text-align: center;
  font-size: 4rem;
  font-weight: bold;
  color: #2B404F;
}

.hbp-home-buying-power {
  text-align: center;
  font-size: 3.5rem;
  font-weight: bold;
  color: #2B404F;
}

.table-header {
  background-color: #2B404F;
}

.total-cost {
  font-weight: bold;
}

.btn:focus {
  box-shadow: none !important;
}

.clear-button {
  margin-left: 4px;
}

.amortization-schedule {
  margin-top: 2rem;
}

/***** Blog *****/

.blog-list { 
  margin-bottom: 7.5rem;
}

.blog-post { 
  background-color: var(--white-color);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.blog-title { 
  font-size: 1.5rem;
  font-weight: bold;
  color: inherit;
  text-decoration: none;
}

.blog-title:hover {
  color: var(--primary-color);
  cursor: pointer;
}

.blog-date { 
  font-size: 0.9rem;
  color: #888;
}

.blog-content-preview { 
  font-size: 1rem;
  margin-top: 0.5rem;
}

/***** Articles *****/

article {
  margin-bottom: 7.5rem;
}

.article-body {
  font-size: 1.125rem;
}

.article-sub-heading, .article-paragraph-heading, .article-list-heading {
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: .5rem;
}

.article-body ul {
  margin-bottom: 1.5rem;
}

.article-body li {
  padding-left: .375rem;
  margin-top: .5rem;
  margin-bottom: .5rem;
}

.internal-link {
  color: var(--primary-color);
  font-weight: bold;
}

/***** Footer *****/

footer {
  right: 0;
  left: 0;
  background-color: var(--dark-color);
  padding-right: 1rem;
}

.footer-logo {
  width: 110px;
  height: auto;
}

/***** MEDIA QUERIES *****/

/*== HOME ==*/

/* Small */
@media (min-width: 500px) {
  footer {
    position: fixed;
  }
  .main-img-container {
    margin-top: 0 !important;
  }
  .hbp-home-buying-power {
    font-size: 4rem;
  }
}

@media screen and (max-width: 540px) and (max-height: 740px) and (orientation: portrait) {
  .main-h1-container {
    margin-bottom: 120px;
  }
}

/* Medium */
@media (max-width: 991px) {
  .logo-img {
    max-width: 216px;
  }
  .hero-img {
    max-width: 246px;
  }
}

@media screen and (max-width: 991px) and (orientation: landscape) {
  .main-h1-container {
    margin-bottom: 150px !important;
  }
}

/* Large */
@media (min-width: 992px) {
  .main-h1-container {
    margin-top: 0;
  }
  .hero-img {
    margin-left: auto !important;
    margin-right: 0 !important;
    max-width: 100%;
  }
}

/*== CALCULATOR ==*/

/* Small */
@media (max-width: 767px){
  .table {
    width: 150%;
  }
  th {
    border-width: 1px;
  }
}

@media print {
  button {
    visibility: hidden;
  }
  h1, .print-btn {
    visibility: hidden;
  }
  .table {
    width: 100%;
  }
}