/* =========================================================
   BRAGA HALF MARATHON 2027
   RACE COURSE
   CASCAIS-LISBOA STYLE
========================================================= */


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #26384c;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
}


/* =========================================================
   TOP BAR
========================================================= */

.identity-bar {
    min-height: 38px;
    background: #26384c;
    color: #ffffff;

    display: flex;
    align-items: center;
}

.identity-inner {
    width: min(1220px, 94%);
    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.identity-place,
.identity-date {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.identity-date {
    color: #e3c3c6;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    position: relative;
    z-index: 100;

    background: #ffffff;

    border-bottom:
        1px solid rgba(38,56,76,.12);
}

.header-inner {
    width: min(1220px, 94%);
    min-height: 100px;
    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 28px;
}

.brand {
    flex: 0 0 245px;
}

.brand img {
    width: 245px;
}


/* =========================================================
   MAIN MENU
========================================================= */

.main-menu {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 25px;
}

.main-menu > a,
.menu-dropdown-toggle {
    position: relative;

    min-height: 42px;

    display: inline-flex;
    align-items: center;

    border: 0;
    background: transparent;

    color: #26384c;

    font-size: 11px;
    font-weight: 900;

    letter-spacing: .07em;
    text-transform: uppercase;

    cursor: pointer;
}

.main-menu > a::after,
.menu-dropdown-toggle::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 3px;

    height: 2px;

    background: #8b1d28;

    transform: scaleX(0);
    transform-origin: left;

    transition:
        transform .2s ease;
}

.main-menu > a:hover::after,
.main-menu > a.active::after,
.menu-dropdown-toggle:hover::after,
.menu-dropdown-toggle.active::after {
    transform: scaleX(1);
}


/* =========================================================
   INFO DROPDOWN
========================================================= */

.menu-dropdown {
    position: relative;
}

.menu-dropdown-toggle {
    gap: 7px;
}

.menu-dropdown-panel {
    position: absolute;

    top: calc(100% + 5px);
    left: 50%;

    width: 215px;

    background: #ffffff;

    border-top:
        3px solid #8b1d28;

    box-shadow:
        0 12px 32px rgba(0,0,0,.16);

    opacity: 0;
    visibility: hidden;

    transform:
        translateX(-50%)
        translateY(-7px);

    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility .18s ease;
}

.menu-dropdown.open
.menu-dropdown-panel {
    opacity: 1;
    visibility: visible;

    transform:
        translateX(-50%)
        translateY(0);
}

.menu-dropdown-panel a {
    display: block;

    padding: 12px 17px;

    border-bottom:
        1px solid #eeeeee;

    color: #344353;

    font-size: 12px;
    font-weight: 700;
}

.menu-dropdown-panel a:hover,
.menu-dropdown-panel a.active {
    background: #f7f3f2;
    color: #8b1d28;
}


/* =========================================================
   LANGUAGE
========================================================= */

.language-selector {
    position: relative;
}

.language-button {
    min-width: 70px;
    height: 38px;

    padding: 0 13px;

    border:
        1px solid #d6dbe0;

    background: #ffffff;
    color: #26384c;

    font-size: 11px;
    font-weight: 900;

    cursor: pointer;
}

.language-panel {
    position: absolute;

    top: calc(100% + 7px);
    right: 0;

    width: 170px;

    background: #ffffff;

    border-top:
        3px solid #8b1d28;

    box-shadow:
        0 10px 30px rgba(0,0,0,.17);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(-6px);

    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility .18s ease;
}

.language-selector.open
.language-panel {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0);
}

.language-panel a {
    display: block;

    padding: 11px 16px;

    border-bottom:
        1px solid #eeeeee;

    color: #344353;

    font-size: 12px;
    font-weight: 700;
}

.language-panel a:hover {
    background: #f7f3f2;
    color: #8b1d28;
}

.mobile-toggle {
    display: none;
}


/* =========================================================
   HERO
========================================================= */

