@import url(//fonts.googleapis.com/css?family=Open+Sans:300italic,300&subset=latin,latin-ext);

/***************** 

WellSleep Centre CSS

*****************/

body {
    background: url(gfx/background-inner.png) center 0px repeat-x;
}
#wrapper {
    background: url(gfx/banner-inner.jpg) center 0px no-repeat;
}
.titleinner {
    padding-top: 300px;
    margin-top: 0px;
    background: url(gfx/title.png) 232px 95px no-repeat;
}
.titleinner img {
    display: none;
}
#title h1 {
    padding: 5px 0 14px 0px;
    font-size: 38px;
    line-height: 1.2;
    margin: 0 0 0 23px;
    background: none;
    color: #674e35;
    font-family: 'Open Sans', Helvetica, Arial, Geneva, sans-serif;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: static;
    max-width: 627px;
    margin-top: 3px;
    opacity: 1;
}
#content h2 {
    padding-bottom: 7px;
    font-size: 28px;
    font-family: 'Open Sans', Helvetica, Arial, Geneva, sans-serif;
    font-weight: 300;
    line-height: 1.3;
    margin-top: 28px;
    text-rendering: optimizeLegibility;
    color: #56412c;
}
#content h2:first-of-type {
    margin-top: 0;
}
#content p + h2:first-of-type {
    margin-top: 28px;
}
#right {
    background-size: 26px 100%;
}

/*  FRONTPAGE  */

body.frontpage {
    background: url(gfx/background-frontpage.png) center 0px repeat-x;
}
body.frontpage #wrapper {
    background: url(gfx/banner-frontpage.jpg) center 0px no-repeat;
}
body.frontpage .titleinner {
    padding-top: 380px;
    background: url(gfx/title.png) 232px 120px no-repeat;

}
body.frontpage #title h1 {
    line-height: 1.3;
}
body.frontpage #title h1.notopimage {
    max-width: 882px;
    font-size: 42px;
    padding-right: 0;
}
body.frontpage #content.otgx {
    width: 882px;
    display: flex;
    flex-wrap: wrap;
}
body.frontpage #content .grid_half {
    width: 48%;
    margin-right: 4%
}
body.frontpage #content .grid_half:nth-of-type(2n) {
    margin-right: 0;
}
body.frontpage #content .grid_half.fancy-box h3 {
    margin: 21px 0 14px 21px;
}
body.frontpage #content .grid_half.fancy-box {
    margin-top: 0;
}
body.frontpage #content .grid4.fancy-box {
    padding: 21px;
    margin: 0;
}
body.frontpage #content .grid4.fancy-box:hover {
    -webkit-box-shadow: 0px 1px 14px 0px rgba(85, 85, 85, 0.21);
    -moz-box-shadow:    0px 1px 14px 0px rgba(85, 85, 85, 0.21);
    box-shadow:         0px 1px 14px 0px rgba(85, 85, 85, 0.21);
}
body.frontpage #content .grid4.fancy-box li {
    margin: 14px 0;
}

/*========

Right

========*/

body.frontpage #right {
    margin-top: 0px;
    padding-left: 0;
    margin-left: 0;
    background: none;
    position: absolute;
    top: 600px;
}
body.frontpage #right img{
    display: none;
}
body.frontpage #right p.smalltag {
    text-transform: none;
    padding-left: 20px;
}
body.frontpage #pagemetadata {
    clear: both;
    padding-left: 0;
    margin-left: 0;
}

body.frontpage #content .grid_third {
    width: 30%;
    margin-right: 5%;
}

/* Fancy boxes */

