/* =========================================================
   BRAGA HALF MARATHON 2027
   GALLERY
   css/style-gallery.css
========================================================= */


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #ffffff;
    color: #26384c;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 16px;
    line-height: 1.6;
}

body.lightbox-open {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}


/* =========================================================
   GLOBAL WIDTH
========================================================= */

.identity-inner,
.header-inner,
.gallery-hero-inner,
.gallery-grid,
.footer-main {
    width: min(1180px, calc(100% - 40px));
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   IDENTITY BAR
========================================================= */

.identity-bar {
    width: 100%;
    background: #26384c;
    color: #ffffff;
}

.identity-inner {
    min-height: 36px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .10em;
    text-transform: uppercase;
}

.identity-place,
.identity-date {
    white-space: nowrap;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    position: relative;
    z-index: 1000;

    width: 100%;

    background: #ffffff;

    border-bottom:
        1px solid rgba(38, 56, 76, .10);
}

.header-inner {
    min-height: 92px;

    display: flex;
    align-items: center;

    gap: 28px;
}


/* =========================================================
   LOGO
========================================================= */

.brand {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
}

.brand img {
    width: 245px;
    height: auto;
}


/* =========================================================
   MAIN MENU
========================================================= */

.main-menu {
    margin-left: auto;

    display: flex;
    align-items: center;

    gap: 3px;
}

.main-menu > a,
.menu-dropdown-toggle {
    position: relative;

    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 11px;

    border: 0;
    background: transparent;

    color: #26384c;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: .04em;
    text-transform: uppercase;

    white-space: nowrap;

    cursor: pointer;

    transition:
        color .20s ease,
        background .20s ease;
}

.main-menu > a:hover,
.menu-dropdown-toggle:hover,
.main-menu > a.active,
.menu-dropdown-toggle.active {
    color: #b1767e;
}

.main-menu > a.active::after,
.menu-dropdown-toggle.active::after {
    content: "";

    position: absolute;

    left: 11px;
    right: 11px;
    bottom: 2px;

    height: 2px;

    background: #b1767e;
}


/* =========================================================
   INFO DROPDOWN
========================================================= */

.menu-dropdown {
    position: relative;
}

.menu-dropdown-toggle span {
    margin-left: 5px;
    font-size: 11px;
}

.menu-dropdown-panel {
    position: absolute;

    top: calc(100% + 5px);
    left: 0;

    width: 205px;

    padding: 8px 0;

    background: #ffffff;

    border:
        1px solid rgba(38, 56, 76, .10);

    box-shadow:
        0 12px 34px rgba(24, 42, 60, .15);

    opacity: 0;
    visibility: hidden;

    transform: translateY(7px);

    transition:
        opacity .20s ease,
        visibility .20s ease,
        transform .20s ease;
}

.menu-dropdown:hover .menu-dropdown-panel,
.menu-dropdown:focus-within .menu-dropdown-panel,
.menu-dropdown.open .menu-dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-dropdown-panel a {
    display: block;

    padding: 10px 16px;

    color: #26384c;

    font-size: 13px;
    font-weight: 600;

    transition:
        color .20s ease,
        background .20s ease;
}

.menu-dropdown-panel a:hover {
    color: #b1767e;
    background: #f7f3f3;
}


/* =========================================================
   LANGUAGE
========================================================= */

.language-selector {
    position: relative;
    margin-left: 6px;
}

.language-button {
    min-width: 49px;
    min-height: 38px;

    padding: 0 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 4px;

    border:
        1px solid rgba(38, 56, 76, .20);

    background: #ffffff;
    color: #26384c;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;
}

.language-panel {
    position: absolute;

    top: calc(100% + 5px);
    right: 0;

    min-width: 145px;

    padding: 7px 0;

    background: #ffffff;

    border:
        1px solid rgba(38, 56, 76, .10);

    box-shadow:
        0 12px 34px rgba(24, 42, 60, .15);

    opacity: 0;
    visibility: hidden;

    transform: translateY(7px);

    transition:
        opacity .20s ease,
        visibility .20s ease,
        transform .20s ease;
}

.language-selector:hover .language-panel,
.language-selector:focus-within .language-panel,
.language-selector.open .language-panel {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.language-panel a {
    display: block;

    padding: 9px 14px;

    color: #26384c;

    font-size: 13px;
    font-weight: 600;
}

.language-panel a:hover {
    color: #b1767e;
    background: #f7f3f3;
}


/* =========================================================
   MOBILE BUTTON
========================================================= */

.mobile-toggle {
    display: none;

    margin-left: auto;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #26384c;

    font-size: 27px;

    cursor: pointer;
}


/* =========================================================
   HERO
========================================================= */

.gallery-hero {
    position: relative;

    width: 100%;
    min-height: 410px;

    display: flex;
    align-items: center;

    overflow: hidden;

    background:
        #26384c
        url("../images/gallery.png")
        center center / cover
        no-repeat;
}

.gallery-hero::before {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(25, 43, 61, .96) 0%,
            rgba(25, 43, 61, .85) 25%,
            rgba(25, 43, 61, .48) 53%,
            rgba(25, 43, 61, .10) 82%,
            rgba(25, 43, 61, 0) 100%
        );
}

.gallery-hero-inner {
    position: relative;
    z-index: 2;

    color: #ffffff;
}

.hero-kicker {
    display: block;

    margin-bottom: 11px;

    color: #e3c3c6;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: .18em;
    text-transform: uppercase;
}

.gallery-hero h1 {
    margin: 0 0 14px;

    color: #ffffff;

    font-size: clamp(42px, 5vw, 66px);
    font-weight: 800;

    line-height: 1;

    letter-spacing: -.025em;
}

.gallery-hero p {
    max-width: 430px;

    margin: 0;

    color: rgba(255, 255, 255, .90);

    font-size: 17px;
    line-height: 1.65;
}


/* =========================================================
   INTRODUCTION
========================================================= */

.gallery-intro-section {
    width: 100%;

    padding: 70px 20px 28px;

    background: #ffffff;
}

.gallery-intro {
    width: min(720px, 100%);

    margin: 0 auto;

    text-align: center;
}

.section-kicker,
.gallery-message > span {
    display: block;

    margin-bottom: 9px;

    color: #b1767e;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .19em;
    text-transform: uppercase;
}

.gallery-intro h2 {
    margin: 0 0 15px;

    color: #26384c;

    font-size: clamp(29px, 3.5vw, 42px);
    font-weight: 800;

    line-height: 1.15;
}

.gallery-intro p {
    max-width: 650px;

    margin: 0 auto;

    color: #536575;

    font-size: 15px;
    line-height: 1.75;
}


/* =========================================================
   GALLERY SECTION
========================================================= */

.gallery-section {
    width: 100%;

    padding: 22px 0 78px;

    background: #ffffff;
}


/* =========================================================
   PHOTO GRID
========================================================= */

.gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    grid-auto-rows: 225px;

    gap: 10px;
}