.course-hero {
    min-height: 380px;

    display: flex;
    align-items: center;

    background-image:

        linear-gradient(
            90deg,
            rgba(25,38,52,.86) 0%,
            rgba(25,38,52,.60) 36%,
            rgba(25,38,52,.16) 68%,
            rgba(25,38,52,.03) 100%
        ),

        url("../images/braga-hero-2027.jpg");

    background-size: cover;
    background-position: center;
}

.course-hero-inner {
    width: min(1220px, 94%);
    margin: auto;
}

.course-hero-copy {
    max-width: 620px;
    color: #ffffff;
}

.hero-kicker,
.section-kicker {
    color: #8b1d28;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: .20em;
    text-transform: uppercase;
}

.hero-kicker {
    color: #e9cdd0;
}

.course-hero h1 {
    margin-top: 12px;

    font-size:
        clamp(48px, 5vw, 70px);

    line-height: .98;

    font-weight: 900;
    text-transform: uppercase;
}

.course-hero p {
    max-width: 570px;

    margin-top: 19px;

    font-size: 18px;
    line-height: 1.55;
}


/* =========================================================
   COUNTDOWN
========================================================= */

.countdown-section {
    border-bottom:
        1px solid #e7e7e7;
}

.mini-countdown {
    width: min(1180px, 94%);
    min-height: 82px;
    margin: auto;

    display: grid;

    grid-template-columns:
        1.35fr
        repeat(4, .7fr)
        1.25fr;
}

.mini-countdown > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 13px 12px;

    border-right:
        1px solid #eeeeee;
}

.countdown-intro {
    align-items: flex-start !important;
}

.countdown-intro strong {
    color: #26384c !important;
    font-size: 13px !important;
}

.countdown-intro span {
    color: #8b1d28 !important;
}

.mini-countdown strong {
    color: #8b1d28;

    font-size: 27px;
    font-weight: 900;
}

.mini-countdown span {
    margin-top: 5px;

    color: #777777;

    font-size: 8px;
    font-weight: 800;

    letter-spacing: .12em;
    text-transform: uppercase;
}

.race-day {
    background: #26384c;
}

.race-day strong {
    color: #ffffff !important;
    font-size: 16px !important;
}

.race-day span {
    color: #e3c3c6 !important;
}


/* =========================================================

   COURSE INTRO
========================================================= */

.course-intro {
    padding:
        78px 20px 52px;
}

.course-intro-inner {
    max-width: 900px;

    margin: auto;

    text-align: center;
}

.course-intro h2 {
    margin-top: 10px;

    font-size:
        clamp(35px, 4vw, 50px);

    font-weight: 900;
}

.course-intro p {
    max-width: 720px;

    margin:
        18px auto 0;

    color: #68727c;

    font-size: 16px;
    line-height: 1.7;
}

.course-source-note {
    font-size: 13px !important;
}


/* =========================================================
   DISTANCE SELECTOR
========================================================= */

.distance-section {
    padding:
        0 20px 65px;
}

.distance-grid {
    width: min(1120px, 94%);

    margin: auto;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 18px;
}

