/* Google Fonts import */
@import url("https://fonts.googleapis.com/css2?family=Jockey+One&family=Lexend&display=swap");

/* Override default browser styles */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* General styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #000030;
    font-family: 'Lexend', sans-serif;
}

h1,
h2,
h3,
h4 {
    font-family: 'Jockey One', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #005da0;
}

h2 {
    font-size: 300%;
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

h3 {
    font-size: 200%;
}

ul {
    list-style: none;
}

.hidden {
    display: none;
}

/* General video styles */
.video-section {
    margin: 1rem 1rem 0;
}

.video-container {
    position: relative;
    /* 16:9 ratio */
    padding-bottom: 56.25%;
    height: 0;
    max-width: 1000px;
    max-height: 563px;
    margin: 0 auto 0;
}

.video {
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 1000px;
    max-height: 563px;
}

/* Header */

header {
    background-color: #ffffff;
    width: 100%;
    padding: 0 0.5rem;
    position: fixed;
    z-index: 99;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header a {
    text-decoration: none;
    color: inherit;
}

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

#logo>img {
    height: 36px;
    padding: 0 5px;
    margin: auto;
    text-align: center;
}

#menu {
    font-size: 100%;
}

/* Targets non-active nav items */
.non-active {
    background-color: #ffffff;
    color: #000030;
    width: 100%;
    padding: .5rem;
    border-radius: 5px;
    display: block;
}

/* Targets active nav items */
.active {
    background-color: #005da0;
    color: #ffffff;
    width: 100%;
    padding: .5rem;
    border-radius: 5px;
    display: block;
}

/* Nav styles with dropdown toggle */
nav {
    background-color: #ffffff;
    width: 100%;
    padding: .5rem;
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
}

/* Nav elements that come after the nav-toggle id when checked */
#nav-toggle:checked~nav {
    display: block;
}

/* Nav elements when toggle is unchecked */
#nav-toggle {
    display: none;
}

.nav-toggle-label {
    color: #005da0;
    font-size: 2rem;
}

/* Main - Index Page */

/* Carousel image gallery */
.carousel-container {
    width: 100%;
    max-height: 750px;
    position: relative;
    margin-top: 45px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel {
    display: flex;
    /* Controls the duration of each image before scrolling */
    animation: scroll 20s linear infinite;
}

.carousel>img {
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Auto scrolling animation */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    10% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-100%);
    }

    30% {
        transform: translateX(-100%);
    }

    40% {
        transform: translateX(-200%);
    }

    50% {
        transform: translateX(-200%);
    }

    60% {
        transform: translateX(-300%);
    }

    70% {
        transform: translateX(-300%);
    }

    80% {
        transform: translateX(-400%);
    }

    90% {
        transform: translateX(-400%);
    }

    100% {
        transform: translateX(-500%);
    }
}

/* Reasons section */
#reasons {
    margin: .5rem 1rem 0;
}

#reasons div div {
    margin-top: .5rem;
    padding: 1rem;
    border-radius: 10px;
}

#inclusiveness>h3,
#history>h3 {
    color: #ffffff;
}

#teamwork,
#respect {
    background-color: #e2e2e2;
}

#inclusiveness,
#history {
    color: #ffffff;
    background-color: #005da0;
}

#left-icon-1,
#left-icon-2 {
    display: none;
}

/* External Links section */
#links {
    margin: 1rem 1rem 0;
}

#link-image {
    height: 400px;
    width: fit-content;
    margin: 0 auto;
}

#link-image img {
    width: auto;
    height: 100%;
}

#link-uk-rugby {
    max-width: 400px;
    margin: .5rem auto 0;
    font-size: 200%;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

#links h2 {
    margin: .5rem auto 0;
}

#link-uk-rugby div {
    width: 25%;
    height: 60px;
    margin-top: 1rem;
}

#link-uk-rugby img {
    width: auto;
    height: 100%;
}

/* Main - Rules Page */

/* Hero Image section */
#rules-hero {
    height: 400px;
    width: 100%;
    margin-top: 45px;
    background: url(../images/rugby_ref.webp) no-repeat center top/cover;
}

/* Rules accordion section */
#rules-accordion {
    margin: .5rem 1rem 0;
}

#rules-accordion>ul {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto 0;
}

#rules-accordion li {
    margin-top: .5rem;
    background-color: #005da0;
    border-radius: 10px;
}

#rules-accordion li label {
    font-family: 'Jockey One', sans-serif;
    font-size: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

/* Changes size of accordion arrow icons */
#rules-accordion li label span {
    font-size: 20px;
}

#rules-accordion li div {
    background-color: #e2e2e2;
    border-radius: 0 0 10px 10px;
    position: relative;
}

/* Hides accordion images for mobile view */
#rules-accordion li div img {
    display: none;
}