/* =========================================================
   PHOTO
========================================================= */

.gallery-item {
    position: relative;

    display: block;

    width: 100%;
    height: 100%;

    padding: 0;

    overflow: hidden;

    border: 0;

    background: #26384c;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform .45s ease,
        filter .35s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
}


/* =========================================================
   FIRST 7 PHOTOS
========================================================= */

/* PHOTO 01 */
.gallery-grid .gallery-item:nth-child(1) {
    grid-column: 1;
    grid-row: span 2;
}

/* PHOTO 02 */
.gallery-grid .gallery-item:nth-child(2) {
    grid-column: 2;
}

/* PHOTO 03 */
.gallery-grid .gallery-item:nth-child(3) {
    grid-column: 3;
}

/* PHOTO 04 */
.gallery-grid .gallery-item:nth-child(4) {
    grid-column: 2 / 4;
}

/* PHOTO 05 */
.gallery-grid .gallery-item:nth-child(5) {
    grid-column: 1;
}

/* PHOTO 06 */
.gallery-grid .gallery-item:nth-child(6) {
    grid-column: 2;
}

/* PHOTO 07 */
.gallery-grid .gallery-item:nth-child(7) {
    grid-column: 3;
}


/* =========================================================
   PHOTOS 08 + 09 + 10
========================================================= */