.distance-card {
    min-height: 225px;

    padding: 28px 25px;

    border:
        1px solid #e0e2e4;

    background: #ffffff;

    text-align: left;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.distance-card:hover {
    transform:
        translateY(-4px);

    box-shadow:
        0 12px 30px
        rgba(38,56,76,.08);

    border-color: #8b1d28;
}

.distance-card.active {
    background: #8b1d28;
    border-color: #8b1d28;
}

.distance-number {
    color: #8b1d28;

    font-size: 50px;
    line-height: 1;

    font-weight: 900;
}

.distance-unit {
    margin-top: 3px;

    color: #8b1d28;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: .15em;
}

.distance-card h3 {
    margin-top: 19px;

    color: #26384c;

    font-size: 23px;
    font-weight: 900;
}

.distance-card p {
    margin-top: 8px;

    color: #68727c;

    font-size: 13px;
}

.distance-card.active
.distance-number,

.distance-card.active
.distance-unit,

.distance-card.active h3,

.distance-card.active p {
    color: #ffffff;
}


/* =========================================================
   COURSE PANELS
========================================================= */

.course-panel {
    display: none;

    padding:
        75px 20px 90px;

    background: #f5f2ef;
}

.course-panel.active {
    display: block;
}

.course-panel-inner {
    width: min(1160px, 94%);
    margin: auto;
}

.course-heading {
    max-width: 780px;
}

.course-heading h2 {
    margin-top: 9px;

    color: #26384c;

    font-size:
        clamp(34px, 4vw, 48px);

    line-height: 1.1;

    font-weight: 900;
}

.course-heading p {
    margin-top: 14px;

    color: #68727c;

    font-size: 16px;
}


/* =========================================================
   QUICK INFORMATION
========================================================= */

.quick-info-grid {
    margin-top: 40px;

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 12px;
}

.quick-info-card {
    min-height: 110px;

    padding: 22px;

    background: #ffffff;

    border-top:
        3px solid #8b1d28;
}

.quick-info-card span {
    color: #7d858d;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: .13em;
    text-transform: uppercase;
}

.quick-info-card strong {
    display: block;

    margin-top: 7px;

    color: #26384c;

    font-size: 16px;
    font-weight: 900;
}


/* =========================================================
   INTERACTIVE COURSE MAP
========================================================= */

.interactive-map-box {
    margin-top: 28px;

    background: #ffffff;

    border:
        1px solid #dfe2e4;

    box-shadow:
        0 12px 34px
        rgba(38,56,76,.08);

    overflow: hidden;
}


/* =========================================================
   MAP HEADER
========================================================= */

.map-header {
    min-height: 86px;

    padding: 18px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    background: #26384c;

    color: #ffffff;
}

.map-header span {
    color: #e3c3c6;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: .17em;

    text-transform: uppercase;
}

.map-header h3 {
    margin-top: 4px;

    color: #ffffff;

    font-size: 24px;
    font-weight: 900;
}


/* =========================================================
   MAP RESET BUTTON
========================================================= */

.map-reset {
    min-width: 150px;
    height: 39px;

    padding: 0 15px;

    border:
        1px solid
        rgba(255,255,255,.35);

    background:
        rgba(255,255,255,.07);

    color: #ffffff;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: .09em;

    text-transform: uppercase;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease;
}

.map-reset:hover {
    background: #ffffff;
    color: #26384c;
}


/* =========================================================
   LEAFLET MAP
========================================================= */

.leaflet-course-map {
    width: 100%;
    height: 520px;

    background: #e8edf0;
}

.leaflet-container {
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


/* =========================================================
   LEAFLET POPUPS
========================================================= */

.leaflet-popup-content {
    color: #26384c;

    font-size: 12px;
    line-height: 1.5;
}

.leaflet-popup-content strong {
    color: #8b1d28;

    font-size: 12px;
}


/* =========================================================
   MAP LEGEND
========================================================= */

.map-legend {
    min-height: 50px;

    padding: 12px 20px;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 25px;

    background: #ffffff;

    border-top:
        1px solid #eeeeee;

    color: #68727c;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .08em;

    text-transform: uppercase;
}

.map-legend > div {
    display: flex;
    align-items: center;

    gap: 7px;
}

.legend-line {
    width: 24px;
    height: 4px;

    display: inline-block;

    background: #a20f22;

    border-radius: 5px;
}

.legend-start {
    width: 11px;
    height: 11px;

    display: inline-block;

    border-radius: 50%;

    background: #1d7d46;

    border:
        2px solid #ffffff;

    box-shadow:
        0 0 0 1px #1d7d46;
}

.legend-finish {
    width: 11px;
    height: 11px;

    display: inline-block;

    border-radius: 50%;

    background: #8b1d28;

    border:
        2px solid #ffffff;

    box-shadow:
        0 0 0 1px #8b1d28;
}


/* =========================================================
   COURSE VIDEOS
========================================================= */

.course-video {
    margin-top: 30px;

    padding: 42px;

    background: #ffffff;

    border:
        1px solid #e0e2e4;

    box-shadow:
        0 10px 30px
        rgba(38,56,76,.05);
}

.course-video-heading {
    max-width: 760px;

    margin-bottom: 26px;
}

.course-video-heading h3 {
    margin-top: 8px;

    color: #26384c;

    font-size:
        clamp(28px, 3vw, 38px);

    line-height: 1.1;

    font-weight: 900;
}

.course-video-heading p {
    max-width: 650px;

    margin-top: 12px;

    color: #68727c;

    font-size: 14px;
    line-height: 1.7;
}


/* =========================================================
   RESPONSIVE YOUTUBE VIDEO
========================================================= */

.video-wrapper {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #182736;

    box-shadow:
        0 12px 32px
        rgba(38,56,76,.14);
}

.video-wrapper iframe {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    border: 0;
}


/* =========================================================
   ROUTE STORY
========================================================= */

.route-story {
    margin-top: 28px;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 45px;

    align-items: center;

    background: #ffffff;

    padding: 44px;
}

.route-story-copy h3 {
    margin-top: 9px;

    color: #26384c;

    font-size: 34px;
    font-weight: 900;
}

.route-story-copy p {
    margin-top: 15px;

    color: #68727c;

    font-size: 15px;
    line-height: 1.7;
}

.route-highlights {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 12px;
}

.route-highlights div {
    min-height: 105px;

    padding: 20px;

    background: #f5f2ef;

    border-left:
        3px solid #8b1d28;
}

.route-highlights strong {
    display: block;

    color: #26384c;

    font-size: 16px;
    font-weight: 900;
}

.route-highlights span {
    display: block;

    margin-top: 5px;

    color: #777777;

    font-size: 10px;
}


/* =========================================================
   DETAILED ROUTE
========================================================= */

.details-box {
    margin-top: 25px;

    background: #ffffff;

    border:
        1px solid #dedede;
}

.details-toggle {
    width: 100%;
    min-height: 62px;

    padding: 0 23px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border: 0;

    background: #ffffff;

    color: #26384c;

    font-size: 13px;
    font-weight: 900;

    text-transform: uppercase;

    cursor: pointer;
}

.details-toggle span {
    color: #8b1d28;

    font-size: 24px;
}

.details-content {
    display: none;

    padding:
        5px 28px 28px;
}

.details-box.open
.details-content {
    display: block;
}

.details-content ol {
    padding-left: 20px;
}

.details-content li {
    padding: 8px 0;

    border-bottom:
        1px solid #eeeeee;

    color: #68727c;

    font-size: 13px;
}


/* =========================================================
   FINAL COURSE NOTE
========================================================= */

.course-note-section {
    padding:
        70px 20px;

    text-align: center;
}

.course-note-inner {
    max-width: 780px;

    margin: auto;
}

.course-note-inner h2 {
    margin-top: 8px;

    color: #26384c;

    font-size: 34px;
    font-weight: 900;
}

.course-note-inner p {
    margin-top: 15px;

    color: #68727c;

    line-height: 1.7;
}


/* =========================================================
   CTA
========================================================= */

.course-cta {
    padding:
        60px 20px;

    background: #8b1d28;

    color: #ffffff;
}

.course-cta-inner {
    width: min(1050px, 92%);

    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

.course-cta span {
    color: #e3c3c6;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: .13em;

    text-transform: uppercase;
}

.course-cta h2 {
    margin-top: 7px;

    font-size: 36px;
    font-weight: 900;
}

.course-cta-button {
    min-width: 185px;
    height: 49px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    color: #8b1d28;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: .06em;

    text-transform: uppercase;

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.course-cta-button:hover {
    background: #26384c;

    color: #ffffff;

    transform:
        translateY(-2px);
}


/* =========================================================
   FOOTER STRIP
========================================================= */

.braga-strip {
    padding:
        40px 20px;

    background: #26384c;

    color: #ffffff;

    text-align: center;
}

.braga-strip strong {
    display: block;

    font-size: 26px;
}

.braga-strip span {
    display: block;

    margin-top: 7px;

    color: #e3c3c6;

    font-size: 10px;

    letter-spacing: .08em;

    text-transform: uppercase;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    padding: 25px;

    background: #1d2c3b;

    color:
        rgba(255,255,255,.65);

    text-align: center;

    font-size: 10px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .quick-info-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .route-story {
        grid-template-columns:
            1fr;
    }

}


/* =========================================================
   MOBILE MENU / TABLET
========================================================= */

@media (max-width: 820px) {

    .brand {
        flex:
            0 0 180px;
    }

    .brand img {
        width: 180px;
    }


    /* MOBILE BUTTON */

    .mobile-toggle {
        display: flex;

        width: 42px;
        height: 38px;

        align-items: center;
        justify-content: center;

        border:
            1px solid #dddddd;

        background: #ffffff;

        color: #26384c;

        font-size: 20px;

        cursor: pointer;
    }


    /* MOBILE MENU */

    .main-menu {
        position: absolute;

        top: 100%;
        left: 0;

        width: 100%;

        display: none;

        flex-direction: column;

        gap: 0;

        background: #ffffff;

        box-shadow:
            0 12px 25px
            rgba(0,0,0,.12);
    }

    .site-header.menu-open
    .main-menu {
        display: flex;
    }

    .main-menu > a,
    .menu-dropdown-toggle {
        width: 100%;

        min-height: 48px;

        justify-content: center;

        border-bottom:
            1px solid #eeeeee;
    }

    .menu-dropdown {
        width: 100%;
    }

    .menu-dropdown-panel {
        position: static;

        width: 100%;

        display: none;

        opacity: 1;
        visibility: visible;

        transform: none;

        box-shadow: none;

        border-top:
            1px solid #eeeeee;
    }

    .menu-dropdown.open
    .menu-dropdown-panel {
        display: block;
    }

    .menu-dropdown-panel a {
        text-align: center;
    }


    /* LANGUAGE */

    .language-selector {
        margin-left: auto;
    }


    /* COUNTDOWN */

    .mini-countdown {
        grid-template-columns:
            repeat(4, 1fr);
    }

    .countdown-intro,
    .race-day {
        grid-column:
            1 / 5;
    }


    /* DISTANCES */

    .distance-grid {
        grid-template-columns:
            1fr;
    }


    /* MAP */

    .leaflet-course-map {
        height: 450px;
    }


    /* VIDEO */

    .course-video {
        padding:
            30px 24px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 520px) {

    .header-inner {
        min-height: 82px;

        gap: 10px;
    }

    .brand {
        flex:
            0 0 150px;
    }

    .brand img {
        width: 150px;
    }


    /* HERO */

    .course-hero {
        min-height: 330px;
    }

    .course-hero h1 {
        font-size: 40px;
    }

    .course-hero p {
        font-size: 15px;
    }


    /* QUICK INFO */

    .quick-info-grid {
        grid-template-columns:
            1fr;
    }


    /* MAP HEADER */

    .map-header {
        flex-direction: column;

        align-items: flex-start;
    }

    .map-reset {
        width: 100%;
    }

    .leaflet-course-map {
        height: 390px;
    }

    .map-legend {
        justify-content:
            flex-start;

        flex-wrap: wrap;

        gap:
            12px 20px;
    }


    /* VIDEO */

    .course-video {
        margin-top: 22px;

        padding:
            25px 17px;
    }

    .course-video-heading {
        margin-bottom: 20px;
    }

    .course-video-heading h3 {
        font-size: 27px;
    }


    /* ROUTE */

    .route-story {
        padding:
            28px 20px;
    }

    .route-highlights {
        grid-template-columns:
            1fr;
    }


    /* CTA */

    .course-cta-inner {
        flex-direction: column;

        align-items: flex-start;

        gap: 25px;
    }

    .course-cta-button {
        width: 100%;
    }

}