/* Hides accordion content when checkbox is unchecked */
#rules-accordion label+input[type="checkbox"] {
    display: none;
}

#rules-accordion .accordion-content {
    max-height: 0;
    overflow: hidden;
}

/* Reveals accordion content when checkbox is checked */
#rules-accordion label+input[type="checkbox"]:checked+.accordion-content {
    max-height: 800px;
    padding: 1rem;
}

/* Pitch Image */
#rules-accordion {
    display: flex;
    flex-direction: column;
}

#pitch {
    height: fit-content;
    width: 100%;
    max-width: 600px;
    margin: .5rem auto 0;
}

#pitch>img {
    height: auto;
    width: 100%;
    margin-top: .5rem;
}

/* Main - Positions Page */

/* Hero Image section */
#positions-hero {
    height: 400px;
    width: 100%;
    margin-top: 45px;
    background: url(../images/rugby_positions.webp) no-repeat center top/cover;
}

/* Positions accordion section */
#positions {
    margin: .5rem 1rem 0;
}

#positions-container {
    max-width: 1250px;
    margin: 0 auto 0;
}

#forwards-accordion {
    margin-top: .5rem;
}

#backs-accordion {
    margin-top: 1rem;
}

.positions-accordion>h3,
.positions-accordion>p {
    text-align: center;
}

.positions-accordion>ul {
    width: 100%;
    margin: 0 auto 0;
}

.positions-accordion li {
    margin-top: .5rem;
    background-color: #005da0;
    border-radius: 10px;
}

.positions-accordion li label {
    font-family: 'Jockey One', sans-serif;
    font-size: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

/* Changes size of accordion arrow icons */
.positions-accordion li label span {
    font-size: 20px;
}

.positions-accordion li div {
    background-color: #e2e2e2;
    border-radius: 0 0 10px 10px;
    position: relative;
}

.positions-img {
    display: flex;
    flex-direction: column;
}

.positions-img>img {
    width: 50%;
    max-width: 200px;
    margin: auto;
    padding-bottom: .5rem;
}

/* Hides accordion content when checkbox is unchecked */
#forwards-accordion label+input[type="checkbox"],
#backs-accordion label+input[type="checkbox"] {
    display: none;
}

#forwards-accordion .accordion-content,
#backs-accordion .accordion-content {
    max-height: 0;
    overflow: hidden;
}

/* Reveals accordion content when checkbox is checked */
#forwards-accordion label+input[type="checkbox"]:checked+.accordion-content,
#backs-accordion label+input[type="checkbox"]:checked+.accordion-content {
    max-height: 1500px;
    padding: 1rem;
}

/* Main - Newsletter */

#newsletter-main {
    /* Sets height to viewport height minus the header and footer */
    height: calc(100vh - 117px);
    /* Fixes display issue on small landscape devices */
    min-height: 400px;
    /* Makes space for the header */
    margin: 45px 1rem 0;
}

#newsletter-response {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

/* Email image */
#email-img {
    margin: 0 auto 0;
    height: 200px;
}

#email-img>img {
    height: 100%;
}

#newsletter-message {
    margin: 1rem auto 0;
}

#newsletter-message>p {
    font-size: 120%;
    text-align: center;
    max-width: 600px;
}

/* Footer */

#footer {
    background-color: #000030;
    margin-top: 1rem;
}

/* Removes margin on Newsletter footer */
.newsletter-footer {
    margin-top: 0 !important;
}

/* Social Media links */
#social-media {
    padding: 1rem;
}

#social-media>ul {
    font-size: 2rem;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
}

.social-media-link {
    color: #ffffff;
}

/* Newsletter */
#newsletter {
    padding: 0 1rem 1rem;
    margin: 0 auto;
    max-width: 400px;
}

#newsletter>h2 {
    color: #ffffff;
    font-size: 200%;
    text-align: center;
}

.button-inputs {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

#newsletter form input::placeholder {
    color: #000030;
}

.newsletter-input {
    font-size: 100%;
    color: #000030;
    background-color: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 5px;
    margin-bottom: 10px;
    border-style: inset;
    border-color: #808080;
    border-width: 5px;
    border-radius: 10px;
}

.newsletter-btn {
    font-size: 100%;
    color: #ffffff;
    background-color: #005da0;
    width: 50%;
    max-width: 100px;
    padding: 5px;
    border-style: inset;
    border-color: #808080;
    border-width: 5px;
}

/* Sets radius to be flat against the adjacent button */
#newsletter-submit {
    margin-right: 5px;
    border-radius: 10px 0 0 10px;
}

#newsletter-reset {
    margin-left: 5px;
    border-radius: 0 10px 10px 0;
}

/* 404 Error Page */

#error-page {
    margin: 45px 1rem 0;
    text-align: center;
}

