/**
 * NSIC Network theme: front-end styles.
 *
 * Ported from the original site's /assets/css/app.css (class names kept so the look
 * matches the archive), plus the base rules the original inherited from the BlueFrame
 * stylesheet and the few new components (school grid, page text, 404).
 *
 * Per-page colours and the background image are injected inline by nsic_inline_styles():
 * --primary, --primary-dark, --secondary and body { background-image }.
 **/

/* Roboto Condensed Bold, Apache License 2.0, self-hosted (assets/fonts). */
@font-face {
    font-family: "Roboto Condensed";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/roboto-condensed-700-latin.woff2") format("woff2");
}

:root {
    --text-color: #fff;
    --text-color-transparent: hsla(0, 0%, 100%, 0.65);
    --text-color-dark: rgba(0, 0, 0, 0.25);
    --primary: #061561;
    --primary-dark: #02082a;
    --secondary: #fff;
}

/* Base ------------------------------------------------------------------- */

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

html {
    overflow: unset !important;
}

body {
    margin: 0;
    color: var(--text-color);
    font-family: Helvetica, Arial, sans-serif;
    background-color: var(--primary);
    background-image: linear-gradient(to bottom, var(--primary) 0, var(--primary-dark) 100%);
    background-size: cover;
    background-attachment: fixed;
    background-position: center top;
    overscroll-behavior: none;
}

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

button {
    font: inherit;
    color: inherit;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    border: 0;
}

/* Layout ----------------------------------------------------------------- */

.portal {
    min-height: 100vh;
}

.portal,
.portal-content {
    display: flex;
    flex-direction: column;
}

.portal-content {
    flex: 1;
    padding-top: 15px;
}

.contained {
    margin: 0 auto;
    width: 100%;
}

.with-padding {
    padding: 10px;
}

.portal-layout {
    display: flex;
    flex-direction: row;
}

.portal-layout-main {
    width: 100%;
}

@media screen and (min-width: 768px) {
    .contained {
        width: 90%;
    }
}

@media screen and (min-width: 992px) {
    .contained {
        width: 85%;
    }
}

@media screen and (min-width: 1280px) {
    .contained {
        width: 80%;
    }
}

/* Header: logo row ------------------------------------------------------- */

.logo-row {
    display: none;
    justify-content: center;
    min-height: 130px;
    padding-top: 20px;
}

.header-logo {
    margin: 20px;
}

.logo-flex {
    align-items: center;
    display: flex;
}

.logo-text {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 20px;
    margin: 10px;
    text-shadow: 0 3px 5px #000;
    text-transform: uppercase;
}

.logo-small {
    width: 120px;
}

.logo-medium {
    width: 160px;
}

.logo {
    width: 190px;
}

.logo-large {
    width: 220px;
}

@media (min-width: 400px) {
    .logo-row {
        display: flex;
    }

    .menu-logo {
        display: none;
    }

    .logo-text {
        font-size: 30px;
    }

    .logo-small {
        width: 220px;
    }

    .logo-medium {
        width: 280px;
    }

    .logo {
        width: 340px;
    }

    .logo-large {
        width: 390px;
    }
}

@media (min-width: 576px) {
    .logo-text {
        font-size: 40px;
        margin-left: 15px;
    }

    .logo-small {
        width: 275px;
    }

    .logo-medium {
        width: 340px;
    }

    .logo {
        width: 420px;
    }

    .logo-large {
        width: 510px;
    }
}

@media (min-width: 768px) {
    .logo-text {
        font-size: 50px;
        margin-left: 20px;
    }

    .logo-medium {
        width: 400px;
    }

    .logo {
        width: 510px;
    }

    .logo-large {
        width: 640px;
    }
}

/* Header: navigation ----------------------------------------------------- */

