/*
Shared styles for every page of the site.
Each page also loads one stylesheet of its own (for example games.css).
*/

/* ============================================================
BASE: Page defaults, headings, text, links and helpers used everywhere
============================================================ */

/* Nothing may make the page scroll sideways: decorations that reach past the screen edge (glows, tilted cards)
   are cut off at the edge. "clip" also works on phones, where overflow-x: hidden on body alone does not. */
html {
    overflow-x: clip;
    background-color: #666;
}

/* The footer is never visible without scrolling: the page is at least one screen plus the footer tall,
   so on short pages the footer starts right below the bottom edge of the screen.
   --footer-height is the footer's own height (without its top margin); update it if the footer changes. */
:root {
    --footer-height: 301px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh + var(--footer-height) + env(safe-area-inset-bottom));
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: "Trebuchet MS", Arial, sans-serif;
}

/* Page content keeps its normal full width (as without the column layout above), and the space
   above the footer comes from the footer alone, so pages don't add their own bottom margin to it */
body > main {
    flex-shrink: 0;
    /* !important: page stylesheets set their own bottom margins; the footer's spacing replaces them */
    margin-bottom: 0 !important;
}

#footer-global {
    margin-top: auto;
}

h1 {
    font-size: 3rem;
    color: white;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin: 0;
}

h2 {
    font-size: 2rem;
    color: white;
    font-weight: 600;
    margin: 0;
}

h3 {
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
    margin: 0;
}

p {
    padding: 0;
    color: white;
}

a {
    text-decoration: none;
    color: white;
}

* {
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

/* Text for search engines and screen readers only. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Sticker title that also links one level up (gallery year, tournament year) */
.title-back {
    display: block;
    color: inherit;
}

.title-back:focus-visible {
    outline: 2px solid white;
    outline-offset: 6px;
}

/* ============================================================
BACKGROUND: The blurred logo photo behind every page
============================================================ */

.background {
    position: fixed;
    /* Tall enough for the screen with the phone's browser bars hidden, so no band shows while scrolling */
    height: 100vh;
    height: 100lvh;
    width: 100%;
    background-color: #666;
    z-index: -1;
    pointer-events: none;
    top: 0;
}

.background-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

/* ============================================================
HEADER: Top bar: logo, menu, account icon and language switch
============================================================ */

#header-global:empty::before {
    content: '';
    position: fixed;
    inset: 0 0 auto;
    height: 5rem;
    background: #000c;
    backdrop-filter: blur(.5rem);
    -webkit-backdrop-filter: blur(.5rem);
    z-index: 10;
    pointer-events: none;
}

header {
    position: fixed;
    inset: 0 0 auto;
    /* Always 80px tall, on every screen and window height */
    height: 5rem;
    display: flex;
    justify-content: space-between;
    line-height: 1;
    background: #000c;
    backdrop-filter: blur(.5rem);
    -webkit-backdrop-filter: blur(.5rem);
    z-index: 10;
}

.nav-logo, .nav-lang {
    display: flex;
    align-items: center;
    margin: 0 32px;
}

#header[aria-busy="true"] .nav-logo, #header[aria-busy="true"] .nav-list, #header[aria-busy="true"] .nav-lang, #header[aria-busy="true"] .menu-button {
    visibility: hidden;
}

.nav-logo {
    justify-content: center;
}

.nav-logo-link {
    display: block;
    width: 3.5rem;
    transition: transform .5s;
}

.nav-logo-link:focus {
    transform: scale(1.15);
}

@media (hover: hover) and (pointer: fine) {
    .nav-logo-link:hover {
        transform: scale(1.15);
    }
}

/* Menu links centred on the page (not in the space between logo and icons), so they line up with the centred content */
header nav {
    position: absolute;
    inset: 0 auto 0 50%;
    display: flex;
    justify-content: center;
    transform: translateX(-50%);
}