#error-page>h1 {
    font-size: 600%;
}

#error-page>p {
    font-size: 120%;
    margin: 1rem auto 2rem;
}

#error-page>a {
    text-decoration: none;
    width: fit-content;
}

#home-btn {
    font-size: 150%;
    text-align: center;
    color: #ffffff;
    background-color: #005da0;
    width: fit-content;
    padding: .5rem;
    border: 2px solid #005da0;
    border-radius: 5px;
    box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
}

#home-btn:hover {
    color: #000030;
    background-color: #ffffff;
    border-color: #000030;
    transition-duration: 0.4s;
    cursor: pointer;
}

/* Media Query: smaller devices (less than 320px) */
@media screen and (max-width: 319px) {

    /* General Styles */
    h2 {
        font-size: 250%;
    }

    h3 {
        font-size: 150%;
    }

    /* Header */

    #logo {
        font-size: 180%;
    }

    #logo>img {
        height: 36px;
        padding: 0 5px;
        margin: auto;
        text-align: center;
    }

    /* Main - Index Page */

    .carousel-container {
        margin-top: 40px;
    }
}

/* Media Query: tablets (768px and up) */
@media screen and (min-width: 768px) {

    /* General Styles */
    h2 {
        font-size: 400%;
    }

    h3 {
        font-size: 250%;
    }

    /* General video styles */
    .video-section {
        margin: 2rem 2rem 0;
    }

    /* Header */

    header {
        padding: 0 0 0 1rem;
        align-items: center;
    }

    #logo {
        font-size: 300%;
    }

    #logo>img {
        height: 60px;
    }

    #menu {
        font-size: 110%;
        display: flex;
    }

    #menu>li {
        width: 120px;
        text-align: center;
    }

    /* Replaces nav toggle with an inline-block */
    nav {
        display: inline-block;
        position: relative;
        width: fit-content;
    }

    /* Removes nav toggle */
    .nav-toggle-label {
        display: none;
    }

    /* Main - Index Page */

    /* Applies new top margin to the carousel gallery */
    .carousel-container {
        margin-top: 67px;
    }

    /* Reasons section */
    #reasons {
        margin: 1rem 2rem 0;
    }

    #reasons div div {
        margin-top: 1rem;
        padding: 2rem;
    }

    .text-right {
        text-align: right;
    }

    #left-icon-1,
    #left-icon-2 {
        display: initial;
    }

    #right-icon-1,
    #right-icon-2 {
        display: none;
    }

    /* External Links section */
    #links {
        margin: 2rem 2rem 0;
    }

    #link-image {
        height: 500px;
    }

    #links h2 {
        margin: 1rem auto 0;
    }

    #link-uk-rugby {
        max-width: 800px;
        margin: 2rem auto 0;
        font-size: 300%;
    }

    #link-uk-rugby div {
        height: 150px;
        margin-top: 2rem;
    }

    /* Main - Rules Page */

    /* Hero Image */
    #rules-hero {
        height: 500px;
        margin-top: 67px;
    }

    /* Rules accordion section */
    #rules-accordion {
        margin: 1rem 2rem 0;
    }

    #rules-accordion li {
        margin-top: 1rem;
    }

    #rules-accordion li label {
        font-size: 40px;
    }
    
    /* Changes size of accordion arrow icons */
    #rules-accordion li label span {
        font-size: 25px;
    }

    /* Displays accordion images in top right corner */
    #rules-accordion li div img {
        display: initial;
        width: auto;
        height: 40vh;
        max-height: 250px;
        justify-content: center;
        float: right;
        margin-left: 1rem;
    }

    .accordion-content p {
        text-align: justify;
    }

    #rules-accordion label+input[type="checkbox"]:checked+.accordion-content {
        padding: 2rem;
    }

    /* Pitch Image */
    #pitch>img {
        margin-top: 1rem;
    }

    /* Rules video */
    #rules-video {
        margin: 1rem 2rem 0;
    }

    /* Main - Positions Page */

    /* Hero Image */
    #positions-hero {
        height: 500px;
        margin-top: 67px;
    }

    /* Positions accordion section */
    #positions {
        margin: 1rem 2rem 0;
    }

    .positions-accordion>h3 {
        font-size: 300%;
    }

    .positions-accordion>p {
        font-size: 120%;
    }

    .positions-accordion li {
        margin-top: 1rem;
    }

    .positions-accordion li label {
        font-size: 40px;
    }
    
    /* Changes size of accordion arrow icons */
    .positions-accordion li label span {
        font-size: 25px;
    }

    .positions-img {
        display: block;
    }

    /* Displays accordion images in top right corner */
    .positions-accordion li div img {
        display: initial;
        width: auto;
        height: 40vh;
        max-height: 250px;
        justify-content: center;
        float: right;
        margin-left: 1rem;
        padding: 0;
    }

    #forwards-accordion label+input[type="checkbox"]:checked+.accordion-content,
    #backs-accordion label+input[type="checkbox"]:checked+.accordion-content {
        padding: 2rem;
    }

    /* Main - Newsletter */

    #newsletter-main {
        /* Sets height to viewport height minus the larger header and footer */
        height: calc(100vh - 159px);
        /* Fixes display issue on larger landscape devices */
        min-height: 700px;
        /* Increases space for the header */
        margin: 67px 2rem 0;
    }

    /* Increases email image size */
    #email-img {
        height: 400px;
    }

    #newsletter-message {
        margin: 2rem auto 0;
    }

    #newsletter-message>p {
        font-size: 160%;
    }

    /* Footer */

    #footer {
        margin-top: 2rem;
    }

    #social-media>ul {
        font-size: 3rem;
    }

    /* Newsletter */
    #newsletter {
        max-width: 600px;
    }

    #newsletter>h2 {
        font-size: 300%;
    }

    /* Displays first and last name inputs on the same line */
    .name-inputs {
        display: flex;
        flex-direction: row;
    }

    .email-input {
        display: flex;
        justify-content: center;
    }

    /* Sets radius to be flat against the adjacent button */
    #newsletter-fname {
        margin-right: 5px;
        border-radius: 10px 0 0 10px;
    }

    #newsletter-lname {
        margin-left: 5px;
        border-radius: 0 10px 10px 0;
    }

    /* 404 Error Page */

    #error-page {
        margin: 67px auto 0;
        max-width: 600px;
    }

    #error-page>h1 {
        font-size: 800%;
    }

    #error-page>p {
        font-size: 150%;
        margin: 1rem auto 3rem;
    }

    #home-btn {
        font-size: 175%;
        padding: .75rem;
    }
}