/*
   FINAL LAYOUT

   ┌───────────────┬─────────────────────────────┐
   │               │          PHOTO 09           │
   │               │                             │
   │   PHOTO 08    ├─────────────────────────────┤
   │               │          PHOTO 10           │
   │               │                             │
   └───────────────┴─────────────────────────────┘
*/


/* PHOTO 08 */

.gallery-grid .gallery-item:nth-child(8) {
    grid-column: 1;
    grid-row: span 2;
}


/* PHOTO 09 */

.gallery-grid .gallery-item:nth-child(9) {
    grid-column: 2 / 4;
}


/* PHOTO 10 */

.gallery-grid .gallery-item:nth-child(10) {
    grid-column: 2 / 4;
}


/* Photo 08 is aerial and vertical */

.gallery-grid .gallery-item:nth-child(8) img {
    object-position: center center;
}


/* Photos 09 and 10 are panoramic */

.gallery-grid .gallery-item:nth-child(9) img,
.gallery-grid .gallery-item:nth-child(10) img {
    object-position: center center;
}


/* =========================================================
   PHOTO OVERLAY
========================================================= */

.gallery-overlay {
    position: absolute;

    inset: 0;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 18px;

    padding: 20px;

    background:
        linear-gradient(
            180deg,
            rgba(21, 38, 54, 0) 40%,
            rgba(21, 38, 54, .82) 100%
        );

    opacity: 0;

    transition: opacity .30s ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus .gallery-overlay {
    opacity: 1;
}

.gallery-caption {
    color: #ffffff;

    font-size: 16px;
    font-weight: 700;
}

.gallery-plus {
    flex: 0 0 auto;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(255, 255, 255, .70);

    border-radius: 50%;

    color: #ffffff;

    font-size: 24px;
    font-weight: 300;

    line-height: 1;
}

.gallery-item:focus-visible {
    outline: 3px solid #b1767e;
    outline-offset: 3px;
}


/* =========================================================
   GALLERY MESSAGE / CTA
========================================================= */

.gallery-message-section {
    width: 100%;

    padding: 74px 20px;

    background: #f5f1f1;
}

.gallery-message {
    width: min(760px, 100%);

    margin: 0 auto;

    text-align: center;
}

.gallery-message h2 {
    margin: 0 0 16px;

    color: #26384c;

    font-size: clamp(30px, 4vw, 43px);
    font-weight: 800;

    line-height: 1.15;
}

.gallery-message p {
    max-width: 610px;

    margin: 0 auto 27px;

    color: #536575;

    font-size: 15px;
    line-height: 1.75;
}

.gallery-button {
    min-height: 49px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 28px;

    background: #26384c;

    color: #ffffff;

    font-size: 12px;
    font-weight: 800;

    letter-spacing: .07em;
    text-transform: uppercase;

    transition:
        background .25s ease,
        transform .25s ease;
}

.gallery-button:hover {
    background: #b1767e;

    transform: translateY(-2px);
}


/* =========================================================
   RUNNING PORTUGAL
========================================================= */

.running-portugal-section {
    width: 100%;

    padding: 57px 20px;

    background: #26384c;

    color: #ffffff;
}

.running-portugal-inner {
    width: min(980px, 100%);

    margin: 0 auto;

    display: flex;
    align-items: center;

    gap: 34px;
}

.rp-mark {
    flex: 0 0 auto;

    width: 86px;
    height: 86px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        2px solid rgba(255, 255, 255, .60);

    color: #ffffff;

    font-size: 27px;
    font-weight: 800;

    letter-spacing: .04em;
}

.rp-copy {
    max-width: 700px;
}

.rp-copy > span {
    display: block;

    margin-bottom: 7px;

    color: #e3c3c6;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .19em;
    text-transform: uppercase;
}

.rp-copy h2 {
    margin: 0 0 8px;

    color: #ffffff;

    font-size: 28px;
    font-weight: 800;

    line-height: 1.2;
}

.rp-copy p {
    margin: 0;

    color: rgba(255, 255, 255, .76);

    font-size: 14px;
    line-height: 1.7;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    width: 100%;

    background: #1d2c3b;

    color: #ffffff;
}

.footer-main {
    padding-top: 37px;
    padding-bottom: 31px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 40px;
}

.footer-brand,
.footer-event {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.footer-brand strong,
.footer-event strong {
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;

    letter-spacing: .04em;
}

.footer-brand span,
.footer-event span {
    color: rgba(255, 255, 255, .62);

    font-size: 13px;
}

.footer-event {
    text-align: right;
}


/* =========================================================
   FOOTER DISCLAIMER
========================================================= */

.footer-disclaimer {
    border-top:
        1px solid rgba(255, 255, 255, .08);
}

.footer-disclaimer p {
    width: min(1180px, calc(100% - 40px));

    margin: 0 auto;

    padding: 19px 0 23px;

    color: rgba(255, 255, 255, .50);

    font-size: 11px;
    line-height: 1.6;

    text-align: center;
}


/* =========================================================
   LIGHTBOX
========================================================= */

.lightbox {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 35px 80px;

    background:
        rgba(12, 24, 36, .95);
}

.lightbox.open {
    display: flex;
}

.lightbox-content {
    position: relative;

    width: min(1250px, 100%);

    max-height: calc(100vh - 70px);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    display: block;

    max-width: 100%;
    max-height: calc(100vh - 125px);

    width: auto;
    height: auto;

    object-fit: contain;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, .40);
}

.lightbox-caption {
    margin-top: 13px;

    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    text-align: center;
}


/* =========================================================
   LIGHTBOX BUTTONS
========================================================= */

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;

    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;

    background:
        rgba(255, 255, 255, .12);

    color: #ffffff;

    cursor: pointer;

    transition:
        background .20s ease,
        transform .20s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background:
        rgba(255, 255, 255, .24);
}