.nav-list {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-list-item {
    --nav-gap: 2em;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 var(--nav-gap);
    font-size: .875rem;
}

/* "You are here": a white line at the bottom edge of the header, a little wider than the menu word */
.nav-list-item:has(> .nav-link[aria-current="page"])::after {
    content: '';
    position: absolute;
    right: calc(var(--nav-gap) / 2);
    bottom: 0;
    left: calc(var(--nav-gap) / 2);
    height: 3px;
    background: white;
}

.nav-link {
    padding: 0;
    border: 0;
    background: none;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: transform .5s;
}

.nav-link:focus-visible {
    transform: scale(1.2);
}

@media (hover: hover) and (pointer: fine) {
    .nav-list-item:hover .nav-link {
        transform: scale(1.2);
    }
}

.nav-lang {
    height: 100%;
    gap: 24px;
}

@media (min-width: 951px) and (max-width: 1200px) {
    .nav-list-item {
        --nav-gap: 1.25em;
    }
}

.account-link {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: transform .5s;
}

.account-link svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-link:focus-visible {
    transform: scale(1.2);
}

@media (hover: hover) and (pointer: fine) {
    .account-link:hover {
        transform: scale(1.2);
    }
}

.account-link:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.account-link.is-logged-in svg {
    fill: currentColor;
    stroke: none;
}

/* 40x40px tap area, same as the account icon */
.nav-lang-link {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: none;
    color: white;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: .1em;
    cursor: pointer;
    transition: transform .5s;
}

.nav-lang-link:focus-visible {
    transform: scale(1.2);
}

@media (hover: hover) and (pointer: fine) {
    .nav-lang-link:hover {
        transform: scale(1.2);
    }
}

.nav-link:focus-visible, .nav-lang-link:focus-visible {
    outline: 2px solid white;
    outline-offset: 4px;
    border-radius: .15rem;
}

.header-panel {
    position: fixed;
    top: 5rem;
    z-index: 9;
    box-sizing: border-box;
    padding-top: 16px;
    max-height: calc(100svh - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #0009;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    visibility: hidden;
    transform: translateY(-100%);
    transition: transform .3s ease-in-out, visibility 0s .3s;
}

.header-panel.is-open {
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.header-panel a {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 50px;
    color: white;
    text-decoration: none;
}

.header-panel a[hidden] {
    display: none;
}

.header-panel a span {
    display: inline-block;
    transition: transform .5s;
}

.header-panel a[href]:focus-visible span {
    transform: scale(1.2);
}

@media (hover: hover) and (pointer: fine) {
    .header-panel a[href]:hover span {
        transform: scale(1.2);
    }
}

.header-panel a:focus-visible {
    outline: 2px solid white;
    outline-offset: -2px;
}

.header-panel a[aria-disabled="true"] {
    opacity: .4;
    cursor: default;
}

.language-options a {
    justify-content: center;
}

/* Language list starts right below the header: each 50px row already has room above and below its text */
.language-options {
    padding-top: 0;
}

.menu, .menu-button {
    display: none;
}

@media (max-width: 950px) {
    header nav {
        display: none;
    }

    .nav-logo {
        position: absolute;
        inset: 0 auto 0 50%;
        width: 56px;
        min-width: 0;
        margin: 0;
        transform: translateX(-50%);
    }

    .nav-logo-link {
        width: 56px;
        max-width: none;
    }

    .nav-lang {
        flex-shrink: 0;
        order: 2;
    }

    .menu {
        display: block;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 8;
        font-weight: 600;
        font-size: .875rem;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

    .menu-link {
        position: relative;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        width: 100%;
        min-height: 50px;
        padding: 0 32px;
        border: 0;
        background: none;
        color: white;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    .menu-link span {
        display: inline-block;
        transform-origin: left center;
        transition: transform .5s;
    }

    .menu-link:focus-visible span {
        transform: scale(1.2);
    }

@media (hover: hover) and (pointer: fine) {
    .menu-link:hover span {
            transform: scale(1.2);
        }
}

    .menu-link:focus-visible {
        outline: 2px solid white;
        outline-offset: -2px;
    }

    .menu-button {
        display: grid;
        flex-shrink: 0;
        height: 80px;
        margin: 0 32px;
        padding: 0;
        border: 0;
        background: none;
        width: 56px;
        cursor: pointer;
        order: 0;
    }

    .menu-button:focus-visible {
        outline: 2px solid white;
        outline-offset: -4px;
    }

    .menu-bar {
        grid-area: 1 / 1 / 1 / 1;
        place-self: center;
        background: white;
        width: 33.6px;
        height: 3.2px;
        border-radius: 1px;
        transition: transform .5s, margin .5s, opacity .5s;
    }

    .menu-bar-top {
        margin-bottom: 22.4px;
    }

    .menu-bar-bottom {
        margin-top: 22.4px;
    }

    .menu-button.active .menu-bar-top {
        transform: rotate(135deg);
        margin-bottom: 0;
    }

    .menu-button.active .menu-bar-middle {
        opacity: 0;
        transform: rotate(135deg);
    }

    .menu-button.active .menu-bar-bottom {
        transform: rotate(45deg);
        margin-top: 0;
    }
}

.nav-link, .header-panel a, .menu-link {
    font: 600 14px/1 "Trebuchet MS", Arial, sans-serif;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* Phone: account icon and language closer together, so the centred logo has room on small phones */
@media (max-width: 600px) {
    :root {
        --footer-height: 246px;
    }

    .nav-lang {
        gap: 8px;
    }

    /* Smaller side margins: menu bars and "EN" both 30px from the screen edge,
    and the menu items line up with the bars */
    .menu-button {
        margin: 0 16px;
    }

    .nav-lang {
        margin: 0 21px;
    }

    .menu-link {
        padding: 0 30px;
    }

    /* Menu icon about 1/6 smaller (same proportions) */
    .menu-bar {
        width: 28px;
        height: 2.75px;
    }

    .menu-bar-top {
        margin-bottom: 18.5px;
    }

    .menu-bar-bottom {
        margin-top: 18.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-panel, .header-panel a span, .nav-link, .nav-lang-link, .account-link, .menu-link span, .menu-bar {
        transition: none;
    }
}

/* ============================================================
FOOTER: Bottom of every page: logo, contact and legal links
============================================================ */

footer {
    position: relative;
    margin-top: 8rem;
    display: flex;
    flex-direction: column;
    font-family: "Trebuchet MS", Arial, sans-serif;
    z-index: 8;
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo {
    width: 7.5rem;
    height: auto;
}

.separator-line {
    height: 1px;
    flex: 1;
    margin: 0 2rem;
}

.separator-line-left {
    background: linear-gradient(to left, #fff9, transparent);
}

.separator-line-right {
    background: linear-gradient(to right, #fff9, transparent);
}

/* Logo, contact, links and copyright are spaced evenly: the visible gap between each is the same (37px; 32px on phones).
   The margins are a bit smaller than the gaps because the text lines have some room of their own. */
.footer-middle {
    color: white;
    margin: 1.875rem auto 1.75rem;
}

/* Legal links on one centred row; "© 2026 B Games" on its own line below. Space for the iPhone home bar at the bottom. */
.footer-bottom {
    display: flex;
    justify-content: center;
    padding: 0 2rem calc(2rem + env(safe-area-inset-bottom));
    color: white;
}

.footer-nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.75rem;
}

.footer-nav-list-item {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    white-space: nowrap;
}

/* Copyright: last in the page and on its own line below the legal links (also last for the Tab key) */
.footer-nav-list-item:last-child {
    flex-basis: 100%;
    justify-content: center;
    margin-top: 1.3125rem;
}

/* Bullets between the legal links only */
.footer-nav-list-item:nth-last-child(n+3)::after {
    content: '\2022';
    margin: 0 .5em;
}

/* At least 24px tall, so every link is easy to tap */
.footer-nav-link {
    display: inline-block;
    min-height: 24px;
    line-height: 24px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    padding: 0;
    margin: 0;
}

/* Tablet */
@media (max-width: 950px) {
    footer {
        margin-top: 6rem;
    }
}

/* Phone */
@media (max-width: 600px) {
    footer {
        margin-top: 4rem;
    }

    .footer-logo {
        width: 5rem;
    }

    .footer-middle {
        margin: 1.5625rem auto 1.4375rem;
    }

    /* Slightly tighter letters and bullets, so the text can stay as large as possible */
    .footer-nav-link {
        letter-spacing: 0.04em;
    }

    .footer-nav-list-item:nth-last-child(n+3)::after {
        margin: 0 .35em;
    }

    /* The legal links stay on one line: the text shrinks just enough to fit the screen (at most 12px).
       Same size in every language: the divisor is the width in em of the longest row (French). */
    .footer-nav-list {
        font-size: min(0.75rem, calc((100vw - 4rem) / 37.6));
    }

    /* The copyright line has room on its own, so it keeps 12px */
    .footer-nav-list-item:last-child {
        margin-top: 1rem;
        font-size: 0.75rem;
    }
}