/* Media Query: laptop and desktop (1000px and up) */
@media screen and (min-width: 1000px) {

    /* General video styles */
    .video-container {
        /* 16:9 */
        padding-bottom: 563px;
    }

    /* Main - Index Page */

    /* Carousel image gallery */
    .carousel-container {
        max-height: 600px;
    }

    .carousel>img {
        width: 50%;
        height: auto;
    }

    /* Auto scrolling animation */
    @keyframes scroll {
        0% {
            transform: translateX(0);
        }

        10% {
            transform: translateX(0);
        }

        20% {
            transform: translateX(-50%);
        }

        30% {
            transform: translateX(-50%);
        }

        40% {
            transform: translateX(-100%);
        }

        50% {
            transform: translateX(-100%);
        }

        60% {
            transform: translateX(-150%);
        }

        70% {
            transform: translateX(-150%);
        }

        80% {
            transform: translateX(-200%);
        }

        90% {
            transform: translateX(-200%);
        }

        100% {
            transform: translateX(-250%);
        }
    }

    /* Reasons section */
    #reasons div div {
        margin: 1rem;
        padding: 3rem;
    }

    #reasons div div p {
        font-size: 120%;
    }

    .reasons-first-half,
    .reasons-second-half {
        display: flex;
        max-width: 1250px;
        margin: 0 auto;
    }

    #inclusiveness>h3,
    #respect>h3 {
        color: #ffffff;
    }

    #teamwork>h3,
    #history>h3 {
        color: #005da0;
    }

    #teamwork,
    #history {
        color: #000030;
        background-color: #e2e2e2;
        width: 40%;
    }

    #inclusiveness,
    #respect {
        color: #ffffff;
        background-color: #005da0;
        width: 60%;
    }

    #teamwork,
    #respect {
        margin-right: .5rem;
    }

    /* External Links section */
    #link-uk-rugby {
        max-width: 1000px;
    }

    /* Main - Rules Page */

    /* Hero Image */
    #rules-hero {
        height: 600px;
        background: url(../images/rugby_ref_wide.webp) no-repeat center top/cover;
    }

    /* Rules accordion section */
    .positions-accordion>p {
        font-size: 140%;
    }

    .accordion-content p {
        font-size: 120%;
    }

    /* Pitch Image */
    #pitch {
        max-width: 900px;
        margin: 1rem auto 0;
    }

    /* Main - Positions Page */

    /* Hero Image */
    #positions-hero {
        height: 600px;
        background: url(../images/rugby_positions_wide.webp) no-repeat center top/cover;
    }

    /* Main - Newsletter */

    #newsletter-main {
        min-height: initial;
    }

    #newsletter-response {
        flex-direction: row;
        max-width: 1250px;
        margin: 0 auto 0;
        justify-content: space-evenly;
        align-items: center;
    }

    #email-img,
    #newsletter-message {
        margin: 0;
    }
}