* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  min-width: 300px;
}

.layout-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.region-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.region-header, .region-primary-menu #block-searchform {
  position: relative;
  width: 100%;
  height: auto;
  max-width: 1070px;
  margin: 0 auto;
  padding: 0 14px 0 20px;
}

.region-primary-menu #block-searchform {
  position: absolute;
  display: block;
  top: 44px;
  left: -99999px;
  width: 100%;
  height: 100px;
  background: #333;
} 

.region-primary-menu.show #block-searchform {
  left: 0;
  height: 200px;
  z-index: 100;
} 

.region-primary-menu #search-block-form {
  width: 276px;
  padding-top: 60px;
  margin: 0 auto;
}

#block-searchform #edit-keys {
  width: 228px;
  height: 34px;
  line-height: 34px;
  padding: 0 8px;
  background: #fff;
  border: none;
  box-sizing: border-box;
}

#block-searchform input[id*="edit-submit"] {
  width: 36px;
  height: 34px;
  background: url(../images/search-2.gif);
  border: none;
  color: transparent;
  overflow: hidden;
}

.site-name {
  padding-top: 14px;
  width: 154px;
}

.site-name a {
  font-size: 24px;
  line-height: 24px;
  letter-spacing: 0px;
  font-weight: 500;
  color: #4E9CCA;
}

.region-primary-menu, .home-panel-inner, .region-footer {
  position: relative;
  width: 100%;
  max-width: 1070px;
  margin: 0 auto;
}

.home-panel {
  position: relative;
  width: 100%;
  padding-top: 286px;
  background-image: url(../images/home-back.jpg);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 560px;
}

.home-panel-inner {
  background: #fff;
}

.home-panel .panel-position {
  padding: 0 20px;
}

.home-panel h1 {
  position: absolute;
  top: -290px;
  left: 28px;
  font-size: 24px;
  line-height: 28px;
  font-weight: 600;
  color: #fff;
  width: 240px;
}

.home-panel p {
  font-size: 16px;
  line-height: 22px;
  color: #646464;
}

.home-panel p span {
  font-weight: 600;
}

.home-buttons {
  display: block;
  width: 1030px;
  max-width: 100%;
  height: auto;
  margin: 14px auto;
}

.home-buttons ul {
  margin: 0;
  padding: 0;
}

.home-buttons li {
  display: block;
  width: 100%;
  height: 85px;
  text-align: center;
  line-height: 85px;
  background: #922449;
  padding: 0;
  margin: 0;
}

.home-buttons li:nth-child(2) {
  background: #4AC163;
}

.home-buttons li:nth-child(3) {
  background: #05699D;
}

.home-buttons li:nth-child(4) {
  background: #F4A023;
}

.home-buttons li:nth-child(5) {
  background: #9F4990;
}

.home-buttons li a, .home-buttons li a.is-active {
  display: block;
  font-size: 30px;
  font-weight: 500;
  line-height: 85px;
  color: #fff;
  background: rgba(0, 0, 0, 0);
  transition: background 0.5s;
}

.home-buttons li a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.home-set {
  display: flex;
  flex-wrap: wrap;
  width: 1030px;
  max-width: 100%;
  padding: 15px 0;
  margin: 24px auto 0 auto;
}

.home-set-left {
  display: flex;
  flex-wrap: wrap;
  flex: 50%;
  padding: 0 20px 20px;
}

.home-set-left > div {
  flex: 50%;
}

.home-set-left > div:first-child {
  background-color: #e9f3f9;
  padding: 10px;
  align-self: center;
}

.home-set-right {
  flex: auto;
  padding: 0 0 0 20px;
}

.home-set-left h3 {
  margin: 0;
  color: #4257b2;
  font-size: 26px;
}

.home-set-left a.button {
  margin-top: 14px;
  font-size: 14px;
  width: 150px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  padding: 0;
  margin: 0;
  background: #4257b2;
}

.home-set-right h2 {
  font-size: 20px;
  line-height: 22px;
  font-weight: 600;
  margin-top: 0;
  color: #646464;
}

.home-set-right {
  border-top: 1px solid #c9c9c9;
  padding-top: 32px;
}

