/*
Variables.
**************************************************/
:root {
    --banner-blue: #94B8FF;
    --link-color: #1A5AFE;
    --link-hover-color: #013ACB;
    --side-margin: 2%;
    --banner-height: 100px;
    --banner-img-height: calc(0.5 * var(--banner-height));
    --nav-bg-color: #e4e9f7;
    --blue-text-color: #0069AF;
    --brain-comms-color: #a5c880;
    --box-bg-color: #E0E0E0;
    --twitter-color: #00A3D4;
    --facebook-color: #4667A6;
    --font-family-serif: 'CormorantGaramond', serif;
}

/*
Styling rules.
**************************************************/

p {
    text-align: justify;
    hyphens: none;
}

/* Some style tweaks and colours to match the logo */
a {
    text-decoration: none;
    color: var(--link-color);
    &:hover {
        color: var(--link-hover-color);
    }
}
.bg-secondary:hover {
    color: white;
}
h1 {
    font-weight: 600;
    font-family: var(--font-family-serif); 
}
h2, h3 {
    color: var(--blue-text-color);
}

.banner, .navbar-header, footer {
    padding: 0rem var(--side-margin);
}
.messages, .content {
    padding: 0rem calc(var(--side-margin) * 4);
}
.page-header-image,
.clickable-page-list .row {
    margin-bottom: 1rem;
}

.clickable-page-list .clickable-page-col .cell-wrapper {
    &:not(.overlaytext) .text-wrapper {
        p, h4 {
            text-align: center;
            color: initial;
            font-size: 1.5vw;
        }
        h4 {
            font-size: 2.5vw;
            font-weight: 600;
            font-family: var(--font-family-serif); 
        }
    }
}
.clickable-page-list .clickable-page-col,
.grants-list .grants-list-item {
    .cell-wrapper.overlaytext {
        position: relative;
        .text-wrapper {
            position: absolute;
            width: 100%;
            top: 67%;
            p {
                font-size: 1.5vw;
                padding-left: 5%;
                width: 95%;
                text-align: left;
                color: white;
                background-color: rgba(0,0,0,0.76);
            }
        }
    }
}
.grants-list .grants-list-item .cell-wrapper.overlaytext .text-wrapper p{
    font-size: 1.2rem;
}
.grants-list .grants-list-item {
    text-align: center;
    .item-wrapper {
        width: 100%;
        height: 100%;
        background: url("/static/guarantors/img/Brain-watermark_squared.47afd2ff6f3e.jpg") center center/cover no-repeat;;
    }
}
.grantapps-link {
    display: block;
    font-size: 1.5rem;
    &.margin-around {
        margin: 7vh 10vw;
    }
    &.margin-below {
        margin-bottom: 7vh;
    }
}
.year-and-type {
    font-weight: 600;
    text-transform: uppercase;
} 
.fellows-list .fellows-list-item a,
.speakers-list .speakers-list-item .wrapper {
    display: block;
    width: 288px;
    margin: 0 auto;
    img {
        border-radius: 50%;
        display: block;
        margin: 0 auto;
    }
    p {
        text-align: center;
    }
    .fellow-name,
    .speaker-name {
        color: var(--blue-text-color);
        font-family: var(--font-family-serif); 
        font-size: 1.7rem;
    }
    .year-and-type {
        font-size: 0.6rem;
    }
    .project-title {
        font-size: 0.9rem;
    }
}
.block-publication .item-title,
.fellow-detail .project-title {
    font-size: 1.2rem;
    font-weight: 600;
}
.fellow-detail .project-title {
    text-align: left;
    color: var(--blue-text-color);
    font-size: 1.5rem;
}
.block-publication .item-journal {
    text-transform: uppercase;
}

.pagination {
    margin-top: 1.5rem;
}

footer {
    /* Flip horizontally (we'll flip content back again in a bit, leaving the bg-image flipped)*/
    -webkit-transform:scaleX(-1);
    -moz-transform:scaleX(-1);
    -ms-transform:scaleX(-1);
    -o-transform:scaleX(-1);
    transform: scaleX(-1);
    .footer-content {
        /* Flip back everything except background-image */
        -webkit-transform:scaleX(-1);
        -moz-transform:scaleX(-1);
        -ms-transform:scaleX(-1);
        -o-transform:scaleX(-1);
        transform: scaleX(-1);
    }
    background-color: var(--banner-blue);
    margin-top: 1.5rem;
    padding-bottom: 1rem;
    background-image: url("/static/guarantors/img/brain_image_masked.2830bada47fc.png");
    background-repeat: no-repeat;
    background-size: 66%;
    background-position: 180% 41%;
    .footer-menu div p {
        margin-top: 1.2rem;
    }
    .site-info p {
        margin-top: 0.3rem;
        margin-bottom: 0.3rem;
        font-size: 0.9rem;
    }
    .admin-info p a {
        color: DarkRed;
    }
    a { 
        text-decoration: none;
        color: black;
        &:hover {
            color: white;
        }
        &.telemarq-link {
            color: white;
        }
        &.telemarq-link:hover {
            color: black;
        }
    }
}

.banner {
    height: var(--banner-height);
    background-color: var(--banner-blue);
    img {
        margin-top: calc(0.5 * (var(--banner-height) - var(--banner-img-height)));
        height: var(--banner-img-height);
    }
    @media only screen and (min-width: 622px) {
        background-image: url("/static/guarantors/img/brain_image_masked.2830bada47fc.png");
        background-repeat: no-repeat;
        background-size: auto var(--banner-height);
        background-position: 95% 0%;
    }
}