.nav-row {
    background-color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.navbar {
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 10px 25px;
}

.nav-brand {
    width: 80%;
}

.main-nav-toggle {
    cursor: pointer;
    font-size: 30px;
    margin-left: auto;
    padding: 0;
    background: none;
    border: 0;
}

.main-nav {
    display: none;
    flex-direction: column;
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.main-nav.displayed {
    display: flex;
}

.main-nav li {
    font-size: 14px;
    margin: 20px 0 0;
}

.main-nav li .social-button:not(:last-child) {
    padding: 0 10px 0 0;
}

.logo-link,
.top-link {
    color: var(--text-color);
    text-decoration: none;
}

.top-link:hover {
    color: var(--text-color-transparent);
}

.social-icon {
    fill: var(--text-color);
    height: 25px;
    width: 25px;
}

.social-icon:hover {
    fill: var(--text-color-transparent);
}

.dropdown-button {
    cursor: pointer;
    padding: 0;
    background: none;
    border: 0;
}

.dropdown-button:hover {
    color: var(--text-color-transparent);
}

.dropdown-content {
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.dropdown-content a {
    padding: 10px 0 0 20px;
}

.button-box {
    background-color: transparent;
    border: 2px solid var(--text-color);
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    text-align: center;
}

.button-box:hover {
    background-color: var(--text-color-transparent);
    border: 2px solid transparent;
}

@media screen and (min-width: 768px) {
    .navbar {
        flex-wrap: unset;
        padding: 10px 0;
    }

    .nav-brand {
        width: unset;
    }

    .main-nav-toggle {
        display: none;
    }

    .main-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        width: unset;
    }

    .main-nav li {
        align-items: center;
        display: inline-flex;
        height: 30px;
        margin: 0;
        padding: 15px;
    }

    .main-nav li:not(:last-child) {
        border-right: 1px solid var(--text-color-transparent);
    }

    .dropdown {
        display: inline-block;
        position: relative;
    }

    .dropdown-content {
        background-color: #333;
        display: none;
        min-width: 250px;
        position: absolute;
        right: 0;
    }

    .dropdown-content a {
        color: #fff;
        display: block;
        padding: 16px;
    }

    .dropdown-content a:hover {
        color: hsla(0, 0%, 100%, 0.25);
    }

    .dropdown-content a:not(:first-child) {
        border-top: 1px dotted hsla(0, 0%, 100%, 0.25);
    }

    .dropdown:hover .dropdown-content,
    .dropdown:focus-within .dropdown-content,
    .dropdown-content.show {
        display: block;
    }
}

@media screen and (min-width: 992px) {
    .main-nav li {
        font-size: 16px;
        padding: 20px;
    }

    .main-nav li .social-button:not(:last-child) {
        padding: 0 14px 0 0;
    }

    .social-icon {
        height: 35px;
        width: 35px;
    }
}

/* Sponsors and ad boxes -------------------------------------------------- */

.ad-box {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-box-top {
    padding-top: 15px;
    text-align: center;
}

.ad-box-bottom {
    padding-bottom: 15px;
    text-align: center;
}

.sponsorSlide {
    display: none;
}

.sponsorSlide.is-active {
    display: block;
}

.localSponsor {
    vertical-align: middle;
    width: 100%;
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

/* Page text -------------------------------------------------------------- */

.page-title {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 24px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.page-header {
    font-size: 32px;
    margin-top: 10px;
    text-transform: uppercase;
}

.page-text {
    font-size: 16px;
    line-height: 1.4;
}

.page-text a {
    color: var(--secondary);
}

.page-text a:hover {
    color: var(--text-color-transparent);
}

.page-text img {
    height: auto;
}

@media screen and (min-width: 768px) {
    .page-title {
        font-size: 32px;
    }
}

/* School grid (home page) ------------------------------------------------ */

.school-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px 10px;
}

.school-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 150px;
    color: var(--text-color);
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.school-grid-item:hover {
    opacity: 0.75;
}

.school-grid-item img {
    width: 100%;
    height: auto;
}

.school-grid-title {
    margin-top: 6px;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 14px;
    text-transform: uppercase;
}

@media screen and (min-width: 576px) {
    .school-grid-item {
        width: 200px;
    }
}

@media screen and (min-width: 992px) {
    .school-grid-item {
        width: 240px;
    }

    .school-grid-title {
        font-size: 16px;
    }
}

/* Footer ----------------------------------------------------------------- */

.footer-links {
    font-size: smaller;
    margin: 20px 0;
    text-align: center;
}

.legal {
    margin: 30px 0;
}

.legal > a {
    color: var(--text-color);
    text-decoration: none;
}

.legal > a:hover {
    color: var(--text-color-transparent);
}

.legal > a + a::before {
    content: "|";
    margin: 0 10px;
    color: var(--text-color-transparent);
}