.home-set-right ul {
  list-style: none;
  padding-left: 0;
}

.home-set-right ul li {
  margin: 14px 0;
  font-size: 16px;
}

.home-set-right ul li a {
  color: #646464;
  font-weight: 400;
}

.path-grammar .block-page-title-block {
  position: relative;
  padding-top: 266px;
  padding-bottom: 16px;
}

.path-grammar .block-page-title-block:after  {
  position: absolute;
  content: " ";
  display: block;
  top: -13px;
  left: -30px;
  width: 100vw;
  max-width: 740px;
  height: 255px;
  margin-bottom: 4px;
  background-image: url(../images/grammar.jpg);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 400px;
}

main {
  position: relative;
  width: 100%;
  max-width: 1038px;
  margin: 0 auto;
  z-index: 100;
  flex: 1;
}

.path-frontpage main {
  max-width: 100%;
}

.about-page main, .page-node-type-grammar main, .path-dialogues main, .path-grammar main, .path-lessons main {
  overflow: hidden;
}  

.about-page main:before {
  content: " ";
  display: block;
  top: 0;
  left: 0;
  width: calc(100% + 56px);
  padding-top: 220px;
  background-image: url(../images/about-back.jpg);
  background-repeat: no-repeat;
  background-position: right 0;
  background-size: 640px;
}

.about-page main:after {
  content: "";
  display: table;
  clear: both;
}

main .layout-content {
  padding: 10px 30px;
}

.about-page .layout-sidebar-second {
  width: 100%;
  clear: both;
}

main img {
  max-width: 100%;
  height: auto !important;
}

.layout-sidebar-second #block-inuitlanguagemap {
  position: relative;
  overflow: hidden;
  padding-top: 160px;
}

main .layout-sidebar-second #block-inuitlanguagemap img {
  position: relative;
  max-width: 110%;
  margin-left: -8%;
}

.path-dialogues main:before {
  content: " ";
  display: block;
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  padding-top: 259px;
  background-image: url(../images/dialogues-mobile.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center bottom;
}

.region-footer {
  display: flex;
  clear: both;
  height: auto;
  padding: 20px;
}

.region-footer a {
  font-weight: 700;
  color: #7e8035;
  text-decoration: underline;
}

.region-footer #block-footertext {
  width: 100%;
  font-size: 13px;
}

.region-footer #block-footertext .field {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
}

.region-footer #block-footertext .footer-text {
  width: 150px;
  float: left;
}

.region-footer #footer-pirurvik,
.region-footer #footer-nunavut {
  display: flex;
}

.region-footer #footer-pirurvik img {
  width: 115px;
  height: auto;
  margin-left: 10px;
}

.region-footer #footer-nunavut {
  justify-content: end;
}

@media screen and (min-width: 320px) {


  .home-panel h1 {
    top: -286px;
    left: 50%;
    margin-left: -100px;
  }

  .path-dialogues main:before {
    padding-top: 75%;
  }

}

@media screen and (min-width: 340px) {

  .site-name a {
    font-size: 28px;
    line-height: 28px;
  }

}

@media screen and (min-width: 362px) {

  .site-name a {
    font-size: 32px;
    line-height: 32px;
  }
  
}

@media screen and (min-width: 400px) {

  .path-grammar .block-page-title-block:after  {
    background-size: 100%;
    background-position: center;
  }

}

@media screen and (min-width: 480px) {

  .home-buttons li {
    display: inline-block;
    float: left;
    width: 206px;
    max-width: 20%;
    height: 60px;
    line-height: 60px;
  }

  .home-buttons li a, .home-buttons li a.is-active {
    font-size: 14px;
    line-height: 60px;
  }
  
  .about-page main:before {
    width: calc(100% + 84px);
    padding-top: 288px;
    background-repeat: no-repeat;
    background-position: right 0;
    background-size: 860px;
  }
  
  .path-dialogues main:before {
    padding-top: 55%;
  }

}

@media screen and (min-width: 570px) {

  .home-panel {
    padding-top: 52%;
    background-size: 368px;
  }
  
  .home-panel h1 {
    top: -50vw;
  }
  
}  

