/* General page styling */
* {
    box-sizing: border-box;
}

body {
    width: 90%;
    margin: 0 auto;
    padding: 0;
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #f4f7f6;
    color: #263238;
    line-height: 1.7;
}

/* Header styling */
header {
    text-align: center;
    background-color: #123c35;
    color: white;
    padding: 25px 20px;
    border-radius: 0 0 12px 12px;
}

#title {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 3px #00000055;
}

.tagline {
    margin: 5px 0 20px;
    color: #d2e8df;
    font-size: 1.1rem;
}

/* Navigation styling */
nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
}

nav li {
    margin: 0;
}

/* Hyperlink state 1: Normal */
nav a:link {
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    display: block;
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* Hyperlink state 2: Visited */
nav a:visited {
    color: #c4e6d8;
}

/* Hyperlink state 3: Mouse hovering */
nav a:hover {
    background-color: #e4b363;
    color: #123c35;
}

/* Hyperlink state 4: Mouse button pressed */
nav a:active {
    background-color: #ffffff;
    color: #123c35;
    transform: scale(0.96);
}

/* Hyperlink state 5: Keyboard focus */
nav a:focus {
    outline: 3px solid #e4b363;
    outline-offset: 3px;
}

/* Main section: three columns */
#main {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 24px;
    width: 100%;
    margin: 30px auto;
}

/* Shared column styling */
.column1,
.column2,
.column3 {
    min-width: 0;
    flex: 1;
    padding: 18px;
    background-color: #ffffff;
    border: 1px solid #d5e1dc;
    border-radius: 10px;
    box-shadow: 0 3px 10px #0000000d;
}

/* Featured Runner on the left */
.column3 {
    order: 1;
}

/* Upcoming Races in the middle */
.column2 {
    order: 2;
    flex: 1.2;
}

/* Training Tips on the right */
.column1 {
    order: 3;
}

/* Google Font for all h2 headings */
h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    color: #176b55;
    text-align: center;
    text-decoration: underline;
    text-decoration-color: #e4b363;
    text-underline-offset: 7px;
    margin: 0 0 20px;
}

/* Responsive images */
#main img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

#main p {
    font-size: 0.98rem;
    margin: 12px 0;
}

/* Footer layout */
footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 25px;
    background-color: #123c35;
    color: white;
    padding: 25px;
    border-radius: 12px 12px 0 0;
    margin-top: 30px;
}

footer h3 {
    font-family: 'Poppins', sans-serif;
    color: #e4b363;
    margin-top: 0;
    margin-bottom: 12px;
}

footer p {
    margin: 8px 0;
    overflow-wrap: anywhere;
}

footer i {
    margin-right: 8px;
    color: #e4b363;
}

footer a {
    color: #ffffff;
    text-decoration: none;
}

footer a:hover {
    color: #e4b363;
}

.footer-social a {
    display: inline-block;
    font-size: 1.8rem;
    margin-right: 14px;
    transition: transform 0.2s ease;
}

.footer-social a:hover {
    transform: translateY(-3px);
    color: #e4b363;
}

.footer-copy {
    align-self: center;
    color: #d2e8df;
    font-size: 0.9rem;
}

/* Media query 1: Screens narrower than 1000px */
@media screen and (max-width: 999px) {
    body {
        width: 100%;
    }

    header,
    footer {
        border-radius: 0;
    }

    #main {
        width: 100%;
        padding: 0 15px;
        gap: 15px;
    }
}

/* Media query 2: Screens narrower than 700px */
@media screen and (max-width: 699px) {
    #main {
        flex-direction: column;
        padding: 0 15px;
        gap: 20px;
    }

    .column1,
    .column2,
    .column3 {
        flex: none;
        width: 100%;
        border: none;
        padding: 0;
        box-shadow: none;
        background-color: transparent;
        border-radius: 0;
    }

    /* Reset ordering for a natural mobile reading flow */
    .column3 {
        order: 1;
    }

    .column2 {
        order: 2;
    }

    .column1 {
        order: 3;
    }

    #title {
        font-size: 1.8rem;
    }

    nav ul {
        gap: 5px;
    }

    nav a:link {
        padding: 8px 10px;
    }

    #main img {
        height: auto;
        max-width: 100%;
        max-height: 300px;
        object-fit: cover;
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px 20px;
    }
}