body.frontpage #content .fancy-box {
    margin-top: 21px;
    border-radius: 3px;
    -webkit-box-shadow: 0px 1px 14px 0px rgba(85, 85, 85, 0.21);
    -moz-box-shadow:    0px 1px 14px 0px rgba(85, 85, 85, 0.21);
    box-shadow:         0px 1px 14px 0px rgba(85, 85, 85, 0.21);
    border: 1px solid #dddddd;
    box-sizing: border-box;
    margin-bottom: 49px;
    transition: box-shadow 0.3s ease;
}
body.frontpage #content .fancy-box:hover {
    -webkit-box-shadow: 0px 1px 14px 0px rgba(85, 85, 85, 0.49);
    -moz-box-shadow:    0px 1px 14px 0px rgba(85, 85, 85, 0.49);
    box-shadow:         0px 1px 14px 0px rgba(85, 85, 85, 0.49);
    transition: box-shadow 0.3s ease;
}
body.frontpage #content .fancy-box p.img-box {
    margin: 0;
    padding: 0;
    border-bottom: none;
}
body.frontpage #content .fancy-box p img {
    margin: 0;
    padding: 0;
    border: none;
}
body.frontpage #content .fancy-box img {
    width: 100%;
    border-radius: 3px 3px 0 0;
    border-bottom: 3px solid #f9c000 !important;
    box-sizing: border-box;
}
body.frontpage #content .fancy-box h2 {
    text-align: center;
    margin-top: 7px;
    margin-bottom: 14px;
    padding: 0;
    border-bottom: none;
    font-size: 21px;
    color: #416EBF;
}
body.frontpage #content .fancy-box p {
    color: #626262;
    margin: 21px;
    margin-top: 0;
}
body.frontpage #content .grid_third:nth-of-type(4),
body.frontpage #content .grid_third:nth-of-type(8) {
    margin-right: 0;
}

/* Tablet styles */

@media only screen and (min-width: 769px) and (max-width: 1024px) {
    #features {
        width: 650px;
    }
    body.frontpage #content.otgx {
        width: 650px;
    }
    /* Fancy boxes */
    body.frontpage #content .grid_third {
        width: 30%;
    }
    .titleinner {
        padding-top: 300px;
        padding-bottom: 0;
        background: url(gfx/title-mobile.png) 232px 73px no-repeat;
    }
    body.frontpage #wrapper {
        background: url(gfx/banner-frontpage.jpg) center 0px no-repeat;
    }
    body.frontpage .titleinner {
        background: url(gfx/title-mobile.png) 232px 105px no-repeat;
        background-size: 350px;
    }
    #wrapper {
        background-position: -450px 0;
    }
}

@media only screen and (max-width: 768px) {
    #wrapper {
        background-position: -400px 0;
        width: 753px;
    }
    .titleinner {
        padding-bottom: 0;
        background: url(gfx/title-mobile.png) 232px 74px no-repeat;
    }
    body.frontpage #title h1 {
        width: auto;
    }
    #title h1.notopimage {
        max-width: 100%;
        padding-right: 0;
        line-height: 1.2;
    }
    body.frontpage {
        background: none;    
    }
    body.frontpage #wrapper {
        background: url(gfx/banner-frontpage.jpg) -250px 0px no-repeat;
        background-size: 1200px;
    }
    body.frontpage .titleinner {
        padding-top: 380px;
        background: url(gfx/title.png) 227px 38px no-repeat;
    }
    body.frontpage #title h1.notopimage {
        line-height: 1.2;
        font-size: 28px;
    }
    #content {
        background-size: 420px;
    }
    body.frontpage #content {
        padding-top: 0;
    }
    body.frontpage #content h2 {
        font-size: 24px;
    }
    body.frontpage #content .grid4 .grid_third.feature-box {
        width: 62.5%;
    }
    body.frontpage #content .grid4 .grid_third.feature-box:nth-of-type(2n) {
        margin-right: 0;
    }
    body.frontpage #content .grid4 .grid1:nth-of-type(2n) {
        margin-right: 0;
    }
    body.frontpage #content .grid1 {
        width: 44.5%;
        min-height: 0;
        padding-top: 0;                                
    }
    #features .features {
        margin-bottom: 42px;
        margin-left: 232px;
    }
    .news article .articletext {
        width: 100%;
        float: none;
    }
    body.frontpage .feature-box-container,
    .features {
        background-size: 100%;
    }
    body.frontpage #content h3 {
        padding-bottom: 7px;
    }
    #right {
        border-top: 1px solid #e4e4e4;
        margin-top: 0px;
    }
    body.frontpage #right {
        border-top: none;
        width: 186px;
    }
    body.frontpage #content.otgx {
        width: 418px;
    }
    /* Fancy boxes */
    body.frontpage #content .grid_third {
        width: 100%;
        margin-right: 0;
        margin-bottom: 35px;
    }
    #right .rightwidget {
        padding: 13px 0px 0px 0px;
    }
    .separator {
        background-color: #e4e4e4;
        width: 100%;
        height: 1px;
        display: block;
        float: left;
        margin-top: 35px;
        margin-bottom: 49px;
    }
    body.frontpage #content #box6 .grid_half {
        width: 100%;
        margin-right: 0;
    }
    body.frontpage .titleinner {
        padding-top: 315px;
        padding-bottom: 0;
        background: url(gfx/title-mobile.png) 232px 90px no-repeat;
        background-size: 300px;
    }

}