@media screen and (min-width: 580px) {

  .home-buttons li {
    height: 80px;
    line-height: 80px;
  }

  .home-buttons li a, .home-buttons li a.is-active {
    font-size: 18px;
    line-height: 80px;
  }
  
  .home-set-left a.button {
    line-height: 36px;
    width: 120px;
    height: 36px;
  }
  
  .path-dialogues main:before {
    padding-top: 45%;
  }

}

@media screen and (min-width: 680px) {

  .region-header {
    height: 140px;
    padding: 0 20px;
  }

  .region-primary-menu #block-searchform {
    position: relative;
    height: 50px;
    top: 0;
    left: 0;
    background: none;
  } 

  .region-primary-menu #search-block-form {
    position: absolute;
    top: -67px;
    right: 14px;
    width: auto;
    padding: 0;
  }
  
  #block-searchform #edit-keys {
    width: 208px;
    height: 28px;
    line-height: 28px;
    background: #e3e3e3;
  }

  #block-searchform #edit-keys:focus {
    background: #fff;
    box-shadow: inset 1px 1px 6px 0 rgba(0, 0, 0, 0.3);
  }

  #block-searchform #edit-keys {
    width: 208px;
  }
  
  #block-searchform input[id*="edit-submit"] {
    width: 30px;
    height: 28px;
    background: url(../images/search.gif);
    border: none;
    color: transparent;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.5s;
  } 
  
  #block-searchform input[id*="edit-submit"]:hover {
    opacity: 0.5;
  }

  .site-name {
    padding-top: 16px;
    width: 240px;
  } 

  .site-name a {
    font-size: 40px;
    line-height: 48px;
    letter-spacing: 0;
  }

  .home-panel {
    display: block;
    height: 370px;
    padding-top: 0;
    background-position: center -98px;
    background-size: 1438px;
    background-attachment: fixed;
    overflow: hidden;
  }

  .home-panel-inner {
    position: absolute;
    width: 100%;
    max-width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: none;
    clip: rect(0, auto, auto, 0);
  }

  .home-panel .panel-position {
    position: fixed;
    display: table;
    top: 0;
    left: 54%;
    margin-left: -20px;
    width: 280px;
    height: 560px;
    padding: 190px 40px 40px 40px;
    background: linear-gradient(transparent 10%, rgba(42, 127, 168, 0.70));
    box-sizing: border-box;
    table-layout: fixed;
  }

  .home-panel .panel-position > div {
    display: table-cell;
    vertical-align: middle;
    height: 370px;
    top: 190px;
    box-sizing: border-box;
  }
  
  .home-panel h1 {
    position: relative;
    width: auto;
    top: 0;
    left: 0;
    font-size: 20px;
    margin-left: 0;
    
  }

  .home-panel p {
    font-size: 18px;
    line-height: 24px;
    color: #fff;
  }

  .home-buttons {
    margin: 9px auto;
    height: 120px;
  }

  .home-buttons li {
    height: 120px;
    line-height: 120px;
  }

  .home-buttons li a, .home-buttons li a.is-active {
    font-size: 20px;
    line-height: 120px;
  }

  .home-set {
    margin: 26px auto 0 auto;
    border-top: 1px solid #c9c9c9;
    border-bottom: 1px solid #c9c9c9;
  }

  .home-set-right {
    border: none;
    border-left: 1px solid #c9c9c9;
  }

  .home-set-right h2 {
    font-size: 22px;
    line-height: 22px;
    font-weight: 700;
    margin-top: 0;
  }

  .home-set-right ul li {
    font-size: 14px;
  }

  .about-page main .layout-content {
    padding: 10px 10px 10px 30px;
  }

  .about-page main:before {
    width: calc(100% + 50px);
    padding-top: 290px;
    background-repeat: no-repeat;
    background-position: right -66px;
    background-size: 1104px;
  }

  .about-page main .layout-content {
    float: right;
    display: block;
    width: calc(100% - 240px);
    padding: 10px 10px 10px 20px;
  }
  
  .page-node-type-dialogue .layout-content {
    padding-bottom: 0;
  }
  
  .about-page main .layout-sidebar-first {
    width: 240px;
  }

  .layout-sidebar-second #block-inuitlanguagemap {
    padding-top: 20px;
  }

  main .layout-sidebar-second #block-inuitlanguagemap img {
    position: relative;
    max-width: 100%;
    margin-left: 0;
  }
  
  .path-dialogues main:before {
    display: none;
  }
  
  .path-dialogues .block-page-title-block {
    border-bottom: 1px solid #c9c9c9;
  }
  
  .path-grammar .block-page-title-block {
    padding-top: 0;
    padding-bottom: 0;
  }
  
  .path-grammar .block-page-title-block:after  {
    position: relative;
    width: 100%;
    max-width: 764px;
    height: 232px;
    left: 0;
    top: 0;
    margin-bottom: 4px;
    background-size: 764px;
    background-position: center -190px;
  }
  
  .path-dialogues .region-content .views-element-container {
    float: left;
    width: 100%;
    padding-left: 50%;
    background-image: url(../images/dialogues-desk.jpg);
    background-repeat: no-repeat;
    background-position: left top;
    background-size: 50%;
  }
  
  .path-dialogues .region-content .views-element-container .view-dialogues {
    float: left;
    border-left: 1px solid #c9c9c9;
  }
  
  .path-grammar .layout--twocol .layout__region {
    width: 50%;
    max-width: 382px;
    float: left;
  }
  
  .path-grammar .layout--twocol .layout__region--first {
    border-right: 3px solid #fff;
  }
  
  .path-grammar .layout--twocol .layout__region--second {
    border-left: 3px solid #fff;
  }

  .path-dialogues .region-footer, .page-node-type-dialogue .region-footer {
    margin-top: 0;
  }
  
  .path-frontpage .region-footer {
    border: none;
  }

}