.lightbox-close {
    top: 22px;
    right: 27px;

    width: 46px;
    height: 46px;

    border-radius: 50%;

    font-size: 28px;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;

    width: 50px;
    height: 68px;

    transform: translateY(-50%);

    font-size: 36px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform:
        translateY(-50%)
        scale(1.04);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .brand img {
        width: 220px;
    }

    .main-menu > a,
    .menu-dropdown-toggle {
        padding-left: 8px;
        padding-right: 8px;

        font-size: 11px;
    }

    .gallery-grid {
        grid-auto-rows: 205px;
    }

}


/* =========================================================
   MOBILE NAVIGATION
========================================================= */

@media (max-width: 820px) {

    .identity-inner {
        min-height: 40px;

        font-size: 10px;
    }


    .header-inner {
        min-height: 76px;

        flex-wrap: wrap;

        padding-top: 12px;
        padding-bottom: 12px;
    }


    .brand img {
        width: 205px;
    }


    .mobile-toggle {
        display: block;
    }


    .main-menu {
        order: 3;

        width: 100%;

        margin: 0;

        display: none;

        flex-direction: column;
        align-items: stretch;

        gap: 0;

        padding-top: 10px;

        border-top:
            1px solid rgba(38, 56, 76, .09);
    }


    .main-menu.open {
        display: flex;
    }


    .main-menu > a,
    .menu-dropdown-toggle {
        width: 100%;

        min-height: 45px;

        justify-content: space-between;

        padding: 0 4px;

        font-size: 12px;
    }


    .main-menu > a.active::after,
    .menu-dropdown-toggle.active::after {
        left: 4px;
        right: auto;

        width: 35px;
    }


    .menu-dropdown-panel {
        position: static;

        display: none;

        width: 100%;

        padding: 0 0 8px 14px;

        border: 0;

        box-shadow: none;

        opacity: 1;
        visibility: visible;

        transform: none;
    }


    .menu-dropdown:hover .menu-dropdown-panel {
        display: none;
    }


    .menu-dropdown.open .menu-dropdown-panel {
        display: block;
    }


    .language-selector {
        margin-left: 0;
    }


    .language-panel {
        right: auto;
        left: 0;
    }


    .gallery-hero {
        min-height: 345px;

        background-position: 61% center;
    }


    .gallery-hero::before {
        background:
            linear-gradient(
                90deg,
                rgba(25, 43, 61, .95) 0%,
                rgba(25, 43, 61, .78) 53%,
                rgba(25, 43, 61, .22) 100%
            );
    }


    .gallery-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        grid-auto-rows: 220px;
    }


    /*
       Tablet gallery:
       reset the desktop placements first.
    */

    .gallery-grid .gallery-item:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }


    .gallery-grid .gallery-item:nth-child(1) {
        grid-row: span 2;
    }


    .gallery-grid .gallery-item:nth-child(4) {
        grid-column: 1 / 3;
    }


    .gallery-grid .gallery-item:nth-child(8) {
        grid-column: 1;
        grid-row: span 2;
    }


    .gallery-grid .gallery-item:nth-child(9),
    .gallery-grid .gallery-item:nth-child(10) {
        grid-column: 2;
    }


    .running-portugal-inner {
        gap: 25px;
    }


    .footer-main {
        flex-direction: column;
        gap: 20px;
    }


    .footer-event {
        text-align: left;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 620px) {

    .identity-inner {
        width: min(100% - 28px, 520px);

        flex-direction: column;
        align-items: flex-start;
        justify-content: center;

        gap: 1px;

        padding-top: 6px;
        padding-bottom: 6px;
    }


    .header-inner,
    .gallery-hero-inner,
    .footer-main {
        width: min(100% - 28px, 520px);
    }


    .brand img {
        width: 180px;
    }


    .gallery-hero {
        min-height: 310px;
    }


    .gallery-hero h1 {
        font-size: 40px;
    }


    .gallery-hero p {
        font-size: 15px;
    }


    .gallery-intro-section {
        padding:
            50px
            14px
            20px;
    }


    .gallery-section {
        padding-top: 15px;
        padding-bottom: 50px;
    }


    .gallery-grid {
        width: min(100% - 28px, 520px);

        grid-template-columns: 1fr;

        grid-auto-rows: 250px;

        gap: 8px;
    }


    /*
       Everything becomes one photo per row
    */

    .gallery-grid .gallery-item:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }


    .gallery-item {
        min-height: 250px;
    }


    .gallery-overlay {
        opacity: 1;

        padding: 17px;

        background:
            linear-gradient(
                180deg,
                rgba(21, 38, 54, 0) 48%,
                rgba(21, 38, 54, .78) 100%
            );
    }


    .gallery-caption {
        font-size: 15px;
    }


    .gallery-plus {
        width: 32px;
        height: 32px;

        font-size: 21px;
    }


    .gallery-message-section {
        padding:
            55px
            18px;
    }


    .gallery-message h2 {
        font-size: 31px;
    }


    .running-portugal-section {
        padding:
            45px
            18px;
    }


    .running-portugal-inner {
        flex-direction: column;
        align-items: flex-start;

        gap: 20px;
    }


    .rp-mark {
        width: 72px;
        height: 72px;

        font-size: 23px;
    }


    .rp-copy h2 {
        font-size: 24px;
    }


    .footer-main {
        padding-top: 30px;
        padding-bottom: 26px;
    }


    .footer-disclaimer p {
        width: min(100% - 28px, 520px);

        padding-top: 18px;
        padding-bottom: 21px;
    }


    .lightbox {
        padding:
            15px
            10px;
    }


    .lightbox-content img {
        max-height:
            calc(100vh - 105px);
    }


    .lightbox-close {
        top: 8px;
        right: 8px;

        width: 40px;
        height: 40px;

        font-size: 24px;
    }


    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 54px;

        font-size: 27px;
    }


    .lightbox-prev {
        left: 5px;
    }


    .lightbox-next {
        right: 5px;
    }

}


/* =========================================================
   VERY SMALL SCREENS
========================================================= */

@media (max-width: 420px) {

    .gallery-hero h1 {
        font-size: 34px;
    }


    .gallery-grid {
        grid-auto-rows: 220px;
    }


    .gallery-item {
        min-height: 220px;
    }


    .gallery-caption {
        font-size: 14px;
    }

}