/* Mobile styles*/

@media only screen and (max-width: 700px) {
    body,
    body.frontpage {
        background: none;
    }
    #wrapper {
        width: 100%;
        background-position: -350px 0;
        background-size: 1080px;
        background-repeat: repeat-x;
    }
    body.frontpage #wrapper {
        width: 100%;
        background-size: 900px;
    }
    #content {
        background-size: contain;
    }
    body.frontpage #content {
        background: none;
    }
    .titleinner{
        background-position: 0px 50px;
        padding-top: 210px;
        width: 92%;
        background-size: 250px;
    }
    body.frontpage .titleinner {
        padding-top: 235px;
        background-size: 300px;
        background-position: 0px 51px;
    }
    #title h1 {
        font-size: 28px;
        margin-left: 0;
        width: 100%;
        text-shadow: 1px 1px 0px #ffffff;
    }
    .titleinner h1 {
        max-width: 100% !important;
        min-width: 186px !important;
    }
    body.frontpage #title h1 {
        margin-left: 0;
        width: 100%;
        text-shadow: 1px 1px 0px #ffffff;
    }
    body.frontpage #title h1.notopimage {
        line-height: 1.2;
        font-size: 28px;
        margin-bottom: 7px;
    }
    body.frontpage #content h2 {
        font-size: 22px;
        text-align: left;
    }
    body.frontpage #content .grid1 {
        width: 44%;
        margin-right: 12%;
        margin-bottom: 0;
    }
    body.frontpage #content img {
        float: none;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }
    body.frontpage #content .grid1 p img {
        width: 100%;
        max-width: 100%;
        float: none;
    }
    #features .features {
        margin-left: 0px;
    }
    body.frontpage #content.otgx {
        width: 97%;
    }
    body.frontpage #right {
        position: relative;
        top: 0;
    }
    /* Fancy boxes */
    body.frontpage #content .grid_third {
        width: 30%;
        margin-right: 4.5%;
    }
    body.frontpage {
        background: url(gfx/background-frontpage.png) center 0px repeat-x;
        background-size: 0.6px;
    }
}
@media only screen and (max-width: 520px) {
    /* Fancy boxes */
    body.frontpage #content .grid_third {
        width: 100%;
        margin-right: 0;
    }
    body.frontpage #content .grid_half.fancy-box {
        width: 100%;
        margin-right: 0;
    }
    body.frontpage {
        background: none;
    }
    body.frontpage #wrapper {
        background: url(gfx/banner-frontpage.jpg) -250px 0px no-repeat;
        background-size: 850px;
    }
    body.frontpage .titleinner {
        padding-bottom: 0;
        padding-top: 220px;
        background: url(gfx/title-mobile.png) 0 50px no-repeat;
        background-size: 270px;
    }
    #wrapper {
        background-position: -445px 0;
    }
}
@media only screen and (max-width: 350px) {
    body.frontpage #wrapper {
        background: url(gfx/banner-frontpage.jpg) -347px 0px no-repeat;
        background-size: 850px;
    }
    #wrapper {
        background-position: -570px 0;
    }
}