@media screen and (min-width: 820px) {

  .about-page main .layout-content {
    width: calc(100% - 265px);
    padding: 10px 10px 10px 30px;
  }
  
  .about-page main .layout-sidebar-first {
    width: 265px;
  }
  
  .path-dialogues .region-content .views-element-container {
    padding-left: 60%;
    background-size: 60%;
  }
  
}

@media screen and (min-width: 900px) {

  .region-header {
    height: 222px;
    padding: 0 20px;
    align-items: baseline;
  }
  
  .site-name {
    padding-top: 71px;
  }
  
  .region-primary-menu #search-block-form {
    top: -93px;
  }

  .home-panel {
    padding-top: 0;
    background-position: center -14px;
  }
  
  .home-panel .panel-position {
    left: 58%;
    padding-top: 272px;
  }
  
  .home-buttons {
    height: 164px;
  }
  
  .home-buttons li {
    height: 164px;
    line-height: 164px;
  }
  
  .home-buttons li a, .home-buttons li a.is-active {
    font-size: 26px;
    line-height: 164px;
  }
  
  .home-set-right ul {
    margin-bottom: 0;
  }

  .about-page main .layout-content {
    padding: 10px 10px 10px 40px;
  } 
  
  .path-dialogues .region-content .views-element-container {
    padding-left: 478px;
    background-size: 479px;
  }

  .path-glossary main .layout-content {
    float: left;
  }

  .path-glossary aside.layout-sidebar-second {
    float: right;
    position: relative;
    top: 162px;
  }

}


@media screen and (min-width: 1040px) {

  .path-grammar main .layout-content {
    float: left;
  }

  .path-grammar aside.layout-sidebar-second {
    float: right;
    position: relative;
    top: 148px;
  }

}

@media screen and (min-width: 1080px) {
  
  main .layout-content {
    padding: 10px 6px;
  }
  
  .about-page main .layout-content {
    padding: 10px 0 10px 40px;
  } 

}

@media screen and (min-width: 1090px) {
  
  .site-name {
    padding-top: 120px;
    width: auto;
  }

}

@media screen and (min-width: 1438px) {

  .home-panel {
    background-size: 100%;
  }
  
}


@media screen and (min-width: 1480px) {
  
  .page-node-type-dialogue  .block-page-title-block {
    margin-left: -30px;
  }

}