a.left-logo img {
    width: 100%;
    /* hack to mitigate effect on mobile screens */
    max-width: 165px; 
    opacity: 0.7;
    margin-bottom: 1em;
}

.brainjournal, .braincomms {
    padding-top: 5px;
    padding-bottom: 5px;
}
.brainjournal {
    background-color: var(--banner-blue);
}
.braincomms {
    background-color: var(--brain-comms-color);
}

.clickable-img-list {
    margin-top: 0rem;
    margin-bottom: 1rem;
    .row {
        margin: 0 15%;
        .clickable-img-col {
            &:only-of-type img {
                /* eg. /conference/ */
                width: 90%;
                height: 90%;
            }
            .cell-wrapper {
                margin: 0 auto;
                a, div {
                    img {
                        display: block;
                        margin: 0 auto;
                    }
                    p {
                        margin: 0 auto;
                        text-align: center
                    }
                }
            }
        }
    }
    & + .clickable-img-list {
        /* If this immediately follows another, lose the top margin so they can look seamless */
        margin-top: -1rem;
    }
}
.circle-img,
.clickable-img-col img.trustee-photo {
    border-radius: 50%;
}
/*.rich-text-matrix-2 .row {
    margin-top: 1rem;
    .cell {
        .cell-wrapper {
            margin: 0 auto;
        }
        // TODO: use media query to undo the styles below if screen is narrow
        &:nth-child(odd) .cell-wrapper p {
            text-align: left;
        }
        &:nth-child(even) .cell-wrapper p {
            text-align: right;
        }
        &:last-child:nth-child(odd) .cell-wrapper p {
            text-align: center;
        }
    }
}*/
.rich-text-matrix {
    margin-top: 0rem;
    margin-bottom: 1rem;
    & + .rich-text-matrix {
        /* If this immediately follows another, lose the top margin so they can look seamless */
        margin-top: -1rem;
    }
    .row {
        .cell {
            .cell-wrapper {
                margin: 0 auto;
                width: 150px;
            }
            .cell-wrapper p {
                text-align: center;
            }
        }
    }
}
/*.matrix-wrapper {
    margin-top: 3rem;
    .matrix-cell {
        float: left;
        padding-right: 3rem;
        p {
            text-align: justify;
        }
    }
}*/

/* Now that content title is within middle panel (rather than above, across entire width of page) ensure we get some vertical space between fixed position navbar and content containers when there are no messages to show and there's no breadcrumb bar. */
div.messages {
    padding-top: 0.8em;
}
div.content {
    margin-top: 1.8rem;
}

.navbar-header {
    background-color: var(--nav-bg-color);
    nav .nav-item .nav-link {
        color: rgba(0,0,0,0.7);
        font-size: 1.1rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        border-style: none none solid none;
        border-width: 5px;
        border-color: transparent;
        &.active {
            color: rgba(0,0,0,1);
            border-color: var(--banner-blue);
            @media only screen and (max-width: 991px) {
                border-style: none none none solid;
                padding-left: 0.2rem;
            }
        }
    }
    .control-icons {
        padding-left: 0px;
        a.dropdown-toggle {
            text-decoration: none;
            &::after {
                display: none;
            }
        }
        a.control-icon {
            font-size: 1.1rem;
            vertical-align: super;
        }
        i.control-icon {
            margin: 0.6rem 0.8rem;
            font-size: 2.5rem;
            color: rgba(0,0,0,0.7);
        }
        #username {
            font-weight: 600;
            padding-left: 1rem;
            padding-right: 1rem;
        }
        .dropdown-menu {
            min-width: 13rem;
         }
     }
}

/* Smaller font-size in left-hand-menu level 1 */
div.panel-default.tree .navlist-menu-level-1 {
    font-size: 85%;
    line-height: 120%;
}

li.blog-post-item {
    margin-top: 2rem;
}
.blog-meta, .blog-sharing-options, .blog-root-link {
    margin-top: 1rem;
}
.share-blog-item {
    color: white;
}
.share-blog-item.share-twitter {
    background-color: var(--twitter-color);
}
.share-blog-item.share-facebook {
    background-color: var(--facebook-color);
}

/* Display Submit button inline in application lists */
.application-submit-form, .application-accept-form {
    display: inline;
}

form {
    ul {
        padding-left: 0px;
        li {
            list-style: none outside none;
            margin-top: 0.6em;
        }
    }
    label {
        margin-right: 1rem;
        margin-bottom: 0em;
        min-width: 10.5rem;
        & ~ textarea {
            vertical-align: top;
        }
    }
    p:only-of-type label {
        /* Don't indent the input if it's the only one visible (nothing to align it with!) */
        min-width: 0rem;
    }
    .helptext {
        font-style: italic;
        display: block;
        padding-left: 14.5em;
    }
    .subsection-include {
        font-size: 90%;
        color: #666;
        margin-bottom: 2em;
        ul {
            margin-left: 2em;
            li {
                list-style: disc outside none;
            }
        }
    }
    &#application-form .meeting_date {
        margin-bottom: 1.5em;
    }
    .errorlist {
        color: red;
    }
}

.input-group.date, .input-group.currency {
    width: 12em;
}
.fileup_actions {
    input[type="file"] {
        display: inline;
    }
    label {
        font-weight: normal;
    }
}

.active-filter {
    font-weight: bold;
}

.social-media-icon {
    height: 2rem;
}

